]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
store_result.c: add to error queue which provider failed to load credential and hint...
authorDr. David von Oheimb <dev@ddvo.net>
Sun, 13 Apr 2025 05:28:08 +0000 (07:28 +0200)
committerTomas Mraz <tomas@openssl.org>
Tue, 20 May 2025 19:19:34 +0000 (21:19 +0200)
Reviewed-by: Nicola Tuveri <nic.tuv@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27367)

crypto/store/store_result.c

index b5e50557c23860ef6b070f8943ea817d286646f4..9944d353dc601028711fea557825fbb3d97a9630 100644 (file)
@@ -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: