From: Ondřej Surý Date: Mon, 20 Oct 2025 19:11:00 +0000 (+0200) Subject: threads: Replace CRYPTO_THREAD_clean_local_for_fips() with CRYPTO_THREAD_clean_local() X-Git-Tag: 3.6-PRE-CLANG-FORMAT-WEBKIT~99 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a74fbe97626e1579f96d25304ed5e8093523f853;p=thirdparty%2Fopenssl.git threads: Replace CRYPTO_THREAD_clean_local_for_fips() with CRYPTO_THREAD_clean_local() Reviewed-by: Neil Horman Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/28781) (cherry picked from commit 9f87698878c25b53f5ddb662ae8eb9bcf80d7959) --- diff --git a/crypto/threads_common.c b/crypto/threads_common.c index e626e3168a5..fbc28483f84 100644 --- a/crypto/threads_common.c +++ b/crypto/threads_common.c @@ -412,22 +412,3 @@ void CRYPTO_THREAD_clean_local(void) CRYPTO_THREAD_set_local(&master_key, NULL); } } - -#ifdef FIPS_MODULE -void CRYPTO_THREAD_clean_local_for_fips(void) -{ - MASTER_KEY_ENTRY *mkey; - - /* - * If we never initialized the master key, there - * is no data to clean, so we are done here - */ - if (master_key_init == 0) - return; - - mkey = CRYPTO_THREAD_get_local(&master_key); - if (mkey != NULL) - clean_master_key(mkey); - CRYPTO_THREAD_cleanup_local(&master_key); -} -#endif diff --git a/include/internal/threads_common.h b/include/internal/threads_common.h index f42d601e74a..0497a9e1193 100644 --- a/include/internal/threads_common.h +++ b/include/internal/threads_common.h @@ -30,8 +30,4 @@ int CRYPTO_THREAD_set_local_ex(CRYPTO_THREAD_LOCAL_KEY_ID id, void CRYPTO_THREAD_clean_local(void); -# ifdef FIPS_MODULE -void CRYPTO_THREAD_clean_local_for_fips(void); -# endif - #endif diff --git a/providers/fips/self_test.c b/providers/fips/self_test.c index 95c43d8ddcb..9fb23e44c35 100644 --- a/providers/fips/self_test.c +++ b/providers/fips/self_test.c @@ -174,7 +174,7 @@ DEP_INIT_ATTRIBUTE void init(void) DEP_FINI_ATTRIBUTE void cleanup(void) { CRYPTO_THREAD_lock_free(self_test_lock); - CRYPTO_THREAD_clean_local_for_fips(); + CRYPTO_THREAD_clean_local(); } #endif