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

Commit 031dc503 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
(cherry picked from commit 924c3a96)
Merged-In: I1741929c639f2dbc6417974bf3287d8d141e33df
parent acffc03f
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -54,6 +54,7 @@
#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"
@@ -899,7 +900,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
@@ -80,7 +80,8 @@ init_flags!(
        gatt_robust_caching,
        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
@@ -11,6 +11,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;
    }
}