Refactor OSSL_LIB_CTX to avoid using CRYPTO_EX_DATA
authorHugo Landau <hlandau@openssl.org>
Mon, 14 Mar 2022 08:13:12 +0000 (08:13 +0000)
committerPauli <pauli@openssl.org>
Thu, 31 Mar 2022 23:49:19 +0000 (10:49 +1100)
commit927d0566ded0dff9d6c5abc8a40bb84068446b76
treec6d898a04aaa2062c9a74cb9c89ce25fa9680a41
parent9c140a33663f319ad4000a6a985c3e14297c7389
Refactor OSSL_LIB_CTX to avoid using CRYPTO_EX_DATA

This refactors OSSL_LIB_CTX to avoid using CRYPTO_EX_DATA. The assorted
objects to be managed by OSSL_LIB_CTX are hardcoded and are initialized
eagerly rather than lazily, which avoids the need for locking on access
in most cases.

Fixes #17116.

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/17881)
23 files changed:
crypto/bio/bss_core.c
crypto/context.c
crypto/core_namemap.c
crypto/encode_decode/decoder_meth.c
crypto/encode_decode/encoder_meth.c
crypto/evp/evp_fetch.c
crypto/initthread.c
crypto/property/defn_cache.c
crypto/property/property.c
crypto/property/property_string.c
crypto/provider_child.c
crypto/provider_conf.c
crypto/provider_core.c
crypto/rand/rand_lib.c
crypto/self_test_core.c
crypto/store/store_meth.c
doc/internal/man3/ossl_lib_ctx_get_data.pod
include/crypto/context.h [new file with mode: 0644]
include/internal/cryptlib.h
providers/fips/fipsprov.c
providers/implementations/rands/crngt.c
providers/implementations/rands/drbg.c
test/context_internal_test.c