Skip to content

Commit d00adcb

Browse files
committed
secure_storage: re-add MbedTLS backend
Re-add the option to use the MbedTLS ITS backend on posix. This backend is much simpler to setup than the Zephyr backends in a testing environment. This was previously removed in: zephyrproject-rtos#82319 Signed-off-by: Jordan Yates <[email protected]>
1 parent 059e86f commit d00adcb

File tree

6 files changed

+43
-0
lines changed

6 files changed

+43
-0
lines changed

modules/mbedtls/configs/config-tls-generic.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -486,6 +486,11 @@
486486
#define MBEDTLS_PSA_CRYPTO_STORAGE_C
487487
#endif
488488

489+
#if defined(CONFIG_SECURE_STORAGE_ITS_IMPLEMENTATION_MBEDTLS)
490+
#define MBEDTLS_PSA_ITS_FILE_C
491+
#define MBEDTLS_FS_IO
492+
#endif
493+
489494
#endif /* CONFIG_MBEDTLS_PSA_CRYPTO_C */
490495

491496
#if defined(CONFIG_MBEDTLS_PSA_STATIC_KEY_SLOTS)

samples/psa/its/Kconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Copyright (c) 2025 Embeint Inc
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
# We explicitly don't want SECURE_STORAGE_ITS_IMPLEMENTATION_MBEDTLS here
5+
choice SECURE_STORAGE_ITS_IMPLEMENTATION
6+
default SECURE_STORAGE_ITS_IMPLEMENTATION_ZEPHYR
7+
default SECURE_STORAGE_ITS_IMPLEMENTATION_CUSTOM
8+
endchoice
9+
10+
source "Kconfig.zephyr"

subsys/secure_storage/Kconfig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ source "subsys/logging/Kconfig.template.log_config"
2727
choice SECURE_STORAGE_ITS_IMPLEMENTATION
2828
prompt "Internal Trusted Storage (ITS) API implementation"
2929

30+
config SECURE_STORAGE_ITS_IMPLEMENTATION_MBEDTLS
31+
bool "MbedTLS ITS implementation"
32+
depends on ARCH_POSIX
33+
help
34+
Use MbedTLS's implementation of the ITS API.
35+
3036
config SECURE_STORAGE_ITS_IMPLEMENTATION_ZEPHYR
3137
bool "Zephyr's ITS implementation"
3238
select SECURE_STORAGE_ITS_TRANSFORM_MODULE
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
CONFIG_SECURE_STORAGE=y
2+
CONFIG_SECURE_STORAGE_ITS_IMPLEMENTATION_ZEPHYR=y
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Copyright (c) 2025 Embeint Inc
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
# We explicitly don't want SECURE_STORAGE_ITS_IMPLEMENTATION_MBEDTLS here
5+
# as it implements `psa_ps_*` and not the underlying `secure_storage_its_*`.
6+
choice SECURE_STORAGE_ITS_IMPLEMENTATION
7+
default SECURE_STORAGE_ITS_IMPLEMENTATION_ZEPHYR
8+
default SECURE_STORAGE_ITS_IMPLEMENTATION_CUSTOM
9+
endchoice
10+
11+
source "Kconfig.zephyr"
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Copyright (c) 2025 Embeint Inc
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
# We explicitly don't want SECURE_STORAGE_ITS_IMPLEMENTATION_MBEDTLS here
5+
choice SECURE_STORAGE_ITS_IMPLEMENTATION
6+
default SECURE_STORAGE_ITS_IMPLEMENTATION_ZEPHYR
7+
default SECURE_STORAGE_ITS_IMPLEMENTATION_CUSTOM
8+
endchoice
9+
10+
source "Kconfig.zephyr"

0 commit comments

Comments
 (0)