summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Sing <jsing@cvs.openbsd.org>2014-06-05 17:47:17 +0000
committerJoel Sing <jsing@cvs.openbsd.org>2014-06-05 17:47:17 +0000
commit746a41b9f82721ed0c7c186d820fadc8787959ec (patch)
treeccc6269751970b789dc0db8e6fe249759eab1b43
parenta17ee4706696787676b5428be1f08a86b4ed5022 (diff)
Ensure that sess_cert is not NULL before trying to use it.
Fixes CVE-2014-3470, from OpenSSL. ok deraadt@
-rw-r--r--lib/libssl/src/ssl/s3_clnt.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/libssl/src/ssl/s3_clnt.c b/lib/libssl/src/ssl/s3_clnt.c
index 2b538f21b43..d1455cffc11 100644
--- a/lib/libssl/src/ssl/s3_clnt.c
+++ b/lib/libssl/src/ssl/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