summaryrefslogtreecommitdiffstats
path: root/apps/dhparam.c
diff options
context:
space:
mode:
authorPW Hu <jlu.hpw@foxmail.com>2021-10-08 17:01:47 +0800
committerTomas Mraz <tomas@openssl.org>2021-10-11 10:46:19 +0200
commitfa885e4ba153b6be3e446c8f323762482cef92ae (patch)
tree40bcb287f4d61bb4f901b1c81b235292107b57b8 /apps/dhparam.c
parent6e463bcd53fedbb4ec277a5eb885619e32adcdd2 (diff)
Bugfix: unsafe return check of EVP_PKEY_fromdata
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/16783) (cherry picked from commit d11cab47810715ba472070300b180944a1d93633)
Diffstat (limited to 'apps/dhparam.c')
-rw-r--r--apps/dhparam.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/apps/dhparam.c b/apps/dhparam.c
index 6b8546e93b..db9e964cf0 100644
--- a/apps/dhparam.c
+++ b/apps/dhparam.c
@@ -384,7 +384,7 @@ static EVP_PKEY *dsa_to_dh(EVP_PKEY *dh)
ctx = EVP_PKEY_CTX_new_from_name(NULL, "DHX", NULL);
if (ctx == NULL
|| EVP_PKEY_fromdata_init(ctx) <= 0
- || !EVP_PKEY_fromdata(ctx, &pkey, EVP_PKEY_KEY_PARAMETERS, params)) {
+ || EVP_PKEY_fromdata(ctx, &pkey, EVP_PKEY_KEY_PARAMETERS, params) <= 0) {
BIO_printf(bio_err, "Error, failed to set DH parameters\n");
goto err;
}