Merge "[wpa_supplicant] Enable RCOI selection for Passpoint"
diff --git a/hostapd/aidl/hostapd.cpp b/hostapd/aidl/hostapd.cpp
index 7874785..bbfd174 100644
--- a/hostapd/aidl/hostapd.cpp
+++ b/hostapd/aidl/hostapd.cpp
@@ -298,7 +298,8 @@
const IfaceParams& iface_params,
const ChannelParams& channelParams,
const NetworkParams& nw_params,
- const std::string br_name)
+ const std::string br_name,
+ const std::string owe_transition_ifname)
{
if (nw_params.ssid.size() >
static_cast<uint32_t>(
@@ -396,6 +397,14 @@
is_6Ghz_band_only ? 1 : 2,
nw_params.passphrase.c_str());
break;
+ case EncryptionType::OWE_TRANSITION:
+ encryption_config_as_string = StringPrintf(
+ "wpa=2\n"
+ "rsn_pairwise=%s\n"
+ "wpa_key_mgmt=OWE\n"
+ "ieee80211w=2",
+ is_60Ghz_band_only ? "GCMP" : "CCMP");
+ break;
default:
wpa_printf(MSG_ERROR, "Unknown encryption type");
return "";
@@ -525,6 +534,12 @@
vendor_elements_as_string = StringPrintf("vendor_elements=%s", ss.str().c_str());
}
+ std::string owe_transition_ifname_as_string;
+ if (!owe_transition_ifname.empty()) {
+ owe_transition_ifname_as_string = StringPrintf(
+ "owe_transition_ifname=%s", owe_transition_ifname.c_str());
+ }
+
return StringPrintf(
"interface=%s\n"
"driver=nl80211\n"
@@ -548,6 +563,7 @@
"%s\n"
"%s\n"
"%s\n"
+ "%s\n"
"%s\n",
iface_params.name.c_str(), ssid_as_string.c_str(),
channel_config_as_string.c_str(),
@@ -561,6 +577,7 @@
#endif /* CONFIG_INTERWORKING */
encryption_config_as_string.c_str(),
bridge_as_string.c_str(),
+ owe_transition_ifname_as_string.c_str(),
enable_edmg_as_string.c_str(),
edmg_channel_as_string.c_str(),
vendor_elements_as_string.c_str());
@@ -771,7 +788,7 @@
wpa_printf(MSG_INFO, "AddSingleAccessPoint, iface=%s",
iface_params.name.c_str());
return addSingleAccessPoint(iface_params, iface_params.channelParams[0],
- nw_params, "");
+ nw_params, "", "");
} else if (channelParamsSize == 2) {
// Concurrent APs
wpa_printf(MSG_INFO, "AddDualAccessPoint, iface=%s",
@@ -781,6 +798,18 @@
return createStatus(HostapdStatusCode::FAILURE_ARGS_INVALID);
}
+std::vector<uint8_t> generateRandomOweSsid()
+{
+ u8 random[8] = {0};
+ os_get_random(random, 8);
+
+ std::string ssid = StringPrintf("Owe-%s", random);
+ wpa_printf(MSG_INFO, "Generated OWE SSID: %s", ssid.c_str());
+ std::vector<uint8_t> vssid(ssid.begin(), ssid.end());
+
+ return vssid;
+}
+
::ndk::ScopedAStatus Hostapd::addConcurrentAccessPoints(
const IfaceParams& iface_params, const NetworkParams& nw_params)
{
@@ -800,9 +829,24 @@
// start BSS on specified bands
for (std::size_t i = 0; i < channelParamsListSize; i ++) {
IfaceParams iface_params_new = iface_params;
+ NetworkParams nw_params_new = nw_params;
iface_params_new.name = managed_interfaces[i];
+
+ std::string owe_transition_ifname = "";
+ if (nw_params.encryptionType == EncryptionType::OWE_TRANSITION) {
+ if (i == 0 && i+1 < channelParamsListSize) {
+ owe_transition_ifname = managed_interfaces[i+1];
+ nw_params_new.encryptionType = EncryptionType::NONE;
+ } else {
+ owe_transition_ifname = managed_interfaces[0];
+ nw_params_new.isHidden = true;
+ nw_params_new.ssid = generateRandomOweSsid();
+ }
+ }
+
ndk::ScopedAStatus status = addSingleAccessPoint(
- iface_params_new, iface_params.channelParams[i], nw_params, br_name);
+ iface_params_new, iface_params.channelParams[i], nw_params_new,
+ br_name, owe_transition_ifname);
if (!status.isOk()) {
wpa_printf(MSG_ERROR, "Failed to addAccessPoint %s",
managed_interfaces[i].c_str());
@@ -818,7 +862,8 @@
const IfaceParams& iface_params,
const ChannelParams& channelParams,
const NetworkParams& nw_params,
- const std::string br_name)
+ const std::string br_name,
+ const std::string owe_transition_ifname)
{
if (hostapd_get_iface(interfaces_, iface_params.name.c_str())) {
wpa_printf(
@@ -826,7 +871,8 @@
iface_params.name.c_str());
return createStatus(HostapdStatusCode::FAILURE_IFACE_EXISTS);
}
- const auto conf_params = CreateHostapdConfig(iface_params, channelParams, nw_params, br_name);
+ const auto conf_params = CreateHostapdConfig(iface_params, channelParams, nw_params,
+ br_name, owe_transition_ifname);
if (conf_params.empty()) {
wpa_printf(MSG_ERROR, "Failed to create config params");
return createStatus(HostapdStatusCode::FAILURE_ARGS_INVALID);
diff --git a/hostapd/aidl/hostapd.h b/hostapd/aidl/hostapd.h
index 18a7a23..ffdbd8e 100644
--- a/hostapd/aidl/hostapd.h
+++ b/hostapd/aidl/hostapd.h
@@ -64,7 +64,8 @@
const IfaceParams& IfaceParams,
const ChannelParams& channelParams,
const NetworkParams& nw_params,
- std::string br_name);
+ std::string br_name,
+ std::string owe_transition_ifname);
::ndk::ScopedAStatus addConcurrentAccessPoints(
const IfaceParams& IfaceParams,
const NetworkParams& nw_params);
diff --git a/wpa_supplicant/aidl/p2p_iface.cpp b/wpa_supplicant/aidl/p2p_iface.cpp
index e1be7ce..3dcfec8 100644
--- a/wpa_supplicant/aidl/p2p_iface.cpp
+++ b/wpa_supplicant/aidl/p2p_iface.cpp
@@ -1026,6 +1026,24 @@
&P2pIface::removeClientInternal, peer_address, isLegacyClient);
}
+::ndk::ScopedAStatus P2pIface::findOnSocialChannels(
+ int32_t in_timeoutInSec)
+{
+ return validateAndCall(
+ this, SupplicantStatusCode::FAILURE_IFACE_INVALID,
+ &P2pIface::findOnSocialChannelsInternal, in_timeoutInSec);
+}
+
+::ndk::ScopedAStatus P2pIface::findOnSpecificFrequency(
+ int32_t in_freq,
+ int32_t in_timeoutInSec)
+{
+ return validateAndCall(
+ this, SupplicantStatusCode::FAILURE_IFACE_INVALID,
+ &P2pIface::findOnSpecificFrequencyInternal,
+ in_freq, in_timeoutInSec);
+}
+
std::pair<std::string, ndk::ScopedAStatus> P2pIface::getNameInternal()
{
return {ifname_, ndk::ScopedAStatus::ok()};
@@ -2017,6 +2035,37 @@
return ndk::ScopedAStatus::ok();
}
+ndk::ScopedAStatus P2pIface::findOnSocialChannelsInternal(uint32_t timeout_in_sec)
+{
+ struct wpa_supplicant* wpa_s = retrieveIfacePtr();
+ if (wpa_s->wpa_state == WPA_INTERFACE_DISABLED) {
+ return createStatus(SupplicantStatusCode::FAILURE_IFACE_DISABLED);
+ }
+ uint32_t search_delay = wpas_p2p_search_delay(wpa_s);
+ if (wpas_p2p_find(
+ wpa_s, timeout_in_sec, P2P_FIND_ONLY_SOCIAL, 0, nullptr,
+ nullptr, search_delay, 0, nullptr, 0)) {
+ return createStatus(SupplicantStatusCode::FAILURE_UNKNOWN);
+ }
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus P2pIface::findOnSpecificFrequencyInternal(
+ uint32_t freq, uint32_t timeout_in_sec)
+{
+ struct wpa_supplicant* wpa_s = retrieveIfacePtr();
+ if (wpa_s->wpa_state == WPA_INTERFACE_DISABLED) {
+ return createStatus(SupplicantStatusCode::FAILURE_IFACE_DISABLED);
+ }
+ uint32_t search_delay = wpas_p2p_search_delay(wpa_s);
+ if (wpas_p2p_find(
+ wpa_s, timeout_in_sec, P2P_FIND_START_WITH_FULL, 0, nullptr,
+ nullptr, search_delay, 0, nullptr, freq)) {
+ return createStatus(SupplicantStatusCode::FAILURE_UNKNOWN);
+ }
+ return ndk::ScopedAStatus::ok();
+}
+
/**
* Retrieve the underlying |wpa_supplicant| struct
* pointer for this iface.
diff --git a/wpa_supplicant/aidl/p2p_iface.h b/wpa_supplicant/aidl/p2p_iface.h
index 1d57ddc..4cb86b6 100644
--- a/wpa_supplicant/aidl/p2p_iface.h
+++ b/wpa_supplicant/aidl/p2p_iface.h
@@ -166,6 +166,9 @@
const std::vector<uint8_t>& in_info) override;
::ndk::ScopedAStatus removeClient(
const std::vector<uint8_t>& peer_address, bool isLegacyClient) override;
+ ::ndk::ScopedAStatus findOnSocialChannels(int32_t in_timeoutInSec) override;
+ ::ndk::ScopedAStatus findOnSpecificFrequency(
+ int32_t in_freq, int32_t in_timeoutInSec) override;
private:
// Corresponding worker functions for the AIDL methods.
@@ -280,6 +283,9 @@
const std::vector<uint8_t>& info);
ndk::ScopedAStatus removeClientInternal(
const std::vector<uint8_t>& peer_address, bool isLegacyClient);
+ ndk::ScopedAStatus findOnSocialChannelsInternal(uint32_t timeout_in_sec);
+ ndk::ScopedAStatus findOnSpecificFrequencyInternal(
+ uint32_t freq, uint32_t timeout_in_sec);
struct wpa_supplicant* retrieveIfacePtr();
struct wpa_supplicant* retrieveGroupIfacePtr(
diff --git a/wpa_supplicant/aidl/sta_iface.cpp b/wpa_supplicant/aidl/sta_iface.cpp
index abde780..9b967e4 100644
--- a/wpa_supplicant/aidl/sta_iface.cpp
+++ b/wpa_supplicant/aidl/sta_iface.cpp
@@ -770,6 +770,31 @@
&StaIface::setMboCellularDataStatusInternal, in_available);
}
+::ndk::ScopedAStatus StaIface::setQosPolicyFeatureEnabled(
+ bool in_enable)
+{
+ return validateAndCall(
+ this, SupplicantStatusCode::FAILURE_UNKNOWN,
+ &StaIface::setQosPolicyFeatureEnabledInternal, in_enable);
+}
+
+::ndk::ScopedAStatus StaIface::sendQosPolicyResponse(
+ bool in_morePolicies,
+ const std::vector<QosPolicyStatus>& in_qosPolicyStatusList)
+{
+ return validateAndCall(
+ this, SupplicantStatusCode::FAILURE_UNKNOWN,
+ &StaIface::sendQosPolicyResponseInternal, in_morePolicies,
+ in_qosPolicyStatusList);
+}
+
+::ndk::ScopedAStatus StaIface::removeAllQosPolicies()
+{
+ return validateAndCall(
+ this, SupplicantStatusCode::FAILURE_UNKNOWN,
+ &StaIface::removeAllQosPoliciesInternal);
+}
+
std::pair<std::string, ndk::ScopedAStatus> StaIface::getNameInternal()
{
return {ifname_, ndk::ScopedAStatus::ok()};
@@ -1742,6 +1767,22 @@
ndk::ScopedAStatus::ok()};
}
+ndk::ScopedAStatus StaIface::setQosPolicyFeatureEnabledInternal(bool enable)
+{
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus StaIface::sendQosPolicyResponseInternal(
+ bool more_policies, const std::vector<QosPolicyStatus>& qos_policy_status_list)
+{
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus StaIface::removeAllQosPoliciesInternal()
+{
+ return ndk::ScopedAStatus::ok();
+}
+
/**
* Retrieve the underlying |wpa_supplicant| struct
* pointer for this iface.
diff --git a/wpa_supplicant/aidl/sta_iface.h b/wpa_supplicant/aidl/sta_iface.h
index 98c3187..0853b7e 100644
--- a/wpa_supplicant/aidl/sta_iface.h
+++ b/wpa_supplicant/aidl/sta_iface.h
@@ -20,6 +20,7 @@
#include <aidl/android/hardware/wifi/supplicant/Hs20AnqpSubtypes.h>
#include <aidl/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.h>
#include <aidl/android/hardware/wifi/supplicant/ISupplicantStaNetwork.h>
+#include <aidl/android/hardware/wifi/supplicant/QosPolicyStatus.h>
#include <aidl/android/hardware/wifi/supplicant/RxFilterType.h>
extern "C"
@@ -145,6 +146,10 @@
DppResponderBootstrapInfo* _aidl_return) override;
::ndk::ScopedAStatus startDppEnrolleeResponder(int32_t in_listenChannel) override;
::ndk::ScopedAStatus stopDppResponder(int32_t in_ownBootstrapId) override;
+ ::ndk::ScopedAStatus setQosPolicyFeatureEnabled(bool in_enable) override;
+ ::ndk::ScopedAStatus sendQosPolicyResponse(
+ bool in_morePolicies, const std::vector<QosPolicyStatus>& in_qosPolicyStatusList) override;
+ ::ndk::ScopedAStatus removeAllQosPolicies() override;
private:
// Corresponding worker functions for the AIDL methods.
@@ -241,6 +246,10 @@
DppCurve curve);
ndk::ScopedAStatus startDppEnrolleeResponderInternal(uint32_t listen_channel);
ndk::ScopedAStatus stopDppResponderInternal(uint32_t own_bootstrap_id);
+ ndk::ScopedAStatus setQosPolicyFeatureEnabledInternal(bool enable);
+ ndk::ScopedAStatus sendQosPolicyResponseInternal(
+ bool more_policies, const std::vector<QosPolicyStatus>& qos_policy_status_list);
+ ndk::ScopedAStatus removeAllQosPoliciesInternal();
struct wpa_supplicant* retrieveIfacePtr();