Bluetooth: Request MITM Protection when initiator
authorMikel Astiz <mikel.astiz@bmw-carit.de>
Tue, 8 Apr 2014 12:21:34 +0000 (14:21 +0200)
committerJohan Hedberg <johan.hedberg@intel.com>
Fri, 11 Apr 2014 17:33:08 +0000 (10:33 -0700)
commitb16c6604885841e1b7d2eb09a3256bf6d3d4bc8a
tree6d8c56effc2220662e13ed567dfa374e61dcc349
parent7e74170af1fd5f09fb176759c1d0c0024548c057
Bluetooth: Request MITM Protection when initiator

The GAP Specification gives the flexibility to decide whether MITM
Protection is requested or not (Bluetooth Core Specification v4.0
Volume 3, part C, section 6.5.3) when replying to an
HCI_EV_IO_CAPA_REQUEST event.

The recommendation is *not* to set this flag "unless the security
policy of an available local service requires MITM Protection"
(regardless of the bonding type). However, the kernel doesn't
necessarily have this information and therefore the safest choice is
to always use MITM Protection, also for General Bonding.

This patch changes the behavior for the General Bonding initiator
role, always requesting MITM Protection even if no high security level
is used. Depending on the remote capabilities, the protection might
not be actually used, and we will accept this locally unless of course
a high security level was originally required.

Note that this was already done for Dedicated Bonding. No-Bonding is
left unmodified because MITM Protection is normally not desired in
these cases.

Signed-off-by: Mikel Astiz <mikel.astiz@bmw-carit.de>
Signed-off-by: Timo Mueller <timo.mueller@bmw-carit.de>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
net/bluetooth/hci_event.c