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

Commit 7a842166 authored by Martin Brabham's avatar Martin Brabham
Browse files

Security: Fix pairing handler dispatching

When a connection is initiated from the remote, the
module must behave accordingly

Bug: 162984360
Test: cert/run SecurityTest
Tag: #gd-refactor
Change-Id: I3e87e003387c4fb3ba4c7c09e3fe545848ae0b7c
parent 2753907a
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -256,7 +256,8 @@ void SecurityManagerImpl::HandleEvent(T packet) {
    auto bd_addr = packet.GetBdAddr();
    auto event_code = packet.GetEventCode();

    if (event_code != hci::EventCode::LINK_KEY_REQUEST) {
    if (event_code != hci::EventCode::LINK_KEY_REQUEST && event_code != hci::EventCode::PIN_CODE_REQUEST &&
        event_code != hci::EventCode::IO_CAPABILITY_RESPONSE) {
      LOG_ERROR("No classic pairing handler for device '%s' ready for command %s ", bd_addr.ToString().c_str(),
                hci::EventCodeText(event_code).c_str());
      return;
+3 −1
Original line number Diff line number Diff line
@@ -128,8 +128,10 @@ void ClassicPairingHandler::Initiate(
    }
  }

  if (locally_initiated_) {
    GetChannel()->Connect(GetRecord()->GetPseudoAddress()->GetAddress());
  }
}

void ClassicPairingHandler::OnNameRequestComplete(hci::Address address, bool success) {
  if (GetNameDbModule()->IsNameCached(address)) {