Skip to content

Commit

Permalink
Bluetooth: Fix not notifying when connection encryption changes
Browse files Browse the repository at this point in the history
Some layers such as SMP depend on getting notified about encryption
changes immediately as they only allow certain PDU to be transmitted
over an encrypted link which may cause SMP implementation to reject
valid PDUs received thus causing pairing to fail when it shouldn't.

Fixes: 7aca0ac ("Bluetooth: Wait for HCI_OP_WRITE_AUTH_PAYLOAD_TO to complete")
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
  • Loading branch information
Vudentz committed Dec 15, 2023
1 parent 64b8bc7 commit f67eabf
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions net/bluetooth/hci_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -820,8 +820,6 @@ static u8 hci_cc_write_auth_payload_timeout(struct hci_dev *hdev, void *data,
if (!rp->status)
conn->auth_payload_timeout = get_unaligned_le16(sent + 2);

hci_encrypt_cfm(conn, 0);

unlock:
hci_dev_unlock(hdev);

Expand Down Expand Up @@ -3683,12 +3681,8 @@ static void hci_encrypt_change_evt(struct hci_dev *hdev, void *data,
cp.handle = cpu_to_le16(conn->handle);
cp.timeout = cpu_to_le16(hdev->auth_payload_timeout);
if (hci_send_cmd(conn->hdev, HCI_OP_WRITE_AUTH_PAYLOAD_TO,
sizeof(cp), &cp)) {
sizeof(cp), &cp))
bt_dev_err(hdev, "write auth payload timeout failed");
goto notify;
}

goto unlock;
}

notify:
Expand Down

0 comments on commit f67eabf

Please sign in to comment.