]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
apps: Print out a proper message when a store cannot be opened
authorTomas Mraz <tomas@openssl.org>
Mon, 9 Oct 2023 09:36:50 +0000 (11:36 +0200)
committerTomas Mraz <tomas@openssl.org>
Thu, 19 Oct 2023 08:10:00 +0000 (10:10 +0200)
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)

apps/lib/apps.c

index 6b2a4b86ce670313ba2b0fac17f9accb9489e341..945ac1e716c100ca2a9d73c64018d567f586abd7 100644 (file)
@@ -1003,10 +1003,16 @@ int load_key_certs_crls(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 ((ppkey != NULL || ppubkey != NULL || pparams != NULL