From eb2263da9abf3676cbcac672eee8a26416a8c309 Mon Sep 17 00:00:00 2001 From: Matt Caswell Date: Mon, 21 Jun 2021 11:34:04 +0100 Subject: Set use_fallbacks to zero when we add a provider to the store Update use_fallbacks to zero when we add a provider to the store rather than when we activate it. Its only at the point that we add it to the store that it is actually usable and visible to other threads. Reviewed-by: Paul Dale Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/15854) --- crypto/provider.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'crypto/provider.c') diff --git a/crypto/provider.c b/crypto/provider.c index 12336acc57..f5dbc4f94a 100644 --- a/crypto/provider.c +++ b/crypto/provider.c @@ -26,12 +26,12 @@ OSSL_PROVIDER *OSSL_PROVIDER_try_load(OSSL_LIB_CTX *libctx, const char *name, isnew = 1; } - if (!ossl_provider_activate(prov, retain_fallbacks, 1)) { + if (!ossl_provider_activate(prov, 1)) { ossl_provider_free(prov); return NULL; } - if (isnew && !ossl_provider_add_to_store(prov)) { + if (isnew && !ossl_provider_add_to_store(prov, retain_fallbacks)) { ossl_provider_deactivate(prov); ossl_provider_free(prov); return NULL; -- cgit v1.2.3