From: Dr. David von Oheimb Date: Fri, 27 Aug 2021 16:33:56 +0000 (+0200) Subject: OSSL_STORE_open_ex(): Prevent spurious error: unregistered scheme=file X-Git-Tag: openssl-3.2.0-alpha1~3123 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7c64ca71c2ceeb1d47e8499bd351de7d0078ce37;p=thirdparty%2Fopenssl.git OSSL_STORE_open_ex(): Prevent spurious error: unregistered scheme=file Reviewed-by: Paul Dale (Merged from https://github.com/openssl/openssl/pull/16452) --- diff --git a/crypto/store/store_lib.c b/crypto/store/store_lib.c index 42722a25608..4efa7eea038 100644 --- a/crypto/store/store_lib.c +++ b/crypto/store/store_lib.c @@ -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