diff options
author | Matt Caswell <matt@openssl.org> | 2021-11-09 15:20:31 +0100 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2021-11-12 18:16:14 +0100 |
commit | 1e8ed3e596162d7490b26fb12e58af5208f52402 (patch) | |
tree | 5fee239a6254e94dbb1a9442fbf4ff7d6da9e0fc /crypto/provider.c | |
parent | Stop receiving child callbacks in a child libctx when appropriate (diff) | |
download | openssl-1e8ed3e596162d7490b26fb12e58af5208f52402.tar.xz openssl-1e8ed3e596162d7490b26fb12e58af5208f52402.zip |
Correctly activate the provider in OSSL_PROVIDER_try_load
If during OSSL_PROVIDER_try_load() we attempt to load a provider, but
adding to the store gives back a different provider, then we need to
ensure this different provider has its activation count increased.
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/16980)
Diffstat (limited to 'crypto/provider.c')
-rw-r--r-- | crypto/provider.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/crypto/provider.c b/crypto/provider.c index 974c636bc1..114b426929 100644 --- a/crypto/provider.c +++ b/crypto/provider.c @@ -39,6 +39,12 @@ OSSL_PROVIDER *OSSL_PROVIDER_try_load(OSSL_LIB_CTX *libctx, const char *name, ossl_provider_free(prov); return NULL; } + if (actual != prov) { + if (!ossl_provider_activate(actual, 1, 0)) { + ossl_provider_free(actual); + return NULL; + } + } return actual; } |