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/ts.c | |
parent | Fix documentation for tlsext_ticket_key (diff) | |
download | openssl-d9f073575fdb07b486cd1b38974cd177687ccc1e.tar.xz openssl-d9f073575fdb07b486cd1b38974cd177687ccc1e.zip |
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/ts.c')
-rw-r--r-- | apps/ts.c | 17 |
1 files changed, 10 insertions, 7 deletions
@@ -204,8 +204,10 @@ int ts_main(int argc, char **argv) case OPT_QUERY: case OPT_REPLY: case OPT_VERIFY: - if (mode != OPT_ERR) + if (mode != OPT_ERR) { + BIO_printf(bio_err, "%s: Must give only one of -query, -reply, or -verify\n", prog); goto opthelp; + } mode = o; break; case OPT_DATA: @@ -288,17 +290,18 @@ int ts_main(int argc, char **argv) } /* No extra arguments. */ - argc = opt_num_rest(); - if (argc != 0 || mode == OPT_ERR) + if (!opt_check_rest_arg(NULL)) + goto opthelp; + if (mode == OPT_ERR) { + BIO_printf(bio_err, "%s: Must give one of -query, -reply, or -verify\n", prog); goto opthelp; + } if (!app_RAND_load()) goto end; - if (digestname != NULL) { - if (!opt_md(digestname, &md)) - goto opthelp; - } + if (!opt_md(digestname, &md)) + goto opthelp; if (mode == OPT_REPLY && passin && !app_passwd(passin, NULL, &password, NULL)) { BIO_printf(bio_err, "Error getting password.\n"); |