From: Tomas Mraz Date: Mon, 9 Oct 2023 09:36:50 +0000 (+0200) Subject: apps: Print out a proper message when a store cannot be opened X-Git-Tag: openssl-3.1.4~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ca0c9879da38fcfd2b1c41c86429276cddbee555;p=thirdparty%2Fopenssl.git apps: Print out a proper message when a store cannot be opened Fixes #22306 Reviewed-by: David von Oheimb Reviewed-by: Richard Levitte (Merged from https://github.com/openssl/openssl/pull/22318) (cherry picked from commit edc2b6e3b1950ab0fb71e2d7dca0836b43a9ec3b) --- diff --git a/apps/lib/apps.c b/apps/lib/apps.c index d5dc7edebd9..69f21380a5d 100644 --- a/apps/lib/apps.c +++ b/apps/lib/apps.c @@ -956,10 +956,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 (cnt_expectations > 0 && !OSSL_STORE_eof(ctx)) {