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

Commit 0430149b authored by Hui Peng's avatar Hui Peng Committed by Gerrit Code Review
Browse files

Merge "[Invisalign2] Separate security fields from tBTM_SEC_DEV_REC" into main

parents 164090c4 2c92bb26
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -147,8 +147,8 @@ bool btm_ble_addr_resolvable(const RawAddress& rpa,
  if (!BTM_BLE_IS_RESOLVE_BDA(rpa)) return false;

  if ((p_dev_rec->device_type & BT_DEVICE_TYPE_BLE) &&
      (p_dev_rec->ble_keys.key_type & BTM_LE_KEY_PID)) {
    if (rpa_matches_irk(rpa, p_dev_rec->ble_keys.irk)) {
      (p_dev_rec->sec_rec.ble_keys.key_type & BTM_LE_KEY_PID)) {
    if (rpa_matches_irk(rpa, p_dev_rec->sec_rec.ble_keys.irk)) {
      btm_ble_init_pseudo_addr(p_dev_rec, rpa);
      return true;
    }
@@ -164,11 +164,11 @@ static bool btm_ble_match_random_bda(void* data, void* context) {
  RawAddress* random_bda = static_cast<RawAddress*>(context);

  if (!(p_dev_rec->device_type & BT_DEVICE_TYPE_BLE) ||
      !(p_dev_rec->ble_keys.key_type & BTM_LE_KEY_PID))
      !(p_dev_rec->sec_rec.ble_keys.key_type & BTM_LE_KEY_PID))
    // Match fails preconditions
    return true;

  if (rpa_matches_irk(*random_bda, p_dev_rec->ble_keys.irk)) {
  if (rpa_matches_irk(*random_bda, p_dev_rec->sec_rec.ble_keys.irk)) {
    // Matched
    return false;
  }
+3 −3
Original line number Diff line number Diff line
@@ -532,7 +532,7 @@ static void btm_ble_ble_unsupported_resolving_list_load_dev(
  uint8_t* p = param;

  UINT8_TO_STREAM(p, BTM_BLE_META_ADD_IRK_ENTRY);
  ARRAY_TO_STREAM(p, p_dev_rec->ble_keys.irk, OCTET16_LEN);
  ARRAY_TO_STREAM(p, p_dev_rec->sec_rec.ble_keys.irk, OCTET16_LEN);
  UINT8_TO_STREAM(p, p_dev_rec->ble.identity_address_with_type.type);
  BDADDR_TO_STREAM(p, p_dev_rec->ble.identity_address_with_type.bda);

@@ -545,7 +545,7 @@ static void btm_ble_ble_unsupported_resolving_list_load_dev(
}

static bool is_peer_identity_key_valid(const tBTM_SEC_DEV_REC& dev_rec) {
  return dev_rec.ble_keys.key_type & BTM_LE_KEY_PID;
  return dev_rec.sec_rec.ble_keys.key_type & BTM_LE_KEY_PID;
}

static Octet16 get_local_irk() { return btm_sec_cb.devcb.id_keys.irk; }
@@ -577,7 +577,7 @@ void btm_ble_resolving_list_load_dev(tBTM_SEC_DEV_REC& dev_rec) {
    return;
  }

  const Octet16& peer_irk = dev_rec.ble_keys.irk;
  const Octet16& peer_irk = dev_rec.sec_rec.ble_keys.irk;
  const Octet16& local_irk = get_local_irk();

  if (dev_rec.ble.identity_address_with_type.bda.IsEmpty()) {
+115 −105

File changed.

Preview size limit exceeded, changes collapsed.

+28 −28

File changed.

Preview size limit exceeded, changes collapsed.

+1 −1
Original line number Diff line number Diff line
@@ -160,7 +160,7 @@ void BTM_db_reset(void) {

static bool set_sec_state_idle(void* data, void* context) {
  tBTM_SEC_DEV_REC* p_dev_rec = static_cast<tBTM_SEC_DEV_REC*>(data);
  p_dev_rec->sec_state = BTM_SEC_STATE_IDLE;
  p_dev_rec->sec_rec.sec_state = BTM_SEC_STATE_IDLE;
  return true;
}

Loading