Bluetooth: Re-encrypt link after receiving an LTK
authorJohan Hedberg <johan.hedberg@intel.com>
Fri, 28 Feb 2014 16:10:02 +0000 (18:10 +0200)
committerMarcel Holtmann <marcel@holtmann.org>
Fri, 28 Feb 2014 16:17:46 +0000 (08:17 -0800)
commit38ccdc93326f61b84734028e586ed522a53b733a
tree98353cfea0cd3e34c7beb6df3b5227481742f01a
parent9489eca4ab2fd5d9bbf3bab992168cc8107fc3e9
Bluetooth: Re-encrypt link after receiving an LTK

It's not strictly speaking required to re-encrypt a link once we receive
an LTK since the connection is already encrypted with the STK. However,
re-encrypting with the LTK allows us to verify that we've received an
LTK that actually works.

This patch updates the SMP code to request encrypting with the LTK in
case we're in master role and waits until the key refresh complete event
before notifying user space of the distributed keys.

A new flag is also added for the SMP context to ensure that we
re-encryption only once in case of multiple calls to smp_distribute_keys.

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