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 commitfc84d46d72) (cherry picked from commit0163c6ad1f)
This commit is contained in:
parent
66f7afbb98
commit
257c3dd6cd
|
|
@ -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