MASTER_KEY_ENTRY *mkey = data;
int i;
+ if (data == NULL)
+ return;
+
for (i = 0; i < CRYPTO_THREAD_LOCAL_KEY_MAX; i++) {
if (mkey[i].ctx_table != NULL)
clean_master_key_id(&mkey[i]);
(uintptr_t)ctx, data);
}
+void CRYPTO_THREAD_clean_local(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_set_local(&master_key, NULL);
+ }
+}
+
#ifdef FIPS_MODULE
void CRYPTO_THREAD_clean_local_for_fips(void)
{
int CRYPTO_THREAD_set_local_ex(CRYPTO_THREAD_LOCAL_KEY_ID id,
OSSL_LIB_CTX *ctx, void *data);
+void CRYPTO_THREAD_clean_local(void);
+
# ifdef FIPS_MODULE
void CRYPTO_THREAD_clean_local_for_fips(void);
# endif