modules: mbedtls: add promptless CONFIG_MBEDTLS_PSA_CRYPTO_STORAGE_C

Add a Kconfig option to match the Mbed TLS define
instead of defining it based on CONFIG_SECURE_STORAGE.

This gives more flexibility regarding the potential re-definition of the
CONFIG_MBEDTLS_PSA_CRYPTO_STORAGE_C Kconfig option.

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
This commit is contained in:
Tomi Fontanilles 2025-02-14 16:34:02 +02:00 committed by Benjamin Cabé
commit 8627250d3c
3 changed files with 6 additions and 3 deletions

View file

@ -585,6 +585,9 @@ config MBEDTLS_PSA_P256M_DRIVER_RAW
Warning: Usage of this Kconfig option is prohibited in Zephyr's codebase.
Users can enable it in case of very memory-constrained devices, but be aware that the p256-m interface is absolutely not guaranted to remain stable over time.
config MBEDTLS_PSA_CRYPTO_STORAGE_C
bool
config MBEDTLS_PSA_STATIC_KEY_SLOTS
bool "Use statically allocated key buffers to store key material"
default y if !MBEDTLS_ENABLE_HEAP

View file

@ -477,17 +477,16 @@
#if defined(CONFIG_MBEDTLS_PSA_CRYPTO_C)
#define MBEDTLS_PSA_CRYPTO_C
#define MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS
#endif
#if defined(CONFIG_MBEDTLS_PSA_P256M_DRIVER_ENABLED)
#define MBEDTLS_PSA_P256M_DRIVER_ENABLED
#endif
#if defined(CONFIG_SECURE_STORAGE)
#if defined(CONFIG_MBEDTLS_PSA_CRYPTO_STORAGE_C)
#define MBEDTLS_PSA_CRYPTO_STORAGE_C
#endif
#endif /* CONFIG_MBEDTLS_PSA_CRYPTO_C */
#if defined(CONFIG_MBEDTLS_PSA_STATIC_KEY_SLOTS)
#define MBEDTLS_PSA_STATIC_KEY_SLOTS
#endif

View file

@ -4,6 +4,7 @@
menuconfig SECURE_STORAGE
bool "Secure storage subsystem"
depends on !BUILD_WITH_TFM
select MBEDTLS_PSA_CRYPTO_STORAGE_C if MBEDTLS_PSA_CRYPTO_C
select EXPERIMENTAL
help
The secure storage subsystem provides an implementation of the PSA Secure Storage API