Skip to content

Commit b9cd3eb

Browse files
committed
[nrf fromtree] secure_storage: use hybrid key store in samples/tests
Use dynamic allocation for key material for better compatibility as a fully static key store is a new feature that not all PSA Crypto implementations support. Explicitly enable CONFIG_MBEDTLS_ENABLE_HEAP to ensure that Mbed TLS uses heap for the PSA keys' data (instead of failing at runtime). This will turn off CONFIG_MBEDTLS_PSA_STATIC_KEY_SLOTS, making the implementation default to dynamic key slots. Signed-off-by: Tomi Fontanilles <[email protected]> (cherry picked from commit eb1ed12) Signed-off-by: Tomi Fontanilles <[email protected]>
1 parent 1d84a57 commit b9cd3eb

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

samples/psa/persistent_key/overlay-secure_storage.conf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
CONFIG_MBEDTLS=y
44
CONFIG_MBEDTLS_PSA_CRYPTO_C=y
5+
CONFIG_MBEDTLS_ENABLE_HEAP=y
6+
CONFIG_MBEDTLS_HEAP_SIZE=1024
57

68
# The default stack size (1024) is not enough for the PSA Crypto core.
79
# On top of that, the ITS implementation uses the stack for buffers.

tests/subsys/secure_storage/psa/crypto/overlay-secure_storage.conf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ CONFIG_MBEDTLS=y
55
CONFIG_TEST_RANDOM_GENERATOR=y
66
CONFIG_TIMER_RANDOM_GENERATOR=y
77
CONFIG_MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG_ALLOW_NON_CSPRNG=y
8-
# PSA Crypto needs some heap, but MINIMAL_LIBC has none by default.
9-
CONFIG_COMMON_LIBC_MALLOC_ARENA_SIZE=2048
108
CONFIG_MBEDTLS_PSA_CRYPTO_C=y
9+
CONFIG_MBEDTLS_ENABLE_HEAP=y
10+
CONFIG_MBEDTLS_HEAP_SIZE=1024
1111

1212
CONFIG_SECURE_STORAGE=y
1313
# For testing isolation between the different callers of the ITS.

0 commit comments

Comments
 (0)