Commit 8080d96
committed
nrf_security: Do not enable the enabler on QEMU targets
NRF_SECURITY_ENABLER applies nRF-Security-oriented defaults whenever
Bluetooth crypto is enabled, most notably implying MBEDTLS_ENABLE_HEAP.
That routes all Mbed TLS / PSA allocations through the fixed-size Mbed
TLS static heap (MBEDTLS_MEMORY_BUFFER_ALLOC_C), whose size defaults to
value of 512 bytes.
The nRF Security (Oberon) backend is only available on Nordic Arm cores
(NRF_SECURITY depends on SOC_FAMILY_NORDIC_NRF && ARM), so QEMU targets
fall back to the vanilla Mbed TLS PSA provider. That provider expects to
allocate from the C library heap; with the 512-byte static heap forced
on instead, AES-ECB and AES-CMAC operations run out of memory and PSA
returns PSA_ERROR_INSUFFICIENT_MEMORY (-141). This broke Bluetooth host
crypto tests on qemu_cortex_m3 and qemu_x86 (bluetooth.addr RPA
resolution and the bluetooth.gatt* db-hash generation), which pass on
upstream Zephyr precisely because upstream does not enable the static
heap for these builds.
Since QEMU targets can never use nRF Security, exclude them from the
enabler so they behave like upstream Zephyr and allocate PSA scratch
memory from the C library heap.
Assisted-by: Cursor:Claude Opus 4.8
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>1 parent 15fb7bb commit 8080d96
1 file changed
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
| 118 | + | |
118 | 119 | | |
119 | 120 | | |
120 | 121 | | |
| |||
0 commit comments