summaryrefslogtreecommitdiffstats
path: root/net/bluetooth
diff options
context:
space:
mode:
authorSonny Sasaka <sonnysasaka@chromium.org>2020-04-06 11:04:02 -0700
committerMarcel Holtmann <marcel@holtmann.org>2020-04-08 22:18:32 +0200
commitffee202a78c2980688bc5d2f7d56480e69a5e0c9 (patch)
tree3c540a5c14936c6bcce8f5a3ded40dac48771295 /net/bluetooth
parentfcd156ee8bc6a989dbf7e5efbccdc9cdb831fd27 (diff)
downloadlinux-ffee202a78c2980688bc5d2f7d56480e69a5e0c9.tar.gz
linux-ffee202a78c2980688bc5d2f7d56480e69a5e0c9.tar.bz2
linux-ffee202a78c2980688bc5d2f7d56480e69a5e0c9.zip
Bluetooth: Always request for user confirmation for Just Works (LE SC)
To improve security, always give the user-space daemon a chance to accept or reject a Just Works pairing (LE). The daemon may decide to auto-accept based on the user's intent. This patch is similar to the previous patch but applies for LE Secure Connections (SC). Signed-off-by: Sonny Sasaka <sonnysasaka@chromium.org> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth')
-rw-r--r--net/bluetooth/smp.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c
index daf198fb2b31..df22cbf94693 100644
--- a/net/bluetooth/smp.c
+++ b/net/bluetooth/smp.c
@@ -2201,7 +2201,7 @@ mackey_and_ltk:
if (err)
return SMP_UNSPECIFIED;
- if (smp->method == JUST_WORKS || smp->method == REQ_OOB) {
+ if (smp->method == REQ_OOB) {
if (hcon->out) {
sc_dhkey_check(smp);
SMP_ALLOW_CMD(smp, SMP_CMD_DHKEY_CHECK);
@@ -2216,6 +2216,9 @@ mackey_and_ltk:
confirm_hint = 0;
confirm:
+ if (smp->method == JUST_WORKS)
+ confirm_hint = 1;
+
err = mgmt_user_confirm_request(hcon->hdev, &hcon->dst, hcon->type,
hcon->dst_type, passkey, confirm_hint);
if (err)