input: encrypt on receive conn req if classic_bonded_only
authorArchie Pusaka <apusaka@chromium.org>
Wed, 22 Jul 2020 16:20:33 +0000 (00:20 +0800)
committerAyush Garg <ayush.garg@samsung.com>
Mon, 12 Apr 2021 09:00:50 +0000 (14:30 +0530)
commitd26409a78c1a29b3fbb2eb95471c38aab9c44d4a
treebeb57b6cce1a9b1862a387d843eb72c850fcd84e
parentae186be8d92c5a8067359be1ef8c8038c4de5db6
input: encrypt on receive conn req if classic_bonded_only

According to bluetooth HID1.1 spec, section 5.4.3.5.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 Response with a result code of “Connection Successful”
(0x0000) after an L2CAP Connect Request is received.

This patch raises the security level to medium when listening for
incoming connection if the flag classic_bonded_only is set,
effectively starting encryption.

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