aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2014-06-06 03:39:56 -0400
committerMarcel Holtmann <marcel@holtmann.org>2014-12-03 10:51:16 -0500
commitdf8e1a4c7339f6447e75430e7c8172deddb489a9 (patch)
tree32fdad023662184ee3b098da31055e1021837548 /net/bluetooth
parentf3a73d97b3b78584e111478d07dfd063453f112e (diff)
Bluetooth: Set link key generation bit if necessary for LE SC
Depending on whether Secure Connections is enabled or not we may need to add the link key generation bit to the key distribution. This patch does the necessary modifications to the build_pairing_cmd() function. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth')
-rw-r--r--net/bluetooth/smp.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c
index 0973e37073e2..d993d7d4fcc8 100644
--- a/net/bluetooth/smp.c
+++ b/net/bluetooth/smp.c
@@ -333,6 +333,16 @@ static void build_pairing_cmd(struct l2cap_conn *conn,
333 if (test_bit(HCI_PRIVACY, &hdev->dev_flags)) 333 if (test_bit(HCI_PRIVACY, &hdev->dev_flags))
334 local_dist |= SMP_DIST_ID_KEY; 334 local_dist |= SMP_DIST_ID_KEY;
335 335
336 if (test_bit(HCI_SC_ENABLED, &hdev->dev_flags)) {
337 if ((authreq & SMP_AUTH_SC) &&
338 test_bit(HCI_SSP_ENABLED, &hdev->dev_flags)) {
339 local_dist |= SMP_DIST_LINK_KEY;
340 remote_dist |= SMP_DIST_LINK_KEY;
341 }
342 } else {
343 authreq &= ~SMP_AUTH_SC;
344 }
345
336 if (rsp == NULL) { 346 if (rsp == NULL) {
337 req->io_capability = conn->hcon->io_capability; 347 req->io_capability = conn->hcon->io_capability;
338 req->oob_flag = SMP_OOB_NOT_PRESENT; 348 req->oob_flag = SMP_OOB_NOT_PRESENT;