diff options
Diffstat (limited to 'net/bluetooth/smp.c')
-rw-r--r-- | net/bluetooth/smp.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c index 4f9662d0fd81..3d1cc164557d 100644 --- a/net/bluetooth/smp.c +++ b/net/bluetooth/smp.c | |||
@@ -909,10 +909,11 @@ 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 | 912 | /* Require MITM if IO Capability allows or the security level |
913 | * flag is set we should also set it for the SMP request. | 913 | * requires it. |
914 | */ | 914 | */ |
915 | if ((hcon->auth_type & 0x01)) | 915 | if (hcon->io_capability != HCI_IO_NO_INPUT_OUTPUT || |
916 | sec_level > BT_SECURITY_MEDIUM) | ||
916 | authreq |= SMP_AUTH_MITM; | 917 | authreq |= SMP_AUTH_MITM; |
917 | 918 | ||
918 | if (hcon->link_mode & HCI_LM_MASTER) { | 919 | if (hcon->link_mode & HCI_LM_MASTER) { |