aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2014-03-18 09:42:30 -0400
committerMarcel Holtmann <marcel@holtmann.org>2014-03-18 13:18:26 -0400
commit2e2336445e696805b40d6a13cf25f26d49e20069 (patch)
treee248d860b6ed117a674d113e3e1b5d636aa07d62 /net/bluetooth
parent943a732ab6440f4edbccd8cd9044a588b35059a0 (diff)
Bluetooth: Fix MITM flag when initiating SMP pairing
The pairing process initiated through mgmt sets the conn->auth_type value regardless of BR/EDR or LE pairing. This value will contain the MITM flag if the local IO capability allows it. When sending the SMP pairing request we should check the value and ensure that the MITM bit gets correctly set in the bonding flags. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth')
-rw-r--r--net/bluetooth/smp.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c
index 6f29430c29c4..a0150033e797 100644
--- a/net/bluetooth/smp.c
+++ b/net/bluetooth/smp.c
@@ -909,6 +909,12 @@ int smp_conn_security(struct hci_conn *hcon, __u8 sec_level)
909 909
910 authreq = seclevel_to_authreq(sec_level); 910 authreq = seclevel_to_authreq(sec_level);
911 911
912 /* hcon->auth_type is set by pair_device in mgmt.c. If the MITM
913 * flag is set we should also set it for the SMP request.
914 */
915 if ((hcon->auth_type & 0x01))
916 authreq |= SMP_AUTH_MITM;
917
912 if (hcon->link_mode & HCI_LM_MASTER) { 918 if (hcon->link_mode & HCI_LM_MASTER) {
913 struct smp_cmd_pairing cp; 919 struct smp_cmd_pairing cp;
914 920