summaryrefslogtreecommitdiffstats
path: root/apps/ec.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/ec.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/ec.c')
-rw-r--r--apps/ec.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/apps/ec.c b/apps/ec.c
index 495e8e6617..d89c580020 100644
--- a/apps/ec.c
+++ b/apps/ec.c
@@ -70,7 +70,7 @@ int ec_main(int argc, char **argv)
BIO *in = NULL, *out = NULL;
ENGINE *e = NULL;
const EVP_CIPHER *enc = NULL;
- char *infile = NULL, *outfile = NULL, *prog;
+ char *infile = NULL, *outfile = NULL, *ciphername = NULL, *prog;
char *passin = NULL, *passout = NULL, *passinarg = NULL, *passoutarg = NULL;
OPTION_CHOICE o;
int informat = FORMAT_PEM, outformat = FORMAT_PEM, text = 0, noout = 0;
@@ -131,8 +131,7 @@ int ec_main(int argc, char **argv)
e = setup_engine(opt_arg(), 0);
break;
case OPT_CIPHER:
- if (!opt_cipher(opt_unknown(), &enc))
- goto opthelp;
+ ciphername = opt_unknown();
break;
case OPT_CONV_FORM:
point_format = opt_arg();
@@ -162,6 +161,10 @@ int ec_main(int argc, char **argv)
if (argc != 0)
goto opthelp;
+ if (ciphername != NULL) {
+ if (!opt_cipher(ciphername, &enc))
+ goto opthelp;
+ }
private = param_out || pubin || pubout ? 0 : 1;
if (text && !pubin)
private = 1;