Modify the legacy provider to use OSSL_LIB_CTX_new_child()

Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14991)
This commit is contained in:
Matt Caswell 2021-04-22 08:31:08 +01:00
parent f12a5690de
commit d0efad482f

View File

@ -178,13 +178,8 @@ int OSSL_provider_init(const OSSL_CORE_HANDLE *handle,
{
OSSL_LIB_CTX *libctx = NULL;
/*
* We do not need to use any up-calls provided by libcrypto, so we ignore
* the "in" dispatch table.
*/
if ((*provctx = ossl_prov_ctx_new()) == NULL
|| (libctx = OSSL_LIB_CTX_new()) == NULL) {
|| (libctx = OSSL_LIB_CTX_new_child(handle, in)) == NULL) {
OSSL_LIB_CTX_free(libctx);
legacy_teardown(*provctx);
*provctx = NULL;