mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-12 13:34:10 +08:00
Bluetooth: Fix MITM flag when initiating SMP pairing
The pairing process initiated through mgmt sets the conn->auth_type value regardless of BR/EDR or LE pairing. This value will contain the MITM flag if the local IO capability allows it. When sending the SMP pairing request we should check the value and ensure that the MITM bit gets correctly set in the bonding flags. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
This commit is contained in:
parent
943a732ab6
commit
2e2336445e
@ -909,6 +909,12 @@ int smp_conn_security(struct hci_conn *hcon, __u8 sec_level)
|
|||||||
|
|
||||||
authreq = seclevel_to_authreq(sec_level);
|
authreq = seclevel_to_authreq(sec_level);
|
||||||
|
|
||||||
|
/* hcon->auth_type is set by pair_device in mgmt.c. If the MITM
|
||||||
|
* flag is set we should also set it for the SMP request.
|
||||||
|
*/
|
||||||
|
if ((hcon->auth_type & 0x01))
|
||||||
|
authreq |= SMP_AUTH_MITM;
|
||||||
|
|
||||||
if (hcon->link_mode & HCI_LM_MASTER) {
|
if (hcon->link_mode & HCI_LM_MASTER) {
|
||||||
struct smp_cmd_pairing cp;
|
struct smp_cmd_pairing cp;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user