From: Peiwei Hu Date: Sat, 28 May 2022 16:05:28 +0000 (+0800) Subject: Fix the checks of EVP_PKEY_param_check X-Git-Tag: openssl-3.2.0-alpha1~2575 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e85bef981c037a6ebc0ca39f61c11bd79ed89fb3;p=thirdparty%2Fopenssl.git Fix the checks of EVP_PKEY_param_check Reviewed-by: Tomas Mraz Reviewed-by: Paul Dale Reviewed-by: Todd Short (Merged from https://github.com/openssl/openssl/pull/18424) --- diff --git a/apps/dhparam.c b/apps/dhparam.c index 764f7929d46..c1d7168a608 100644 --- a/apps/dhparam.c +++ b/apps/dhparam.c @@ -329,7 +329,7 @@ int dhparam_main(int argc, char **argv) BIO_printf(bio_err, "Error, failed to check DH parameters\n"); goto end; } - if (!EVP_PKEY_param_check(ctx)) { + if (EVP_PKEY_param_check(ctx) <= 0) { BIO_printf(bio_err, "Error, invalid parameters generated\n"); goto end; } diff --git a/apps/ecparam.c b/apps/ecparam.c index 7ee19349dc4..608014be8f1 100644 --- a/apps/ecparam.c +++ b/apps/ecparam.c @@ -283,7 +283,7 @@ int ecparam_main(int argc, char **argv) goto end; } pctx = EVP_PKEY_CTX_new_from_pkey(NULL, params_key, NULL); - if (pctx == NULL || !EVP_PKEY_param_check(pctx)) { + if (pctx == NULL || EVP_PKEY_param_check(pctx) <= 0) { BIO_printf(bio_err, "failed\n"); goto end; }