aboutsummaryrefslogtreecommitdiff
path: root/apps/dsa.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/dsa.c')
-rw-r--r--apps/dsa.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/apps/dsa.c b/apps/dsa.c
index 51c02843539f..9ba8c252dafe 100644
--- a/apps/dsa.c
+++ b/apps/dsa.c
@@ -1,5 +1,5 @@
/*
- * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-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
@@ -92,6 +92,7 @@ int dsa_main(int argc, char **argv)
int selection = 0;
OSSL_ENCODER_CTX *ectx = NULL;
+ opt_set_unknown_name("cipher");
prog = opt_init(argc, argv, dsa_options);
while ((o = opt_next()) != OPT_EOF) {
switch (o) {
@@ -161,17 +162,12 @@ int dsa_main(int argc, char **argv)
}
/* No extra args. */
- argc = opt_num_rest();
- if (argc != 0)
+ if (!opt_check_rest_arg(NULL))
goto opthelp;
- if (ciphername != NULL) {
- if (!opt_cipher(ciphername, &enc))
- goto end;
- }
- private = pubin || pubout ? 0 : 1;
- if (text && !pubin)
- private = 1;
+ if (!opt_cipher(ciphername, &enc))
+ goto end;
+ private = !pubin && (!pubout || text);
if (!app_passwd(passinarg, passoutarg, &passin, &passout)) {
BIO_printf(bio_err, "Error getting passwords\n");