summaryrefslogtreecommitdiffstats
path: root/apps/cms.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/cms.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/cms.c')
-rw-r--r--apps/cms.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/apps/cms.c b/apps/cms.c
index 451f0862c2..4f1e614e4c 100644
--- a/apps/cms.c
+++ b/apps/cms.c
@@ -286,7 +286,7 @@ int cms_main(int argc, char **argv)
X509_VERIFY_PARAM *vpm = NULL;
char *certfile = NULL, *keyfile = NULL, *contfile = NULL;
const char *CAfile = NULL, *CApath = NULL, *CAstore = NULL;
- char *certsoutfile = NULL;
+ char *certsoutfile = NULL, *digestname = NULL;
int noCAfile = 0, noCApath = 0, noCAstore = 0;
char *infile = NULL, *outfile = NULL, *rctfile = NULL;
char *passinarg = NULL, *passin = NULL, *signerfile = NULL, *originatorfile = NULL, *recipfile = NULL;
@@ -565,8 +565,7 @@ int cms_main(int argc, char **argv)
certsoutfile = opt_arg();
break;
case OPT_MD:
- if (!opt_md(opt_arg(), &sign_md))
- goto end;
+ digestname = opt_arg();
break;
case OPT_SIGNER:
/* If previous -signer argument add signer to list */
@@ -699,6 +698,8 @@ int cms_main(int argc, char **argv)
}
}
app_RAND_load();
+ if (digestname != NULL && !opt_md(digestname, &sign_md))
+ goto end;
/* Remaining args are files to process. */
argc = opt_num_rest();