-
Notifications
You must be signed in to change notification settings - Fork 8.4k
modules: openthread: use PSA Crypto API as default choice for crypto #98088
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?
Changes from all commits
063b8a0
f5a5bea
79f68c5
0261511
8437089
1e26227
0ee1e64
a9037fa
a30b278
e12c5eb
4e0ce67
c597e21
778b40d
7a2b496
4e9f2a1
307ff11
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 |
|---|---|---|
|
|
@@ -147,54 +147,105 @@ config OPENTHREAD_SHELL | |
| depends on SHELL | ||
|
|
||
| config MBEDTLS_PROMPTLESS | ||
| default y if !CUSTOM_OPENTHREAD_SECURITY | ||
| default y if OPENTHREAD_SECURITY_DEFAULT_CONFIG | ||
|
|
||
| choice OPENTHREAD_SECURITY | ||
| prompt "OpenThread security" | ||
| default OPENTHREAD_MBEDTLS_CHOICE | ||
| choice OPENTHREAD_SECURITY_CONFIG | ||
| prompt "OpenThread security configuration" | ||
| default OPENTHREAD_SECURITY_DEFAULT_CONFIG | ||
|
|
||
| config CUSTOM_OPENTHREAD_SECURITY | ||
| bool "Custom" | ||
| config OPENTHREAD_SECURITY_CUSTOM_CONFIG | ||
| bool "Custom configuration" | ||
| help | ||
| Security settings will be controlled directly by the user. | ||
| Enabling this setting will give access to full control of mbed TLS | ||
| Enabling this setting will give access to full control of Mbed TLS | ||
| configuration. | ||
|
|
||
| config OPENTHREAD_MBEDTLS_CHOICE | ||
| bool "mbed TLS built-in" | ||
| select OPENTHREAD_MBEDTLS | ||
| config OPENTHREAD_SECURITY_DEFAULT_CONFIG | ||
| bool "Default configuration" | ||
| help | ||
| Use the OpenThread mbed TLS configuration pre-defined security scheme. | ||
| Use the OpenThread Mbed TLS configuration pre-defined security scheme. | ||
|
|
||
| endchoice | ||
| endchoice # OPENTHREAD_SECURITY | ||
|
|
||
| config OPENTHREAD_CRYPTO_PSA | ||
| bool "PSA Crypto API" | ||
| default y | ||
| select PSA_CRYPTO | ||
| select OPENTHREAD_PLATFORM_KEY_REF if !OPENTHREAD_COPROCESSOR_RCP | ||
| imply OPENTHREAD_PLATFORM_KEYS_EXPORTABLE_ENABLE | ||
| help | ||
| Use PSA Crypto API as backend for cryptographic operations instead | ||
| of legacy Mbed TLS. | ||
|
|
||
| config OPENTHREAD_MBEDTLS | ||
| if OPENTHREAD_SECURITY_DEFAULT_CONFIG | ||
|
|
||
| config OPENTHREAD_CRYPTO_PSA_CONFIG | ||
| bool | ||
| select MBEDTLS | ||
| select MBEDTLS_ENABLE_HEAP | ||
| default y if OPENTHREAD_CRYPTO_PSA | ||
| imply SECURE_STORAGE if !BUILD_WITH_TFM | ||
| select PSA_WANT_KEY_TYPE_AES | ||
| select PSA_WANT_ALG_ECB_NO_PADDING | ||
| select PSA_WANT_KEY_TYPE_HMAC | ||
| select PSA_WANT_ALG_HMAC | ||
| select PSA_WANT_ALG_CCM | ||
| select PSA_WANT_ALG_SHA_256 | ||
| select PSA_WANT_ALG_CMAC | ||
| select PSA_WANT_ALG_JPAKE if OPENTHREAD_COMMISSIONER_JOINER | ||
| select PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT if OPENTHREAD_COMMISSIONER_JOINER || \ | ||
| OPENTHREAD_ECDSA | ||
| select PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_EXPORT if OPENTHREAD_COMMISSIONER_JOINER || \ | ||
| OPENTHREAD_ECDSA | ||
| select PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_GENERATE if OPENTHREAD_COMMISSIONER_JOINER || \ | ||
|
Contributor
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. Isn't this needed for SRP as well?
Contributor
Author
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. TBH I don't know the details of the protocol, but based on the previous requirement on the secp256r1 curve might be so. However this problem is arguably preexisting since ECP wasn't enabled for SRP.
Contributor
Author
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. I added an initial fix up commit to address this |
||
| OPENTHREAD_ECDSA | ||
| select PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_DERIVE if OPENTHREAD_COMMISSIONER_JOINER || \ | ||
| OPENTHREAD_ECDSA | ||
| select PSA_WANT_ECC_SECP_R1_256 if OPENTHREAD_COMMISSIONER_JOINER || \ | ||
| OPENTHREAD_SRP | ||
| select PSA_WANT_ALG_ECDSA if OPENTHREAD_ECDSA | ||
| select PSA_WANT_ALG_DETERMINISTIC_ECDSA if OPENTHREAD_ECDSA | ||
| select PSA_WANT_ALG_ECDH if OPENTHREAD_ECDSA | ||
| select PSA_WANT_ALG_TLS12_PRF if OPENTHREAD_COMMISSIONER_JOINER | ||
| select PSA_WANT_ALG_TLS12_ECJPAKE_TO_PMS if OPENTHREAD_COMMISSIONER_JOINER | ||
| select PSA_WANT_ALG_HKDF if OPENTHREAD_TREL | ||
| select PSA_WANT_ALG_HKDF_EXTRACT if OPENTHREAD_TREL | ||
| select PSA_WANT_ALG_HKDF_EXPAND if OPENTHREAD_TREL | ||
|
|
||
| config OPENTHREAD_CRYPTO_LEGACY_MBEDTLS_CONFIG | ||
| bool | ||
| default y if !OPENTHREAD_CRYPTO_PSA | ||
| select MBEDTLS_CIPHER_AES_ENABLED | ||
| select MBEDTLS_CIPHER_CCM_ENABLED | ||
| select MBEDTLS_SHA256 | ||
| select MBEDTLS_ENTROPY_C | ||
| select MBEDTLS_CMAC | ||
| select MBEDTLS_CIPHER | ||
| select MBEDTLS_MD_C | ||
| select MBEDTLS_SSL_PROTO_TLS1_2 if OPENTHREAD_COMMISSIONER || OPENTHREAD_JOINER | ||
| select MBEDTLS_SSL_PROTO_DTLS if OPENTHREAD_COMMISSIONER || OPENTHREAD_JOINER | ||
| select MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED if OPENTHREAD_COMMISSIONER || OPENTHREAD_JOINER | ||
| select MBEDTLS_ECJPAKE_C if OPENTHREAD_COMMISSIONER || OPENTHREAD_JOINER | ||
| select MBEDTLS_ECP_DP_SECP256R1_ENABLED if OPENTHREAD_COMMISSIONER || OPENTHREAD_JOINER || \ | ||
| OPENTHREAD_SRP_CLIENT || OPENTHREAD_SRP_SERVER | ||
| select MBEDTLS_ECP_NIST_OPTIM if OPENTHREAD_COMMISSIONER || OPENTHREAD_JOINER | ||
| select MBEDTLS_CTR_DRBG_C if OPENTHREAD_COMMISSIONER || OPENTHREAD_JOINER | ||
| select MBEDTLS_HMAC_DRBG_C if OPENTHREAD_COMMISSIONER || OPENTHREAD_JOINER || \ | ||
| OPENTHREAD_SRP_CLIENT || OPENTHREAD_SRP_SERVER | ||
| select MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED if OPENTHREAD_ECDSA | ||
| select MBEDTLS_ECJPAKE_C if OPENTHREAD_COMMISSIONER_JOINER | ||
| select MBEDTLS_ECP_C if OPENTHREAD_COMMISSIONER_JOINER || OPENTHREAD_ECDSA | ||
| select MBEDTLS_ECP_DP_SECP256R1_ENABLED if OPENTHREAD_COMMISSIONER_JOINER || \ | ||
| OPENTHREAD_SRP | ||
| select MBEDTLS_ECDH_C if OPENTHREAD_ECDSA | ||
| select MBEDTLS_ECDSA_C if OPENTHREAD_ECDSA | ||
| select MBEDTLS_ECDSA_DETERMINISTIC if OPENTHREAD_ECDSA | ||
| select MBEDTLS_ECP_NIST_OPTIM if OPENTHREAD_COMMISSIONER_JOINER | ||
| select MBEDTLS_CTR_DRBG_C if OPENTHREAD_COMMISSIONER_JOINER | ||
| select MBEDTLS_HMAC_DRBG_C if OPENTHREAD_COMMISSIONER_JOINER || \ | ||
| OPENTHREAD_SRP | ||
|
|
||
| config OPENTHREAD_MBEDTLS_TLS_CONFIG | ||
| bool | ||
| default y | ||
| select MBEDTLS | ||
| select MBEDTLS_ENABLE_HEAP | ||
| select MBEDTLS_MD_C | ||
| select MBEDTLS_SSL_PROTO_TLS1_2 if OPENTHREAD_COMMISSIONER_JOINER | ||
| select MBEDTLS_SSL_PROTO_DTLS if OPENTHREAD_COMMISSIONER_JOINER | ||
| select MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED if OPENTHREAD_COMMISSIONER_JOINER | ||
| select MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED if OPENTHREAD_ECDSA | ||
| select MBEDTLS_PK_WRITE_C if OPENTHREAD_ECDSA | ||
| select MBEDTLS_ECP_C if OPENTHREAD_COMMISSIONER || OPENTHREAD_JOINER || OPENTHREAD_ECDSA | ||
| help | ||
| TLS configuration of Mbed TLS. | ||
|
|
||
| endif # OPENTHREAD_SECURITY_DEFAULT_CONFIG | ||
|
|
||
| config OPENTHREAD_MBEDTLS_LIB_NAME | ||
| string "mbedtls lib name" | ||
|
|
@@ -318,15 +369,6 @@ config OPENTHREAD_MAC_SOFTWARE_CSMA_BACKOFF_ENABLE | |
| Set y to enable software CSMA backoff. The option can be disabled if | ||
| the radio has hardware support for this feature (IEEE802154_HW_CSMA). | ||
|
|
||
| config OPENTHREAD_CRYPTO_PSA | ||
| bool "ARM PSA crypto API" | ||
| depends on PSA_CRYPTO_CLIENT | ||
| select OPENTHREAD_PLATFORM_KEY_REF if !OPENTHREAD_COPROCESSOR_RCP | ||
| imply OPENTHREAD_PLATFORM_KEYS_EXPORTABLE_ENABLE | ||
| help | ||
| Enable crypto backend library implementation based on ARM PSA crypto | ||
| API instead of the default, using mbedTLS. | ||
|
|
||
| config OPENTHREAD_PLATFORM_KEYS_EXPORTABLE_ENABLE | ||
| bool "Make MAC keys exportable" | ||
| depends on OPENTHREAD_PLATFORM_KEY_REF | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.