From 3cf219fb97893e3a5841e77e9cd677c42ae1cc00 Mon Sep 17 00:00:00 2001 From: Aleksandr Khromykh Date: Mon, 17 Jun 2024 10:07:11 +0200 Subject: [PATCH] Bluetooth: Mesh: align mesh and host psa usage Commit aligns usage mesh and host PSA. Since PSA crypto is supported in host then there is no reason to switch off some of host features to get rid of tinycrypt functions in the final image. Signed-off-by: Aleksandr Khromykh --- .../mesh/boards/nrf5340dk_nrf5340_cpuapp_ns.conf | 6 ++---- .../mesh_demo/boards/nrf5340dk_nrf5340_cpuapp_ns.conf | 6 ++---- .../boards/nrf5340dk_nrf5340_cpuapp_ns.conf | 4 ++-- subsys/bluetooth/mesh/CMakeLists.txt | 8 +++----- tests/bsim/bluetooth/mesh/overlay_psa.conf | 6 ++---- 5 files changed, 11 insertions(+), 19 deletions(-) diff --git a/samples/bluetooth/mesh/boards/nrf5340dk_nrf5340_cpuapp_ns.conf b/samples/bluetooth/mesh/boards/nrf5340dk_nrf5340_cpuapp_ns.conf index f56dfa703f1..ee6d1210e8d 100644 --- a/samples/bluetooth/mesh/boards/nrf5340dk_nrf5340_cpuapp_ns.conf +++ b/samples/bluetooth/mesh/boards/nrf5340dk_nrf5340_cpuapp_ns.conf @@ -1,4 +1,2 @@ -# The option adds TinyCrypt based bt_rand. -CONFIG_BT_HOST_CRYPTO=n -# The option adds GATT caching feature that is based on TinyCrypt. -CONFIG_BT_GATT_CACHING=n +# Enable PSA as a crypto backend in host +CONFIG_BT_USE_PSA_API=y diff --git a/samples/bluetooth/mesh_demo/boards/nrf5340dk_nrf5340_cpuapp_ns.conf b/samples/bluetooth/mesh_demo/boards/nrf5340dk_nrf5340_cpuapp_ns.conf index f56dfa703f1..ee6d1210e8d 100644 --- a/samples/bluetooth/mesh_demo/boards/nrf5340dk_nrf5340_cpuapp_ns.conf +++ b/samples/bluetooth/mesh_demo/boards/nrf5340dk_nrf5340_cpuapp_ns.conf @@ -1,4 +1,2 @@ -# The option adds TinyCrypt based bt_rand. -CONFIG_BT_HOST_CRYPTO=n -# The option adds GATT caching feature that is based on TinyCrypt. -CONFIG_BT_GATT_CACHING=n +# Enable PSA as a crypto backend in host +CONFIG_BT_USE_PSA_API=y diff --git a/samples/bluetooth/mesh_provisioner/boards/nrf5340dk_nrf5340_cpuapp_ns.conf b/samples/bluetooth/mesh_provisioner/boards/nrf5340dk_nrf5340_cpuapp_ns.conf index c4aa66d1201..ee6d1210e8d 100644 --- a/samples/bluetooth/mesh_provisioner/boards/nrf5340dk_nrf5340_cpuapp_ns.conf +++ b/samples/bluetooth/mesh_provisioner/boards/nrf5340dk_nrf5340_cpuapp_ns.conf @@ -1,2 +1,2 @@ -# The option adds TinyCrypt based bt_rand. -CONFIG_BT_HOST_CRYPTO=n +# Enable PSA as a crypto backend in host +CONFIG_BT_USE_PSA_API=y diff --git a/subsys/bluetooth/mesh/CMakeLists.txt b/subsys/bluetooth/mesh/CMakeLists.txt index c628fb6d9db..2009601f0f8 100644 --- a/subsys/bluetooth/mesh/CMakeLists.txt +++ b/subsys/bluetooth/mesh/CMakeLists.txt @@ -127,8 +127,6 @@ endif() zephyr_library_link_libraries_ifdef(CONFIG_MBEDTLS mbedTLS) -if (CONFIG_BUILD_WITH_TFM) - target_include_directories(${ZEPHYR_CURRENT_LIBRARY} PRIVATE - $/api_ns/interface/include - ) -endif() +zephyr_library_include_directories_ifdef(CONFIG_BUILD_WITH_TFM + $/api_ns/interface/include +) diff --git a/tests/bsim/bluetooth/mesh/overlay_psa.conf b/tests/bsim/bluetooth/mesh/overlay_psa.conf index 1957085b7e4..764d8cb6ea4 100644 --- a/tests/bsim/bluetooth/mesh/overlay_psa.conf +++ b/tests/bsim/bluetooth/mesh/overlay_psa.conf @@ -1,7 +1,5 @@ -# The option adds TinyCrypt based bt_rand. -CONFIG_BT_HOST_CRYPTO=n -# The option adds GATT caching feature that is based on TinyCrypt. -CONFIG_BT_GATT_CACHING=n +# Enable PSA as a crypto backend in host +CONFIG_BT_USE_PSA_API=y # Enable mbedTLS PSA as a crypto backend CONFIG_BT_MESH_USES_MBEDTLS_PSA=y