diff options
author | jsing <> | 2014-06-05 17:47:16 +0000 |
---|---|---|
committer | jsing <> | 2014-06-05 17:47:16 +0000 |
commit | e6aea325b431722badc843e83c34e3213006d354 (patch) | |
tree | bf905cfeccfb2219a6b68551540ead21470e1ab3 | |
parent | a5eaf8ae8a59227ec7a51920b1562ab92c770aae (diff) | |
download | openbsd-e6aea325b431722badc843e83c34e3213006d354.tar.gz openbsd-e6aea325b431722badc843e83c34e3213006d354.tar.bz2 openbsd-e6aea325b431722badc843e83c34e3213006d354.zip |
Ensure that sess_cert is not NULL before trying to use it.
Fixes CVE-2014-3470, from OpenSSL.
ok deraadt@
-rw-r--r-- | src/lib/libssl/s3_clnt.c | 8 | ||||
-rw-r--r-- | src/lib/libssl/src/ssl/s3_clnt.c | 8 |
2 files changed, 16 insertions, 0 deletions
diff --git a/src/lib/libssl/s3_clnt.c b/src/lib/libssl/s3_clnt.c index 2b538f21b4..d1455cffc1 100644 --- a/src/lib/libssl/s3_clnt.c +++ b/src/lib/libssl/s3_clnt.c | |||
@@ -2156,6 +2156,14 @@ ssl3_send_client_key_exchange(SSL *s) | |||
2156 | int ecdh_clnt_cert = 0; | 2156 | int ecdh_clnt_cert = 0; |
2157 | int field_size = 0; | 2157 | int field_size = 0; |
2158 | 2158 | ||
2159 | if (s->session->sess_cert == NULL) { | ||
2160 | ssl3_send_alert(s, SSL3_AL_FATAL, | ||
2161 | SSL_AD_UNEXPECTED_MESSAGE); | ||
2162 | SSLerr(SSL_F_SSL3_SEND_CLIENT_KEY_EXCHANGE, | ||
2163 | SSL_R_UNEXPECTED_MESSAGE); | ||
2164 | goto err; | ||
2165 | } | ||
2166 | |||
2159 | /* | 2167 | /* |
2160 | * Did we send out the client's ECDH share for use | 2168 | * Did we send out the client's ECDH share for use |
2161 | * in premaster computation as part of client | 2169 | * in premaster computation as part of client |
diff --git a/src/lib/libssl/src/ssl/s3_clnt.c b/src/lib/libssl/src/ssl/s3_clnt.c index 2b538f21b4..d1455cffc1 100644 --- a/src/lib/libssl/src/ssl/s3_clnt.c +++ b/src/lib/libssl/src/ssl/s3_clnt.c | |||
@@ -2156,6 +2156,14 @@ ssl3_send_client_key_exchange(SSL *s) | |||
2156 | int ecdh_clnt_cert = 0; | 2156 | int ecdh_clnt_cert = 0; |
2157 | int field_size = 0; | 2157 | int field_size = 0; |
2158 | 2158 | ||
2159 | if (s->session->sess_cert == NULL) { | ||
2160 | ssl3_send_alert(s, SSL3_AL_FATAL, | ||
2161 | SSL_AD_UNEXPECTED_MESSAGE); | ||
2162 | SSLerr(SSL_F_SSL3_SEND_CLIENT_KEY_EXCHANGE, | ||
2163 | SSL_R_UNEXPECTED_MESSAGE); | ||
2164 | goto err; | ||
2165 | } | ||
2166 | |||
2159 | /* | 2167 | /* |
2160 | * Did we send out the client's ECDH share for use | 2168 | * Did we send out the client's ECDH share for use |
2161 | * in premaster computation as part of client | 2169 | * in premaster computation as part of client |