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

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

Merge "[Invisalign2] make wipe_secrets_and_remove static" into main

parents d3cfc75f 446c80bc
Loading
Loading
Loading
Loading
+18 −6
Original line number Original line Diff line number Diff line
@@ -55,6 +55,12 @@ constexpr char kBtmLogTag[] = "BOND";


}
}


static void wipe_secrets_and_remove(tBTM_SEC_DEV_REC* p_dev_rec) {
  p_dev_rec->link_key.fill(0);
  memset(&p_dev_rec->ble_keys, 0, sizeof(tBTM_SEC_BLE_KEYS));
  list_remove(btm_sec_cb.sec_dev_rec, p_dev_rec);
}

/*******************************************************************************
/*******************************************************************************
 *
 *
 * Function         BTM_SecAddDevice
 * Function         BTM_SecAddDevice
@@ -142,12 +148,6 @@ bool BTM_SecAddDevice(const RawAddress& bd_addr, DEV_CLASS dev_class,
  return true;
  return true;
}
}


void wipe_secrets_and_remove(tBTM_SEC_DEV_REC* p_dev_rec) {
  p_dev_rec->link_key.fill(0);
  memset(&p_dev_rec->ble_keys, 0, sizeof(tBTM_SEC_BLE_KEYS));
  list_remove(btm_sec_cb.sec_dev_rec, p_dev_rec);
}

/** Removes the device from acceptlist */
/** Removes the device from acceptlist */
void BTM_AcceptlistRemove(const RawAddress& address);
void BTM_AcceptlistRemove(const RawAddress& address);


@@ -791,3 +791,15 @@ bool BTM_IsRemoteNameKnown(const RawAddress& bd_addr, tBT_TRANSPORT transport) {
  tBTM_SEC_DEV_REC* p_dev_rec = btm_find_dev(bd_addr);
  tBTM_SEC_DEV_REC* p_dev_rec = btm_find_dev(bd_addr);
  return (p_dev_rec == nullptr) ? false : p_dev_rec->is_name_known();
  return (p_dev_rec == nullptr) ? false : p_dev_rec->is_name_known();
}
}

namespace bluetooth {
namespace testing {
namespace legacy {

void wipe_secrets_and_remove(tBTM_SEC_DEV_REC* p_dev_rec) {
  ::wipe_secrets_and_remove(p_dev_rec);
}

}  // namespace legacy
}  // namespace testing
}  // namespace bluetooth
+0 −2
Original line number Original line Diff line number Diff line
@@ -20,8 +20,6 @@
#include "types/ble_address_with_type.h"
#include "types/ble_address_with_type.h"
#include "types/raw_address.h"
#include "types/raw_address.h"


void wipe_secrets_and_remove(tBTM_SEC_DEV_REC* p_dev_rec);

/** Free resources associated with the device associated with |bd_addr| address.
/** Free resources associated with the device associated with |bd_addr| address.
 *
 *
 * *** WARNING ***
 * *** WARNING ***
+12 −0
Original line number Original line Diff line number Diff line
@@ -34,6 +34,18 @@
using testing::Return;
using testing::Return;
using testing::Test;
using testing::Test;


namespace bluetooth {
namespace testing {
namespace legacy {

void wipe_secrets_and_remove(tBTM_SEC_DEV_REC* p_dev_rec);

}  // namespace legacy
}  // namespace testing
}  // namespace bluetooth

using bluetooth::testing::legacy::wipe_secrets_and_remove;

constexpr size_t kBtmSecMaxDeviceRecords =
constexpr size_t kBtmSecMaxDeviceRecords =
    static_cast<size_t>(BTM_SEC_MAX_DEVICE_RECORDS + 1);
    static_cast<size_t>(BTM_SEC_MAX_DEVICE_RECORDS + 1);


+0 −3
Original line number Original line Diff line number Diff line
@@ -103,9 +103,6 @@ void BTM_SecClearSecurityFlags(const RawAddress& /* bd_addr */) {
void btm_consolidate_dev(tBTM_SEC_DEV_REC* /* p_target_rec */) {
void btm_consolidate_dev(tBTM_SEC_DEV_REC* /* p_target_rec */) {
  inc_func_call_count(__func__);
  inc_func_call_count(__func__);
}
}
void wipe_secrets_and_remove(tBTM_SEC_DEV_REC* /* p_dev_rec */) {
  inc_func_call_count(__func__);
}
void btm_dev_consolidate_existing_connections(const RawAddress& /* bd_addr */) {
void btm_dev_consolidate_existing_connections(const RawAddress& /* bd_addr */) {
  inc_func_call_count(__func__);
  inc_func_call_count(__func__);
}
}