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

Commit 7d7b00eb authored by Hansong Zhang's avatar Hansong Zhang Committed by android-build-team Robot
Browse files

Legacy pairing: Reject device with same BD_ADDR

Change-Id: If3daec91c3d108a4e7e988608e0600c79ea5f053
Tag: #vulnerability
Test: manual
Bug: 174626251
(cherry picked from commit 7dec29b5)
parent 0f6776ab
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -4674,6 +4674,13 @@ void btm_sec_pin_code_request(const RawAddress& p_bda) {
  VLOG(2) << __func__ << " BDA: " << p_bda
          << " state: " << btm_pair_state_descr(btm_cb.pairing_state);

  RawAddress local_bd_addr = *controller_get_interface()->get_address();
  if (p_bda == local_bd_addr) {
    android_errorWriteLog(0x534e4554, "174626251");
    btsnd_hcic_pin_code_neg_reply(p_bda);
    return;
  }

  if (btm_cb.pairing_state != BTM_PAIR_STATE_IDLE) {
    if ((p_bda == btm_cb.pairing_bda) &&
        (btm_cb.pairing_state == BTM_PAIR_STATE_WAIT_AUTH_COMPLETE)) {