diff options
author | Dr. David von Oheimb <David.von.Oheimb@siemens.com> | 2021-08-27 15:33:18 +0200 |
---|---|---|
committer | Dr. David von Oheimb <dev@ddvo.net> | 2021-12-07 15:26:40 +0100 |
commit | d9f073575fdb07b486cd1b38974cd177687ccc1e (patch) | |
tree | d0e8bf2bb5f98e59ae5fb06a07f4115ab5468516 /apps/pkey.c | |
parent | b0be101326f369f0dd547556d2f3eb3ef5ed0e33 (diff) |
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/pkey.c')
-rw-r--r-- | apps/pkey.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/apps/pkey.c b/apps/pkey.c index fb3899b08e..41a4c29897 100644 --- a/apps/pkey.c +++ b/apps/pkey.c @@ -171,8 +171,7 @@ int pkey_main(int argc, char **argv) } /* No extra arguments. */ - argc = opt_num_rest(); - if (argc != 0) + if (!opt_check_rest_arg(NULL)) goto opthelp; if (text && text_pub) @@ -190,10 +189,8 @@ int pkey_main(int argc, char **argv) private = (!noout && !pubout) || (text && !text_pub); - if (ciphername != NULL) { - if (!opt_cipher(ciphername, &cipher)) - goto opthelp; - } + if (!opt_cipher(ciphername, &cipher)) + goto opthelp; if (cipher == NULL) { if (passoutarg != NULL) BIO_printf(bio_err, |