diff options
| author | markus <> | 2002-09-05 22:44:52 +0000 |
|---|---|---|
| committer | markus <> | 2002-09-05 22:44:52 +0000 |
| commit | 715a204e4615e4a70a466fcb383a9a57cad5e6b8 (patch) | |
| tree | 2d2e93c4a34d1f7f04aba73706353332d7700641 /src/lib/libssl/s3_clnt.c | |
| parent | 15b5d84f9da2ce4bfae8580e56e34a859f74ad71 (diff) | |
| download | openbsd-715a204e4615e4a70a466fcb383a9a57cad5e6b8.tar.gz openbsd-715a204e4615e4a70a466fcb383a9a57cad5e6b8.tar.bz2 openbsd-715a204e4615e4a70a466fcb383a9a57cad5e6b8.zip | |
import openssl-0.9.7-beta3
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 */ |
