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

Commit 0bdc2d61 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "L2CAP: Call Authenticate for the Classic Pairing service"

parents 8589afd5 118f75c0
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -55,6 +55,14 @@ void Link::Disconnect() {
  acl_connection_->Disconnect(hci::DisconnectReason::REMOTE_USER_TERMINATED_CONNECTION);
}

void Link::Encrypt() {
  acl_connection_->SetConnectionEncryption(hci::Enable::ENABLED);
}

void Link::Authenticate() {
  acl_connection_->AuthenticationRequested();
}

std::shared_ptr<FixedChannelImpl> Link::AllocateFixedChannel(Cid cid, SecurityPolicy security_policy) {
  auto channel = fixed_channel_allocator_.AllocateChannel(cid, security_policy);
  data_pipeline_manager_.AttachChannel(cid, channel, l2cap::internal::DataPipelineManager::ChannelMode::BASIC);
+4 −0
Original line number Diff line number Diff line
@@ -65,6 +65,10 @@ class Link : public l2cap::internal::ILink {

  virtual void Disconnect();

  virtual void Encrypt();

  virtual void Authenticate();

  // FixedChannel methods

  std::shared_ptr<FixedChannelImpl> AllocateFixedChannel(Cid cid, SecurityPolicy security_policy);
+3 −0
Original line number Diff line number Diff line
@@ -126,6 +126,9 @@ void LinkManager::OnConnectSuccess(std::unique_ptr<hci::AclConnection> acl_conne
    auto fixed_channel_impl = link->AllocateFixedChannel(fixed_channel_service.first, SecurityPolicy());
    fixed_channel_service.second->NotifyChannelCreation(
        std::make_unique<FixedChannel>(fixed_channel_impl, l2cap_handler_));
    if (fixed_channel_service.first == kClassicPairingTriggerCid) {
      link->Authenticate();
    }
  }
  if (pending_dynamic_channels_.find(device) != pending_dynamic_channels_.end()) {
    for (Psm psm : pending_dynamic_channels_[device]) {