-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
entropy: Add PSA rng as the entropy provider for the nrf54h20 #17200
base: main
Are you sure you want to change the base?
Changes from all commits
b34e548
1044a83
46122d7
34099e2
6c8b70d
f0dda58
3312fc7
f4fe615
8fb6b14
1df584d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# | ||
# Copyright (c) 2024 Nordic Semiconductor ASA | ||
# | ||
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause | ||
# | ||
|
||
# Disable serial and UART interface. | ||
CONFIG_SERIAL=n | ||
CONFIG_UART_CONSOLE=n | ||
CONFIG_LOG=n | ||
|
||
# RAM usage configuration | ||
CONFIG_HEAP_MEM_POOL_SIZE=8192 | ||
CONFIG_MAIN_STACK_SIZE=2048 | ||
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048 | ||
|
||
# BT configuration | ||
CONFIG_BT=y | ||
CONFIG_BT_HCI_RAW=y | ||
CONFIG_BT_MAX_CONN=1 | ||
CONFIG_BT_CTLR_ASSERT_HANDLER=y | ||
CONFIG_BT_PERIPHERAL=y | ||
CONFIG_BT_CENTRAL=n | ||
CONFIG_BT_BUF_ACL_RX_SIZE=502 | ||
CONFIG_BT_BUF_ACL_TX_SIZE=251 | ||
CONFIG_BT_CTLR_DATA_LENGTH_MAX=251 | ||
CONFIG_BT_CTLR_PHY_2M=n | ||
|
||
# ipc_radio | ||
CONFIG_IPC_RADIO_BT=y | ||
CONFIG_IPC_RADIO_BT_HCI_IPC=y | ||
|
||
# NRF_802154_ENCRYPTION is not enabled by default in the `overlay-802154.conf` file | ||
# that is pulled in by NETCORE_IPC_RADIO_IEEE802154 in application's Kconfig.sysbuild. | ||
# For Wi-Fi builds, this option will not get applied anyway. | ||
CONFIG_NRF_802154_ENCRYPTION=y |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,7 +42,3 @@ | |
&cpuapp_cpurad_ipc { | ||
status = "disabled"; | ||
}; | ||
|
||
&prng { | ||
status = "disabled"; | ||
}; |
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -39,7 +39,25 @@ if(CONFIG_BUILD_WITH_TFM) | |||
include(${NRF_SECURITY_ROOT}/cmake/config_to_tf-m.cmake) | ||||
endif() | ||||
|
||||
if(CONFIG_BUILD_WITH_TFM OR CONFIG_PSA_SSF_CRYPTO_CLIENT) | ||||
if(CONFIG_PSA_SSF_CRYPTO_CLIENT AND NOT CONFIG_NRF_SECURITY) | ||||
zephyr_compile_definitions(MBEDTLS_PSA_CRYPTO_CONFIG) | ||||
zephyr_compile_definitions(MBEDTLS_PSA_CRYPTO_CLIENT) | ||||
zephyr_compile_definitions(MBEDTLS_PSA_CRYPTO_CONFIG_FILE="ssf_crypto_config_empty.h") | ||||
zephyr_compile_definitions(MBEDTLS_CONFIG_FILE="ssf_crypto_config_empty.h") | ||||
|
||||
zephyr_include_directories( | ||||
${NRF_SECURITY_ROOT}/include | ||||
# Oberon PSA headers | ||||
${ZEPHYR_OBERON_PSA_CRYPTO_MODULE_DIR}/include | ||||
${ZEPHYR_OBERON_PSA_CRYPTO_MODULE_DIR}/library | ||||
# Mbed TLS (mbedcrypto) PSA headers | ||||
${ARM_MBEDTLS_PATH}/include | ||||
${ARM_MBEDTLS_PATH}/library | ||||
Comment on lines
+52
to
+55
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are those two |
||||
) | ||||
|
||||
zephyr_sources(${CMAKE_CURRENT_LIST_DIR}/src/ssf_secdom/ssf_crypto.c) | ||||
|
||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||
elseif(CONFIG_BUILD_WITH_TFM OR CONFIG_PSA_SSF_CRYPTO_CLIENT) | ||||
# We enable either TF-M or the SSF client PSA crypto interface but we are | ||||
# not in the secure image build | ||||
|
||||
|
@@ -88,6 +106,9 @@ else() | |||
nrf_security_debug("Building for pure Zephyr") | ||||
endif() | ||||
|
||||
# This check is needed for the cases that CONFIG_PSA_SSF_CRYPTO_CLIENT | ||||
# is enabled but the CONFIG_NRF_SECURITY is not enabled | ||||
if(CONFIG_NRF_SECURITY) | ||||
set(CONFIG_MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG True) | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. indent section |
||||
|
||||
# Add library for crypto configs (NS/S-only build) | ||||
|
@@ -135,3 +156,4 @@ add_subdirectory(${NRFXLIB_DIR}/crypto crypto_copy) | |||
|
||||
# Add mbed TLS Libraries | ||||
add_subdirectory(src) | ||||
endif() |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,6 +29,12 @@ config NORDIC_SECURITY_BACKEND | |
Note that this will enable nrf_oberon by default. Multiple backends is | ||
not supported. | ||
|
||
config PSA_SSF_CRYPTO_CLIENT | ||
bool | ||
prompt "PSA crypto provided through SDFW Service Framework (SSF)" | ||
default y | ||
depends on SSF_CLIENT && SSF_PSA_CRYPTO_SERVICE_ENABLED | ||
Comment on lines
+32
to
+36
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just an observation: since the SSF PSA crypto client exists solely as a backend for this API, we could consider integrating it more closely in the future |
||
|
||
config NRF_SECURITY | ||
tomi-font marked this conversation as resolved.
Show resolved
Hide resolved
|
||
bool | ||
prompt "Enable nRF Security" if !PSA_PROMPTLESS | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/* | ||
* Copyright (c) 2024 Nordic Semiconductor ASA | ||
* | ||
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause | ||
*/ | ||
|
||
/* This is intentionally empty since the SSF doesn't support any configuration yet. */ |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,18 +18,7 @@ SSF_CLIENT_SERVICE_DEFINE(psa_crypto_srvc, PSA_CRYPTO, cbor_encode_psa_crypto_re | |
|
||
psa_status_t ssf_psa_crypto_init(void) | ||
{ | ||
int err; | ||
struct psa_crypto_req req = { 0 }; | ||
struct psa_crypto_rsp rsp = { 0 }; | ||
|
||
req.psa_crypto_req_msg_choice = psa_crypto_req_msg_psa_crypto_init_req_m_c; | ||
|
||
err = ssf_client_send_request(&psa_crypto_srvc, &req, &rsp, NULL); | ||
if (err != 0) { | ||
return err; | ||
} | ||
|
||
return rsp.psa_crypto_rsp_status; | ||
return PSA_SUCCESS; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we remove the server part of this API? We could keep it as a no-op there as well. |
||
} | ||
|
||
psa_status_t ssf_psa_get_key_attributes( | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2 space indent