Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bluetooth: Mesh: use secure storage in ble mesh #82319

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions modules/mbedtls/configs/config-tls-generic.h
Original file line number Diff line number Diff line change
Expand Up @@ -482,12 +482,6 @@
#define MBEDTLS_PSA_P256M_DRIVER_ENABLED
#endif

#if defined(CONFIG_ARCH_POSIX) && !defined(CONFIG_PICOLIBC) && !defined(CONFIG_SECURE_STORAGE)
#define MBEDTLS_PSA_ITS_FILE_C
#define MBEDTLS_PSA_CRYPTO_STORAGE_C
#define MBEDTLS_FS_IO
#endif

#if defined(CONFIG_SECURE_STORAGE)
#define MBEDTLS_PSA_CRYPTO_STORAGE_C
#endif
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CONFIG_SECURE_STORAGE=n
1 change: 1 addition & 0 deletions samples/bluetooth/mesh/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ CONFIG_FLASH=y
CONFIG_FLASH_MAP=y
CONFIG_NVS=y
CONFIG_SETTINGS=y
CONFIG_SECURE_STORAGE=y
CONFIG_HWINFO=y

CONFIG_BT=y
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CONFIG_SECURE_STORAGE=n
1 change: 1 addition & 0 deletions samples/bluetooth/mesh_demo/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ CONFIG_FLASH_MAP=y
CONFIG_NVS=y
CONFIG_SETTINGS=y
CONFIG_BT_MESH_RPL_STORE_TIMEOUT=600
CONFIG_SECURE_STORAGE=y

# Limit the number of key slots in PSA Crypto core to reduce
# RAM footprint
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CONFIG_SECURE_STORAGE=n
1 change: 1 addition & 0 deletions samples/bluetooth/mesh_provisioner/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ CONFIG_FLASH_MAP=y
CONFIG_NVS=y
CONFIG_SETTINGS=y
CONFIG_BT_MESH_RPL_STORE_TIMEOUT=600
CONFIG_SECURE_STORAGE=y

#CONFIG_BT_MESH_LOG_LEVEL_DBG=y
#CONFIG_BT_MESH_SETTINGS_LOG_LEVEL_DBG=y
Expand Down
2 changes: 2 additions & 0 deletions samples/boards/nordic/mesh/onoff-app/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ CONFIG_FLASH=y
CONFIG_FLASH_MAP=y
CONFIG_NVS=y
CONFIG_SETTINGS=y
CONFIG_SECURE_STORAGE=y

CONFIG_BT_MESH_RPL_STORE_TIMEOUT=600

CONFIG_BOOT_BANNER=y
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ CONFIG_FLASH=y
CONFIG_FLASH_MAP=y
CONFIG_NVS=y
CONFIG_SETTINGS=y
CONFIG_SECURE_STORAGE=y

CONFIG_BT_OBSERVER=y
CONFIG_BT_BROADCASTER=y
Expand Down
1 change: 1 addition & 0 deletions samples/boards/phytec/reel_board/mesh_badge/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,5 @@ CONFIG_FLASH=y
CONFIG_FLASH_MAP=y
CONFIG_NVS=y
CONFIG_SETTINGS=y
CONFIG_SECURE_STORAGE=y
CONFIG_CBPRINTF_FP_SUPPORT=y
5 changes: 5 additions & 0 deletions subsys/bluetooth/mesh/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1452,6 +1452,10 @@ config BT_MESH_SOL_ADV_XMIT

endmenu # Proxy

config BT_MESH_SECURE_STORAGE
bool
depends on SECURE_STORAGE

choice BT_MESH_CRYPTO_LIB
prompt "Crypto library:"
default BT_MESH_USES_TFM_PSA if BUILD_WITH_TFM
Expand Down Expand Up @@ -1491,6 +1495,7 @@ config BT_MESH_USES_MBEDTLS_PSA
select PSA_WANT_ALG_SHA_256
select PSA_WANT_ALG_ECDH
select PSA_WANT_ECC_SECP_R1_256
select BT_MESH_SECURE_STORAGE if BT_SETTINGS
help
Use Mbed TLS as PSA Crypto API provider. This is useful on platforms
that do not support TF-M.
Expand Down
1 change: 1 addition & 0 deletions tests/bluetooth/mesh_shell/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ CONFIG_FLASH=y
CONFIG_FLASH_MAP=y
CONFIG_NVS=y
CONFIG_SETTINGS=y
CONFIG_SECURE_STORAGE=y

CONFIG_BT=y
CONFIG_BT_OBSERVER=y
Expand Down
13 changes: 0 additions & 13 deletions tests/bsim/bluetooth/mesh/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ if(CONFIG_SETTINGS)
if(CONFIG_BT_MESH_USES_MBEDTLS_PSA)
target_sources(app PRIVATE
src/distribute_keyid.c
src/psa_its_emul.c
)
endif()

Expand Down Expand Up @@ -82,15 +81,3 @@ zephyr_include_directories(
${BSIM_COMPONENTS_PATH}/libUtilv1/src/
${BSIM_COMPONENTS_PATH}/libPhyComv1/src/
)

# The mbedTLS PSA ITS is not thread safe.
# The issue: https://github.com/zephyrproject-rtos/zephyr/issues/59362
# Also, it isn't possible to use "native" ITS implementation since
# mbedTLS includes headers that do not exist.
# This linker option allows linking custom ITS implementation instead of
# precompiled objects from the mbedTLS library to run it in parallel.
if(CONFIG_BT_MESH_USES_MBEDTLS_PSA)
zephyr_ld_options(
${LINKERFLAGPREFIX},--allow-multiple-definition
)
endif()
1 change: 1 addition & 0 deletions tests/bsim/bluetooth/mesh/overlay_pst.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ CONFIG_BT_SETTINGS=y
CONFIG_FLASH=y
CONFIG_FLASH_MAP=y
CONFIG_NVS=y
CONFIG_SECURE_STORAGE=y

CONFIG_BT_PERIPHERAL=y
CONFIG_BT_MESH_GATT_PROXY=y
Expand Down
209 changes: 0 additions & 209 deletions tests/bsim/bluetooth/mesh/src/psa_its_emul.c

This file was deleted.

Loading