From 55c0b2ea45970bfb81dc3b61abe8fc94c40bd6b3 Mon Sep 17 00:00:00 2001 From: Valerio Setti Date: Wed, 6 Nov 2024 05:44:25 +0100 Subject: [PATCH] tests: bt: enable entropy sources where missing Moving from TinyCrypt to PSA Crypto API caused an entropy source to be always required, so this commit adds it in tests where necessary. Signed-off-by: Valerio Setti --- .../beacon/boards/nrf54l15dk_nrf54l15_cpuapp.conf | 13 +++++++++++++ samples/bluetooth/central_ht/boards/frdm_rw612.conf | 1 + .../bluetooth/central_ht/boards/rd_rw612_bga.conf | 1 + samples/bluetooth/iso_connected_benchmark/prj.conf | 2 ++ .../boards/nucleo_l4r5zi_stm32l4r5xx.conf | 1 + .../boards/nucleo_l4r5zi_stm32l4r5xx.overlay | 3 +++ .../boards/nrf54l15dk_nrf54l15_cpuapp.conf | 13 +++++++++++++ .../bluetooth/peripheral_ht/boards/frdm_rw612.conf | 1 + .../boards/mimxrt1020_evk_mimxrt1021.conf | 1 + .../peripheral_ht/boards/rd_rw612_bga.conf | 1 + samples/bluetooth/st_ble_sensor/prj.conf | 1 + samples/boards/st/power_mgmt/stm32wb_ble/prj.conf | 1 + samples/subsys/logging/ble_backend/prj.conf | 2 ++ tests/bluetooth/shell/audio.conf | 3 +++ tests/bluetooth/tester/boards/frdm_rw612.conf | 1 + tests/bluetooth/tester/boards/rd_rw612_bga.conf | 1 + 16 files changed, 46 insertions(+) create mode 100644 samples/bluetooth/beacon/boards/nrf54l15dk_nrf54l15_cpuapp.conf create mode 100644 samples/bluetooth/peripheral/boards/nucleo_l4r5zi_stm32l4r5xx.conf create mode 100644 samples/bluetooth/peripheral/boards/nucleo_l4r5zi_stm32l4r5xx.overlay create mode 100644 samples/bluetooth/peripheral_hr/boards/nrf54l15dk_nrf54l15_cpuapp.conf create mode 100644 samples/bluetooth/peripheral_ht/boards/mimxrt1020_evk_mimxrt1021.conf diff --git a/samples/bluetooth/beacon/boards/nrf54l15dk_nrf54l15_cpuapp.conf b/samples/bluetooth/beacon/boards/nrf54l15dk_nrf54l15_cpuapp.conf new file mode 100644 index 00000000000..350b42b0f67 --- /dev/null +++ b/samples/bluetooth/beacon/boards/nrf54l15dk_nrf54l15_cpuapp.conf @@ -0,0 +1,13 @@ +# We need a random number generator to properly initialize the PSA Crypto core +# implemented by Mbed TLS. The proper thing to do in this platform would be +# to enable ENTROPY_GENERATOR, but this is not supported right now for the +# following reasons: +# - at device-tree level (nrf54l15_cpuapp.dtsi) the only RNG source available +# is "zephyr,psa-crypto-rng" which means that TF-M is required in order for +# this to work. Unfortunately TF-M is still not supported for this platform, yet. +# - cpuapp does not have a direct access to the RNG without TF-M, so there's +# no other way it can make use of it as of now. +# +# Since both options are not viable, we fall back to the test random generator +# until further support is added to the platform. +CONFIG_TEST_RANDOM_GENERATOR=y diff --git a/samples/bluetooth/central_ht/boards/frdm_rw612.conf b/samples/bluetooth/central_ht/boards/frdm_rw612.conf index 2df782efc71..6bec2cd6b37 100644 --- a/samples/bluetooth/central_ht/boards/frdm_rw612.conf +++ b/samples/bluetooth/central_ht/boards/frdm_rw612.conf @@ -1 +1,2 @@ CONFIG_PM=y +CONFIG_ENTROPY_GENERATOR=y diff --git a/samples/bluetooth/central_ht/boards/rd_rw612_bga.conf b/samples/bluetooth/central_ht/boards/rd_rw612_bga.conf index 2df782efc71..6bec2cd6b37 100644 --- a/samples/bluetooth/central_ht/boards/rd_rw612_bga.conf +++ b/samples/bluetooth/central_ht/boards/rd_rw612_bga.conf @@ -1 +1,2 @@ CONFIG_PM=y +CONFIG_ENTROPY_GENERATOR=y diff --git a/samples/bluetooth/iso_connected_benchmark/prj.conf b/samples/bluetooth/iso_connected_benchmark/prj.conf index 09781083adb..eb099a3497a 100644 --- a/samples/bluetooth/iso_connected_benchmark/prj.conf +++ b/samples/bluetooth/iso_connected_benchmark/prj.conf @@ -15,3 +15,5 @@ CONFIG_MAIN_STACK_SIZE=2048 CONFIG_LOG=y CONFIG_CBPRINTF_FP_SUPPORT=y CONFIG_LOG_BUFFER_SIZE=2048 + +CONFIG_ENTROPY_GENERATOR=y diff --git a/samples/bluetooth/peripheral/boards/nucleo_l4r5zi_stm32l4r5xx.conf b/samples/bluetooth/peripheral/boards/nucleo_l4r5zi_stm32l4r5xx.conf new file mode 100644 index 00000000000..5858c7b6db1 --- /dev/null +++ b/samples/bluetooth/peripheral/boards/nucleo_l4r5zi_stm32l4r5xx.conf @@ -0,0 +1 @@ +CONFIG_ENTROPY_GENERATOR=y diff --git a/samples/bluetooth/peripheral/boards/nucleo_l4r5zi_stm32l4r5xx.overlay b/samples/bluetooth/peripheral/boards/nucleo_l4r5zi_stm32l4r5xx.overlay new file mode 100644 index 00000000000..1213a82bf2c --- /dev/null +++ b/samples/bluetooth/peripheral/boards/nucleo_l4r5zi_stm32l4r5xx.overlay @@ -0,0 +1,3 @@ +&rng { + status = "okay"; +}; diff --git a/samples/bluetooth/peripheral_hr/boards/nrf54l15dk_nrf54l15_cpuapp.conf b/samples/bluetooth/peripheral_hr/boards/nrf54l15dk_nrf54l15_cpuapp.conf new file mode 100644 index 00000000000..350b42b0f67 --- /dev/null +++ b/samples/bluetooth/peripheral_hr/boards/nrf54l15dk_nrf54l15_cpuapp.conf @@ -0,0 +1,13 @@ +# We need a random number generator to properly initialize the PSA Crypto core +# implemented by Mbed TLS. The proper thing to do in this platform would be +# to enable ENTROPY_GENERATOR, but this is not supported right now for the +# following reasons: +# - at device-tree level (nrf54l15_cpuapp.dtsi) the only RNG source available +# is "zephyr,psa-crypto-rng" which means that TF-M is required in order for +# this to work. Unfortunately TF-M is still not supported for this platform, yet. +# - cpuapp does not have a direct access to the RNG without TF-M, so there's +# no other way it can make use of it as of now. +# +# Since both options are not viable, we fall back to the test random generator +# until further support is added to the platform. +CONFIG_TEST_RANDOM_GENERATOR=y diff --git a/samples/bluetooth/peripheral_ht/boards/frdm_rw612.conf b/samples/bluetooth/peripheral_ht/boards/frdm_rw612.conf index 2df782efc71..6bec2cd6b37 100644 --- a/samples/bluetooth/peripheral_ht/boards/frdm_rw612.conf +++ b/samples/bluetooth/peripheral_ht/boards/frdm_rw612.conf @@ -1 +1,2 @@ CONFIG_PM=y +CONFIG_ENTROPY_GENERATOR=y diff --git a/samples/bluetooth/peripheral_ht/boards/mimxrt1020_evk_mimxrt1021.conf b/samples/bluetooth/peripheral_ht/boards/mimxrt1020_evk_mimxrt1021.conf new file mode 100644 index 00000000000..5858c7b6db1 --- /dev/null +++ b/samples/bluetooth/peripheral_ht/boards/mimxrt1020_evk_mimxrt1021.conf @@ -0,0 +1 @@ +CONFIG_ENTROPY_GENERATOR=y diff --git a/samples/bluetooth/peripheral_ht/boards/rd_rw612_bga.conf b/samples/bluetooth/peripheral_ht/boards/rd_rw612_bga.conf index 2df782efc71..6bec2cd6b37 100644 --- a/samples/bluetooth/peripheral_ht/boards/rd_rw612_bga.conf +++ b/samples/bluetooth/peripheral_ht/boards/rd_rw612_bga.conf @@ -1 +1,2 @@ CONFIG_PM=y +CONFIG_ENTROPY_GENERATOR=y diff --git a/samples/bluetooth/st_ble_sensor/prj.conf b/samples/bluetooth/st_ble_sensor/prj.conf index eb6dae37fbe..4bcba44c606 100644 --- a/samples/bluetooth/st_ble_sensor/prj.conf +++ b/samples/bluetooth/st_ble_sensor/prj.conf @@ -4,3 +4,4 @@ CONFIG_BT_DEVICE_NAME="P2PSRV1" CONFIG_BT_GATT_CLIENT=y CONFIG_LOG=y CONFIG_LOG_BUFFER_SIZE=2048 +CONFIG_ENTROPY_GENERATOR=y diff --git a/samples/boards/st/power_mgmt/stm32wb_ble/prj.conf b/samples/boards/st/power_mgmt/stm32wb_ble/prj.conf index 1dff53f1da7..a04a0c309c3 100644 --- a/samples/boards/st/power_mgmt/stm32wb_ble/prj.conf +++ b/samples/boards/st/power_mgmt/stm32wb_ble/prj.conf @@ -2,3 +2,4 @@ CONFIG_BT=y CONFIG_BT_DEVICE_NAME="Test beacon" CONFIG_POWEROFF=y CONFIG_PM=y +CONFIG_ENTROPY_GENERATOR=y diff --git a/samples/subsys/logging/ble_backend/prj.conf b/samples/subsys/logging/ble_backend/prj.conf index f98016410b9..0a290f80da3 100644 --- a/samples/subsys/logging/ble_backend/prj.conf +++ b/samples/subsys/logging/ble_backend/prj.conf @@ -8,3 +8,5 @@ CONFIG_LOG_PROCESS_THREAD_STACK_SIZE=2048 # Uncomment to use the maximum buffer size # CONFIG_BT_L2CAP_TX_MTU=600 # CONFIG_BT_BUF_ACL_RX_SIZE=600 + +CONFIG_TEST_RANDOM_GENERATOR=y diff --git a/tests/bluetooth/shell/audio.conf b/tests/bluetooth/shell/audio.conf index 5e4e57ff561..ea738538c4d 100644 --- a/tests/bluetooth/shell/audio.conf +++ b/tests/bluetooth/shell/audio.conf @@ -248,3 +248,6 @@ CONFIG_BT_CTLR_ADV_ISO_STREAM_MAX=4 # Match the number of unicast streams supported in BAP CONFIG_BT_CTLR_ISOAL_SOURCES=2 CONFIG_BT_CTLR_ISOAL_SINKS=2 + +# Enable entropy source for Mbed TLS's PSA Crypto core +CONFIG_ENTROPY_GENERATOR=y diff --git a/tests/bluetooth/tester/boards/frdm_rw612.conf b/tests/bluetooth/tester/boards/frdm_rw612.conf index ba1ae16dc7c..fc61f3bc7d2 100644 --- a/tests/bluetooth/tester/boards/frdm_rw612.conf +++ b/tests/bluetooth/tester/boards/frdm_rw612.conf @@ -1,4 +1,5 @@ CONFIG_BT_MAX_CONN=16 +CONFIG_ENTROPY_GENERATOR=y # debug options # CONFIG_UART_CONSOLE=y diff --git a/tests/bluetooth/tester/boards/rd_rw612_bga.conf b/tests/bluetooth/tester/boards/rd_rw612_bga.conf index ba1ae16dc7c..fc61f3bc7d2 100644 --- a/tests/bluetooth/tester/boards/rd_rw612_bga.conf +++ b/tests/bluetooth/tester/boards/rd_rw612_bga.conf @@ -1,4 +1,5 @@ CONFIG_BT_MAX_CONN=16 +CONFIG_ENTROPY_GENERATOR=y # debug options # CONFIG_UART_CONSOLE=y