]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
OSSL_STORE_open_ex(): Prevent spurious error: unregistered scheme=file
authorDr. David von Oheimb <David.von.Oheimb@siemens.com>
Fri, 27 Aug 2021 16:33:56 +0000 (18:33 +0200)
committerDr. David von Oheimb <dev@ddvo.net>
Fri, 7 Jan 2022 09:40:44 +0000 (10:40 +0100)
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/16452)

crypto/store/store_lib.c

index 42722a2560851ea091894c5e0d0f091516a24316..4efa7eea038413909b925cf2630c3cfb2c15f548 100644 (file)
@@ -114,13 +114,17 @@ OSSL_STORE_open_ex(const char *uri, OSSL_LIB_CTX *libctx, const char *propq,
         scheme = schemes[i];
         OSSL_TRACE1(STORE, "Looking up scheme %s\n", scheme);
 #ifndef OPENSSL_NO_DEPRECATED_3_0
+        ERR_set_mark();
         if ((loader = ossl_store_get0_loader_int(scheme)) != NULL) {
+            ERR_clear_last_mark();
             no_loader_found = 0;
             if (loader->open_ex != NULL)
                 loader_ctx = loader->open_ex(loader, uri, libctx, propq,
                                              ui_method, ui_data);
             else
                 loader_ctx = loader->open(loader, uri, ui_method, ui_data);
+        } else {
+            ERR_pop_to_mark();
         }
 #endif
         if (loader == NULL