summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2023-11-29 14:32:10 +0100
committerRichard Levitte <levitte@openssl.org>2023-12-04 15:12:34 +0100
commit7ebaab7689f66ede1f960c42be3446922e3f5e21 (patch)
tree4403c93488e6bb81bb4242edd50634362dc8810c /apps
parent31c2c12f2dada75c334f6a9aa60c8424cf4fd040 (diff)
Make 'openssl list' less sensitive for providers without params
When a provider can't return parameters, make that a warning instead of an error, and continue to list further providers. Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com> Reviewed-by: Todd Short <todd.short@me.com> (Merged from https://github.com/openssl/openssl/pull/22866)
Diffstat (limited to 'apps')
-rw-r--r--apps/list.c37
1 files changed, 20 insertions, 17 deletions
diff --git a/apps/list.c b/apps/list.c
index 8649598df7..adcf6803b4 100644
--- a/apps/list.c
+++ b/apps/list.c
@@ -1238,6 +1238,9 @@ static void list_provider_info(void)
sk_OSSL_PROVIDER_sort(providers);
for (i = 0; i < sk_OSSL_PROVIDER_num(providers); i++) {
const OSSL_PROVIDER *prov = sk_OSSL_PROVIDER_value(providers, i);
+ const char *provname = OSSL_PROVIDER_get0_name(prov);
+
+ BIO_printf(bio_out, " %s\n", provname);
/* Query the "known" information parameters, the order matches below */
params[0] = OSSL_PARAM_construct_utf8_ptr(OSSL_PROV_PARAM_NAME,
@@ -1250,23 +1253,23 @@ static void list_provider_info(void)
params[4] = OSSL_PARAM_construct_end();
OSSL_PARAM_set_all_unmodified(params);
if (!OSSL_PROVIDER_get_params(prov, params)) {
- BIO_printf(bio_err, "ERROR: Unable to query provider parameters\n");
- return;
- }
-
- /* Print out the provider information, the params order matches above */
- BIO_printf(bio_out, " %s\n", OSSL_PROVIDER_get0_name(prov));
- if (OSSL_PARAM_modified(params))
- BIO_printf(bio_out, " name: %s\n", name);
- if (OSSL_PARAM_modified(params + 1))
- BIO_printf(bio_out, " version: %s\n", version);
- if (OSSL_PARAM_modified(params + 2))
- BIO_printf(bio_out, " status: %sactive\n", status ? "" : "in");
- if (verbose) {
- if (OSSL_PARAM_modified(params + 3))
- BIO_printf(bio_out, " build info: %s\n", buildinfo);
- print_param_types("gettable provider parameters",
- OSSL_PROVIDER_gettable_params(prov), 4);
+ BIO_printf(bio_err,
+ "WARNING: Unable to query provider parameters for %s\n",
+ provname);
+ } else {
+ /* Print out the provider information, the params order matches above */
+ if (OSSL_PARAM_modified(params))
+ BIO_printf(bio_out, " name: %s\n", name);
+ if (OSSL_PARAM_modified(params + 1))
+ BIO_printf(bio_out, " version: %s\n", version);
+ if (OSSL_PARAM_modified(params + 2))
+ BIO_printf(bio_out, " status: %sactive\n", status ? "" : "in");
+ if (verbose) {
+ if (OSSL_PARAM_modified(params + 3))
+ BIO_printf(bio_out, " build info: %s\n", buildinfo);
+ print_param_types("gettable provider parameters",
+ OSSL_PROVIDER_gettable_params(prov), 4);
+ }
}
}
sk_OSSL_PROVIDER_free(providers);