Skip to content

Commit

Permalink
Bluetooth: Fix MITM protection requirement preservation
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Johan Hedberg authored and Gustavo F. Padovan committed Jan 19, 2011
1 parent 88644bb commit 65cf686
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions net/bluetooth/hci_conn.c
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,9 @@ static int hci_conn_auth(struct hci_conn *conn, __u8 sec_level, __u8 auth_type)
else if (conn->link_mode & HCI_LM_AUTH)
return 1;

/* Make sure we preserve an existing MITM requirement*/
auth_type |= (conn->auth_type & 0x01);

conn->auth_type = auth_type;

if (!test_and_set_bit(HCI_CONN_AUTH_PEND, &conn->pend)) {
Expand Down

0 comments on commit 65cf686

Please sign in to comment.