summaryrefslogtreecommitdiff
path: root/apps/req.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/req.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/req.c')
-rw-r--r--apps/req.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/apps/req.c b/apps/req.c
index 274f839902..36ac493807 100644
--- a/apps/req.c
+++ b/apps/req.c
@@ -241,7 +241,6 @@ int req_main(int argc, char **argv)
X509 *new_x509 = NULL, *CAcert = NULL;
X509_REQ *req = NULL;
EVP_CIPHER *cipher = NULL;
- EVP_MD *md = NULL;
int ext_copy = EXT_COPY_UNSET;
BIO *addext_bio = NULL;
char *extsect = NULL;
@@ -473,8 +472,7 @@ int req_main(int argc, char **argv)
}
/* No extra arguments. */
- argc = opt_num_rest();
- if (argc != 0)
+ if (!opt_check_rest_arg(NULL))
goto opthelp;
if (!app_RAND_load())
@@ -533,11 +531,8 @@ int req_main(int argc, char **argv)
/* Check that any specified digest is fetchable */
if (digest != NULL) {
- if (!opt_md(digest, &md)) {
- ERR_clear_error();
+ if (!opt_check_md(digest))
goto opthelp;
- }
- EVP_MD_free(md);
} else {
/* No digest specified, default to configuration */
p = NCONF_get_string(req_conf, section, "default_md");