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)
This commit is contained in:
parent
bc28ca499e
commit
fc84d46d72
|
@ -408,7 +408,7 @@ static int pkey_dh_derive(EVP_PKEY_CTX *ctx, unsigned char *key,
|
||||||
}
|
}
|
||||||
dh = (DH *)EVP_PKEY_get0_DH(ctx->pkey);
|
dh = (DH *)EVP_PKEY_get0_DH(ctx->pkey);
|
||||||
dhpub = EVP_PKEY_get0_DH(ctx->peerkey);
|
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);
|
ERR_raise(ERR_LIB_DH, DH_R_KEYS_NOT_SET);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue