diff options
author | Pauli <paul.dale@oracle.com> | 2020-02-10 13:37:53 +1000 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2020-02-21 13:04:25 +0100 |
commit | e1dcac22607f6ecbb5ad4f15fc1a54f54f40c1ba (patch) | |
tree | 6bd079b5d6ca0157a36dd17e8f3deb44966c60e2 /apps | |
parent | 292c8bdc083d1b739ae241775bfac36f1f998294 (diff) |
apps: distinguish between a parameter error and an unknown parameter.
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
(Merged from https://github.com/openssl/openssl/pull/11049)
Diffstat (limited to 'apps')
-rw-r--r-- | apps/lib/apps.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/apps/lib/apps.c b/apps/lib/apps.c index 3a9521f67e..d407c19895 100644 --- a/apps/lib/apps.c +++ b/apps/lib/apps.c @@ -2690,6 +2690,7 @@ OSSL_PARAM *app_params_new_from_opts(STACK_OF(OPENSSL_STRING) *opts, size_t sz = (size_t)sk_OPENSSL_STRING_num(opts); size_t params_n; char *opt = "", *stmp, *vtmp = NULL; + int found = 1; if (opts == NULL) return NULL; @@ -2708,7 +2709,7 @@ OSSL_PARAM *app_params_new_from_opts(STACK_OF(OPENSSL_STRING) *opts, /* Skip over the separator so that vmtp points to the value */ vtmp++; if (!OSSL_PARAM_allocate_from_text(¶ms[params_n], paramdefs, - stmp, vtmp, strlen(vtmp), NULL)) + stmp, vtmp, strlen(vtmp), &found)) goto err; OPENSSL_free(stmp); } @@ -2716,7 +2717,8 @@ OSSL_PARAM *app_params_new_from_opts(STACK_OF(OPENSSL_STRING) *opts, return params; err: OPENSSL_free(stmp); - BIO_printf(bio_err, "Parameter error '%s'\n", opt); + BIO_printf(bio_err, "Parameter %s '%s'\n", found ? "error" : "unknown", + opt); ERR_print_errors(bio_err); app_params_free(params); return NULL; |