summaryrefslogtreecommitdiffstats
path: root/apps/pkcs7.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/pkcs7.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/pkcs7.c')
-rw-r--r--apps/pkcs7.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/apps/pkcs7.c b/apps/pkcs7.c
index efc58b10c9..d970feb30e 100644
--- a/apps/pkcs7.c
+++ b/apps/pkcs7.c
@@ -61,7 +61,6 @@ int pkcs7_main(int argc, char **argv)
int i, print_certs = 0, text = 0, noout = 0, p7_print = 0, ret = 1;
OPTION_CHOICE o;
OSSL_LIB_CTX *libctx = app_get0_libctx();
- const char *propq = app_get0_propq();
prog = opt_init(argc, argv, pkcs7_options);
while ((o = opt_next()) != OPT_EOF) {
@@ -120,7 +119,7 @@ int pkcs7_main(int argc, char **argv)
if (in == NULL)
goto end;
- p7 = PKCS7_new_ex(libctx, propq);
+ p7 = PKCS7_new_ex(libctx, app_get0_propq());
if (p7 == NULL) {
BIO_printf(bio_err, "unable to allocate PKCS7 object\n");
ERR_print_errors(bio_err);