5e3446d6f130b84077d6cf21ab7eb47514b3244c
[openwrt/staging/wigyori.git] /
1 From eaeca896d077e9e42866f7f7caae7b62211a0d0d Mon Sep 17 00:00:00 2001
2 From: Phil Elwell <phil@raspberrypi.com>
3 Date: Mon, 1 Mar 2021 09:12:44 +0000
4 Subject: [PATCH 0058/1085] Revert "Bluetooth: Always request for user
5 confirmation for Just Works (LE SC)"
6
7 This reverts commit ffee202a78c2980688bc5d2f7d56480e69a5e0c9.
8
9 The commit "Bluetooth: Always request for user confirmation for Just
10 Works" prevents BLE devices pairing in (at least) the Raspberry Pi OS
11 GUI. After reverting it, pairing works again. Although this companion
12 commit ("... (LE SC)") has not been demonstrated to be problematic,
13 it follows the same logic and therefore could affect some use cases.
14
15 If another solution to the problem is found then this reversion will
16 be removed.
17
18 See: https://github.com/raspberrypi/linux/issues/4139
19
20 Signed-off-by: Phil Elwell <phil@raspberrypi.com>
21 ---
22 net/bluetooth/smp.c | 5 +----
23 1 file changed, 1 insertion(+), 4 deletions(-)
24
25 --- a/net/bluetooth/smp.c
26 +++ b/net/bluetooth/smp.c
27 @@ -2215,7 +2215,7 @@ mackey_and_ltk:
28 if (err)
29 return SMP_UNSPECIFIED;
30
31 - if (smp->method == REQ_OOB) {
32 + if (smp->method == JUST_WORKS || smp->method == REQ_OOB) {
33 if (test_bit(SMP_FLAG_INITIATOR, &smp->flags)) {
34 sc_dhkey_check(smp);
35 SMP_ALLOW_CMD(smp, SMP_CMD_DHKEY_CHECK);
36 @@ -2230,9 +2230,6 @@ mackey_and_ltk:
37 confirm_hint = 0;
38
39 confirm:
40 - if (smp->method == JUST_WORKS)
41 - confirm_hint = 1;
42 -
43 err = mgmt_user_confirm_request(hcon->hdev, &hcon->dst, hcon->type,
44 hcon->dst_type, passkey, confirm_hint);
45 if (err)