diff options
author | Matt Caswell <matt@openssl.org> | 2021-06-18 13:28:40 +0200 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2021-06-24 15:48:14 +0200 |
commit | 1d74203cf5d8542d349fbb2d5f35ad40994dec9f (patch) | |
tree | a3c4d976fc41d54db82922e19901dea3c237b4f5 /crypto/provider.c | |
parent | Instantiate predefined providers just-in-time (diff) | |
download | openssl-1d74203cf5d8542d349fbb2d5f35ad40994dec9f.tar.xz openssl-1d74203cf5d8542d349fbb2d5f35ad40994dec9f.zip |
Instantiate user-added builtin providers when we need them
Previously we created the provider object for builtin providers at the
point that OPENSSL_add_builtin() was called. Instead we delay that until
the provider is actually loaded.
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.c')
-rw-r--r-- | crypto/provider.c | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/crypto/provider.c b/crypto/provider.c index 60664e9e24..5aec157c1f 100644 --- a/crypto/provider.c +++ b/crypto/provider.c @@ -94,29 +94,6 @@ int OSSL_PROVIDER_get_capabilities(const OSSL_PROVIDER *prov, return ossl_provider_get_capabilities(prov, capability, cb, arg); } -int OSSL_PROVIDER_add_builtin(OSSL_LIB_CTX *libctx, const char *name, - OSSL_provider_init_fn *init_fn) -{ - OSSL_PROVIDER *prov = NULL; - - if (name == NULL || init_fn == NULL) { - ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_NULL_PARAMETER); - return 0; - } - - /* Create it */ - if ((prov = ossl_provider_new(libctx, name, init_fn, 0)) == NULL) - return 0; - - /* - * It's safely stored in the internal store at this point, - * free the returned extra reference - */ - ossl_provider_free(prov); - - return 1; -} - const char *OSSL_PROVIDER_get0_name(const OSSL_PROVIDER *prov) { return ossl_provider_name(prov); |