Skip to content

Commit

Permalink
Bluetooth: Do not repeatedly ask for authentication
Browse files Browse the repository at this point in the history
Removing code, not present in upstream, that causes kernel to
repeatedly ask for authentication when the link key is invalid.

If two devices were paired but the remote device had removed
the pairing, a connection attempt would result in authentication
failure. The removed code would in this case ask for authentication
again, the remote device would reply with a link key request that
would be handled by the userspace, and when the (still invalid)
link key was received authentication would fail again and the
process would unnecessarily repeat.

Removing the code stops the unnecessary repeated authentication
attempts with an invalid link key.

[sbj] Do not repeatedly ask for authentication. Fixes JB#18165.

Signed-off-by: Hannu Mallat <hannu.mallat@jolla.com>
  • Loading branch information
Hannu Mallat authored and RealJohnGalt committed Apr 27, 2016
1 parent 45b282a commit ae043d0
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions net/bluetooth/hci_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -1837,18 +1837,6 @@ static inline void hci_auth_complete_evt(struct hci_dev *hdev, struct sk_buff *s

conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(ev->handle));
if (conn) {
if (ev->status == 0x06 && hdev->ssp_mode > 0 &&
conn->ssp_mode > 0) {
struct hci_cp_auth_requested cp;
hci_remove_link_key(hdev, &conn->dst);
cp.handle = cpu_to_le16(conn->handle);
hci_send_cmd(conn->hdev, HCI_OP_AUTH_REQUESTED,
sizeof(cp), &cp);
hci_dev_unlock(hdev);
BT_INFO("Pin or key missing");
return;
}

if (!ev->status) {
conn->link_mode |= HCI_LM_AUTH;
conn->sec_level = conn->pending_sec_level;
Expand Down

0 comments on commit ae043d0

Please sign in to comment.