diff options
author | Matt Caswell <matt@openssl.org> | 2018-04-17 11:32:20 +0100 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2018-04-18 08:20:13 +0100 |
commit | 87b315965296273750ab69728648bbff331e1687 (patch) | |
tree | 7b117b165c5e910aa4631e1f810b033b905b7931 /ssl/statem/statem_srvr.c | |
parent | 1d015368ebe245c4468522d152edfd8a1069426e (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/5993)
Diffstat (limited to 'ssl/statem/statem_srvr.c')
-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 c7cd9eb662..f216db76c6 100644 --- a/ssl/statem/statem_srvr.c +++ b/ssl/statem/statem_srvr.c @@ -1698,6 +1698,12 @@ int tls_construct_server_key_exchange(SSL *s) } dh = EVP_PKEY_get0_DH(s->s3->tmp.pkey); + if (dh == NULL) { + al = SSL_AD_INTERNAL_ERROR; + SSLerr(SSL_F_TLS_CONSTRUCT_SERVER_KEY_EXCHANGE, + ERR_R_INTERNAL_ERROR); + goto err; + } EVP_PKEY_free(pkdh); pkdh = NULL; |