Skip to content

Commit 7176662

Browse files
Update code to work with demos using latest mbedtls version (#207)
* Update code to work with demos using latest mbedtls version * Add documentation for the new mutex initialisation * Fix Formatting * Remove unwanted extern statements
1 parent 7686f80 commit 7176662

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

source/portable/mbedtls/core_pkcs11_mbedtls.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -475,6 +475,13 @@ static CK_RV prvMbedTLS_Initialize( void )
475475
mbedtls_entropy_init( &xP11Context.xMbedEntropyContext );
476476
mbedtls_ctr_drbg_init( &xP11Context.xMbedDrbgCtx );
477477

478+
/* Initialise the global mutexes for the PSA API's */
479+
#if defined( MBEDTLS_PSA_CRYPTO_C )
480+
mbedtls_mutex_init( &mbedtls_threading_key_slot_mutex );
481+
mbedtls_mutex_init( &mbedtls_threading_psa_globaldata_mutex );
482+
mbedtls_mutex_init( &mbedtls_threading_psa_rngdata_mutex );
483+
#endif
484+
478485
lMbedTLSResult = mbedtls_ctr_drbg_seed( &xP11Context.xMbedDrbgCtx,
479486
mbedtls_entropy_func,
480487
&xP11Context.xMbedEntropyContext,

0 commit comments

Comments
 (0)