-
Notifications
You must be signed in to change notification settings - Fork 8k
modules: mbedtls: add helper Kconfig PSA_CRYPTO #96415
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
base: main
Are you sure you want to change the base?
modules: mbedtls: add helper Kconfig PSA_CRYPTO #96415
Conversation
f28c600
to
e84cc0d
Compare
a1d0c73
b85f601
to
a1d0c73
Compare
Hold on with reviews: apparently I did a rebase mistake and I brought back |
The dependency should be PSA_CRYPTO_CLIENT and not MBEDTLS_PSA_CRYPTO_CLIENT because the former is more generic. TF-M can indeed provide PSA Crypto API, not only Mbed TLS. Signed-off-by: Valerio Setti <[email protected]>
The driver code only relies on legacy Mbed TLS crypto, not on PSA API, so enabling MBEDTLS_PSA_CRYPTO_C is not needed here. Signed-off-by: Valerio Setti <[email protected]>
…_EFR32 The driver only uses psa_generate_random() so ENTROPY_C is not required. Signed-off-by: Valerio Setti <[email protected]>
The goal of new Kconfig PSA_CRYPTO_PROVIDER is to automatically enable any of the PSA Crypto API provider available for the platform without having the user to manually pick the proper one. This provider can be either TF-M, if that's enabled in the build, or Mbed TLS otherwise. PSA_CRYPTO_PROVIDER simplifies also modules/subsystem Kconfigs removing blocks as: select MBEDTLS if !BUILD_WITH_TFM select MBEDTLS_PSA_CRYPTO_C if !BUILD_WITH_TFM Kconfig PSA_CRYPTO_PROVIDER_CUSTOM is also added to allow the end user to add a custom implementation of PSA Crypto API instead of TF-M or Mbed TLS ones. Signed-off-by: Valerio Setti <[email protected]>
Remove previous Kconfig choices CONFIG_BT_MESH_USES_MBEDTLS_PSA and CONFIG_BT_MESH_USES_TFM_PSA and use CONFIG_PSA_CRYPTO instead. This commit also updates test code accordingly. Signed-off-by: Valerio Setti <[email protected]>
a1d0c73
to
7dd0de0
Compare
Update release-notes about the following additions: - CONFIG_PSA_CRYPTO - CONFIG_PSA_CRYPTO_PROVIDER_TFM - CONFIG_PSA_CRYPTO_PROVIDER_MBEDTLS - CONFIG_PSA_CRYPTO_PROVIDER_CUSTOM Signed-off-by: Valerio Setti <[email protected]>
7dd0de0
to
925b69a
Compare
|
bool "PSA Crypto API" | ||
help | ||
Enable a PSA Crypto API provider in the build. If TF-M is enabled then | ||
it will be used for this scope, otherwise Mbed TLS will be used. |
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.
The help text is saying that there are only 2 options.
It should also mention the custom/out-of-tree option.
I found that in the Zephyr codebase there are several occurrences of the following pattern:
This is used to enable Mbed TLS' PSA Crypto Core when TF-M is not available in the build. This is not really nice because it brings the PSA Crypto enablement logic down to the subsystem/module/sample/test using it and it also causes code duplication.
The goal of this PR is to introduce
PSA_CRYPTO_PROVIDER
as a solution to this problem. This is meant to simplify the end user life: they will just need to enablePSA_CRYPTO_PROVIDER
and then Zephyr will take care of enabling what's needed based on the current platform.