aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth/hci_conn.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2014-01-10 05:07:20 -0500
committerJohan Hedberg <johan.hedberg@intel.com>2014-02-13 02:51:32 -0500
commit66138ce8e556a8ddd13baf035fb3a8d0d6dd4bb5 (patch)
tree5dcdef78aab54e79b4ff115fd2a4eae2cdc29837 /net/bluetooth/hci_conn.c
parent11015c7903c74350402f8753339c48bee0186e90 (diff)
Bluetooth: Add support for handling P-256 derived link keys
Before being able to enable Secure Connections support, the core needs to know on how to handle P-256 derived link keys. The difference between authenticated and unauthenticated P-256 derived link keys is the same as its P-192 counter parts. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Diffstat (limited to 'net/bluetooth/hci_conn.c')
-rw-r--r--net/bluetooth/hci_conn.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
index 251f22e32fbf..cf96b3438a91 100644
--- a/net/bluetooth/hci_conn.c
+++ b/net/bluetooth/hci_conn.c
@@ -802,12 +802,14 @@ int hci_conn_security(struct hci_conn *conn, __u8 sec_level, __u8 auth_type)
802 802
803 /* An authenticated combination key has sufficient security for any 803 /* An authenticated combination key has sufficient security for any
804 security level. */ 804 security level. */
805 if (conn->key_type == HCI_LK_AUTH_COMBINATION_P192) 805 if (conn->key_type == HCI_LK_AUTH_COMBINATION_P192 ||
806 conn->key_type == HCI_LK_AUTH_COMBINATION_P256)
806 goto encrypt; 807 goto encrypt;
807 808
808 /* An unauthenticated combination key has sufficient security for 809 /* An unauthenticated combination key has sufficient security for
809 security level 1 and 2. */ 810 security level 1 and 2. */
810 if (conn->key_type == HCI_LK_UNAUTH_COMBINATION_P192 && 811 if ((conn->key_type == HCI_LK_UNAUTH_COMBINATION_P192 ||
812 conn->key_type == HCI_LK_UNAUTH_COMBINATION_P256) &&
811 (sec_level == BT_SECURITY_MEDIUM || sec_level == BT_SECURITY_LOW)) 813 (sec_level == BT_SECURITY_MEDIUM || sec_level == BT_SECURITY_LOW))
812 goto encrypt; 814 goto encrypt;
813 815