From d43f4c27d03c6063ff7ed5d24e4bf7891ca234bc Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Fri, 22 Jul 2016 09:54:12 +0300 Subject: [PATCH] Bluetooth: Remove conn & SMP dependency from BLUETOOTH_TINYCRYPT_ECC Ever since we expose ECDH as a more generic API that's not bound to SMP we shouldn't be requiring selcting SMP in the configuration for it to be available. Move it outside of the BLUETOOTH_SMP and BLUETOOTH_CONN dependencies. Change-Id: I4ac15ff92b1d4fcf3061a487718d364aa7d43bc8 Signed-off-by: Johan Hedberg --- net/bluetooth/Kconfig | 23 ++++++++++++----------- net/bluetooth/Makefile | 3 ++- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/net/bluetooth/Kconfig b/net/bluetooth/Kconfig index 46d84bc4f5e..a361b0567b1 100644 --- a/net/bluetooth/Kconfig +++ b/net/bluetooth/Kconfig @@ -208,17 +208,6 @@ config BLUETOOTH_SMP_SC_ONLY Security Mode 1 Level 4 stands for authenticated LE Secure Connections pairing with encryption. Enabling this option disables legacy pairing. -config BLUETOOTH_TINYCRYPT_ECC - bool "Use TinyCrypt library for LE SC ECDH" - default n - select TINYCRYPT_ECC_DH - depends on MICROKERNEL - help - If this option is set TinyCrypt library is also used for LE Secure - Connections elliptic curve Diffie-Hellman key agreement. If not set - controller crypto is used for ECDH and if controller doesn't support - required HCI commands LE Secure Connections support will be disabled. - config BLUETOOTH_USE_DEBUG_KEYS bool "Enable Security Manager Debug Mode" default n @@ -270,6 +259,18 @@ config BLUETOOTH_MAX_PAIRED endif # BLUETOOTH_CONN +config BLUETOOTH_TINYCRYPT_ECC + bool "Use TinyCrypt library for ECDH" + default n + select TINYCRYPT_ECC_DH + depends on MICROKERNEL + help + If this option is set TinyCrypt library is used for emulating the + ECDH HCI commands and events needed by e.g. LE Secure Connections. + If not set controller crypto is used for ECDH and if + controller doesn't support required HCI commands LE Secure + Connections support will be disabled. + endif # BLUETOOTH_LE config BLUETOOTH_DEBUG diff --git a/net/bluetooth/Makefile b/net/bluetooth/Makefile index 3a5b4d7439b..393974a5ea3 100644 --- a/net/bluetooth/Makefile +++ b/net/bluetooth/Makefile @@ -8,6 +8,8 @@ obj-$(CONFIG_BLUETOOTH_DEBUG) += log.o obj-$(CONFIG_BLUETOOTH_DEBUG_MONITOR) += monitor.o +obj-$(CONFIG_BLUETOOTH_TINYCRYPT_ECC) += hci_ecc.o + ifeq ($(CONFIG_BLUETOOTH_CONN),y) obj-y += conn.o \ l2cap.o \ @@ -21,6 +23,5 @@ ifeq ($(CONFIG_BLUETOOTH_CONN),y) obj-y += smp_null.o endif - obj-$(CONFIG_BLUETOOTH_TINYCRYPT_ECC) += hci_ecc.o obj-$(CONFIG_BLUETOOTH_BREDR) += keys.o l2cap_br.o endif