Revert "[wpa_supplicant] cumilative patch from commit 3a5d1a7e6"
Revert submission 26533062-Supplicant_merge_June24
Reason for revert: https://b.corp.google.com/issues/349780869
Reverted changes: /q/submissionid:26533062-Supplicant_merge_June24
Change-Id: I4a7a5b8ccb6b4822353bacc29649587cd5a3cb80
diff --git a/src/ap/dpp_hostapd.c b/src/ap/dpp_hostapd.c
index 3f89bc2..7a8ea4e 100644
--- a/src/ap/dpp_hostapd.c
+++ b/src/ap/dpp_hostapd.c
@@ -539,15 +539,8 @@
return;
}
- if (hapd->dpp_auth_ok_on_ack) {
+ if (hapd->dpp_auth_ok_on_ack)
hostapd_dpp_auth_success(hapd, 1);
- if (!hapd->dpp_auth) {
- /* The authentication session could have been removed in
- * some error cases, e.g., when starting GAS client and
- * failing to send the initial request. */
- return;
- }
- }
if (!is_broadcast_ether_addr(dst) && !ok) {
wpa_printf(MSG_DEBUG,
@@ -1420,7 +1413,7 @@
}
if (!is_zero_ether_addr(auth->peer_mac_addr) &&
- !ether_addr_equal(src, auth->peer_mac_addr)) {
+ os_memcmp(src, auth->peer_mac_addr, ETH_ALEN) != 0) {
wpa_printf(MSG_DEBUG, "DPP: MAC address mismatch (expected "
MACSTR ") - drop", MAC2STR(auth->peer_mac_addr));
return;
@@ -1470,7 +1463,7 @@
return;
}
- if (!ether_addr_equal(src, auth->peer_mac_addr)) {
+ if (os_memcmp(src, auth->peer_mac_addr, ETH_ALEN) != 0) {
wpa_printf(MSG_DEBUG, "DPP: MAC address mismatch (expected "
MACSTR ") - drop", MAC2STR(auth->peer_mac_addr));
return;
@@ -1579,7 +1572,7 @@
return;
}
- if (!ether_addr_equal(src, auth->peer_mac_addr)) {
+ if (os_memcmp(src, auth->peer_mac_addr, ETH_ALEN) != 0) {
wpa_printf(MSG_DEBUG, "DPP: MAC address mismatch (expected "
MACSTR ") - drop", MAC2STR(auth->peer_mac_addr));
return;
@@ -1865,7 +1858,7 @@
return;
}
- if (!ether_addr_equal(src, auth->peer_mac_addr)) {
+ if (os_memcmp(src, auth->peer_mac_addr, ETH_ALEN) != 0) {
wpa_printf(MSG_DEBUG, "DPP: MAC address mismatch (expected "
MACSTR ") - drop", MAC2STR(auth->peer_mac_addr));
return;
@@ -2140,7 +2133,7 @@
else
expiration = 0;
- if (wpa_auth_pmksa_add2(hapd->wpa_auth, src, intro.pmk, intro.pmk_len,
+ if (wpa_auth_pmksa_add3(hapd->wpa_auth, src, intro.pmk, intro.pmk_len,
intro.pmkid, expiration,
WPA_KEY_MGMT_DPP, pkhash) < 0) {
wpa_printf(MSG_ERROR, "DPP: Failed to add PMKSA cache entry");
@@ -2914,7 +2907,7 @@
else
expiration = 0;
- if (wpa_auth_pmksa_add2(hapd->wpa_auth, src, intro.pmk, intro.pmk_len,
+ if (wpa_auth_pmksa_add3(hapd->wpa_auth, src, intro.pmk, intro.pmk_len,
intro.pmkid, expiration,
WPA_KEY_MGMT_DPP, pkhash) < 0) {
wpa_printf(MSG_ERROR, "DPP: Failed to add PMKSA cache entry");
@@ -3080,7 +3073,7 @@
wpa_printf(MSG_DEBUG, "DPP: GAS request from " MACSTR, MAC2STR(sa));
if (!auth || (!auth->auth_success && !auth->reconfig_success) ||
- !ether_addr_equal(sa, auth->peer_mac_addr)) {
+ os_memcmp(sa, auth->peer_mac_addr, ETH_ALEN) != 0) {
#ifdef CONFIG_DPP2
if (dpp_relay_rx_gas_req(hapd->iface->interfaces->dpp, sa, data,
data_len) == 0) {
@@ -3101,13 +3094,6 @@
* exchange. */
dpp_notify_auth_success(hapd->dpp_auth, 1);
hapd->dpp_auth_ok_on_ack = 0;
-#ifdef CONFIG_TESTING_OPTIONS
- if (dpp_test == DPP_TEST_STOP_AT_AUTH_CONF) {
- wpa_printf(MSG_INFO,
- "DPP: TESTING - stop at Authentication Confirm");
- return NULL;
- }
-#endif /* CONFIG_TESTING_OPTIONS */
}
wpa_hexdump(MSG_DEBUG,
@@ -3962,25 +3948,11 @@
ifaces->dpp_pb_time.usec = 0;
dpp_pkex_free(hapd->dpp_pkex);
hapd->dpp_pkex = NULL;
- hapd->dpp_pkex_bi = NULL;
os_free(hapd->dpp_pkex_auth_cmd);
hapd->dpp_pkex_auth_cmd = NULL;
if (ifaces->dpp_pb_bi) {
char id[20];
- size_t i;
-
- for (i = 0; i < ifaces->count; i++) {
- struct hostapd_iface *iface = ifaces->iface[i];
- size_t j;
-
- for (j = 0; iface && j < iface->num_bss; j++) {
- struct hostapd_data *h = iface->bss[j];
-
- if (h->dpp_pkex_bi == ifaces->dpp_pb_bi)
- h->dpp_pkex_bi = NULL;
- }
- }
os_snprintf(id, sizeof(id), "%u", ifaces->dpp_pb_bi->id);
dpp_bootstrap_remove(ifaces->dpp, id);