Bluetooth: Respect local MITM req in io_cap reply
authorWaldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com>
Thu, 28 Apr 2011 10:07:58 +0000 (12:07 +0200)
committerGustavo F. Padovan <padovan@profusion.mobi>
Thu, 28 Apr 2011 18:03:50 +0000 (15:03 -0300)
If host requires MITM protection notify that to controller in
io capabilities reply even if the remote device requires no bonding.

If it is not respected, host can get an unauthenticated link key while
it expects authenticated one.

Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
net/bluetooth/hci_event.c

index 40e96cd79e4a661bd7866c4e782fda075cdbc50e..9d50e90993ca0637b50d5e95bdb91c377eee7816 100644 (file)
@@ -2397,7 +2397,7 @@ static inline u8 hci_get_auth_req(struct hci_conn *conn)
 
        /* If remote requests no-bonding follow that lead */
        if (conn->remote_auth == 0x00 || conn->remote_auth == 0x01)
-               return 0x00;
+               return conn->remote_auth | (conn->auth_type & 0x01);
 
        return conn->auth_type;
 }