summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomas Mraz <tomas@openssl.org>2023-10-09 11:36:50 +0200
committerTomas Mraz <tomas@openssl.org>2023-10-19 10:11:04 +0200
commite70f5b270440f0b87738dd104018694276827684 (patch)
tree92c15a833660e60548ecc7a62239919610487f2a
parent4a1c530e1f6d38ae7bf12db9f99e19bf8f0f082b (diff)
apps: Print out a proper message when a store cannot be opened
Fixes #22306 Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22318) (cherry picked from commit edc2b6e3b1950ab0fb71e2d7dca0836b43a9ec3b)
-rw-r--r--apps/lib/apps.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/apps/lib/apps.c b/apps/lib/apps.c
index 9de518f383..2c301f3ca8 100644
--- a/apps/lib/apps.c
+++ b/apps/lib/apps.c
@@ -960,10 +960,16 @@ int load_key_certs_crls_suppress(const char *uri, int format, int maybe_stdin,
ctx = OSSL_STORE_open_ex(uri, libctx, propq, get_ui_method(), &uidata,
params, NULL, NULL);
}
- if (ctx == NULL)
+ if (ctx == NULL) {
+ if (!quiet)
+ BIO_printf(bio_err, "Could not open file or uri for loading");
goto end;
- if (expect > 0 && !OSSL_STORE_expect(ctx, expect))
+ }
+ if (expect > 0 && !OSSL_STORE_expect(ctx, expect)) {
+ if (!quiet)
+ BIO_printf(bio_err, "Internal error trying to load");
goto end;
+ }
failed = NULL;
while (cnt_expectations > 0 && !OSSL_STORE_eof(ctx)) {