diff options
author | Joel Sing <jsing@cvs.openbsd.org> | 2014-06-05 17:47:17 +0000 |
---|---|---|
committer | Joel Sing <jsing@cvs.openbsd.org> | 2014-06-05 17:47:17 +0000 |
commit | b5e818913cca23518ef1c97ac5154ac0313c9f83 (patch) | |
tree | d3dec64fff8bc7b9d8eba38e8b191a5255dfecd8 /lib/libssl | |
parent | 9063eaa42ff73cb375b4bb0b78f3720e3033b841 (diff) |
Ensure that sess_cert is not NULL before trying to use it.
Fixes CVE-2014-3470, from OpenSSL.
ok deraadt@
Diffstat (limited to 'lib/libssl')
-rw-r--r-- | lib/libssl/s3_clnt.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/libssl/s3_clnt.c b/lib/libssl/s3_clnt.c index 2b538f21b43..d1455cffc11 100644 --- a/lib/libssl/s3_clnt.c +++ b/lib/libssl/s3_clnt.c @@ -2156,6 +2156,14 @@ ssl3_send_client_key_exchange(SSL *s) int ecdh_clnt_cert = 0; int field_size = 0; + if (s->session->sess_cert == NULL) { + ssl3_send_alert(s, SSL3_AL_FATAL, + SSL_AD_UNEXPECTED_MESSAGE); + SSLerr(SSL_F_SSL3_SEND_CLIENT_KEY_EXCHANGE, + SSL_R_UNEXPECTED_MESSAGE); + goto err; + } + /* * Did we send out the client's ECDH share for use * in premaster computation as part of client |