diff options
author | Matt Caswell <matt@openssl.org> | 2018-04-17 11:32:20 +0100 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2018-04-17 17:09:09 +0100 |
commit | a68236572850a1f50d5c40990b5a15a18ebea3bc (patch) | |
tree | ac30f2a2a744733d1058d09eae3a88e3c6050670 /ssl | |
parent | 7d4488bbd7ac34fffb776cccbfff6b4ac0387e03 (diff) |
Check the return from EVP_PKEY_get0_DH()
Fixes #5934
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/5983)
Diffstat (limited to 'ssl')
-rw-r--r-- | ssl/statem/statem_srvr.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/ssl/statem/statem_srvr.c b/ssl/statem/statem_srvr.c index 7e033ceb16..aa38fada70 100644 --- a/ssl/statem/statem_srvr.c +++ b/ssl/statem/statem_srvr.c @@ -2481,6 +2481,12 @@ int tls_construct_server_key_exchange(SSL *s, WPACKET *pkt) } dh = EVP_PKEY_get0_DH(s->s3->tmp.pkey); + if (dh == NULL) { + SSLfatal(s, SSL_AD_INTERNAL_ERROR, + SSL_F_TLS_CONSTRUCT_SERVER_KEY_EXCHANGE, + ERR_R_INTERNAL_ERROR); + goto err; + } EVP_PKEY_free(pkdh); pkdh = NULL; |