aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/bluetooth/hci_event.c14
-rw-r--r--net/bluetooth/mgmt.c5
2 files changed, 9 insertions, 10 deletions
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index 08016683e8aa..2c097322b126 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -3471,6 +3471,11 @@ static void hci_io_capa_request_evt(struct hci_dev *hdev, struct sk_buff *skb)
3471 /* If we are initiators, there is no remote information yet */ 3471 /* If we are initiators, there is no remote information yet */
3472 if (conn->remote_auth == 0xff) { 3472 if (conn->remote_auth == 0xff) {
3473 cp.authentication = conn->auth_type; 3473 cp.authentication = conn->auth_type;
3474
3475 /* Use MITM protection for outgoing dedicated bonding */
3476 if (conn->io_capability != HCI_IO_NO_INPUT_OUTPUT &&
3477 cp.authentication == HCI_AT_DEDICATED_BONDING)
3478 cp.authentication |= 0x01;
3474 } else { 3479 } else {
3475 conn->auth_type = hci_get_auth_req(conn); 3480 conn->auth_type = hci_get_auth_req(conn);
3476 cp.authentication = conn->auth_type; 3481 cp.authentication = conn->auth_type;
@@ -3542,12 +3547,9 @@ static void hci_user_confirm_request_evt(struct hci_dev *hdev,
3542 rem_mitm = (conn->remote_auth & 0x01); 3547 rem_mitm = (conn->remote_auth & 0x01);
3543 3548
3544 /* If we require MITM but the remote device can't provide that 3549 /* If we require MITM but the remote device can't provide that
3545 * (it has NoInputNoOutput) then reject the confirmation 3550 * (it has NoInputNoOutput) then reject the confirmation request
3546 * request. The only exception is when we're dedicated bonding 3551 */
3547 * initiators (connect_cfm_cb set) since then we always have the MITM 3552 if (loc_mitm && conn->remote_cap == HCI_IO_NO_INPUT_OUTPUT) {
3548 * bit set. */
3549 if (!conn->connect_cfm_cb && loc_mitm &&
3550 conn->remote_cap == HCI_IO_NO_INPUT_OUTPUT) {
3551 BT_DBG("Rejecting request: remote device can't provide MITM"); 3553 BT_DBG("Rejecting request: remote device can't provide MITM");
3552 hci_send_cmd(hdev, HCI_OP_USER_CONFIRM_NEG_REPLY, 3554 hci_send_cmd(hdev, HCI_OP_USER_CONFIRM_NEG_REPLY,
3553 sizeof(ev->bdaddr), &ev->bdaddr); 3555 sizeof(ev->bdaddr), &ev->bdaddr);
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index 11cb00a2befb..54abbce3a39e 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -2850,10 +2850,7 @@ static int pair_device(struct sock *sk, struct hci_dev *hdev, void *data,
2850 } 2850 }
2851 2851
2852 sec_level = BT_SECURITY_MEDIUM; 2852 sec_level = BT_SECURITY_MEDIUM;
2853 if (cp->io_cap == 0x03) 2853 auth_type = HCI_AT_DEDICATED_BONDING;
2854 auth_type = HCI_AT_DEDICATED_BONDING;
2855 else
2856 auth_type = HCI_AT_DEDICATED_BONDING_MITM;
2857 2854
2858 if (cp->addr.type == BDADDR_BREDR) { 2855 if (cp->addr.type == BDADDR_BREDR) {
2859 conn = hci_connect_acl(hdev, &cp->addr.bdaddr, sec_level, 2856 conn = hci_connect_acl(hdev, &cp->addr.bdaddr, sec_level,