aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Elliott <paul.elliott@arm.com>2024-03-15 13:57:16 +0000
committerPaul Elliott <paul.elliott@arm.com>2024-03-15 16:06:20 +0000
commitd35dce6e235dd0c7818949d0954b1bdcaadfea52 (patch)
tree311daacdc4f51f54fa0f036d69130366dc5a8060
parent0db6a9033aed3bd10975c898b850ebf8343b1690 (diff)
downloadmbedtls-d35dce6e235dd0c7818949d0954b1bdcaadfea52.zip
mbedtls-d35dce6e235dd0c7818949d0954b1bdcaadfea52.tar.gz
mbedtls-d35dce6e235dd0c7818949d0954b1bdcaadfea52.tar.bz2
Add comments about RNG mutex requirements
Signed-off-by: Paul Elliott <paul.elliott@arm.com>
-rw-r--r--library/psa_crypto.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/library/psa_crypto.c b/library/psa_crypto.c
index c28937d..373918a 100644
--- a/library/psa_crypto.c
+++ b/library/psa_crypto.c
@@ -7145,6 +7145,9 @@ exit:
#endif
/** Initialize the PSA random generator.
+ *
+ * Note: the mbedtls_threading_psa_rngdata_mutex should be held when calling
+ * this function if mutexes are enabled.
*/
static void mbedtls_psa_random_init(mbedtls_psa_random_context_t *rng)
{
@@ -7177,6 +7180,9 @@ static void mbedtls_psa_random_init(mbedtls_psa_random_context_t *rng)
}
/** Deinitialize the PSA random generator.
+ *
+ * Note: the mbedtls_threading_psa_rngdata_mutex should be held when calling
+ * this function if mutexes are enabled.
*/
static void mbedtls_psa_random_free(mbedtls_psa_random_context_t *rng)
{