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

Commit 924c3a96 authored by Rahul Arya's avatar Rahul Arya
Browse files

Add flag to toggle IRK rotation

Based on discussion in linked bug, to prevent further regressions if the
latest fixes are still incomplete.

Bug: 195410559
Test: compiles
Ignore-AOSP-First: security
Change-Id: I1741929c639f2dbc6417974bf3287d8d141e33df
parent 279e3c3a
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -61,6 +61,7 @@ constexpr char kPrivateAddressPrefix[] = "xx:xx:xx:xx";
#include "btif_hh.h"
#include "btif_util.h"
#include "device/include/controller.h"
#include "gd/common/init_flags.h"
#include "osi/include/allocator.h"
#include "osi/include/compat.h"
#include "osi/include/config.h"
@@ -972,7 +973,8 @@ bt_status_t btif_storage_remove_bonded_device(

  /* Check the length of the paired devices, and if 0 then reset IRK */
  auto paired_devices = btif_config_get_paired_devices();
  if (paired_devices.empty()) {
  if (paired_devices.empty() &&
      bluetooth::common::init_flags::irk_rotation_is_enabled()) {
    LOG_INFO("Last paired device removed, resetting IRK");
    BTA_DmBleResetId();
  }
+2 −1
Original line number Diff line number Diff line
@@ -81,7 +81,8 @@ init_flags!(
        gatt_robust_caching_server,
        btaa_hci,
        gd_rust,
        gd_link_policy
        gd_link_policy,
        irk_rotation
    },
    dependencies: {
        gd_core => gd_security
+1 −0
Original line number Diff line number Diff line
@@ -12,6 +12,7 @@ mod ffi {
        fn btaa_hci_is_enabled() -> bool;
        fn gd_rust_is_enabled() -> bool;
        fn gd_link_policy_is_enabled() -> bool;
        fn irk_rotation_is_enabled() -> bool;
    }
}