Merge "Allow compilation without HS20/INTERWORKING" am: 3c7a7cde4b am: 695b875c54 am: 23251a9b00

Original change: https://android-review.googlesource.com/c/platform/external/wpa_supplicant_8/+/2494216

Change-Id: I1fc895d3b635701d59f34139ac3407ef4e7296a5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Treehugger Robot
2023-05-11 20:21:13 +00:00
committed by Automerger Merge Worker
4 changed files with 35 additions and 0 deletions

View File

@@ -773,6 +773,7 @@ int AidlManager::notifyNetworkRequest(
return 1; return 1;
} }
#ifdef CONFIG_INTERWORKING
/** /**
* Notify that the AT_PERMANENT_ID_REQ is denied from eap_peer when the strict * Notify that the AT_PERMANENT_ID_REQ is denied from eap_peer when the strict
* conservative peer mode is enabled. * conservative peer mode is enabled.
@@ -843,6 +844,7 @@ void AidlManager::notifyAnqpQueryDone(
} }
} }
#ifdef CONFIG_HS20
aidl_hs20_anqp_data.operatorFriendlyName = aidl_hs20_anqp_data.operatorFriendlyName =
misc_utils::convertWpaBufToVector( misc_utils::convertWpaBufToVector(
anqp->hs20_operator_friendly_name); anqp->hs20_operator_friendly_name);
@@ -854,6 +856,16 @@ void AidlManager::notifyAnqpQueryDone(
aidl_hs20_anqp_data.osuProvidersList = aidl_hs20_anqp_data.osuProvidersList =
misc_utils::convertWpaBufToVector( misc_utils::convertWpaBufToVector(
anqp->hs20_osu_providers_list); anqp->hs20_osu_providers_list);
#else
aidl_hs20_anqp_data.operatorFriendlyName =
misc_utils::convertWpaBufToVector(NULL);
aidl_hs20_anqp_data.wanMetrics =
misc_utils::convertWpaBufToVector(NULL);
aidl_hs20_anqp_data.connectionCapability =
misc_utils::convertWpaBufToVector(NULL);
aidl_hs20_anqp_data.osuProvidersList =
misc_utils::convertWpaBufToVector(NULL);
#endif /* CONFIG_HS20 */
} }
callWithEachStaIfaceCallback( callWithEachStaIfaceCallback(
@@ -862,6 +874,7 @@ void AidlManager::notifyAnqpQueryDone(
std::placeholders::_1, macAddrToVec(bssid), aidl_anqp_data, std::placeholders::_1, macAddrToVec(bssid), aidl_anqp_data,
aidl_hs20_anqp_data)); aidl_hs20_anqp_data));
} }
#endif /* CONFIG_INTERWORKING */
/** /**
* Notify all listeners about the end of an HS20 icon query. * Notify all listeners about the end of an HS20 icon query.

View File

@@ -1087,6 +1087,7 @@ ndk::ScopedAStatus StaIface::initiateAnqpQueryInternal(
if (info_elements.size() > kMaxAnqpElems) { if (info_elements.size() > kMaxAnqpElems) {
return createStatus(SupplicantStatusCode::FAILURE_ARGS_INVALID); return createStatus(SupplicantStatusCode::FAILURE_ARGS_INVALID);
} }
#ifdef CONFIG_INTERWORKING
uint16_t info_elems_buf[kMaxAnqpElems]; uint16_t info_elems_buf[kMaxAnqpElems];
uint32_t num_info_elems = 0; uint32_t num_info_elems = 0;
for (const auto &info_element : info_elements) { for (const auto &info_element : info_elements) {
@@ -1110,11 +1111,15 @@ ndk::ScopedAStatus StaIface::initiateAnqpQueryInternal(
return createStatus(SupplicantStatusCode::FAILURE_UNKNOWN); return createStatus(SupplicantStatusCode::FAILURE_UNKNOWN);
} }
return ndk::ScopedAStatus::ok(); return ndk::ScopedAStatus::ok();
#else
return createStatus(SupplicantStatusCode::FAILURE_UNSUPPORTED);
#endif /* CONFIG_INTERWORKING */
} }
ndk::ScopedAStatus StaIface::initiateVenueUrlAnqpQueryInternal( ndk::ScopedAStatus StaIface::initiateVenueUrlAnqpQueryInternal(
const std::vector<uint8_t> &mac_address) const std::vector<uint8_t> &mac_address)
{ {
#ifdef CONFIG_INTERWORKING
struct wpa_supplicant *wpa_s = retrieveIfacePtr(); struct wpa_supplicant *wpa_s = retrieveIfacePtr();
uint16_t info_elems_buf[1] = {ANQP_VENUE_URL}; uint16_t info_elems_buf[1] = {ANQP_VENUE_URL};
if (mac_address.size() != ETH_ALEN) { if (mac_address.size() != ETH_ALEN) {
@@ -1126,11 +1131,15 @@ ndk::ScopedAStatus StaIface::initiateVenueUrlAnqpQueryInternal(
return createStatus(SupplicantStatusCode::FAILURE_UNKNOWN); return createStatus(SupplicantStatusCode::FAILURE_UNKNOWN);
} }
return ndk::ScopedAStatus::ok(); return ndk::ScopedAStatus::ok();
#else
return createStatus(SupplicantStatusCode::FAILURE_UNSUPPORTED);
#endif /* CONFIG_INTERWORKING */
} }
ndk::ScopedAStatus StaIface::initiateHs20IconQueryInternal( ndk::ScopedAStatus StaIface::initiateHs20IconQueryInternal(
const std::vector<uint8_t> &mac_address, const std::string &file_name) const std::vector<uint8_t> &mac_address, const std::string &file_name)
{ {
#ifdef CONFIG_HS20
struct wpa_supplicant *wpa_s = retrieveIfacePtr(); struct wpa_supplicant *wpa_s = retrieveIfacePtr();
if (mac_address.size() != ETH_ALEN) { if (mac_address.size() != ETH_ALEN) {
return createStatus(SupplicantStatusCode::FAILURE_UNKNOWN); return createStatus(SupplicantStatusCode::FAILURE_UNKNOWN);
@@ -1143,6 +1152,9 @@ ndk::ScopedAStatus StaIface::initiateHs20IconQueryInternal(
return createStatus(SupplicantStatusCode::FAILURE_UNKNOWN); return createStatus(SupplicantStatusCode::FAILURE_UNKNOWN);
} }
return ndk::ScopedAStatus::ok(); return ndk::ScopedAStatus::ok();
#else
return createStatus(SupplicantStatusCode::FAILURE_UNSUPPORTED);
#endif /* CONFIG_HS20 */
} }
std::pair<std::vector<uint8_t>, ndk::ScopedAStatus> std::pair<std::vector<uint8_t>, ndk::ScopedAStatus>

View File

@@ -1420,12 +1420,16 @@ ndk::ScopedAStatus StaNetwork::setIdStrInternal(const std::string &id_str)
ndk::ScopedAStatus StaNetwork::setUpdateIdentifierInternal(uint32_t id) ndk::ScopedAStatus StaNetwork::setUpdateIdentifierInternal(uint32_t id)
{ {
#ifdef CONFIG_HS20
struct wpa_ssid *wpa_ssid = retrieveNetworkPtr(); struct wpa_ssid *wpa_ssid = retrieveNetworkPtr();
wpa_ssid->update_identifier = id; wpa_ssid->update_identifier = id;
wpa_printf( wpa_printf(
MSG_MSGDUMP, "update_identifier: %d", wpa_ssid->update_identifier); MSG_MSGDUMP, "update_identifier: %d", wpa_ssid->update_identifier);
resetInternalStateAfterParamsUpdate(); resetInternalStateAfterParamsUpdate();
return ndk::ScopedAStatus::ok(); return ndk::ScopedAStatus::ok();
#else
return createStatusWithMsg(SupplicantStatusCode::FAILURE_UNKNOWN, "Not implemented");
#endif /* CONFIG_HS20 */
} }
ndk::ScopedAStatus StaNetwork::setWapiCertSuiteInternal(const std::string &suite) ndk::ScopedAStatus StaNetwork::setWapiCertSuiteInternal(const std::string &suite)
@@ -2301,6 +2305,7 @@ StaNetwork::getPairwiseCipherInternal()
ndk::ScopedAStatus StaNetwork::setRoamingConsortiumSelectionInternal( ndk::ScopedAStatus StaNetwork::setRoamingConsortiumSelectionInternal(
const std::vector<uint8_t> &selectedRcoi) const std::vector<uint8_t> &selectedRcoi)
{ {
#ifdef CONFIG_HS20
struct wpa_ssid *wpa_ssid = retrieveNetworkPtr(); struct wpa_ssid *wpa_ssid = retrieveNetworkPtr();
if (wpa_ssid == NULL) { if (wpa_ssid == NULL) {
return createStatus(SupplicantStatusCode::FAILURE_NETWORK_INVALID); return createStatus(SupplicantStatusCode::FAILURE_NETWORK_INVALID);
@@ -2316,6 +2321,9 @@ ndk::ScopedAStatus StaNetwork::setRoamingConsortiumSelectionInternal(
resetInternalStateAfterParamsUpdate(); resetInternalStateAfterParamsUpdate();
return ndk::ScopedAStatus::ok(); return ndk::ScopedAStatus::ok();
#else
return createStatusWithMsg(SupplicantStatusCode::FAILURE_UNKNOWN, "Not implemented");
#endif /* CONFIG_HS20 */
} }
/** /**

View File

@@ -1661,6 +1661,7 @@ static int interworking_connect_roaming_consortium(
if (interworking_set_hs20_params(wpa_s, ssid) < 0) if (interworking_set_hs20_params(wpa_s, ssid) < 0)
goto fail; goto fail;
#ifdef CONFIG_HS20
ie = wpa_bss_get_ie(bss, WLAN_EID_ROAMING_CONSORTIUM); ie = wpa_bss_get_ie(bss, WLAN_EID_ROAMING_CONSORTIUM);
anqp = bss->anqp ? bss->anqp->roaming_consortium : NULL; anqp = bss->anqp ? bss->anqp->roaming_consortium : NULL;
for (i = 0; (ie || anqp) && i < cred->num_roaming_consortiums; i++) { for (i = 0; (ie || anqp) && i < cred->num_roaming_consortiums; i++) {
@@ -1679,6 +1680,7 @@ static int interworking_connect_roaming_consortium(
cred->roaming_consortiums_len[i]; cred->roaming_consortiums_len[i];
break; break;
} }
#endif /* CONFIG_HS20 */
if (cred->eap_method == NULL) { if (cred->eap_method == NULL) {
wpa_msg(wpa_s, MSG_DEBUG, wpa_msg(wpa_s, MSG_DEBUG,