77b1b5693ef3cf763a64dd1574514fa5ee023a6f
[openwrt/staging/linusw.git] /
1 From 637d132b72c9208e086b71fbf39954cff3fb851c 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] 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 @@ -2201,7 +2201,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 (hcon->out) {
34 sc_dhkey_check(smp);
35 SMP_ALLOW_CMD(smp, SMP_CMD_DHKEY_CHECK);
36 @@ -2216,9 +2216,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)