]> git.ipfire.org Git - thirdparty/openssl.git/commit
Move deferred self-test lock to FIPS_GLOBAL
authorSimo Sorce <simo@redhat.com>
Mon, 8 Dec 2025 19:06:17 +0000 (14:06 -0500)
committerDmitry Belyavskiy <beldmit@gmail.com>
Fri, 13 Feb 2026 09:53:40 +0000 (10:53 +0100)
commit380aafd8651cf478744a5cfbe8ebf42e51396227
tree7a3db87c09ada1a5d5b672302f10290c3a83e31c
parent0afbd6bfb3f6e95c6039c509135ff26b3b946502
Move deferred self-test lock to FIPS_GLOBAL

The lock for the deferred FIPS self-tests was previously a static
global variable, initialized with CRYPTO_ONCE. This is problematic
when multiple library contexts are used in a single application.

This change moves the lock into the FIPS_GLOBAL structure, making it
per-library-context. The lock is now initialized when the FIPS
provider is initialized and freed when its context is torn down.
This improves encapsulation and avoids global state.

Signed-off-by: Simo Sorce <simo@redhat.com>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/29222)
providers/fips/fipsprov.c