STORE: Fix OSSL_STORE_open_ex() error reporting
authorRichard Levitte <levitte@openssl.org>
Fri, 18 Jun 2021 05:09:25 +0000 (07:09 +0200)
committerRichard Levitte <levitte@openssl.org>
Sun, 20 Jun 2021 17:59:40 +0000 (19:59 +0200)
commitecd699b6dae054d368ca9ff04f3b80013f3c241f
tree04fbd24e72529c987aa05b2af3a9186e37cc3dd8
parenta1a62437e96ce4c1ba807e99a8231560f4ba59ef
STORE: Fix OSSL_STORE_open_ex() error reporting

OSSL_STORE_open_ex() could result in reports like this:

    80722AA3927F0000:error:80000002:system library:file_open_ex:No such file or directory:engines/e_loader_attic.c:1016:calling stat(file:test/blahdibleh.der)
    80722AA3927F0000:error:41800069:lib(131)::path must be absolute:engines/e_loader_attic.c:1010:test/blahdibleh.der
    80722AA3927F0000:error:1600007B:STORE routines:OSSL_STORE_open_ex:no loaders found:crypto/store/store_lib.c:148:No store loaders were found. For standard store loaders you need at least one of the default or base providers available. Did you forget to load them?

The last one turns out to be a bit too generically reported.  It
should only be reported when no loader were loaded at all, not when
loader_ctx happens to be NULL (which may happen for other reasons).

We also move the helpful message to the OSSL_STORE_LOADER fetcher.

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15820)
crypto/store/store_lib.c
crypto/store/store_meth.c