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

Commit 7cc6ca15 authored by David Duarte's avatar David Duarte
Browse files

RootCanal: Check if Authentication is in progress before starting one



Restarting authentication can override the initiator flag
This was happening when an initiator answered a
LinkKeyRequestNegativeReply

Test: gd/cert/run
Change-Id: Id6e937a29ff64697320fc9b4556069eae2dfd725
Signed-off-by: default avatarDavid Duarte <licorne@google.com>
parent 398a7116
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -794,8 +794,10 @@ void LinkLayerController::IncomingIoCapabilityRequestPacket(
            incoming.GetDestinationAddress(), incoming.GetSourceAddress(),
            static_cast<uint8_t>(
                ErrorCode::UNSUPPORTED_REMOTE_OR_LMP_FEATURE)));
    security_manager_.AuthenticationRequest(incoming.GetSourceAddress(), handle,
                                            false);
    if (!security_manager_.AuthenticationInProgress()) {
      security_manager_.AuthenticationRequest(incoming.GetSourceAddress(),
                                              handle, false);
    }
    security_manager_.SetPinRequested(peer);
    if (properties_.IsUnmasked(EventCode::PIN_CODE_REQUEST)) {
      send_event_(bluetooth::hci::PinCodeRequestBuilder::Create(
@@ -1894,7 +1896,9 @@ ErrorCode LinkLayerController::LinkKeyRequestNegativeReply(
  }

  if (properties_.GetSecureSimplePairingSupported()) {
    if (!security_manager_.AuthenticationInProgress()) {
      security_manager_.AuthenticationRequest(address, handle, false);
    }

    ScheduleTask(milliseconds(5),
                 [this, address]() { StartSimplePairing(address); });