Bluetooth: Update LTK lookup to correctly deal with SC LTKs
authorJohan Hedberg <johan.hedberg@intel.com>
Thu, 29 May 2014 11:00:39 +0000 (14:00 +0300)
committerMarcel Holtmann <marcel@holtmann.org>
Wed, 3 Dec 2014 15:51:16 +0000 (16:51 +0100)
commit5378bc5622a9c221cb472ce86a5024290d6353c2
tree5d7c42e53315e6e04e4648617d722582a2d5a0ce
parenta3209694f82a228c95e5e20f5e31fe63e040f33b
Bluetooth: Update LTK lookup to correctly deal with SC LTKs

LTKs derived from Secure Connections based pairing are symmetric, i.e.
they should match both master and slave role. This patch updates the LTK
lookup functions to ignore the desired role when dealing with SC LTKs.

Furthermore, with Secure Connections the EDiv and Rand values are not
used and should always be set to zero. This patch updates the LTK lookup
to first use the bdaddr as key and then do the necessary verifications
of EDiv and Rand based on whether the found LTK is for SC or not.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
net/bluetooth/hci_core.c
net/bluetooth/hci_event.c