summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorClemens Lang <cllang@redhat.com>2022-07-01 15:35:22 +0200
committerDmitry Belyavskiy <beldmit@gmail.com>2022-08-17 09:31:08 +0200
commitbe52cfec4974c47d8c5579928b774a43c9264883 (patch)
treebb9c86487267e01c29e293f0462872d445ddb3b6 /apps
parent9bd968d42e77e2e7e00756cc7bef0817bf8322e1 (diff)
APPS: pkeyparam: Support setting properties
The -provider and -propquery options did not work on pkeyparam. 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) (cherry picked from commit 0185538799803a1a98823f42ac2402ede04f56da)
Diffstat (limited to 'apps')
-rw-r--r--apps/pkeyparam.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/apps/pkeyparam.c b/apps/pkeyparam.c
index 45647341ce..9f38c19cb8 100644
--- a/apps/pkeyparam.c
+++ b/apps/pkeyparam.c
@@ -101,7 +101,8 @@ int pkeyparam_main(int argc, char **argv)
out = bio_open_default(outfile, 'w', FORMAT_PEM);
if (out == NULL)
goto end;
- pkey = PEM_read_bio_Parameters(in, NULL);
+ pkey = PEM_read_bio_Parameters_ex(in, NULL, app_get0_libctx(),
+ app_get0_propq());
if (pkey == NULL) {
BIO_printf(bio_err, "Error reading parameters\n");
ERR_print_errors(bio_err);
@@ -109,7 +110,11 @@ int pkeyparam_main(int argc, char **argv)
}
if (check) {
- ctx = EVP_PKEY_CTX_new(pkey, e);
+ if (e == NULL)
+ ctx = EVP_PKEY_CTX_new_from_pkey(app_get0_libctx(), pkey,
+ app_get0_propq());
+ else
+ ctx = EVP_PKEY_CTX_new(pkey, e);
if (ctx == NULL) {
ERR_print_errors(bio_err);
goto end;