summaryrefslogtreecommitdiffstats
path: root/apps/cms.c
diff options
context:
space:
mode:
authorRich Salz <rsalz@akamai.com>2021-02-08 14:20:01 -0500
committerPauli <ppzgs1@gmail.com>2021-02-12 08:34:17 +1000
commit03bbd346f4410c329d472cc043fb6c49f6688eba (patch)
tree4404d27a430f7a3c8a33ddd6d0633fb35d9a4065 /apps/cms.c
parentd0190e11639956677747f6bc7bb5bcd610fd8600 (diff)
Fetch cipher 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.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/apps/cms.c b/apps/cms.c
index 4f1e614e4c..67cbb9379a 100644
--- a/apps/cms.c
+++ b/apps/cms.c
@@ -289,7 +289,8 @@ int cms_main(int argc, char **argv)
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;
+ char *passinarg = NULL, *passin = NULL, *signerfile = NULL;
+ char *originatorfile = NULL, *recipfile = NULL, *ciphername = NULL;
char *to = NULL, *from = NULL, *subject = NULL, *prog;
cms_key_param *key_first = NULL, *key_param = NULL;
int flags = CMS_DETACHED, noout = 0, print = 0, keyidx = -1, vpmtouched = 0;
@@ -624,8 +625,7 @@ int cms_main(int argc, char **argv)
}
break;
case OPT_CIPHER:
- if (!opt_cipher(opt_unknown(), &cipher))
- goto end;
+ ciphername = opt_unknown();
break;
case OPT_KEYOPT:
keyidx = -1;
@@ -698,8 +698,14 @@ int cms_main(int argc, char **argv)
}
}
app_RAND_load();
- if (digestname != NULL && !opt_md(digestname, &sign_md))
- goto end;
+ if (digestname != NULL) {
+ if (!opt_md(digestname, &sign_md))
+ goto end;
+ }
+ if (ciphername != NULL) {
+ if (!opt_cipher(ciphername, &cipher))
+ goto end;
+ }
/* Remaining args are files to process. */
argc = opt_num_rest();