diff options
author | Clemens Lang <cllang@redhat.com> | 2022-07-01 14:50:59 +0200 |
---|---|---|
committer | Dmitry Belyavskiy <beldmit@gmail.com> | 2022-08-17 09:20:41 +0200 |
commit | ae3c30acac17271693e91dcae42c804cd96e8f93 (patch) | |
tree | b10156e34912a65aca895334701ba8517f44b881 /apps | |
parent | 45479dcee1672661e4f5b6d8b6c9a50453581e65 (diff) |
APPS: dhparam: Support setting properties
The -provider and -propquery options did not work on dhparam. Fix this
and add tests that check that operations that would usually fail with
the FIPS provider work when run with
| -provider default -propquery '?fips!=yes'
See also 30b2c3592e8511b60d44f93eb657a1ecb3662c08, which previously
fixed the same problem in dsaparam and gendsa. See also the initial
report in https://bugzilla.redhat.com/show_bug.cgi?id=2094956.
Signed-off-by: Clemens Lang <cllang@redhat.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/18717)
Diffstat (limited to 'apps')
-rw-r--r-- | apps/dhparam.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/apps/dhparam.c b/apps/dhparam.c index c1d7168a60..93a858d746 100644 --- a/apps/dhparam.c +++ b/apps/dhparam.c @@ -194,7 +194,7 @@ int dhparam_main(int argc, char **argv) BIO_printf(bio_err, "Warning, input file %s ignored\n", infile); } - ctx = EVP_PKEY_CTX_new_from_name(NULL, alg, NULL); + ctx = EVP_PKEY_CTX_new_from_name(app_get0_libctx(), alg, app_get0_propq()); if (ctx == NULL) { BIO_printf(bio_err, "Error, %s param generation context allocation failed\n", @@ -324,7 +324,7 @@ int dhparam_main(int argc, char **argv) EVP_PKEY_print_params(out, pkey, 4, NULL); if (check) { - ctx = EVP_PKEY_CTX_new_from_pkey(NULL, pkey, NULL); + ctx = EVP_PKEY_CTX_new_from_pkey(app_get0_libctx(), pkey, app_get0_propq()); if (ctx == NULL) { BIO_printf(bio_err, "Error, failed to check DH parameters\n"); goto end; @@ -396,7 +396,7 @@ static EVP_PKEY *dsa_to_dh(EVP_PKEY *dh) goto err; } - ctx = EVP_PKEY_CTX_new_from_name(NULL, "DHX", NULL); + ctx = EVP_PKEY_CTX_new_from_name(app_get0_libctx(), "DHX", app_get0_propq()); if (ctx == NULL || EVP_PKEY_fromdata_init(ctx) <= 0 || EVP_PKEY_fromdata(ctx, &pkey, EVP_PKEY_KEY_PARAMETERS, params) <= 0) { |