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

Commit aa26eedc authored by Myles Watson's avatar Myles Watson
Browse files

DO NOT MERGE: Remove pairing on incoming bond request

Bug: 150156492
Tag: #security
Test: Bond two devices, forget from one device and reconnect
Change-Id: I048b7b142e3fe2096cf1a9aa2931c175fa52cd45
(cherry picked from commit 13f409ad3a2423b06af7a7f1a9b06fb06c8820a7)
Merged-In: I048b7b142e3fe2096cf1a9aa2931c175fa52cd45
parent 64fc0f21
Loading
Loading
Loading
Loading
+9 −0
Original line number Original line Diff line number Diff line
@@ -53,6 +53,8 @@ extern fixed_queue_t* btu_general_alarm_queue;
bool(APPL_AUTH_WRITE_EXCEPTION)(BD_ADDR bd_addr);
bool(APPL_AUTH_WRITE_EXCEPTION)(BD_ADDR bd_addr);
#endif
#endif


extern void bta_dm_process_remove_device(BD_ADDR bd_addr);

/*******************************************************************************
/*******************************************************************************
 *             L O C A L    F U N C T I O N     P R O T O T Y P E S            *
 *             L O C A L    F U N C T I O N     P R O T O T Y P E S            *
 ******************************************************************************/
 ******************************************************************************/
@@ -3293,6 +3295,13 @@ void btm_io_capabilities_req(uint8_t* p) {
  BTM_TRACE_EVENT("%s: State: %s", __func__,
  BTM_TRACE_EVENT("%s: State: %s", __func__,
                  btm_pair_state_descr(btm_cb.pairing_state));
                  btm_pair_state_descr(btm_cb.pairing_state));


  if (btm_sec_is_a_bonded_dev(evt_data.bd_addr)) {
    BTM_TRACE_WARNING(
        "%s: Incoming bond request, but device is already bonded (removing)",
        __func__);
    bta_dm_process_remove_device(evt_data.bd_addr);
  }

  p_dev_rec = btm_find_or_alloc_dev(evt_data.bd_addr);
  p_dev_rec = btm_find_or_alloc_dev(evt_data.bd_addr);


  BTM_TRACE_DEBUG("%s:Security mode: %d, Num Read Remote Feat pages: %d",
  BTM_TRACE_DEBUG("%s:Security mode: %d, Num Read Remote Feat pages: %d",