Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Bluetooth: Fix bogus check for re-auth no supported with non-ssp

This reverts 19f8def031bfa50c579149b200bfeeb919727b27
"Bluetooth: Fix auth_complete_evt for legacy units" which seems to be
working around a bug on a broken controller rather then any limitation
imposed by the Bluetooth spec, in fact if there ws not possible to
re-auth the command shall fail not succeed.

Fixes: 19f8def031bf ("Bluetooth: Fix auth_complete_evt for legacy units")
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

+5 -15
-1
include/net/bluetooth/hci_core.h
··· 956 956 /* ----- HCI Connections ----- */ 957 957 enum { 958 958 HCI_CONN_AUTH_PEND, 959 - HCI_CONN_REAUTH_PEND, 960 959 HCI_CONN_ENCRYPT_PEND, 961 960 HCI_CONN_RSWITCH_PEND, 962 961 HCI_CONN_MODE_CHANGE_PEND,
+3 -5
net/bluetooth/hci_conn.c
··· 2449 2449 hci_send_cmd(conn->hdev, HCI_OP_AUTH_REQUESTED, 2450 2450 sizeof(cp), &cp); 2451 2451 2452 - /* If we're already encrypted set the REAUTH_PEND flag, 2453 - * otherwise set the ENCRYPT_PEND. 2452 + /* Set the ENCRYPT_PEND to trigger encryption after 2453 + * authentication. 2454 2454 */ 2455 - if (test_bit(HCI_CONN_ENCRYPT, &conn->flags)) 2456 - set_bit(HCI_CONN_REAUTH_PEND, &conn->flags); 2457 - else 2455 + if (!test_bit(HCI_CONN_ENCRYPT, &conn->flags)) 2458 2456 set_bit(HCI_CONN_ENCRYPT_PEND, &conn->flags); 2459 2457 } 2460 2458
+2 -9
net/bluetooth/hci_event.c
··· 3500 3500 3501 3501 if (!ev->status) { 3502 3502 clear_bit(HCI_CONN_AUTH_FAILURE, &conn->flags); 3503 - 3504 - if (!hci_conn_ssp_enabled(conn) && 3505 - test_bit(HCI_CONN_REAUTH_PEND, &conn->flags)) { 3506 - bt_dev_info(hdev, "re-auth of legacy device is not possible."); 3507 - } else { 3508 - set_bit(HCI_CONN_AUTH, &conn->flags); 3509 - conn->sec_level = conn->pending_sec_level; 3510 - } 3503 + set_bit(HCI_CONN_AUTH, &conn->flags); 3504 + conn->sec_level = conn->pending_sec_level; 3511 3505 } else { 3512 3506 if (ev->status == HCI_ERROR_PIN_OR_KEY_MISSING) 3513 3507 set_bit(HCI_CONN_AUTH_FAILURE, &conn->flags); ··· 3510 3516 } 3511 3517 3512 3518 clear_bit(HCI_CONN_AUTH_PEND, &conn->flags); 3513 - clear_bit(HCI_CONN_REAUTH_PEND, &conn->flags); 3514 3519 3515 3520 if (conn->state == BT_CONFIG) { 3516 3521 if (!ev->status && hci_conn_ssp_enabled(conn)) {