summaryrefslogtreecommitdiff
path: root/apps/genrsa.c
diff options
context:
space:
mode:
authorDr. David von Oheimb <David.von.Oheimb@siemens.com>2021-08-27 15:33:18 +0200
committerDr. David von Oheimb <dev@ddvo.net>2021-12-07 15:26:40 +0100
commitd9f073575fdb07b486cd1b38974cd177687ccc1e (patch)
treed0e8bf2bb5f98e59ae5fb06a07f4115ab5468516 /apps/genrsa.c
parentb0be101326f369f0dd547556d2f3eb3ef5ed0e33 (diff)
downloadopenssl-new-d9f073575fdb07b486cd1b38974cd177687ccc1e.tar.gz
APPS: Improve diagnostics on missing/extra args and unknown cipher/digest
Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/16450)
Diffstat (limited to 'apps/genrsa.c')
-rw-r--r--apps/genrsa.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/apps/genrsa.c b/apps/genrsa.c
index e709ea38ce..1a6c67380f 100644
--- a/apps/genrsa.c
+++ b/apps/genrsa.c
@@ -157,8 +157,7 @@ opthelp:
"Warning: It is not recommended to use more than %d bit for RSA keys.\n"
" Your key size is %d! Larger key size may behave not as expected.\n",
OPENSSL_RSA_MAX_MODULUS_BITS, num);
- } else if (argc > 0) {
- BIO_printf(bio_err, "Extra arguments given.\n");
+ } else if (!opt_check_rest_arg(NULL)) {
goto opthelp;
}
@@ -166,10 +165,8 @@ opthelp:
goto end;
private = 1;
- if (ciphername != NULL) {
- if (!opt_cipher(ciphername, &enc))
- goto end;
- }
+ if (!opt_cipher(ciphername, &enc))
+ goto end;
if (!app_passwd(NULL, passoutarg, NULL, &passout)) {
BIO_printf(bio_err, "Error getting password\n");
goto end;