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

Commit 6cab9ec2 authored by Hsin-chen Chuang's avatar Hsin-chen Chuang Committed by Gerrit Code Review
Browse files

Merge "SMP over BR: Clear LE link key info for temporary bond" into main

parents 3fc63129 042fcb3e
Loading
Loading
Loading
Loading
+14 −2
Original line number Diff line number Diff line
@@ -1863,8 +1863,20 @@ tBTM_STATUS btm_proc_smp_cback(tSMP_EVT event, const RawAddress& bd_addr,

          if (res == BTM_SUCCESS) {
            p_dev_rec->sec_state = BTM_SEC_STATE_IDLE;
            /* add all bonded device into resolving list if IRK is available*/

            if (p_dev_rec->bond_type != tBTM_SEC_DEV_REC::BOND_TYPE_TEMPORARY) {
              // Add all bonded device into resolving list if IRK is available.
              btm_ble_resolving_list_load_dev(*p_dev_rec);
            } else if (p_dev_rec->ble_hci_handle == HCI_INVALID_HANDLE) {
              // At this point LTK should have been dropped by btif.
              // Reset the flags here if LE is not connected (over BR),
              // otherwise they would be reset on disconnected.
              LOG_DEBUG(
                  "SMP over BR triggered by temporary bond has completed,"
                  " resetting the LK flags");
              p_dev_rec->sec_flags &= ~(BTM_SEC_LE_LINK_KEY_KNOWN);
              p_dev_rec->ble.key_type = BTM_LE_KEY_NONE;
            }
          }

          btm_sec_dev_rec_cback_event(p_dev_rec, res, true);