Bluetooth: Fix removing Long Term Key
[deliverable/linux.git] / net / bluetooth / hci_event.c
index c3b0a08f5ab4e8c3e21423a282877e44c89d850e..128e65ac60ae6b0e837811816b152b38a1bda95c 100644 (file)
@@ -3961,7 +3961,13 @@ static void hci_le_ltk_request_evt(struct hci_dev *hdev, struct sk_buff *skb)
 
        hci_send_cmd(hdev, HCI_OP_LE_LTK_REPLY, sizeof(cp), &cp);
 
-       if (ltk->type & HCI_SMP_STK) {
+       /* Ref. Bluetooth Core SPEC pages 1975 and 2004. STK is a
+        * temporary key used to encrypt a connection following
+        * pairing. It is used during the Encrypted Session Setup to
+        * distribute the keys. Later, security can be re-established
+        * using a distributed LTK.
+        */
+       if (ltk->type == HCI_SMP_STK_SLAVE) {
                list_del(&ltk->list);
                kfree(ltk);
        }
This page took 0.025093 seconds and 5 git commands to generate.