summaryrefslogtreecommitdiffstats
path: root/apps/genpkey.c
diff options
context:
space:
mode:
authorPetr Gotthard <petr.gotthard@centrum.cz>2020-12-26 21:32:14 +0100
committerPauli <ppzgs1@gmail.com>2021-02-05 10:24:04 +1000
commit7dc67708c8ae6ec06c7fec34781225ed60b5e68d (patch)
treec48ecd0e6c3a24a5837a09a7e7497c458052d4c6 /apps/genpkey.c
parent88444854affe31ce08a5daaf4b6afc86e6972c63 (diff)
apps/openssl: add -propquery command line option
Fixes #13656. Right now all openssl commands use a NULL propq. This patch adds a possibility to specify a custom propq. The implementation follows the example of set_nameopt/get_nameopt. Various tools had to be modified to call app_get0_propq after it has been populated. Otherwise the -propquery has no effect. The tests then verify the -propquery affects the tool behaviour by requesting a non-existing property. Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/13707)
Diffstat (limited to 'apps/genpkey.c')
-rw-r--r--apps/genpkey.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/apps/genpkey.c b/apps/genpkey.c
index 83af5ec88f..bdd8b43e47 100644
--- a/apps/genpkey.c
+++ b/apps/genpkey.c
@@ -68,7 +68,6 @@ int genpkey_main(int argc, char **argv)
int outformat = FORMAT_PEM, text = 0, ret = 1, rv, do_param = 0;
int private = 0;
OSSL_LIB_CTX *libctx = app_get0_libctx();
- const char *propq = app_get0_propq();
prog = opt_init(argc, argv, genpkey_options);
while ((o = opt_next()) != OPT_EOF) {
@@ -98,11 +97,11 @@ int genpkey_main(int argc, char **argv)
case OPT_PARAMFILE:
if (do_param == 1)
goto opthelp;
- if (!init_keygen_file(&ctx, opt_arg(), e, libctx, propq))
+ if (!init_keygen_file(&ctx, opt_arg(), e, libctx, app_get0_propq()))
goto end;
break;
case OPT_ALGORITHM:
- if (!init_gen_str(&ctx, opt_arg(), e, do_param, libctx, propq))
+ if (!init_gen_str(&ctx, opt_arg(), e, do_param, libctx, app_get0_propq()))
goto end;
break;
case OPT_PKEYOPT: