diff options
| author | jsing <> | 2014-05-31 10:49:28 +0000 |
|---|---|---|
| committer | jsing <> | 2014-05-31 10:49:28 +0000 |
| commit | cc0b160e462358c219bef48df27be2e816b65194 (patch) | |
| tree | 32a374445fa15f520b06510f07c011a6234df599 /src/lib/libssl/ssl_asn1.c | |
| parent | 57e924c96320c9b14de6078fc75984c949b073b2 (diff) | |
| download | openbsd-cc0b160e462358c219bef48df27be2e816b65194.tar.gz openbsd-cc0b160e462358c219bef48df27be2e816b65194.tar.bz2 openbsd-cc0b160e462358c219bef48df27be2e816b65194.zip | |
TLS would not be entirely functional without extensions, so unifdef
OPENSSL_NO_TLSEXT.
ok tedu@
Diffstat (limited to 'src/lib/libssl/ssl_asn1.c')
| -rw-r--r-- | src/lib/libssl/ssl_asn1.c | 16 |
1 files changed, 0 insertions, 16 deletions
diff --git a/src/lib/libssl/ssl_asn1.c b/src/lib/libssl/ssl_asn1.c index 566590f171..b0da6f4bdb 100644 --- a/src/lib/libssl/ssl_asn1.c +++ b/src/lib/libssl/ssl_asn1.c | |||
| @@ -100,11 +100,9 @@ typedef struct ssl_session_asn1_st { | |||
| 100 | ASN1_INTEGER time; | 100 | ASN1_INTEGER time; |
| 101 | ASN1_INTEGER timeout; | 101 | ASN1_INTEGER timeout; |
| 102 | ASN1_INTEGER verify_result; | 102 | ASN1_INTEGER verify_result; |
| 103 | #ifndef OPENSSL_NO_TLSEXT | ||
| 104 | ASN1_OCTET_STRING tlsext_hostname; | 103 | ASN1_OCTET_STRING tlsext_hostname; |
| 105 | ASN1_INTEGER tlsext_tick_lifetime; | 104 | ASN1_INTEGER tlsext_tick_lifetime; |
| 106 | ASN1_OCTET_STRING tlsext_tick; | 105 | ASN1_OCTET_STRING tlsext_tick; |
| 107 | #endif /* OPENSSL_NO_TLSEXT */ | ||
| 108 | #ifndef OPENSSL_NO_PSK | 106 | #ifndef OPENSSL_NO_PSK |
| 109 | ASN1_OCTET_STRING psk_identity_hint; | 107 | ASN1_OCTET_STRING psk_identity_hint; |
| 110 | ASN1_OCTET_STRING psk_identity; | 108 | ASN1_OCTET_STRING psk_identity; |
| @@ -118,10 +116,8 @@ i2d_SSL_SESSION(SSL_SESSION *in, unsigned char **pp) | |||
| 118 | int v1 = 0, v2 = 0, v3 = 0, v4 = 0, v5 = 0, v7 = 0, v8 = 0; | 116 | int v1 = 0, v2 = 0, v3 = 0, v4 = 0, v5 = 0, v7 = 0, v8 = 0; |
| 119 | unsigned char buf[4], ibuf1[LSIZE2], ibuf2[LSIZE2]; | 117 | unsigned char buf[4], ibuf1[LSIZE2], ibuf2[LSIZE2]; |
| 120 | unsigned char ibuf3[LSIZE2], ibuf4[LSIZE2], ibuf5[LSIZE2]; | 118 | unsigned char ibuf3[LSIZE2], ibuf4[LSIZE2], ibuf5[LSIZE2]; |
| 121 | #ifndef OPENSSL_NO_TLSEXT | ||
| 122 | int v6 = 0, v9 = 0, v10 = 0; | 119 | int v6 = 0, v9 = 0, v10 = 0; |
| 123 | unsigned char ibuf6[LSIZE2]; | 120 | unsigned char ibuf6[LSIZE2]; |
| 124 | #endif | ||
| 125 | #ifndef OPENSSL_NO_COMP | 121 | #ifndef OPENSSL_NO_COMP |
| 126 | unsigned char cbuf; | 122 | unsigned char cbuf; |
| 127 | int v11 = 0; | 123 | int v11 = 0; |
| @@ -202,7 +198,6 @@ i2d_SSL_SESSION(SSL_SESSION *in, unsigned char **pp) | |||
| 202 | ASN1_INTEGER_set(&a.verify_result, in->verify_result); | 198 | ASN1_INTEGER_set(&a.verify_result, in->verify_result); |
| 203 | } | 199 | } |
| 204 | 200 | ||
| 205 | #ifndef OPENSSL_NO_TLSEXT | ||
| 206 | if (in->tlsext_hostname) { | 201 | if (in->tlsext_hostname) { |
| 207 | a.tlsext_hostname.length = strlen(in->tlsext_hostname); | 202 | a.tlsext_hostname.length = strlen(in->tlsext_hostname); |
| 208 | a.tlsext_hostname.type = V_ASN1_OCTET_STRING; | 203 | a.tlsext_hostname.type = V_ASN1_OCTET_STRING; |
| @@ -219,7 +214,6 @@ i2d_SSL_SESSION(SSL_SESSION *in, unsigned char **pp) | |||
| 219 | a.tlsext_tick_lifetime.data = ibuf6; | 214 | a.tlsext_tick_lifetime.data = ibuf6; |
| 220 | ASN1_INTEGER_set(&a.tlsext_tick_lifetime, in->tlsext_tick_lifetime_hint); | 215 | ASN1_INTEGER_set(&a.tlsext_tick_lifetime, in->tlsext_tick_lifetime_hint); |
| 221 | } | 216 | } |
| 222 | #endif /* OPENSSL_NO_TLSEXT */ | ||
| 223 | #ifndef OPENSSL_NO_PSK | 217 | #ifndef OPENSSL_NO_PSK |
| 224 | if (in->psk_identity_hint) { | 218 | if (in->psk_identity_hint) { |
| 225 | a.psk_identity_hint.length = strlen(in->psk_identity_hint); | 219 | a.psk_identity_hint.length = strlen(in->psk_identity_hint); |
| @@ -248,7 +242,6 @@ i2d_SSL_SESSION(SSL_SESSION *in, unsigned char **pp) | |||
| 248 | if (in->verify_result != X509_V_OK) | 242 | if (in->verify_result != X509_V_OK) |
| 249 | M_ASN1_I2D_len_EXP_opt(&(a.verify_result), i2d_ASN1_INTEGER, 5, v5); | 243 | M_ASN1_I2D_len_EXP_opt(&(a.verify_result), i2d_ASN1_INTEGER, 5, v5); |
| 250 | 244 | ||
| 251 | #ifndef OPENSSL_NO_TLSEXT | ||
| 252 | if (in->tlsext_tick_lifetime_hint > 0) | 245 | if (in->tlsext_tick_lifetime_hint > 0) |
| 253 | M_ASN1_I2D_len_EXP_opt(&a.tlsext_tick_lifetime, i2d_ASN1_INTEGER, 9, v9); | 246 | M_ASN1_I2D_len_EXP_opt(&a.tlsext_tick_lifetime, i2d_ASN1_INTEGER, 9, v9); |
| 254 | if (in->tlsext_tick) | 247 | if (in->tlsext_tick) |
| @@ -259,7 +252,6 @@ i2d_SSL_SESSION(SSL_SESSION *in, unsigned char **pp) | |||
| 259 | if (in->compress_meth) | 252 | if (in->compress_meth) |
| 260 | M_ASN1_I2D_len_EXP_opt(&(a.comp_id), i2d_ASN1_OCTET_STRING, 11, v11); | 253 | M_ASN1_I2D_len_EXP_opt(&(a.comp_id), i2d_ASN1_OCTET_STRING, 11, v11); |
| 261 | #endif | 254 | #endif |
| 262 | #endif /* OPENSSL_NO_TLSEXT */ | ||
| 263 | #ifndef OPENSSL_NO_PSK | 255 | #ifndef OPENSSL_NO_PSK |
| 264 | if (in->psk_identity_hint) | 256 | if (in->psk_identity_hint) |
| 265 | M_ASN1_I2D_len_EXP_opt(&(a.psk_identity_hint), i2d_ASN1_OCTET_STRING, 7, v7); | 257 | M_ASN1_I2D_len_EXP_opt(&(a.psk_identity_hint), i2d_ASN1_OCTET_STRING, 7, v7); |
| @@ -284,22 +276,18 @@ i2d_SSL_SESSION(SSL_SESSION *in, unsigned char **pp) | |||
| 284 | v4); | 276 | v4); |
| 285 | if (in->verify_result != X509_V_OK) | 277 | if (in->verify_result != X509_V_OK) |
| 286 | M_ASN1_I2D_put_EXP_opt(&a.verify_result, i2d_ASN1_INTEGER, 5, v5); | 278 | M_ASN1_I2D_put_EXP_opt(&a.verify_result, i2d_ASN1_INTEGER, 5, v5); |
| 287 | #ifndef OPENSSL_NO_TLSEXT | ||
| 288 | if (in->tlsext_hostname) | 279 | if (in->tlsext_hostname) |
| 289 | M_ASN1_I2D_put_EXP_opt(&(a.tlsext_hostname), i2d_ASN1_OCTET_STRING, 6, v6); | 280 | M_ASN1_I2D_put_EXP_opt(&(a.tlsext_hostname), i2d_ASN1_OCTET_STRING, 6, v6); |
| 290 | #endif /* OPENSSL_NO_TLSEXT */ | ||
| 291 | #ifndef OPENSSL_NO_PSK | 281 | #ifndef OPENSSL_NO_PSK |
| 292 | if (in->psk_identity_hint) | 282 | if (in->psk_identity_hint) |
| 293 | M_ASN1_I2D_put_EXP_opt(&(a.psk_identity_hint), i2d_ASN1_OCTET_STRING, 7, v7); | 283 | M_ASN1_I2D_put_EXP_opt(&(a.psk_identity_hint), i2d_ASN1_OCTET_STRING, 7, v7); |
| 294 | if (in->psk_identity) | 284 | if (in->psk_identity) |
| 295 | M_ASN1_I2D_put_EXP_opt(&(a.psk_identity), i2d_ASN1_OCTET_STRING, 8, v8); | 285 | M_ASN1_I2D_put_EXP_opt(&(a.psk_identity), i2d_ASN1_OCTET_STRING, 8, v8); |
| 296 | #endif /* OPENSSL_NO_PSK */ | 286 | #endif /* OPENSSL_NO_PSK */ |
| 297 | #ifndef OPENSSL_NO_TLSEXT | ||
| 298 | if (in->tlsext_tick_lifetime_hint > 0) | 287 | if (in->tlsext_tick_lifetime_hint > 0) |
| 299 | M_ASN1_I2D_put_EXP_opt(&a.tlsext_tick_lifetime, i2d_ASN1_INTEGER, 9, v9); | 288 | M_ASN1_I2D_put_EXP_opt(&a.tlsext_tick_lifetime, i2d_ASN1_INTEGER, 9, v9); |
| 300 | if (in->tlsext_tick) | 289 | if (in->tlsext_tick) |
| 301 | M_ASN1_I2D_put_EXP_opt(&(a.tlsext_tick), i2d_ASN1_OCTET_STRING, 10, v10); | 290 | M_ASN1_I2D_put_EXP_opt(&(a.tlsext_tick), i2d_ASN1_OCTET_STRING, 10, v10); |
| 302 | #endif /* OPENSSL_NO_TLSEXT */ | ||
| 303 | #ifndef OPENSSL_NO_COMP | 291 | #ifndef OPENSSL_NO_COMP |
| 304 | if (in->compress_meth) | 292 | if (in->compress_meth) |
| 305 | M_ASN1_I2D_put_EXP_opt(&(a.comp_id), i2d_ASN1_OCTET_STRING, 11, v11); | 293 | M_ASN1_I2D_put_EXP_opt(&(a.comp_id), i2d_ASN1_OCTET_STRING, 11, v11); |
| @@ -436,7 +424,6 @@ d2i_SSL_SESSION(SSL_SESSION **a, const unsigned char **pp, long length) | |||
| 436 | } else | 424 | } else |
| 437 | ret->verify_result = X509_V_OK; | 425 | ret->verify_result = X509_V_OK; |
| 438 | 426 | ||
| 439 | #ifndef OPENSSL_NO_TLSEXT | ||
| 440 | os.length = 0; | 427 | os.length = 0; |
| 441 | os.data = NULL; | 428 | os.data = NULL; |
| 442 | M_ASN1_D2I_get_EXP_opt(osp, d2i_ASN1_OCTET_STRING, 6); | 429 | M_ASN1_D2I_get_EXP_opt(osp, d2i_ASN1_OCTET_STRING, 6); |
| @@ -447,7 +434,6 @@ d2i_SSL_SESSION(SSL_SESSION **a, const unsigned char **pp, long length) | |||
| 447 | os.length = 0; | 434 | os.length = 0; |
| 448 | } else | 435 | } else |
| 449 | ret->tlsext_hostname = NULL; | 436 | ret->tlsext_hostname = NULL; |
| 450 | #endif /* OPENSSL_NO_TLSEXT */ | ||
| 451 | 437 | ||
| 452 | #ifndef OPENSSL_NO_PSK | 438 | #ifndef OPENSSL_NO_PSK |
| 453 | os.length = 0; | 439 | os.length = 0; |
| @@ -473,7 +459,6 @@ d2i_SSL_SESSION(SSL_SESSION **a, const unsigned char **pp, long length) | |||
| 473 | ret->psk_identity = NULL; | 459 | ret->psk_identity = NULL; |
| 474 | #endif /* OPENSSL_NO_PSK */ | 460 | #endif /* OPENSSL_NO_PSK */ |
| 475 | 461 | ||
| 476 | #ifndef OPENSSL_NO_TLSEXT | ||
| 477 | ai.length = 0; | 462 | ai.length = 0; |
| 478 | M_ASN1_D2I_get_EXP_opt(aip, d2i_ASN1_INTEGER, 9); | 463 | M_ASN1_D2I_get_EXP_opt(aip, d2i_ASN1_INTEGER, 9); |
| 479 | if (ai.data != NULL) { | 464 | if (ai.data != NULL) { |
| @@ -495,7 +480,6 @@ d2i_SSL_SESSION(SSL_SESSION **a, const unsigned char **pp, long length) | |||
| 495 | os.length = 0; | 480 | os.length = 0; |
| 496 | } else | 481 | } else |
| 497 | ret->tlsext_tick = NULL; | 482 | ret->tlsext_tick = NULL; |
| 498 | #endif /* OPENSSL_NO_TLSEXT */ | ||
| 499 | #ifndef OPENSSL_NO_COMP | 483 | #ifndef OPENSSL_NO_COMP |
| 500 | os.length = 0; | 484 | os.length = 0; |
| 501 | os.data = NULL; | 485 | os.data = NULL; |
