Skip to content

Commit d3f4ced

Browse files
alxelaxrlubos
authored andcommitted
Bluetooth: Mesh: add tc to psa key convertor
Commit adds functionality that reads the stored tinycrypt keys from settings and import them as persistent keys into PSA crypto library. Signed-off-by: Aleksandr Khromykh <[email protected]>
1 parent 4cf2767 commit d3f4ced

File tree

3 files changed

+448
-0
lines changed

3 files changed

+448
-0
lines changed

subsys/bluetooth/mesh/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ zephyr_linker_sources(SECTIONS scene_types.ld)
8181

8282
zephyr_library_sources_ifdef(CONFIG_BT_MESH_RPL_STORAGE_MODE_EMDS rpl.c)
8383

84+
zephyr_library_sources_ifdef(CONFIG_BT_MESH_KEY_IMPORTER key_importer.c)
85+
8486
if(CONFIG_BT_MESH_USES_MBEDTLS_PSA AND (NOT CONFIG_SOC_FAMILY_NORDIC_NRF))
8587
zephyr_library_link_libraries(mbedTLS)
8688
endif()

subsys/bluetooth/mesh/Kconfig

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,22 @@ config BT_MESH_USES_TFM_PSA
167167
select PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT
168168
select PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_EXPORT
169169

170+
config BT_MESH_KEY_IMPORTER
171+
bool "Use key importer"
172+
help
173+
Use key importer to read out the keys stored in settings subsystem
174+
and import them into PSA internal trusted storage. This is required if
175+
a provisioned device is still going to stay provisioned after changing
176+
from an image using TinyCrypt to an image that uses PSA crypto.
177+
178+
config BT_MESH_KEY_IMPORTER_PRIO
179+
int "Initialization priority for key importer"
180+
depends on BT_MESH_KEY_IMPORTER
181+
default KERNEL_INIT_PRIORITY_DEFAULT
182+
help
183+
The key importer is initialized before the main application. It is initialized
184+
using system initialization macro with application level.
185+
170186
choice TFM_PROFILE_TYPE
171187
depends on BT_MESH_USES_TFM_PSA
172188
default TFM_PROFILE_TYPE_NOT_SET

0 commit comments

Comments
 (0)