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

Commit 446c80bc authored by Hui Peng's avatar Hui Peng
Browse files

[Invisalign2] make wipe_secrets_and_remove static

Bug: 301661850
Test: mma packages/modules/Bluetooth
Change-Id: I460c37292a154dd2bc20b0824e1d7d07213369ef
parent 148bcdc5
Loading
Loading
Loading
Loading
+18 −6
Original line number 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
@@ -142,12 +148,6 @@ bool BTM_SecAddDevice(const RawAddress& bd_addr, DEV_CLASS dev_class,
  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 */
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);
  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 Diff line number Diff line
@@ -20,8 +20,6 @@
#include "types/ble_address_with_type.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.
 *
 * *** WARNING ***
+12 −0
Original line number Diff line number Diff line
@@ -34,6 +34,18 @@
using testing::Return;
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 =
    static_cast<size_t>(BTM_SEC_MAX_DEVICE_RECORDS + 1);

+0 −3
Original line number 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 */) {
  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 */) {
  inc_func_call_count(__func__);
}