summaryrefslogtreecommitdiffstats
path: root/ssl/s3_clnt.c
diff options
context:
space:
mode:
authorEmilia Käsper <emilia@openssl.org>2014-07-24 22:15:29 +0200
committerMatt Caswell <matt@openssl.org>2014-08-06 20:27:51 +0100
commit88ae012c8092852f03c50f6461175271104b4c8a (patch)
tree89eef0140a2e1b491b91576731e8813d8191660c /ssl/s3_clnt.c
parentfc4f4cdb8bf9981904e652abf69b892a45bddacf (diff)
Fix DTLS anonymous EC(DH) denial of service
CVE-2014-3510 Reviewed-by: Dr. Stephen Henson <steve@openssl.org>
Diffstat (limited to 'ssl/s3_clnt.c')
-rw-r--r--ssl/s3_clnt.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/ssl/s3_clnt.c b/ssl/s3_clnt.c
index 2afb892bff..df05f788e9 100644
--- a/ssl/s3_clnt.c
+++ b/ssl/s3_clnt.c
@@ -2253,6 +2253,13 @@ int ssl3_send_client_key_exchange(SSL *s)
RSA *rsa;
unsigned char tmp_buf[SSL_MAX_MASTER_KEY_LENGTH];
+ if (s->session->sess_cert == NULL)
+ {
+ /* We should always have a server certificate with SSL_kRSA. */
+ SSLerr(SSL_F_SSL3_SEND_CLIENT_KEY_EXCHANGE,ERR_R_INTERNAL_ERROR);
+ goto err;
+ }
+
if (s->session->sess_cert->peer_rsa_tmp != NULL)
rsa=s->session->sess_cert->peer_rsa_tmp;
else