Don't try and do ossl_provider_find in ossl_provider_new
authorMatt Caswell <matt@openssl.org>
Mon, 8 Nov 2021 16:47:38 +0000 (16:47 +0000)
committerMatt Caswell <matt@openssl.org>
Fri, 12 Nov 2021 17:16:14 +0000 (17:16 +0000)
commitdc6d9ede6241e6858f8fa78435d6c8eb9cf85aa1
tree8e0df8b1655d1c77987675aac3853ea2fe658087
parent464c2b988ea149badabaf958a96fdc480df89dc7
Don't try and do ossl_provider_find in ossl_provider_new

We leave it to the caller to confirm that the provider does not exist
in the store. If it does exist then later adding it to the store will
fail.

It is possible that the provider could be added to the store in
between the caller checking, and the caller calling ossl_provider_new.
We leave it to the caller to properly handle the failure when it
attempts to add the provider to the store. This is simpler than
having ossl_provider_new try to handle it.

Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/16980)
crypto/provider_core.c