diff options
Diffstat (limited to 'src/lib/libssl/ssl_asn1.c')
-rw-r--r-- | src/lib/libssl/ssl_asn1.c | 29 |
1 files changed, 5 insertions, 24 deletions
diff --git a/src/lib/libssl/ssl_asn1.c b/src/lib/libssl/ssl_asn1.c index 51668db785..28e295f6a4 100644 --- a/src/lib/libssl/ssl_asn1.c +++ b/src/lib/libssl/ssl_asn1.c | |||
@@ -165,16 +165,9 @@ i2d_SSL_SESSION(SSL_SESSION *in, unsigned char **pp) | |||
165 | l = in->cipher_id; | 165 | l = in->cipher_id; |
166 | else | 166 | else |
167 | l = in->cipher->id; | 167 | l = in->cipher->id; |
168 | if (in->ssl_version == SSL2_VERSION) { | 168 | a.cipher.length = 2; |
169 | a.cipher.length = 3; | 169 | buf[0] = ((unsigned char)(l >> 8L))&0xff; |
170 | buf[0] = ((unsigned char)(l >> 16L))&0xff; | 170 | buf[1] = ((unsigned char)(l ))&0xff; |
171 | buf[1] = ((unsigned char)(l >> 8L))&0xff; | ||
172 | buf[2] = ((unsigned char)(l ))&0xff; | ||
173 | } else { | ||
174 | a.cipher.length = 2; | ||
175 | buf[0] = ((unsigned char)(l >> 8L))&0xff; | ||
176 | buf[1] = ((unsigned char)(l ))&0xff; | ||
177 | } | ||
178 | 171 | ||
179 | #ifndef OPENSSL_NO_COMP | 172 | #ifndef OPENSSL_NO_COMP |
180 | if (in->compress_meth) { | 173 | if (in->compress_meth) { |
@@ -400,16 +393,7 @@ long length) | |||
400 | os.data = NULL; | 393 | os.data = NULL; |
401 | os.length = 0; | 394 | os.length = 0; |
402 | M_ASN1_D2I_get_x(ASN1_OCTET_STRING, osp, d2i_ASN1_OCTET_STRING); | 395 | M_ASN1_D2I_get_x(ASN1_OCTET_STRING, osp, d2i_ASN1_OCTET_STRING); |
403 | if (ssl_version == SSL2_VERSION) { | 396 | if ((ssl_version >> 8) >= SSL3_VERSION_MAJOR) { |
404 | if (os.length != 3) { | ||
405 | c.error = SSL_R_CIPHER_CODE_WRONG_LENGTH; | ||
406 | goto err; | ||
407 | } | ||
408 | id = 0x02000000L| | ||
409 | ((unsigned long)os.data[0]<<16L)| | ||
410 | ((unsigned long)os.data[1]<< 8L)| | ||
411 | (unsigned long)os.data[2]; | ||
412 | } else if ((ssl_version >> 8) >= SSL3_VERSION_MAJOR) { | ||
413 | if (os.length != 2) { | 397 | if (os.length != 2) { |
414 | c.error = SSL_R_CIPHER_CODE_WRONG_LENGTH; | 398 | c.error = SSL_R_CIPHER_CODE_WRONG_LENGTH; |
415 | goto err; | 399 | goto err; |
@@ -426,10 +410,7 @@ long length) | |||
426 | ret->cipher_id = id; | 410 | ret->cipher_id = id; |
427 | 411 | ||
428 | M_ASN1_D2I_get_x(ASN1_OCTET_STRING, osp, d2i_ASN1_OCTET_STRING); | 412 | M_ASN1_D2I_get_x(ASN1_OCTET_STRING, osp, d2i_ASN1_OCTET_STRING); |
429 | if ((ssl_version >> 8) >= SSL3_VERSION_MAJOR) | 413 | i = SSL3_MAX_SSL_SESSION_ID_LENGTH; |
430 | i = SSL3_MAX_SSL_SESSION_ID_LENGTH; | ||
431 | else /* if (ssl_version>>8 == SSL2_VERSION_MAJOR) */ | ||
432 | i = SSL2_MAX_SSL_SESSION_ID_LENGTH; | ||
433 | 414 | ||
434 | if (os.length > i) | 415 | if (os.length > i) |
435 | os.length = i; | 416 | os.length = i; |