From 03bbd346f4410c329d472cc043fb6c49f6688eba Mon Sep 17 00:00:00 2001 From: Rich Salz Date: Mon, 8 Feb 2021 14:20:01 -0500 Subject: Fetch cipher after loading providers Reviewed-by: Shane Lontis Reviewed-by: Tomas Mraz Reviewed-by: Paul Dale (Merged from https://github.com/openssl/openssl/pull/14135) --- apps/dsa.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'apps/dsa.c') diff --git a/apps/dsa.c b/apps/dsa.c index ebb841fa53..c4baaf7de9 100644 --- a/apps/dsa.c +++ b/apps/dsa.c @@ -87,7 +87,7 @@ int dsa_main(int argc, char **argv) int modulus = 0, pubin = 0, pubout = 0, ret = 1; int pvk_encr = DEFAULT_PVK_ENCR_STRENGTH; int private = 0; - const char *output_type = NULL; + const char *output_type = NULL, *ciphername = NULL; const char *output_structure = NULL; int selection = 0; OSSL_ENCODER_CTX *ectx = NULL; @@ -151,8 +151,7 @@ int dsa_main(int argc, char **argv) pubout = 1; break; case OPT_CIPHER: - if (!opt_cipher(opt_unknown(), &enc)) - goto end; + ciphername = opt_unknown(); break; case OPT_PROV_CASES: if (!opt_provider(o)) @@ -166,6 +165,10 @@ int dsa_main(int argc, char **argv) if (argc != 0) goto opthelp; + if (ciphername != NULL) { + if (!opt_cipher(ciphername, &enc)) + goto end; + } private = pubin || pubout ? 0 : 1; if (text && !pubin) private = 1; -- cgit v1.2.3