mbedtls: add psa_crypto_init() when Mbed TLS acts a PSA crypto client

Ensure psa_crypto_init() is called during initialization when
Mbed TLS acts as a PSA crypto client. This will setup the PSA
crypto server for further calls.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
This commit is contained in:
Valerio Setti 2024-05-24 16:51:31 +02:00 committed by Carles Cufí
parent 185ec2bf78
commit 69fa93bb79
1 changed files with 6 additions and 0 deletions

View File

@ -94,6 +94,12 @@ static int _mbedtls_init(void)
mbedtls_debug_set_threshold(CONFIG_MBEDTLS_DEBUG_LEVEL);
#endif
#if defined(CONFIG_MBEDTLS_PSA_CRYPTO_CLIENT)
if (psa_crypto_init() != PSA_SUCCESS) {
return -EIO;
}
#endif
return 0;
}