diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2014-01-31 16:24:28 -0800 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2014-02-13 09:51:42 +0200 |
commit | abf76bad8fb503fb21fb0eba854fa048c75ff123 (patch) | |
tree | 24988d3bc5021d20380c16e09e104e04f62a7961 /net/bluetooth/hci_event.c | |
parent | dc8357cc72976f2fbe955e2ad4bba9e0e8ba5022 (diff) | |
download | linux-abf76bad8fb503fb21fb0eba854fa048c75ff123.tar.bz2 |
Bluetooth: Track the AES-CCM encryption status of LE and BR/EDR links
When encryption for LE links has been enabled, it will always be use
AES-CCM encryption. In case of BR/EDR Secure Connections, the link
will also use AES-CCM encryption. In both cases track the AES-CCM
status in the connection flags.
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Diffstat (limited to 'net/bluetooth/hci_event.c')
-rw-r--r-- | net/bluetooth/hci_event.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c index 62aea2edc231..36c9a488ac56 100644 --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c @@ -1997,8 +1997,14 @@ static void hci_encrypt_change_evt(struct hci_dev *hdev, struct sk_buff *skb) conn->link_mode |= HCI_LM_AUTH; conn->link_mode |= HCI_LM_ENCRYPT; conn->sec_level = conn->pending_sec_level; - } else + + if ((conn->type == ACL_LINK && ev->encrypt == 0x02) || + conn->type == LE_LINK) + set_bit(HCI_CONN_AES_CCM, &conn->flags); + } else { conn->link_mode &= ~HCI_LM_ENCRYPT; + clear_bit(HCI_CONN_AES_CCM, &conn->flags); + } } clear_bit(HCI_CONN_ENCRYPT_PEND, &conn->flags); |