File tree Expand file tree Collapse file tree 13 files changed +49
-27
lines changed Expand file tree Collapse file tree 13 files changed +49
-27
lines changed Original file line number Diff line number Diff line change @@ -70,6 +70,11 @@ Deprecated APIs and options
7070New APIs and options
7171====================
7272
73+ * :kconfig:option: `CONFIG_PSA_CRYPTO ` allows to automatically select a PSA Crypto API
74+ provider based on the configuration. TF-M and Mbed TLS are the only options available
75+ for now, but the user can select :kconfig:option: `CONFIG_PSA_CRYPTO_CUSTOM ` to use
76+ a custom solution.
77+
7378..
7479 Link to new APIs here, in a group if you think it's necessary, no need to get
7580 fancy just list the link, that should contain the documentation. If you feel
Original file line number Diff line number Diff line change @@ -158,8 +158,7 @@ config BT_SILABS_EFR32
158158 depends on ZEPHYR_HAL_SILABS_MODULE_BLOBS || BUILD_ONLY_NO_BLOBS
159159 depends on !PM || SOC_GECKO_PM_BACKEND_PMGR
160160 select SOC_GECKO_USE_RAIL
161- select MBEDTLS
162- select MBEDTLS_PSA_CRYPTO_C
161+ select PSA_CRYPTO
163162 select HAS_BT_CTLR
164163 select BT_CTLR_PHY_UPDATE_SUPPORT
165164 select BT_CTLR_PER_INIT_FEAT_XCHG_SUPPORT
Original file line number Diff line number Diff line change @@ -204,7 +204,7 @@ endchoice
204204
205205config WIFI_NM_WPA_SUPPLICANT_CRYPTO_MBEDTLS_PSA
206206 bool "Crypto Platform Secure Architecture support for WiFi"
207- imply MBEDTLS_PSA_CRYPTO_C
207+ select PSA_CRYPTO
208208 select MBEDTLS_USE_PSA_CRYPTO
209209 select PSA_WANT_ALG_ECDH
210210 select PSA_WANT_ALG_HMAC
Original file line number Diff line number Diff line change 11# Copyright (c) 2024 BayLibre SAS
22# SPDX-License-Identifier: Apache-2.0
33
4- # This file extends Kconfig.psa (which is automatically generated) by adding
5- # some logic between PSA_WANT symbols.
4+ config PSA_CRYPTO
5+ bool "PSA Crypto API"
6+ help
7+ Enable a PSA Crypto API provider in the build. If TF-M is enabled then
8+ it will be used for this scope, otherwise Mbed TLS will be used.
9+
10+ choice PSA_CRYPTO_PROVIDER
11+ prompt "PSA Crypto API provider"
12+ depends on PSA_CRYPTO
13+ default PSA_CRYPTO_PROVIDER_TFM if BUILD_WITH_TFM
14+ default PSA_CRYPTO_PROVIDER_MBEDTLS
15+
16+ config PSA_CRYPTO_PROVIDER_TFM
17+ bool "Use TF-M"
18+ depends on BUILD_WITH_TFM
19+ select TFM_PARTITION_CRYPTO
20+
21+ config PSA_CRYPTO_PROVIDER_MBEDTLS
22+ bool "Use Mbed TLS"
23+ depends on !BUILD_WITH_TFM
24+ select MBEDTLS
25+ select MBEDTLS_PSA_CRYPTO_C
26+
27+ config PSA_CRYPTO_PROVIDER_CUSTOM
28+ bool "Use an out-of-tree library"
29+ depends on !BUILD_WITH_TFM
30+
31+ endchoice # PSA_CRYPTO_PROVIDER
32+
33+ # The following section extends Kconfig.psa.auto (which is automatically
34+ # generated) by adding some logic between PSA_WANT symbols.
635
736config PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_BASIC
837 bool
Original file line number Diff line number Diff line change @@ -5,7 +5,6 @@ menuconfig UOSCORE
55 bool "UOSCORE library"
66 depends on ZCBOR
77 depends on ZCBOR_CANONICAL
8- depends on MBEDTLS
98 select UOSCORE_UEDHOC_CRYPTO_COMMON
109
1110 help
@@ -22,7 +21,6 @@ menuconfig UEDHOC
2221 bool "UEDHOC library"
2322 depends on ZCBOR
2423 depends on ZCBOR_CANONICAL
25- depends on MBEDTLS
2624 select UOSCORE_UEDHOC_CRYPTO_COMMON
2725 help
2826 This option enables the UEDHOC library.
@@ -38,7 +36,7 @@ if UOSCORE || UEDHOC
3836
3937config UOSCORE_UEDHOC_CRYPTO_COMMON
4038 bool
41- imply MBEDTLS_PSA_CRYPTO_C if !BUILD_WITH_TFM
39+ select PSA_CRYPTO
4240 select PSA_WANT_ALG_ECDH
4341 select PSA_WANT_ALG_ECDSA
4442 select PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ config NET_SAMPLE_HTTP_SERVER_SERVICE_PORT
1717config NET_SAMPLE_HTTPS_SERVICE
1818 bool "Enable https service"
1919 depends on NET_SOCKETS_SOCKOPT_TLS || TLS_CREDENTIALS
20- imply MBEDTLS_PSA_CRYPTO_C if !BUILD_WITH_TFM
20+ select PSA_CRYPTO
2121
2222if NET_SAMPLE_HTTPS_SERVICE
2323
Original file line number Diff line number Diff line change 11CONFIG_FLASH_AREA_CHECK_INTEGRITY_PSA=y
2- CONFIG_MBEDTLS=y
3- CONFIG_MBEDTLS_PSA_CRYPTO_C=y
2+ CONFIG_PSA_CRYPTO=y
Original file line number Diff line number Diff line change 33
44config BT_CRYPTO
55 bool
6- select MBEDTLS if !BUILD_WITH_TFM
7- select MBEDTLS_PSA_CRYPTO_C if !BUILD_WITH_TFM
6+ select PSA_CRYPTO
87 select PSA_WANT_KEY_TYPE_AES
98 select PSA_WANT_ALG_CMAC
109 select PSA_WANT_ALG_ECB_NO_PADDING
Original file line number Diff line number Diff line change @@ -200,8 +200,7 @@ config BT_BUF_EVT_DISCARDABLE_COUNT
200200config BT_HOST_CRYPTO
201201 bool "Use crypto functionality implemented in the Bluetooth host"
202202 default y if !BT_CTLR_CRYPTO
203- select MBEDTLS if !BUILD_WITH_TFM
204- select MBEDTLS_PSA_CRYPTO_C if !BUILD_WITH_TFM
203+ select PSA_CRYPTO
205204 select PSA_WANT_KEY_TYPE_AES
206205 select PSA_WANT_ALG_ECB_NO_PADDING
207206 help
@@ -1041,8 +1040,7 @@ endif # BT_DF
10411040
10421041config BT_ECC
10431042 bool
1044- select MBEDTLS if !BUILD_WITH_TFM
1045- select MBEDTLS_PSA_CRYPTO_C if !BUILD_WITH_TFM
1043+ select PSA_CRYPTO
10461044 select PSA_WANT_ALG_ECDH
10471045 select PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_GENERATE
10481046 select PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT
Original file line number Diff line number Diff line change @@ -1511,8 +1511,7 @@ choice BT_MESH_CRYPTO_LIB
15111511
15121512config BT_MESH_USES_MBEDTLS_PSA
15131513 bool "mbed TLS PSA"
1514- select MBEDTLS
1515- select MBEDTLS_PSA_CRYPTO_C
1514+ select PSA_CRYPTO
15161515 select PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT
15171516 select PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_EXPORT
15181517 select PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_GENERATE
You can’t perform that action at this time.
0 commit comments