]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
threads: Replace CRYPTO_THREAD_clean_local_for_fips() with CRYPTO_THREAD_clean_local()
authorOndřej Surý <ondrej@sury.org>
Mon, 20 Oct 2025 19:11:00 +0000 (21:11 +0200)
committerNeil Horman <nhorman@openssl.org>
Thu, 23 Oct 2025 13:13:53 +0000 (09:13 -0400)
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28781)

crypto/threads_common.c
include/internal/threads_common.h
providers/fips/self_test.c

index e626e3168a5937fc7249a4a60a4dd197d5379f3f..fbc28483f841b14041df9d25b1f87748cb821ab5 100644 (file)
@@ -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
index f42d601e74abb5875f5a5f1f60f02166fdf629ba..0497a9e1193f49c5bf49617b0be2feb7607c5e45 100644 (file)
@@ -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
index 95c43d8ddcb3d637db917e84b0bc9e3034d577d3..9fb23e44c35de67de4e2f5ab8e4ae8fc3762a2e7 100644 (file)
@@ -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