Skip to content

Commit

Permalink
Bluetooth: SSP: No MITM if required level is less than L3
Browse files Browse the repository at this point in the history
Regardless IO capabilities, clear MITM flag for pairing
initiator if the required security level is less than
BT_SECURITY_L3.

Signed-off-by: Lyle Zhu <[email protected]>
  • Loading branch information
lylezhu2012 authored and henrikbrixandersen committed Oct 16, 2024
1 parent a427497 commit 0e4561b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions subsys/bluetooth/host/classic/ssp.c
Original file line number Diff line number Diff line change
Expand Up @@ -631,6 +631,9 @@ void bt_hci_io_capa_resp(struct net_buf *buf)
/* Clear Bonding flag */
#define BT_HCI_SET_NO_BONDING(auth) ((auth) & 0x01)

/* Clear MITM flag */
#define BT_HCI_SET_NO_MITM(auth) ((auth) & (~0x01))

void bt_hci_io_capa_req(struct net_buf *buf)
{
struct bt_hci_evt_io_capa_req *evt = (void *)buf->data;
Expand Down Expand Up @@ -675,6 +678,11 @@ void bt_hci_io_capa_req(struct net_buf *buf)
auth = BT_HCI_DEDICATED_BONDING;
}
}

if (conn->required_sec_level < BT_SECURITY_L3) {
/* If security level less than L3, clear MITM flag. */
auth = BT_HCI_SET_NO_MITM(auth);
}
} else {
auth = ssp_get_auth(conn);
}
Expand Down

0 comments on commit 0e4561b

Please sign in to comment.