Skip to content

Commit ff381f0

Browse files
committed
[nrf fromlist] secure_storage: use dynamic PSA key slots in samples/tests
Use dynamic key slots for better compatibility as static ones are 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 key slots (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]> Upstream PR #: 85735 (cherry picked from commit ffb764773ffde41783a16faecfedd2cb481bae8a) Signed-off-by: Tomi Fontanilles <[email protected]>
1 parent 5ec8bc7 commit ff381f0

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
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 & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ CONFIG_MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG_ALLOW_NON_CSPRNG=y
88
# PSA Crypto needs some heap, but MINIMAL_LIBC has none by default.
99
CONFIG_COMMON_LIBC_MALLOC_ARENA_SIZE=2048
1010
CONFIG_MBEDTLS_PSA_CRYPTO_C=y
11+
CONFIG_MBEDTLS_ENABLE_HEAP=y
12+
CONFIG_MBEDTLS_HEAP_SIZE=1024
1113

1214
CONFIG_SECURE_STORAGE=y
1315
# For testing isolation between the different callers of the ITS.

0 commit comments

Comments
 (0)