Skip to content

Commit

Permalink
[bluetooth] Remove non-upstream code which causes BT PTS problems
Browse files Browse the repository at this point in the history
Revert "Bluetooth: If link is encrypted, do not send encrpt link request"

This reverts commit 5b26119.

Signed-off-by: Hannu Mallat <hannu.mallat@jollamobile.com>
  • Loading branch information
Hannu Mallat authored and RealJohnGalt committed Apr 27, 2016
1 parent bf22f4a commit 9af741b
Showing 1 changed file with 5 additions and 24 deletions.
29 changes: 5 additions & 24 deletions net/bluetooth/hci_event.c
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -1882,29 +1882,11 @@ static inline void hci_auth_complete_evt(struct hci_dev *hdev, struct sk_buff *s

if (test_bit(HCI_CONN_ENCRYPT_PEND, &conn->pend)) {
if (!ev->status) {
if (conn->link_mode & HCI_LM_ENCRYPT) {
/* Encryption implies authentication */
conn->link_mode |= HCI_LM_AUTH;
conn->link_mode |= HCI_LM_ENCRYPT;
conn->sec_level =
conn->pending_sec_level;
clear_bit(HCI_CONN_ENCRYPT_PEND,
&conn->pend);
hci_encrypt_cfm(conn, ev->status, 1);

if (test_bit(HCI_MGMT, &hdev->flags))
mgmt_encrypt_change(hdev->id,
&conn->dst,
ev->status);

} else {
struct hci_cp_set_conn_encrypt cp;
cp.handle = ev->handle;
cp.encrypt = 0x01;
hci_send_cmd(hdev,
HCI_OP_SET_CONN_ENCRYPT,
sizeof(cp), &cp);
}
struct hci_cp_set_conn_encrypt cp;
cp.handle = ev->handle;
cp.encrypt = 0x01;
hci_send_cmd(hdev, HCI_OP_SET_CONN_ENCRYPT,
sizeof(cp), &cp);
} else {
clear_bit(HCI_CONN_ENCRYPT_PEND, &conn->pend);
hci_encrypt_cfm(conn, ev->status, 0x00);
Expand Down Expand Up @@ -2710,7 +2692,6 @@ static inline void hci_link_key_notify_evt(struct hci_dev *hdev, struct sk_buff
conn->key_type = ev->key_type;
hci_disconnect_amp(conn, 0x06);

conn->link_mode &= ~HCI_LM_ENCRYPT;
pin_len = conn->pin_length;
hci_conn_put(conn);
hci_conn_enter_active_mode(conn, 0);
Expand Down

0 comments on commit 9af741b

Please sign in to comment.