diff options
Diffstat (limited to '')
| -rw-r--r-- | src/lib/libssl/ssl_asn1.c | 55 |
1 files changed, 2 insertions, 53 deletions
diff --git a/src/lib/libssl/ssl_asn1.c b/src/lib/libssl/ssl_asn1.c index 43366b33b8..dd958d6570 100644 --- a/src/lib/libssl/ssl_asn1.c +++ b/src/lib/libssl/ssl_asn1.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: ssl_asn1.c,v 1.27 2014/07/10 08:51:15 tedu Exp $ */ | 1 | /* $OpenBSD: ssl_asn1.c,v 1.28 2014/07/11 09:24:44 beck Exp $ */ |
| 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
| 3 | * All rights reserved. | 3 | * All rights reserved. |
| 4 | * | 4 | * |
| @@ -103,17 +103,13 @@ typedef struct ssl_session_asn1_st { | |||
| 103 | ASN1_OCTET_STRING tlsext_hostname; | 103 | ASN1_OCTET_STRING tlsext_hostname; |
| 104 | ASN1_INTEGER tlsext_tick_lifetime; | 104 | ASN1_INTEGER tlsext_tick_lifetime; |
| 105 | ASN1_OCTET_STRING tlsext_tick; | 105 | ASN1_OCTET_STRING tlsext_tick; |
| 106 | #ifndef OPENSSL_NO_PSK | ||
| 107 | ASN1_OCTET_STRING psk_identity_hint; | ||
| 108 | ASN1_OCTET_STRING psk_identity; | ||
| 109 | #endif /* OPENSSL_NO_PSK */ | ||
| 110 | } SSL_SESSION_ASN1; | 106 | } SSL_SESSION_ASN1; |
| 111 | 107 | ||
| 112 | int | 108 | int |
| 113 | i2d_SSL_SESSION(SSL_SESSION *in, unsigned char **pp) | 109 | i2d_SSL_SESSION(SSL_SESSION *in, unsigned char **pp) |
| 114 | { | 110 | { |
| 115 | #define LSIZE2 (sizeof(long)*2) | 111 | #define LSIZE2 (sizeof(long)*2) |
| 116 | int v1 = 0, v2 = 0, v3 = 0, v4 = 0, v5 = 0, v7 = 0, v8 = 0; | 112 | int v1 = 0, v2 = 0, v3 = 0, v4 = 0, v5 = 0; |
| 117 | unsigned char buf[4], ibuf1[LSIZE2], ibuf2[LSIZE2]; | 113 | unsigned char buf[4], ibuf1[LSIZE2], ibuf2[LSIZE2]; |
| 118 | unsigned char ibuf3[LSIZE2], ibuf4[LSIZE2], ibuf5[LSIZE2]; | 114 | unsigned char ibuf3[LSIZE2], ibuf4[LSIZE2], ibuf5[LSIZE2]; |
| 119 | int v6 = 0, v9 = 0, v10 = 0; | 115 | int v6 = 0, v9 = 0, v10 = 0; |
| @@ -202,18 +198,6 @@ i2d_SSL_SESSION(SSL_SESSION *in, unsigned char **pp) | |||
| 202 | a.tlsext_tick_lifetime.data = ibuf6; | 198 | a.tlsext_tick_lifetime.data = ibuf6; |
| 203 | ASN1_INTEGER_set(&a.tlsext_tick_lifetime, in->tlsext_tick_lifetime_hint); | 199 | ASN1_INTEGER_set(&a.tlsext_tick_lifetime, in->tlsext_tick_lifetime_hint); |
| 204 | } | 200 | } |
| 205 | #ifndef OPENSSL_NO_PSK | ||
| 206 | if (in->psk_identity_hint) { | ||
| 207 | a.psk_identity_hint.length = strlen(in->psk_identity_hint); | ||
| 208 | a.psk_identity_hint.type = V_ASN1_OCTET_STRING; | ||
| 209 | a.psk_identity_hint.data = (unsigned char *)(in->psk_identity_hint); | ||
| 210 | } | ||
| 211 | if (in->psk_identity) { | ||
| 212 | a.psk_identity.length = strlen(in->psk_identity); | ||
| 213 | a.psk_identity.type = V_ASN1_OCTET_STRING; | ||
| 214 | a.psk_identity.data = (unsigned char *)(in->psk_identity); | ||
| 215 | } | ||
| 216 | #endif /* OPENSSL_NO_PSK */ | ||
| 217 | 201 | ||
| 218 | M_ASN1_I2D_len(&(a.version), i2d_ASN1_INTEGER); | 202 | M_ASN1_I2D_len(&(a.version), i2d_ASN1_INTEGER); |
| 219 | M_ASN1_I2D_len(&(a.ssl_version), i2d_ASN1_INTEGER); | 203 | M_ASN1_I2D_len(&(a.ssl_version), i2d_ASN1_INTEGER); |
| @@ -236,12 +220,6 @@ i2d_SSL_SESSION(SSL_SESSION *in, unsigned char **pp) | |||
| 236 | M_ASN1_I2D_len_EXP_opt(&(a.tlsext_tick), i2d_ASN1_OCTET_STRING, 10, v10); | 220 | M_ASN1_I2D_len_EXP_opt(&(a.tlsext_tick), i2d_ASN1_OCTET_STRING, 10, v10); |
| 237 | if (in->tlsext_hostname) | 221 | if (in->tlsext_hostname) |
| 238 | M_ASN1_I2D_len_EXP_opt(&(a.tlsext_hostname), i2d_ASN1_OCTET_STRING, 6, v6); | 222 | M_ASN1_I2D_len_EXP_opt(&(a.tlsext_hostname), i2d_ASN1_OCTET_STRING, 6, v6); |
| 239 | #ifndef OPENSSL_NO_PSK | ||
| 240 | if (in->psk_identity_hint) | ||
| 241 | M_ASN1_I2D_len_EXP_opt(&(a.psk_identity_hint), i2d_ASN1_OCTET_STRING, 7, v7); | ||
| 242 | if (in->psk_identity) | ||
| 243 | M_ASN1_I2D_len_EXP_opt(&(a.psk_identity), i2d_ASN1_OCTET_STRING, 8, v8); | ||
| 244 | #endif /* OPENSSL_NO_PSK */ | ||
| 245 | 223 | ||
| 246 | M_ASN1_I2D_seq_total(); | 224 | M_ASN1_I2D_seq_total(); |
| 247 | 225 | ||
| @@ -262,12 +240,6 @@ i2d_SSL_SESSION(SSL_SESSION *in, unsigned char **pp) | |||
| 262 | M_ASN1_I2D_put_EXP_opt(&a.verify_result, i2d_ASN1_INTEGER, 5, v5); | 240 | M_ASN1_I2D_put_EXP_opt(&a.verify_result, i2d_ASN1_INTEGER, 5, v5); |
| 263 | if (in->tlsext_hostname) | 241 | if (in->tlsext_hostname) |
| 264 | M_ASN1_I2D_put_EXP_opt(&(a.tlsext_hostname), i2d_ASN1_OCTET_STRING, 6, v6); | 242 | M_ASN1_I2D_put_EXP_opt(&(a.tlsext_hostname), i2d_ASN1_OCTET_STRING, 6, v6); |
| 265 | #ifndef OPENSSL_NO_PSK | ||
| 266 | if (in->psk_identity_hint) | ||
| 267 | M_ASN1_I2D_put_EXP_opt(&(a.psk_identity_hint), i2d_ASN1_OCTET_STRING, 7, v7); | ||
| 268 | if (in->psk_identity) | ||
| 269 | M_ASN1_I2D_put_EXP_opt(&(a.psk_identity), i2d_ASN1_OCTET_STRING, 8, v8); | ||
| 270 | #endif /* OPENSSL_NO_PSK */ | ||
| 271 | if (in->tlsext_tick_lifetime_hint > 0) | 243 | if (in->tlsext_tick_lifetime_hint > 0) |
| 272 | M_ASN1_I2D_put_EXP_opt(&a.tlsext_tick_lifetime, i2d_ASN1_INTEGER, 9, v9); | 244 | M_ASN1_I2D_put_EXP_opt(&a.tlsext_tick_lifetime, i2d_ASN1_INTEGER, 9, v9); |
| 273 | if (in->tlsext_tick) | 245 | if (in->tlsext_tick) |
| @@ -415,29 +387,6 @@ d2i_SSL_SESSION(SSL_SESSION **a, const unsigned char **pp, long length) | |||
| 415 | } else | 387 | } else |
| 416 | ret->tlsext_hostname = NULL; | 388 | ret->tlsext_hostname = NULL; |
| 417 | 389 | ||
| 418 | #ifndef OPENSSL_NO_PSK | ||
| 419 | os.length = 0; | ||
| 420 | os.data = NULL; | ||
| 421 | M_ASN1_D2I_get_EXP_opt(osp, d2i_ASN1_OCTET_STRING, 7); | ||
| 422 | if (os.data) { | ||
| 423 | ret->psk_identity_hint = BUF_strndup((char *)os.data, os.length); | ||
| 424 | free(os.data); | ||
| 425 | os.data = NULL; | ||
| 426 | os.length = 0; | ||
| 427 | } else | ||
| 428 | ret->psk_identity_hint = NULL; | ||
| 429 | |||
| 430 | os.length = 0; | ||
| 431 | os.data = NULL; | ||
| 432 | M_ASN1_D2I_get_EXP_opt(osp, d2i_ASN1_OCTET_STRING, 8); | ||
| 433 | if (os.data) { | ||
| 434 | ret->psk_identity = BUF_strndup((char *)os.data, os.length); | ||
| 435 | free(os.data); | ||
| 436 | os.data = NULL; | ||
| 437 | os.length = 0; | ||
| 438 | } else | ||
| 439 | ret->psk_identity = NULL; | ||
| 440 | #endif /* OPENSSL_NO_PSK */ | ||
| 441 | 390 | ||
| 442 | ai.length = 0; | 391 | ai.length = 0; |
| 443 | M_ASN1_D2I_get_EXP_opt(aip, d2i_ASN1_INTEGER, 9); | 392 | M_ASN1_D2I_get_EXP_opt(aip, d2i_ASN1_INTEGER, 9); |
