9541eb149f457db09da100a4986c50c2d3f9926b
[openwrt/staging/neocturne.git] /
1 From b99d91f044ff9360ac03ce7d27eb6aead6cd2d42 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 @@ -2207,7 +2207,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 @@ -2222,9 +2222,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)