From 29c6afa5e74e33e83082c4c76bf584662f3ab868 Mon Sep 17 00:00:00 2001 From: DakshitBabbar Date: Tue, 22 Jul 2025 13:27:45 +0530 Subject: [PATCH 1/3] Update the preprocessor directives to add code supporting MbedTLS version >= v3.6.3 --- source/portable/mbedtls/core_pkcs11_mbedtls.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/portable/mbedtls/core_pkcs11_mbedtls.c b/source/portable/mbedtls/core_pkcs11_mbedtls.c index b14c2902..b7795782 100644 --- a/source/portable/mbedtls/core_pkcs11_mbedtls.c +++ b/source/portable/mbedtls/core_pkcs11_mbedtls.c @@ -476,7 +476,7 @@ static CK_RV prvMbedTLS_Initialize( void ) mbedtls_ctr_drbg_init( &xP11Context.xMbedDrbgCtx ); /* Initialise the global mutexes for the PSA API's */ - #if defined( MBEDTLS_PSA_CRYPTO_C ) + #if defined( MBEDTLS_PSA_CRYPTO_C) && (MBEDTLS_VERSION_NUMBER>=0x03060300 ) mbedtls_mutex_init( &mbedtls_threading_key_slot_mutex ); mbedtls_mutex_init( &mbedtls_threading_psa_globaldata_mutex ); mbedtls_mutex_init( &mbedtls_threading_psa_rngdata_mutex ); From 03470383063add5a0241901795e17ba9014e2dd9 Mon Sep 17 00:00:00 2001 From: DakshitBabbar Date: Tue, 22 Jul 2025 13:32:16 +0530 Subject: [PATCH 2/3] Fix formatting --- source/portable/mbedtls/core_pkcs11_mbedtls.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/portable/mbedtls/core_pkcs11_mbedtls.c b/source/portable/mbedtls/core_pkcs11_mbedtls.c index b7795782..deaedbdd 100644 --- a/source/portable/mbedtls/core_pkcs11_mbedtls.c +++ b/source/portable/mbedtls/core_pkcs11_mbedtls.c @@ -476,7 +476,7 @@ static CK_RV prvMbedTLS_Initialize( void ) mbedtls_ctr_drbg_init( &xP11Context.xMbedDrbgCtx ); /* Initialise the global mutexes for the PSA API's */ - #if defined( MBEDTLS_PSA_CRYPTO_C) && (MBEDTLS_VERSION_NUMBER>=0x03060300 ) + #if defined( MBEDTLS_PSA_CRYPTO_C ) && ( MBEDTLS_VERSION_NUMBER>=0x03060300 ) mbedtls_mutex_init( &mbedtls_threading_key_slot_mutex ); mbedtls_mutex_init( &mbedtls_threading_psa_globaldata_mutex ); mbedtls_mutex_init( &mbedtls_threading_psa_rngdata_mutex ); From a67935343623b64eb980306a63827a30c8bfb32e Mon Sep 17 00:00:00 2001 From: DakshitBabbar Date: Tue, 22 Jul 2025 13:56:15 +0530 Subject: [PATCH 3/3] Fix formatting --- source/portable/mbedtls/core_pkcs11_mbedtls.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/portable/mbedtls/core_pkcs11_mbedtls.c b/source/portable/mbedtls/core_pkcs11_mbedtls.c index deaedbdd..a774e053 100644 --- a/source/portable/mbedtls/core_pkcs11_mbedtls.c +++ b/source/portable/mbedtls/core_pkcs11_mbedtls.c @@ -476,7 +476,7 @@ static CK_RV prvMbedTLS_Initialize( void ) mbedtls_ctr_drbg_init( &xP11Context.xMbedDrbgCtx ); /* Initialise the global mutexes for the PSA API's */ - #if defined( MBEDTLS_PSA_CRYPTO_C ) && ( MBEDTLS_VERSION_NUMBER>=0x03060300 ) + #if defined( MBEDTLS_PSA_CRYPTO_C ) && ( MBEDTLS_VERSION_NUMBER >= 0x03060300 ) mbedtls_mutex_init( &mbedtls_threading_key_slot_mutex ); mbedtls_mutex_init( &mbedtls_threading_psa_globaldata_mutex ); mbedtls_mutex_init( &mbedtls_threading_psa_rngdata_mutex );