diff options
author | Johan Hedberg <johan.hedberg@nokia.com> | 2011-01-19 01:36:49 -0500 |
---|---|---|
committer | Gustavo F. Padovan <padovan@profusion.mobi> | 2011-01-19 11:40:43 -0500 |
commit | 65cf686ee102b7eb0477a4bab82ff227071a0258 (patch) | |
tree | e710dde434f53139dd11b9d61d5a0c33f17f1e3a /net | |
parent | 88644bb9fee591b2743a881923263bc28df4cded (diff) |
Bluetooth: Fix MITM protection requirement preservation
If an existing connection has a MITM protection requirement (the first
bit of the auth_type) then that requirement should not be cleared by new
sockets that reuse the ACL but don't have that requirement.
Signed-off-by: Johan Hedberg <johan.hedberg@nokia.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Diffstat (limited to 'net')
-rw-r--r-- | net/bluetooth/hci_conn.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c index 65a3fb5678eb..fe712a89a856 100644 --- a/net/bluetooth/hci_conn.c +++ b/net/bluetooth/hci_conn.c | |||
@@ -442,6 +442,9 @@ static int hci_conn_auth(struct hci_conn *conn, __u8 sec_level, __u8 auth_type) | |||
442 | else if (conn->link_mode & HCI_LM_AUTH) | 442 | else if (conn->link_mode & HCI_LM_AUTH) |
443 | return 1; | 443 | return 1; |
444 | 444 | ||
445 | /* Make sure we preserve an existing MITM requirement*/ | ||
446 | auth_type |= (conn->auth_type & 0x01); | ||
447 | |||
445 | conn->auth_type = auth_type; | 448 | conn->auth_type = auth_type; |
446 | 449 | ||
447 | if (!test_and_set_bit(HCI_CONN_AUTH_PEND, &conn->pend)) { | 450 | if (!test_and_set_bit(HCI_CONN_AUTH_PEND, &conn->pend)) { |