aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2014-03-24 08:39:07 -0400
committerMarcel Holtmann <marcel@holtmann.org>2014-03-24 10:51:56 -0400
commita82505c7bcbc1f8cce28d092aba01f62c7b85fa3 (patch)
treece2807d5ec429c24ccf693c0f6c85e1ed7b8a9fe /net
parentedca792c036f48b15ee4d70045fb6722e8797281 (diff)
Bluetooth: Don't try to confirm locally initiated SMP pairing
In the case that the just-works model would be triggered we only want to confirm remotely initiated pairings (i.e. those triggered by a Security Request or Pairing Request). This patch adds the necessary check to the tk_request function to fall back to the JUST_WORKS method in the case of a locally initiated pairing. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net')
-rw-r--r--net/bluetooth/smp.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c
index 1b28f5fd798f..b952041bf4ac 100644
--- a/net/bluetooth/smp.c
+++ b/net/bluetooth/smp.c
@@ -387,6 +387,11 @@ static int tk_request(struct l2cap_conn *conn, u8 remote_oob, u8 auth,
387 if (!(auth & SMP_AUTH_BONDING) && method == JUST_CFM) 387 if (!(auth & SMP_AUTH_BONDING) && method == JUST_CFM)
388 method = JUST_WORKS; 388 method = JUST_WORKS;
389 389
390 /* Don't confirm locally initiated pairing attempts */
391 if (method == JUST_CFM && test_bit(SMP_FLAG_INITIATOR,
392 &smp->smp_flags))
393 method = JUST_WORKS;
394
390 /* If Just Works, Continue with Zero TK */ 395 /* If Just Works, Continue with Zero TK */
391 if (method == JUST_WORKS) { 396 if (method == JUST_WORKS) {
392 set_bit(SMP_FLAG_TK_VALID, &smp->smp_flags); 397 set_bit(SMP_FLAG_TK_VALID, &smp->smp_flags);