From e110a4c9006c616e56684d2c6543808cc2aa748c Mon Sep 17 00:00:00 2001 From: Ryan Everett Date: Thu, 22 Feb 2024 10:43:03 +0000 Subject: [PATCH] Make psa_open_key threadsafe This is a simple case of register then unregister Signed-off-by: Ryan Everett --- library/psa_crypto_slot_management.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/psa_crypto_slot_management.c b/library/psa_crypto_slot_management.c index f7b7fbe238..b2a3c7e5a0 100644 --- a/library/psa_crypto_slot_management.c +++ b/library/psa_crypto_slot_management.c @@ -542,7 +542,7 @@ psa_status_t psa_open_key(mbedtls_svc_key_id_t key, psa_key_handle_t *handle) *handle = key; - return psa_unregister_read(slot); + return psa_unregister_read_under_mutex(slot); #else /* MBEDTLS_PSA_CRYPTO_STORAGE_C || MBEDTLS_PSA_CRYPTO_BUILTIN_KEYS */ (void) key;