mirror of https://github.com/openssl/openssl.git
Fix null pointer check in pkey_dh_derive to ensure both keys are set
CLA: trivial
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Todd Short <todd.short@me.com>
(Merged from https://github.com/openssl/openssl/pull/28259)
(cherry picked from commit fc84d46d72
)
This commit is contained in:
parent
7e8d78d579
commit
0163c6ad1f
|
@ -408,7 +408,7 @@ static int pkey_dh_derive(EVP_PKEY_CTX *ctx, unsigned char *key,
|
|||
}
|
||||
dh = (DH *)EVP_PKEY_get0_DH(ctx->pkey);
|
||||
dhpub = EVP_PKEY_get0_DH(ctx->peerkey);
|
||||
if (dhpub == NULL) {
|
||||
if (dhpub == NULL || dh == NULL) {
|
||||
ERR_raise(ERR_LIB_DH, DH_R_KEYS_NOT_SET);
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue