From b944c0bd653c5f1acde98ef53455c56cabd148c3 Mon Sep 17 00:00:00 2001 From: Szymon Janc Date: Wed, 3 Aug 2016 12:49:58 +0200 Subject: [PATCH] Revert "Bluetooth: SMP: Workaround LE SC bug in iOS" This reverts commit 15c1fed5b65cf51a92b270b0353a039f2512e314. This workaround is no longer needed as it was verified that pairing succeed without it. Also I'm no longer sure if initial pairing issue was due to missing bit in key distirbution field or if it was due to iOS already had device with this address paired (ie removing device bonding from settings application fix the problem). Change-Id: I6d69b9afb04afc83139d57d2dffe1b62d40afe5b Signed-off-by: Szymon Janc --- net/bluetooth/smp.c | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c index c0d09b381c2..88ae04f825e 100644 --- a/net/bluetooth/smp.c +++ b/net/bluetooth/smp.c @@ -70,12 +70,8 @@ #define SEND_KEYS (BT_SMP_DIST_ENC_KEY | SIGN_DIST) #endif -/* - * Don't include BT_SMP_DIST_ENC_KEY in this mask. See comment in - * bt_smp_encrypt_change for details. - */ -#define RECV_KEYS_SC (RECV_KEYS & ~(BT_SMP_DIST_LINK_KEY)) -#define SEND_KEYS_SC (SEND_KEYS & ~(BT_SMP_DIST_LINK_KEY)) +#define RECV_KEYS_SC (RECV_KEYS & ~(BT_SMP_DIST_ENC_KEY | BT_SMP_DIST_LINK_KEY)) +#define SEND_KEYS_SC (SEND_KEYS & ~(BT_SMP_DIST_ENC_KEY | BT_SMP_DIST_LINK_KEY)) #define BT_SMP_AUTH_MASK 0x07 #define BT_SMP_AUTH_MASK_SC 0x0f @@ -2661,18 +2657,6 @@ static void bt_smp_encrypt_change(struct bt_l2cap_chan *chan) return; } - /* - * Clear EncKey bit for LE SC. This is legacy key and should not be - * distributed when LE SC is used. We don't clean it initially to - * workaround bug in iOS BT stack where it sends Pairing Failed PDU - * if any (?) keys were distributed but EncKey was not set in key - * distribution. - */ - if (atomic_test_bit(smp->flags, SMP_FLAG_SC)) { - smp->local_dist &= ~BT_SMP_DIST_ENC_KEY; - smp->remote_dist &= ~BT_SMP_DIST_ENC_KEY; - } - if (smp->remote_dist & BT_SMP_DIST_ENC_KEY) { atomic_set_bit(&smp->allowed_cmds, BT_SMP_CMD_ENCRYPT_INFO); } else if (smp->remote_dist & BT_SMP_DIST_ID_KEY) {