Skip to content

Commit

Permalink
Call hostapd function to set pairwise ciphers.
Browse files Browse the repository at this point in the history
  • Loading branch information
abeltrano committed Mar 15, 2024
1 parent 52ea49b commit ee7a561
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/common/service/NetRemoteService.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -723,8 +723,7 @@ NetRemoteService::WifiAccessPointSetPairwiseCipherSuitesImpl(std::string_view ac
}

// Set the cipher suites.
operationStatus.Code = AccessPointOperationStatusCode::OperationNotSupported;
// TODO: operationStatus = accessPointController->SetCipherSuites(std::move(ieee80211CipherSuites));
operationStatus = accessPointController->SetPairwiseCipherSuites(std::move(ieee80211CipherSuites));
if (!operationStatus.Succeeded()) {
wifiOperationStatus.set_code(ToDot11AccessPointOperationStatusCode(operationStatus.Code));
wifiOperationStatus.set_message(std::format("Failed to set cipher suites for access point {} - {}", accessPointId, operationStatus.ToString()));
Expand Down
10 changes: 8 additions & 2 deletions src/linux/wifi/core/AccessPointControllerLinux.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ AccessPointControllerLinux::SetAuthenticationAlgorithms(std::vector<Ieee80211Aut
}

AccessPointOperationStatus
AccessPointControllerLinux::SetPairwiseCipherSuites([[maybe_unused]] std::unordered_map<Ieee80211SecurityProtocol, std::vector<Ieee80211CipherSuite>> pairwiseCipherSuites) noexcept
AccessPointControllerLinux::SetPairwiseCipherSuites(std::unordered_map<Ieee80211SecurityProtocol, std::vector<Ieee80211CipherSuite>> pairwiseCipherSuites) noexcept
{
AccessPointOperationStatus status{ GetInterfaceName() };
const AccessPointOperationStatusLogOnExit logStatusOnExit(&status);
Expand All @@ -295,7 +295,13 @@ AccessPointControllerLinux::SetPairwiseCipherSuites([[maybe_unused]] std::unorde

auto pairwiseCipherSuitesHostapd = Ieee80211CipherSuitesToWpaCipherSuites(pairwiseCipherSuites);

// TODO
try {
m_hostapd.SetPairwiseCipherSuites(pairwiseCipherSuitesHostapd, EnforceConfigurationChange::Now);
} catch (const Wpa::HostapdException& e) {
status.Code = AccessPointOperationStatusCode::InternalError;
status.Details = std::format("failed to set pairwise cipher suites - {}", e.what());
return status;
}

status.Code = AccessPointOperationStatusCode::Succeeded;
return status;
Expand Down

0 comments on commit ee7a561

Please sign in to comment.