summaryrefslogtreecommitdiffstats
path: root/apps/storeutl.c
diff options
context:
space:
mode:
authorRich Salz <rsalz@akamai.com>2021-02-08 14:03:35 -0500
committerPauli <ppzgs1@gmail.com>2021-02-12 08:34:17 +1000
commitd0190e11639956677747f6bc7bb5bcd610fd8600 (patch)
tree65b3b8fa880bd32563f4e59bc82624489673da6d /apps/storeutl.c
parent51e5df0ed01efa47335940425cc8744ecff1b6ae (diff)
Process digest option after loading providers
Reviewed-by: Shane Lontis <shane.lontis@oracle.com> Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14135)
Diffstat (limited to 'apps/storeutl.c')
-rw-r--r--apps/storeutl.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/apps/storeutl.c b/apps/storeutl.c
index 9333c478f2..7c13092fe5 100644
--- a/apps/storeutl.c
+++ b/apps/storeutl.c
@@ -81,7 +81,7 @@ int storeutl_main(int argc, char *argv[])
ASN1_INTEGER *serial = NULL;
unsigned char *fingerprint = NULL;
size_t fingerprintlen = 0;
- char *alias = NULL;
+ char *alias = NULL, *digestname = NULL;
OSSL_STORE_SEARCH *search = NULL;
const EVP_MD *digest = NULL;
OSSL_LIB_CTX *libctx = app_get0_libctx();
@@ -247,8 +247,8 @@ int storeutl_main(int argc, char *argv[])
e = setup_engine(opt_arg(), 0);
break;
case OPT_MD:
- if (!opt_md(opt_unknown(), &digest))
- goto opthelp;
+ digestname = opt_unknown();
+ break;
case OPT_PROV_CASES:
if (!opt_provider(o))
goto end;
@@ -262,6 +262,11 @@ int storeutl_main(int argc, char *argv[])
if (argc != 1)
goto opthelp;
+ if (digestname != NULL) {
+ if (!opt_md(digestname, &digest))
+ goto opthelp;
+ }
+
if (criterion != 0) {
switch (criterion) {
case OSSL_STORE_SEARCH_BY_NAME: