Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 30966414 authored by Bidhya Sharma's avatar Bidhya Sharma Committed by Android (Google) Code Review
Browse files

Merge changes I4c85ef17,I0a5df382 into tm-qpr-dev

* changes:
  Ignore additional encrypt change events when link is auth & encrypted
  Delete keys if SMP over BR fails
parents 27344c2e 1131d231
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -3623,7 +3623,8 @@ static uint8_t bta_dm_ble_smp_cback(tBTM_LE_EVT event, const RawAddress& bda,
                (static_cast<uint8_t>(p_data->complt.reason))));

        if (btm_sec_is_a_bonded_dev(bda) &&
            p_data->complt.reason == SMP_CONN_TOUT) {
            p_data->complt.reason == SMP_CONN_TOUT &&
            !p_data->complt.smp_over_br) {
          // Bonded device failed to encrypt - to test this remove battery from
          // HID device right after connection, but before encryption is
          // established
+7 −0
Original line number Diff line number Diff line
@@ -3289,6 +3289,13 @@ void btm_sec_encrypt_change(uint16_t handle, tHCI_STATUS status,
  if (status == HCI_SUCCESS) {
    if (encr_enable) {
      if (p_dev_rec->hci_handle == handle) {  // classic
        if ((p_dev_rec->sec_flags & BTM_SEC_AUTHENTICATED) &&
            (p_dev_rec->sec_flags & BTM_SEC_ENCRYPTED)) {
          LOG_INFO(
              "Link is authenticated & encrypted, ignoring this enc change "
              "event");
          return;
        }
        p_dev_rec->sec_flags |= (BTM_SEC_AUTHENTICATED | BTM_SEC_ENCRYPTED);
        if (p_dev_rec->pin_code_length >= 16 ||
            p_dev_rec->link_key_type == BTM_LKEY_TYPE_AUTH_COMB ||