aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorVinicius Costa Gomes <vinicius.gomes@openbossa.org>2011-09-02 13:51:20 -0400
committerGustavo F. Padovan <padovan@profusion.mobi>2011-09-21 11:58:12 -0400
commite9bf2bf03e14627fac8520468231ea11dfa37610 (patch)
tree4f0b5949919271fff82ecd68659485c511131e5b /net
parent8aab47574a7f5b46a4cdbc6fd820ab34e6c5dbf9 (diff)
Bluetooth: Require authentication if MITM protection is requested
The HIGH security level requires a 16 digit pin code for non-SSP bondings. Sometimes this requirement is not acceptable and we still want protection againts MITM attacks (which is something that the MEDIUM security level doesn't provide), for that we should allow another way to request authentication without using the HIGH security level. Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@openbossa.org> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Diffstat (limited to 'net')
-rw-r--r--net/bluetooth/hci_event.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index e54d08222605..fd6eea0941b6 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -1103,9 +1103,10 @@ static int hci_outgoing_auth_needed(struct hci_dev *hdev,
1103 return 0; 1103 return 0;
1104 1104
1105 /* Only request authentication for SSP connections or non-SSP 1105 /* Only request authentication for SSP connections or non-SSP
1106 * devices with sec_level HIGH */ 1106 * devices with sec_level HIGH or if MITM protection is requested */
1107 if (!(hdev->ssp_mode > 0 && conn->ssp_mode > 0) && 1107 if (!(hdev->ssp_mode > 0 && conn->ssp_mode > 0) &&
1108 conn->pending_sec_level != BT_SECURITY_HIGH) 1108 conn->pending_sec_level != BT_SECURITY_HIGH &&
1109 !(conn->auth_type & 0x01))
1109 return 0; 1110 return 0;
1110 1111
1111 return 1; 1112 return 1;