input: authenticate when connecting to a bonded device
authorArchie Pusaka <apusaka@chromium.org>
Wed, 22 Jul 2020 16:20:32 +0000 (00:20 +0800)
committerAyush Garg <ayush.garg@samsung.com>
Mon, 12 Apr 2021 09:00:50 +0000 (14:30 +0530)
commitae186be8d92c5a8067359be1ef8c8038c4de5db6
treeb0869723f2c40b34ffaa35acfd99d866e3ec232b
parentadf2be0a00bcf2b0e3c7cd02e8e30853e6f07408
input: authenticate when connecting to a bonded device

According to bluetooth HID1.1 spec, part 5.4.3.4.3:
If the Bluetooth HID Host is bonded to a Bluetooth HID device:
If encryption is not already enabled, the Bluetooth HID Host shall
enable encryption with the Bluetooth HID device before sending an
L2CAP Connect Request to open the HID L2CAP Control channel.

When creating connection, this patch checks whether the target
device is bonded, if yes then we use the medium security level
instead of the low one to enable encryption.

Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
profiles/input/device.c