diff options
author | Matt Caswell <matt@openssl.org> | 2021-06-21 15:37:48 +0100 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2021-06-24 14:48:15 +0100 |
commit | 549b5cb4edbc8d537ae73b6f5614efdd98ed79f4 (patch) | |
tree | 14b8ba4ef208d90153d0e02bcf1c5b1de74097af /crypto/provider_core.c | |
parent | dcbb2be7f76776e86dbdc1b6599c199a16af3742 (diff) |
Don't skip the current provider in ossl_provider_register_child_cb
This restriction was in place to avoid problems with recursive attempts
to aquire the flag lock/store lock from within a provider's init function.
Since those locks are no longer held when calling the init function there
is no reason for the restriction any more.
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15854)
Diffstat (limited to 'crypto/provider_core.c')
-rw-r--r-- | crypto/provider_core.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/crypto/provider_core.c b/crypto/provider_core.c index 18acf62864..8b99b3c1cb 100644 --- a/crypto/provider_core.c +++ b/crypto/provider_core.c @@ -1550,13 +1550,7 @@ static int ossl_provider_register_child_cb(const OSSL_CORE_HANDLE *handle, max = sk_OSSL_PROVIDER_num(store->providers); for (i = 0; i < max; i++) { prov = sk_OSSL_PROVIDER_value(store->providers, i); - /* - * We require register_child_cb to be called during a provider init - * function. The currently initing provider will never be activated yet - * and we we should not attempt to aquire the flag_lock for it. - */ - if (prov == thisprov) - continue; + if (!CRYPTO_THREAD_read_lock(prov->flag_lock)) break; /* |