diff options
Diffstat (limited to 'src/lib/libssl/s3_clnt.c')
-rw-r--r-- | src/lib/libssl/s3_clnt.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/lib/libssl/s3_clnt.c b/src/lib/libssl/s3_clnt.c index e5853ede95..2699b5863b 100644 --- a/src/lib/libssl/s3_clnt.c +++ b/src/lib/libssl/s3_clnt.c | |||
@@ -110,13 +110,14 @@ | |||
110 | */ | 110 | */ |
111 | 111 | ||
112 | #include <stdio.h> | 112 | #include <stdio.h> |
113 | #include "ssl_locl.h" | ||
114 | #include "kssl_lcl.h" | ||
113 | #include <openssl/buffer.h> | 115 | #include <openssl/buffer.h> |
114 | #include <openssl/rand.h> | 116 | #include <openssl/rand.h> |
115 | #include <openssl/objects.h> | 117 | #include <openssl/objects.h> |
116 | #include <openssl/evp.h> | 118 | #include <openssl/evp.h> |
117 | #include "ssl_locl.h" | ||
118 | #include "kssl_lcl.h" | ||
119 | #include <openssl/md5.h> | 119 | #include <openssl/md5.h> |
120 | #include "cryptlib.h" | ||
120 | 121 | ||
121 | static SSL_METHOD *ssl3_get_client_method(int ver); | 122 | static SSL_METHOD *ssl3_get_client_method(int ver); |
122 | static int ssl3_client_hello(SSL *s); | 123 | static int ssl3_client_hello(SSL *s); |
@@ -545,6 +546,7 @@ static int ssl3_client_hello(SSL *s) | |||
545 | *(p++)=i; | 546 | *(p++)=i; |
546 | if (i != 0) | 547 | if (i != 0) |
547 | { | 548 | { |
549 | die(i <= sizeof s->session->session_id); | ||
548 | memcpy(p,s->session->session_id,i); | 550 | memcpy(p,s->session->session_id,i); |
549 | p+=i; | 551 | p+=i; |
550 | } | 552 | } |
@@ -626,6 +628,14 @@ static int ssl3_get_server_hello(SSL *s) | |||
626 | /* get the session-id */ | 628 | /* get the session-id */ |
627 | j= *(p++); | 629 | j= *(p++); |
628 | 630 | ||
631 | if(j > sizeof s->session->session_id) | ||
632 | { | ||
633 | al=SSL_AD_ILLEGAL_PARAMETER; | ||
634 | SSLerr(SSL_F_SSL3_GET_SERVER_HELLO, | ||
635 | SSL_R_SSL3_SESSION_ID_TOO_LONG); | ||
636 | goto f_err; | ||
637 | } | ||
638 | |||
629 | if ((j != 0) && (j != SSL3_SESSION_ID_SIZE)) | 639 | if ((j != 0) && (j != SSL3_SESSION_ID_SIZE)) |
630 | { | 640 | { |
631 | /* SSLref returns 16 :-( */ | 641 | /* SSLref returns 16 :-( */ |
@@ -1588,6 +1598,7 @@ static int ssl3_send_client_key_exchange(SSL *s) | |||
1588 | SSL_MAX_MASTER_KEY_LENGTH); | 1598 | SSL_MAX_MASTER_KEY_LENGTH); |
1589 | EVP_EncryptFinal_ex(&ciph_ctx,&(epms[outl]),&padl); | 1599 | EVP_EncryptFinal_ex(&ciph_ctx,&(epms[outl]),&padl); |
1590 | outl += padl; | 1600 | outl += padl; |
1601 | die(outl <= sizeof epms); | ||
1591 | EVP_CIPHER_CTX_cleanup(&ciph_ctx); | 1602 | EVP_CIPHER_CTX_cleanup(&ciph_ctx); |
1592 | 1603 | ||
1593 | /* KerberosWrapper.EncryptedPreMasterSecret */ | 1604 | /* KerberosWrapper.EncryptedPreMasterSecret */ |