From: Dr. David von Oheimb Date: Sun, 13 Apr 2025 05:28:08 +0000 (+0200) Subject: store_result.c: add to error queue which provider failed to load credential and hint... X-Git-Tag: openssl-3.5.1~93 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=0f83b84cc3a1358df6a9e9ccf6b68291020fa214;p=thirdparty%2Fopenssl.git store_result.c: add to error queue which provider failed to load credential and hint on using default provider Reviewed-by: Nicola Tuveri Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/27367) (cherry picked from commit 1fc96a3cff124777597ed18c2405dc7181bda2ef) --- diff --git a/crypto/store/store_result.c b/crypto/store/store_result.c index b5e50557c23..9944d353dc6 100644 --- a/crypto/store/store_result.c +++ b/crypto/store/store_result.c @@ -153,8 +153,19 @@ int ossl_store_handle_load_result(const OSSL_PARAM params[], void *arg) goto err; ERR_pop_to_mark(); - if (*v == NULL) - ERR_raise(ERR_LIB_OSSL_STORE, ERR_R_UNSUPPORTED); + if (*v == NULL) { + const char *hint = ""; + + if (!OSSL_PROVIDER_available(libctx, "default")) + hint = ":maybe need to load the default provider?"; + if (provider != NULL) + ERR_raise_data(ERR_LIB_OSSL_STORE, ERR_R_UNSUPPORTED, "provider=%s%s", + OSSL_PROVIDER_get0_name(provider), hint); + else if (hint[0] != '\0') + ERR_raise_data(ERR_LIB_OSSL_STORE, ERR_R_UNSUPPORTED, "%s", hint); + else + ERR_raise(ERR_LIB_OSSL_STORE, ERR_R_UNSUPPORTED); + } return (*v != NULL); err: