summaryrefslogtreecommitdiff
path: root/src/lib/libssl/ssl_asn1.c
diff options
context:
space:
mode:
authortedu <>2014-05-05 15:03:22 +0000
committertedu <>2014-05-05 15:03:22 +0000
commit5b4326f23352be2e7084f2020795d8aa042c746f (patch)
treec342d9903092a19dfda173837629fd04c429eda9 /src/lib/libssl/ssl_asn1.c
parent77dd1ca11ad22b323b27beea447edd1e35c3b24e (diff)
downloadopenbsd-5b4326f23352be2e7084f2020795d8aa042c746f.tar.gz
openbsd-5b4326f23352be2e7084f2020795d8aa042c746f.tar.bz2
openbsd-5b4326f23352be2e7084f2020795d8aa042c746f.zip
Remove SRP and Kerberos support from libssl. These are complex protocols
all on their own and we can't effectively maintain them without using them, which we don't. If the need arises, the code can be resurrected.
Diffstat (limited to 'src/lib/libssl/ssl_asn1.c')
-rw-r--r--src/lib/libssl/ssl_asn1.c66
1 files changed, 0 insertions, 66 deletions
diff --git a/src/lib/libssl/ssl_asn1.c b/src/lib/libssl/ssl_asn1.c
index 1d2590268c..566590f171 100644
--- a/src/lib/libssl/ssl_asn1.c
+++ b/src/lib/libssl/ssl_asn1.c
@@ -97,9 +97,6 @@ typedef struct ssl_session_asn1_st {
97 ASN1_OCTET_STRING master_key; 97 ASN1_OCTET_STRING master_key;
98 ASN1_OCTET_STRING session_id; 98 ASN1_OCTET_STRING session_id;
99 ASN1_OCTET_STRING session_id_context; 99 ASN1_OCTET_STRING session_id_context;
100#ifndef OPENSSL_NO_KRB5
101 ASN1_OCTET_STRING krb5_princ;
102#endif /* OPENSSL_NO_KRB5 */
103 ASN1_INTEGER time; 100 ASN1_INTEGER time;
104 ASN1_INTEGER timeout; 101 ASN1_INTEGER timeout;
105 ASN1_INTEGER verify_result; 102 ASN1_INTEGER verify_result;
@@ -112,9 +109,6 @@ typedef struct ssl_session_asn1_st {
112 ASN1_OCTET_STRING psk_identity_hint; 109 ASN1_OCTET_STRING psk_identity_hint;
113 ASN1_OCTET_STRING psk_identity; 110 ASN1_OCTET_STRING psk_identity;
114#endif /* OPENSSL_NO_PSK */ 111#endif /* OPENSSL_NO_PSK */
115#ifndef OPENSSL_NO_SRP
116 ASN1_OCTET_STRING srp_username;
117#endif /* OPENSSL_NO_SRP */
118} SSL_SESSION_ASN1; 112} SSL_SESSION_ASN1;
119 113
120int 114int
@@ -132,9 +126,6 @@ i2d_SSL_SESSION(SSL_SESSION *in, unsigned char **pp)
132 unsigned char cbuf; 126 unsigned char cbuf;
133 int v11 = 0; 127 int v11 = 0;
134#endif 128#endif
135#ifndef OPENSSL_NO_SRP
136 int v12 = 0;
137#endif
138 long l; 129 long l;
139 SSL_SESSION_ASN1 a; 130 SSL_SESSION_ASN1 a;
140 M_ASN1_I2D_vars(in); 131 M_ASN1_I2D_vars(in);
@@ -189,13 +180,6 @@ i2d_SSL_SESSION(SSL_SESSION *in, unsigned char **pp)
189 a.session_id_context.type = V_ASN1_OCTET_STRING; 180 a.session_id_context.type = V_ASN1_OCTET_STRING;
190 a.session_id_context.data = in->sid_ctx; 181 a.session_id_context.data = in->sid_ctx;
191 182
192#ifndef OPENSSL_NO_KRB5
193 if (in->krb5_client_princ_len) {
194 a.krb5_princ.length = in->krb5_client_princ_len;
195 a.krb5_princ.type = V_ASN1_OCTET_STRING;
196 a.krb5_princ.data = in->krb5_client_princ;
197 }
198#endif /* OPENSSL_NO_KRB5 */
199 183
200 if (in->time != 0L) { 184 if (in->time != 0L) {
201 a.time.length = LSIZE2; 185 a.time.length = LSIZE2;
@@ -248,23 +232,12 @@ i2d_SSL_SESSION(SSL_SESSION *in, unsigned char **pp)
248 a.psk_identity.data = (unsigned char *)(in->psk_identity); 232 a.psk_identity.data = (unsigned char *)(in->psk_identity);
249 } 233 }
250#endif /* OPENSSL_NO_PSK */ 234#endif /* OPENSSL_NO_PSK */
251#ifndef OPENSSL_NO_SRP
252 if (in->srp_username) {
253 a.srp_username.length = strlen(in->srp_username);
254 a.srp_username.type = V_ASN1_OCTET_STRING;
255 a.srp_username.data = (unsigned char *)(in->srp_username);
256 }
257#endif /* OPENSSL_NO_SRP */
258 235
259 M_ASN1_I2D_len(&(a.version), i2d_ASN1_INTEGER); 236 M_ASN1_I2D_len(&(a.version), i2d_ASN1_INTEGER);
260 M_ASN1_I2D_len(&(a.ssl_version), i2d_ASN1_INTEGER); 237 M_ASN1_I2D_len(&(a.ssl_version), i2d_ASN1_INTEGER);
261 M_ASN1_I2D_len(&(a.cipher), i2d_ASN1_OCTET_STRING); 238 M_ASN1_I2D_len(&(a.cipher), i2d_ASN1_OCTET_STRING);
262 M_ASN1_I2D_len(&(a.session_id), i2d_ASN1_OCTET_STRING); 239 M_ASN1_I2D_len(&(a.session_id), i2d_ASN1_OCTET_STRING);
263 M_ASN1_I2D_len(&(a.master_key), i2d_ASN1_OCTET_STRING); 240 M_ASN1_I2D_len(&(a.master_key), i2d_ASN1_OCTET_STRING);
264#ifndef OPENSSL_NO_KRB5
265 if (in->krb5_client_princ_len)
266 M_ASN1_I2D_len(&(a.krb5_princ), i2d_ASN1_OCTET_STRING);
267#endif /* OPENSSL_NO_KRB5 */
268 if (in->time != 0L) 241 if (in->time != 0L)
269 M_ASN1_I2D_len_EXP_opt(&(a.time), i2d_ASN1_INTEGER, 1, v1); 242 M_ASN1_I2D_len_EXP_opt(&(a.time), i2d_ASN1_INTEGER, 1, v1);
270 if (in->timeout != 0L) 243 if (in->timeout != 0L)
@@ -293,10 +266,6 @@ i2d_SSL_SESSION(SSL_SESSION *in, unsigned char **pp)
293 if (in->psk_identity) 266 if (in->psk_identity)
294 M_ASN1_I2D_len_EXP_opt(&(a.psk_identity), i2d_ASN1_OCTET_STRING, 8, v8); 267 M_ASN1_I2D_len_EXP_opt(&(a.psk_identity), i2d_ASN1_OCTET_STRING, 8, v8);
295#endif /* OPENSSL_NO_PSK */ 268#endif /* OPENSSL_NO_PSK */
296#ifndef OPENSSL_NO_SRP
297 if (in->srp_username)
298 M_ASN1_I2D_len_EXP_opt(&(a.srp_username), i2d_ASN1_OCTET_STRING, 12, v12);
299#endif /* OPENSSL_NO_SRP */
300 269
301 M_ASN1_I2D_seq_total(); 270 M_ASN1_I2D_seq_total();
302 271
@@ -305,10 +274,6 @@ i2d_SSL_SESSION(SSL_SESSION *in, unsigned char **pp)
305 M_ASN1_I2D_put(&(a.cipher), i2d_ASN1_OCTET_STRING); 274 M_ASN1_I2D_put(&(a.cipher), i2d_ASN1_OCTET_STRING);
306 M_ASN1_I2D_put(&(a.session_id), i2d_ASN1_OCTET_STRING); 275 M_ASN1_I2D_put(&(a.session_id), i2d_ASN1_OCTET_STRING);
307 M_ASN1_I2D_put(&(a.master_key), i2d_ASN1_OCTET_STRING); 276 M_ASN1_I2D_put(&(a.master_key), i2d_ASN1_OCTET_STRING);
308#ifndef OPENSSL_NO_KRB5
309 if (in->krb5_client_princ_len)
310 M_ASN1_I2D_put(&(a.krb5_princ), i2d_ASN1_OCTET_STRING);
311#endif /* OPENSSL_NO_KRB5 */
312 if (in->time != 0L) 277 if (in->time != 0L)
313 M_ASN1_I2D_put_EXP_opt(&(a.time), i2d_ASN1_INTEGER, 1, v1); 278 M_ASN1_I2D_put_EXP_opt(&(a.time), i2d_ASN1_INTEGER, 1, v1);
314 if (in->timeout != 0L) 279 if (in->timeout != 0L)
@@ -339,10 +304,6 @@ i2d_SSL_SESSION(SSL_SESSION *in, unsigned char **pp)
339 if (in->compress_meth) 304 if (in->compress_meth)
340 M_ASN1_I2D_put_EXP_opt(&(a.comp_id), i2d_ASN1_OCTET_STRING, 11, v11); 305 M_ASN1_I2D_put_EXP_opt(&(a.comp_id), i2d_ASN1_OCTET_STRING, 11, v11);
341#endif 306#endif
342#ifndef OPENSSL_NO_SRP
343 if (in->srp_username)
344 M_ASN1_I2D_put_EXP_opt(&(a.srp_username), i2d_ASN1_OCTET_STRING, 12, v12);
345#endif /* OPENSSL_NO_SRP */
346 M_ASN1_I2D_finish(); 307 M_ASN1_I2D_finish();
347} 308}
348 309
@@ -420,21 +381,6 @@ d2i_SSL_SESSION(SSL_SESSION **a, const unsigned char **pp, long length)
420 381
421 os.length = 0; 382 os.length = 0;
422 383
423#ifndef OPENSSL_NO_KRB5
424 os.length = 0;
425 M_ASN1_D2I_get_opt(osp, d2i_ASN1_OCTET_STRING, V_ASN1_OCTET_STRING);
426 if (os.data) {
427 if (os.length > SSL_MAX_KRB5_PRINCIPAL_LENGTH)
428 ret->krb5_client_princ_len = 0;
429 else
430 ret->krb5_client_princ_len = os.length;
431 memcpy(ret->krb5_client_princ, os.data, ret->krb5_client_princ_len);
432 free(os.data);
433 os.data = NULL;
434 os.length = 0;
435 } else
436 ret->krb5_client_princ_len = 0;
437#endif /* OPENSSL_NO_KRB5 */
438 384
439 ai.length = 0; 385 ai.length = 0;
440 M_ASN1_D2I_get_EXP_opt(aip, d2i_ASN1_INTEGER, 1); /* XXX 2038 */ 386 M_ASN1_D2I_get_EXP_opt(aip, d2i_ASN1_INTEGER, 1); /* XXX 2038 */
@@ -561,18 +507,6 @@ d2i_SSL_SESSION(SSL_SESSION **a, const unsigned char **pp, long length)
561 } 507 }
562#endif 508#endif
563 509
564#ifndef OPENSSL_NO_SRP
565 os.length = 0;
566 os.data = NULL;
567 M_ASN1_D2I_get_EXP_opt(osp, d2i_ASN1_OCTET_STRING, 12);
568 if (os.data) {
569 ret->srp_username = BUF_strndup((char *)os.data, os.length);
570 free(os.data);
571 os.data = NULL;
572 os.length = 0;
573 } else
574 ret->srp_username = NULL;
575#endif /* OPENSSL_NO_SRP */
576 510
577 M_ASN1_D2I_Finish(a, SSL_SESSION_free, SSL_F_D2I_SSL_SESSION); 511 M_ASN1_D2I_Finish(a, SSL_SESSION_free, SSL_F_D2I_SSL_SESSION);
578} 512}