aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth/hci_event.c
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2014-01-30 22:40:00 -0500
committerJohan Hedberg <johan.hedberg@intel.com>2014-02-13 02:51:41 -0500
commit98a0b845c63cb74e90a72d1e864ea4be968bdd83 (patch)
tree464a1121e17e527de1abcc17a425e4e74b366079 /net/bluetooth/hci_event.c
parenta513e260ce25eaa5e8c6b834a70085be1d6f40c0 (diff)
Bluetooth: Fix differentiating stored master vs slave LTK types
If LTK distribution happens in both directions we will have two LTKs for the same remote device: one which is used when we're connecting as master and another when we're connecting as slave. When looking up LTKs from the locally stored list we shouldn't blindly return the first match but also consider which type of key is in question. If we do not do this we may end up selecting an incorrect encryption key for a connection. This patch fixes the issue by always specifying to the LTK lookup functions whether we're looking for a master or a slave key. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth/hci_event.c')
-rw-r--r--net/bluetooth/hci_event.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index 8c44bbe19add..7bb8094a3ff2 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -3650,7 +3650,7 @@ static void hci_le_ltk_request_evt(struct hci_dev *hdev, struct sk_buff *skb)
3650 if (conn == NULL) 3650 if (conn == NULL)
3651 goto not_found; 3651 goto not_found;
3652 3652
3653 ltk = hci_find_ltk(hdev, ev->ediv, ev->random); 3653 ltk = hci_find_ltk(hdev, ev->ediv, ev->random, conn->out);
3654 if (ltk == NULL) 3654 if (ltk == NULL)
3655 goto not_found; 3655 goto not_found;
3656 3656