aboutsummaryrefslogtreecommitdiff
path: root/apps/ec.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/ec.c')
-rw-r--r--apps/ec.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/apps/ec.c b/apps/ec.c
index e2dd6f2b48f3..677876ccc90e 100644
--- a/apps/ec.c
+++ b/apps/ec.c
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2022 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2002-2023 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
@@ -80,6 +80,7 @@ int ec_main(int argc, char **argv)
char *point_format = NULL;
int no_public = 0;
+ opt_set_unknown_name("cipher");
prog = opt_init(argc, argv, ec_options);
while ((o = opt_next()) != OPT_EOF) {
switch (o) {
@@ -157,17 +158,12 @@ int ec_main(int argc, char **argv)
}
/* No extra arguments. */
- argc = opt_num_rest();
- if (argc != 0)
+ if (!opt_check_rest_arg(NULL))
goto opthelp;
- if (ciphername != NULL) {
- if (!opt_cipher(ciphername, &enc))
- goto opthelp;
- }
- private = param_out || pubin || pubout ? 0 : 1;
- if (text && !pubin)
- private = 1;
+ if (!opt_cipher(ciphername, &enc))
+ goto opthelp;
+ private = !pubin && (text || (!param_out && !pubout));
if (!app_passwd(passinarg, passoutarg, &passin, &passout)) {
BIO_printf(bio_err, "Error getting passwords\n");