aboutsummaryrefslogtreecommitdiffstats
path: root/apps/ts.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/ts.c
parent51e5df0ed01efa47335940425cc8744ecff1b6ae (diff)
downloadopenssl-d0190e11639956677747f6bc7bb5bcd610fd8600.tar.gz
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/ts.c')
-rw-r--r--apps/ts.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/apps/ts.c b/apps/ts.c
index 12958fbbd0..8500968a0c 100644
--- a/apps/ts.c
+++ b/apps/ts.c
@@ -160,7 +160,7 @@ int ts_main(int argc, char **argv)
CONF *conf = NULL;
const char *CAfile = NULL, *untrusted = NULL, *prog;
const char *configfile = default_config_file, *engine = NULL;
- const char *section = NULL;
+ const char *section = NULL, *digestname = NULL;
char **helpp;
char *password = NULL;
char *data = NULL, *digest = NULL, *policy = NULL;
@@ -276,8 +276,7 @@ int ts_main(int argc, char **argv)
engine = opt_arg();
break;
case OPT_MD:
- if (!opt_md(opt_unknown(), &md))
- goto opthelp;
+ digestname = opt_unknown();
break;
case OPT_V_CASES:
if (!opt_verify(o, vpm))
@@ -293,6 +292,10 @@ int ts_main(int argc, char **argv)
goto opthelp;
app_RAND_load();
+ if (digestname != NULL) {
+ if (!opt_md(digestname, &md))
+ goto opthelp;
+ }
if (mode == OPT_REPLY && passin &&
!app_passwd(passin, NULL, &password, NULL)) {
BIO_printf(bio_err, "Error getting password.\n");