Skip to content

Commit 47cb066

Browse files
anhmolteivindj-nordic
authored andcommitted
softdevice_handler: seed SoftDevice RNG when requested
Seed the SoftDevice RNG with random numbers on SoftDevice SoC event NRF_EVT_RAND_SEED_REQUEST. Handling of SoC events from the SoftDevice (nrf_sdh_soc.c) is from now on a mandatory part of the SoftDevice Handler subsystem. Kconfig option NRF_SDH_SOC is therefore removed. Signed-off-by: Andreas Moltumyr <[email protected]>
1 parent 5f999ab commit 47cb066

File tree

11 files changed

+72
-7
lines changed

11 files changed

+72
-7
lines changed

samples/bluetooth/ble_cgms/prj.conf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ CONFIG_LOG_BACKEND_BM_UARTE=y
44
CONFIG_SOFTDEVICE=y
55
CONFIG_NRF_SDH=y
66

7+
# Enable RNG
8+
CONFIG_NRF_SECURITY=y
9+
CONFIG_MBEDTLS_PSA_CRYPTO_C=y
10+
CONFIG_PSA_WANT_GENERATE_RANDOM=y
11+
712
CONFIG_BLE_ADV=y
813
CONFIG_BLE_ADV_NAME="nRF_BM_CGMS"
914
CONFIG_BLE_ADV_EXTENDED_ADVERTISING=n

samples/bluetooth/ble_hrs/prj.conf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ CONFIG_LOG_BACKEND_BM_UARTE=y
44
CONFIG_SOFTDEVICE=y
55
CONFIG_NRF_SDH=y
66

7+
# Enable RNG
8+
CONFIG_NRF_SECURITY=y
9+
CONFIG_MBEDTLS_PSA_CRYPTO_C=y
10+
CONFIG_PSA_WANT_GENERATE_RANDOM=y
11+
712
CONFIG_BLE_ADV=y
813
CONFIG_BLE_ADV_NAME="nRF_BM_HRS"
914
CONFIG_BLE_ADV_EXTENDED_ADVERTISING=n

samples/bluetooth/ble_lbs/prj.conf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ CONFIG_LOG_BACKEND_BM_UARTE=y
44
CONFIG_SOFTDEVICE=y
55
CONFIG_NRF_SDH=y
66

7+
# Enable RNG
8+
CONFIG_NRF_SECURITY=y
9+
CONFIG_MBEDTLS_PSA_CRYPTO_C=y
10+
CONFIG_PSA_WANT_GENERATE_RANDOM=y
11+
712
CONFIG_BLE_ADV=y
813
CONFIG_BLE_ADV_NAME="nRF_BM_LBS"
914
CONFIG_BLE_ADV_EXTENDED_ADVERTISING=n

samples/bluetooth/ble_nus/prj.conf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ CONFIG_BLE_ADV_DIRECTED_ADVERTISING=n
99
CONFIG_SOFTDEVICE=y
1010
CONFIG_NRF_SDH=y
1111

12+
# Enable RNG
13+
CONFIG_NRF_SECURITY=y
14+
CONFIG_MBEDTLS_PSA_CRYPTO_C=y
15+
CONFIG_PSA_WANT_GENERATE_RANDOM=y
16+
1217
# BLE connection parameter
1318
CONFIG_BLE_CONN_PARAMS=y
1419

samples/bluetooth/ble_pwr_profiling/prj.conf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ CONFIG_CONSOLE=y
77
CONFIG_SOFTDEVICE=y
88
CONFIG_NRF_SDH=y
99

10+
# Enable RNG
11+
CONFIG_NRF_SECURITY=y
12+
CONFIG_MBEDTLS_PSA_CRYPTO_C=y
13+
CONFIG_PSA_WANT_GENERATE_RANDOM=y
14+
1015
# Require storage of a vendor UUID
1116
CONFIG_NRF_SDH_BLE_VS_UUID_COUNT=1
1217

samples/bluetooth/hello_softdevice/prj.conf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,8 @@ CONFIG_LOG_BACKEND_BM_UARTE=y
33

44
CONFIG_SOFTDEVICE=y
55
CONFIG_NRF_SDH=y
6+
7+
# Enable RNG
8+
CONFIG_NRF_SECURITY=y
9+
CONFIG_MBEDTLS_PSA_CRYPTO_C=y
10+
CONFIG_PSA_WANT_GENERATE_RANDOM=y

samples/boot/mcuboot_recovery_entry/prj.conf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ CONFIG_BLE_ADV_DIRECTED_ADVERTISING=n
1515
CONFIG_SOFTDEVICE=y
1616
CONFIG_NRF_SDH_BLE=y
1717
CONFIG_NRF_SDH=y
18+
CONFIG_NRF_SECURITY=y
19+
CONFIG_MBEDTLS_PSA_CRYPTO_C=y
20+
CONFIG_PSA_WANT_GENERATE_RANDOM=y
1821
CONFIG_BLE_MCUMGR=y
1922

2023
CONFIG_MCUBOOT_BOOTUTIL_LIB=y

samples/mcumgr/ble_mcumgr/prj.conf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ CONFIG_MCUMGR_GRP_OS_MCUMGR_PARAMS=y
3939
CONFIG_MCUMGR_GRP_OS_BOOTLOADER_INFO=y
4040
CONFIG_NRF_SDH_BLE=y
4141
CONFIG_NRF_SDH=y
42+
CONFIG_NRF_SECURITY=y
43+
CONFIG_MBEDTLS_PSA_CRYPTO_C=y
44+
CONFIG_PSA_WANT_GENERATE_RANDOM=y
4245
CONFIG_BLE_MCUMGR=y
4346

4447
CONFIG_LOG=y

subsys/softdevice_handler/CMakeLists.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ zephyr_library()
77
zephyr_linker_sources(SECTIONS sdh.ld)
88
zephyr_library_sources(
99
nrf_sdh.c
10+
nrf_sdh_soc.c
1011
irq_connect.c
1112
)
1213

@@ -22,9 +23,6 @@ if(CONFIG_SOFTDEVICE_S115)
2223
target_link_options(app PUBLIC "-Wl,--defsym=z_arm_svc=SVC_Handler")
2324
endif()
2425

25-
if(CONFIG_NRF_SDH_SOC)
26-
zephyr_library_sources(nrf_sdh_soc.c)
27-
endif()
2826
if(CONFIG_NRF_SDH_BLE)
2927
zephyr_library_sources(nrf_sdh_ble.c)
3028
endif()

subsys/softdevice_handler/Kconfig

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,12 @@
66
menuconfig NRF_SDH
77
bool "Softdevice handler"
88
depends on SOFTDEVICE
9+
depends on NRF_SECURITY
10+
depends on MBEDTLS_PSA_CRYPTO_C
11+
depends on PSA_WANT_GENERATE_RANDOM
912

1013
if NRF_SDH
1114

12-
config NRF_SDH_SOC
13-
bool "SoC events"
14-
default y
15-
1615
config NRF_SDH_BLE
1716
bool "BLE events"
1817
default y

0 commit comments

Comments
 (0)