-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Bluetooth: Host: Remove HCI ECC emulation #84268
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
Changes from all commits
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 |
|---|---|---|
| @@ -1,5 +1,4 @@ | ||
| CONFIG_LOG_MODE_IMMEDIATE=y | ||
| CONFIG_BT_SEND_ECC_EMULATION=y | ||
|
|
||
| CONFIG_LIBLC3=y | ||
| CONFIG_FPU=y | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,4 @@ | ||
| CONFIG_LOG_MODE_IMMEDIATE=y | ||
| CONFIG_BT_SEND_ECC_EMULATION=y | ||
|
|
||
| CONFIG_LIBLC3=y | ||
| CONFIG_FPU=y | ||
|
|
||
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,4 @@ | ||
| CONFIG_LOG_MODE_IMMEDIATE=y | ||
| CONFIG_BT_SEND_ECC_EMULATION=y | ||
|
|
||
| CONFIG_LIBLC3=y | ||
| CONFIG_FPU=y | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,4 @@ | ||
| CONFIG_LOG_MODE_IMMEDIATE=y | ||
| CONFIG_BT_SEND_ECC_EMULATION=y | ||
|
|
||
| CONFIG_LIBLC3=y | ||
| CONFIG_FPU=y | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,4 @@ | ||
| CONFIG_LOG_MODE_IMMEDIATE=y | ||
| CONFIG_BT_SEND_ECC_EMULATION=y | ||
|
|
||
| CONFIG_LIBLC3=y | ||
| CONFIG_FPU=y | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,4 @@ | ||
| CONFIG_LOG_MODE_IMMEDIATE=y | ||
| CONFIG_BT_SEND_ECC_EMULATION=y | ||
|
|
||
| CONFIG_LIBLC3=y | ||
| CONFIG_FPU=y | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,4 @@ | ||
| CONFIG_LOG_MODE_IMMEDIATE=y | ||
| CONFIG_BT_SEND_ECC_EMULATION=y | ||
|
|
||
| CONFIG_LIBLC3=y | ||
| CONFIG_FPU=y | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,4 @@ | ||
| CONFIG_LOG_MODE_IMMEDIATE=y | ||
| CONFIG_BT_SEND_ECC_EMULATION=y | ||
|
|
||
| CONFIG_LIBLC3=y | ||
| CONFIG_FPU=y | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,4 @@ | ||
| CONFIG_LOG_MODE_IMMEDIATE=y | ||
| CONFIG_BT_SEND_ECC_EMULATION=y | ||
|
|
||
| CONFIG_LIBLC3=y | ||
| CONFIG_FPU=y | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,4 @@ | ||
| CONFIG_LOG_MODE_IMMEDIATE=y | ||
| CONFIG_BT_SEND_ECC_EMULATION=y | ||
|
|
||
| CONFIG_LIBLC3=y | ||
| CONFIG_FPU=y | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -15,7 +15,7 @@ config BT_LONG_WQ_STACK_SIZE | |||||||||||||||||||||||||||||||||
| # Hidden: Long workqueue stack size. Should be derived from system | ||||||||||||||||||||||||||||||||||
| # requirements. | ||||||||||||||||||||||||||||||||||
| int | ||||||||||||||||||||||||||||||||||
| default 1400 if BT_SEND_ECC_EMULATION | ||||||||||||||||||||||||||||||||||
| default 1400 if BT_ECC | ||||||||||||||||||||||||||||||||||
| default 1300 if BT_GATT_CACHING | ||||||||||||||||||||||||||||||||||
| default 1024 | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
|
|
@@ -407,7 +407,7 @@ config BT_SMP | |||||||||||||||||||||||||||||||||
| bool "Security Manager Protocol support" | ||||||||||||||||||||||||||||||||||
| select BT_CRYPTO | ||||||||||||||||||||||||||||||||||
| select BT_RPA | ||||||||||||||||||||||||||||||||||
| select BT_ECC | ||||||||||||||||||||||||||||||||||
| select BT_ECC if !BT_SMP_OOB_LEGACY_PAIR_ONLY | ||||||||||||||||||||||||||||||||||
| help | ||||||||||||||||||||||||||||||||||
| This option enables support for the Security Manager Protocol | ||||||||||||||||||||||||||||||||||
| (SMP), making it possible to pair devices over LE. | ||||||||||||||||||||||||||||||||||
|
|
@@ -991,36 +991,21 @@ config BT_DF_VS_CONN_IQ_REPORT_16_BITS_IQ_SAMPLES | |||||||||||||||||||||||||||||||||
| format. | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| endif # BT_DF | ||||||||||||||||||||||||||||||||||
| endif # BT_HCI_HOST | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| config BT_ECC | ||||||||||||||||||||||||||||||||||
| bool "ECDH key generation support" | ||||||||||||||||||||||||||||||||||
| default y if BT_SMP && !BT_SMP_OOB_LEGACY_PAIR_ONLY | ||||||||||||||||||||||||||||||||||
| help | ||||||||||||||||||||||||||||||||||
| This option adds support for ECDH HCI commands. | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| config BT_SEND_ECC_EMULATION | ||||||||||||||||||||||||||||||||||
| bool "Emulate ECDH in the Host using PSA Crypto API library" | ||||||||||||||||||||||||||||||||||
| bool | ||||||||||||||||||||||||||||||||||
| select MBEDTLS if !BUILD_WITH_TFM | ||||||||||||||||||||||||||||||||||
| select MBEDTLS_PSA_CRYPTO_C if !BUILD_WITH_TFM | ||||||||||||||||||||||||||||||||||
| select PSA_WANT_ALG_ECDH | ||||||||||||||||||||||||||||||||||
| select PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_GENERATE | ||||||||||||||||||||||||||||||||||
|
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.
Suggested change
Missing some required key-pair feature types. Please add these
Member
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. Those are not present in the current tree, and this PR doesn't add any new requirements wrt PSA APIs or functionality, so I'm wondering are they really needed or if something else (by chance) happens to provide them: zephyr/subsys/bluetooth/host/Kconfig Lines 1002 to 1013 in d1d85fa
As such I could argue that this is really a separate enhancement, independent from this PR, so in that sense it could be done as a follow-up as well (once it's first understood why the current upstream tree seems to work just fine without them).
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. It "works just fine" because Mbed TLS has defined some types without enforcing usage. They have been converting to KEY_PAIR_BASIC and made that the thing that is currently being used in code. This "just works" right now when using the original Mbed TLS distribution, but it is preventing optimizations that is possible to do for anyone implementing PSA crypto APIs making use of the intent of these configurations. We make use of these configurations in Nordics own SDK and they are intently added into PSA crypto configurations scope in Zephyr, we are also cooperating with Trusted-Firmware organization (both in TF-M and Mbed TLS) to ensure that build optimizations are part of the final deliverables. These configurations were added for a reason. Adding them here conforms to the intent, similar to how it is done done in BLE mesh We will add a subsequent PR with these configurations added :) |
||||||||||||||||||||||||||||||||||
| select PSA_WANT_ECC_SECP_R1_256 | ||||||||||||||||||||||||||||||||||
| imply MBEDTLS_PSA_P256M_DRIVER_ENABLED if MBEDTLS_PSA_CRYPTO_C | ||||||||||||||||||||||||||||||||||
| select BT_LONG_WQ | ||||||||||||||||||||||||||||||||||
| depends on BT_ECC && (BT_HCI_RAW || BT_HCI_HOST) | ||||||||||||||||||||||||||||||||||
| default y if HAS_BT_CTLR && !BT_CTLR_ECDH | ||||||||||||||||||||||||||||||||||
| help | ||||||||||||||||||||||||||||||||||
| If this option is set PSA Crypto API library is used for emulating the | ||||||||||||||||||||||||||||||||||
| ECDH HCI commands and events needed by e.g. LE Secure Connections. | ||||||||||||||||||||||||||||||||||
| In builds including the BLE Host, if not set the controller crypto is | ||||||||||||||||||||||||||||||||||
| used for ECDH and if the controller doesn't support the required HCI | ||||||||||||||||||||||||||||||||||
| commands the LE Secure Connections support will be disabled. | ||||||||||||||||||||||||||||||||||
| In builds including the HCI Raw interface and the BLE Controller, this | ||||||||||||||||||||||||||||||||||
| option injects support for the 2 HCI commands required for LE Secure | ||||||||||||||||||||||||||||||||||
| Connections so that Hosts can make use of those. The option defaults | ||||||||||||||||||||||||||||||||||
| to enabled for a combined build with Zephyr's own controller, since it | ||||||||||||||||||||||||||||||||||
| does not have any special ECC support itself (at least not currently). | ||||||||||||||||||||||||||||||||||
| help | ||||||||||||||||||||||||||||||||||
| If this option is set, internal APIs will be available to perform ECDH operations | ||||||||||||||||||||||||||||||||||
| through the long work queue. operations needed e.g. by LE Secure Connections. | ||||||||||||||||||||||||||||||||||
jhedberg marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| endif # BT_HCI_HOST | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| config BT_HOST_CCM | ||||||||||||||||||||||||||||||||||
| bool "Host side AES-CCM module" | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.