summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorPeiwei Hu <jlu.hpw@foxmail.com>2022-05-29 00:05:28 +0800
committerTodd Short <todd.short@me.com>2022-06-02 10:54:17 -0400
commit6e598087f3eb91d147346ce50bc8ea3839d8efac (patch)
treecb947ff6f273a47aee96ac614cf73526114dd13f /apps
parent91486c4ccd540dfff20afcacd462252cf1b6945c (diff)
Fix the checks of EVP_PKEY_param_check
Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Todd Short <todd.short@me.com> (Merged from https://github.com/openssl/openssl/pull/18424) (cherry picked from commit e85bef981c037a6ebc0ca39f61c11bd79ed89fb3)
Diffstat (limited to 'apps')
-rw-r--r--apps/dhparam.c2
-rw-r--r--apps/ecparam.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/apps/dhparam.c b/apps/dhparam.c
index 53d2c7c34d..2742389bb3 100644
--- a/apps/dhparam.c
+++ b/apps/dhparam.c
@@ -318,7 +318,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 e93ecaea6a..5d869cfd14 100644
--- a/apps/ecparam.c
+++ b/apps/ecparam.c
@@ -284,7 +284,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;
}