From: Jouni Malinen Date: Thu, 29 Sep 2022 08:59:54 +0000 (+0300) Subject: wlantest: Recognize SAE case for moving from State 1 to 2 X-Git-Tag: hostap_2_11~1673 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5d5c2cb2be7e7e7d83bca4edb8de64058cefc13e;p=thirdparty%2Fhostap.git wlantest: Recognize SAE case for moving from State 1 to 2 Update STA state tracking for SAE authentication as well as the previous covered Open System algorithm. Signed-off-by: Jouni Malinen --- diff --git a/wlantest/rx_mgmt.c b/wlantest/rx_mgmt.c index 030f1c827..b6703ef44 100644 --- a/wlantest/rx_mgmt.c +++ b/wlantest/rx_mgmt.c @@ -312,12 +312,14 @@ static void rx_mgmt_auth(struct wlantest *wt, const u8 *data, size_t len) struct wlantest_bss *bss; struct wlantest_sta *sta; u16 alg, trans, status; + bool from_ap; mgmt = (const struct ieee80211_mgmt *) data; bss = bss_get(wt, mgmt->bssid); if (bss == NULL) return; - if (os_memcmp(mgmt->sa, mgmt->bssid, ETH_ALEN) == 0) + from_ap = os_memcmp(mgmt->sa, mgmt->bssid, ETH_ALEN) == 0; + if (from_ap) sta = sta_get(bss, mgmt->da); else sta = sta_get(bss, mgmt->sa); @@ -339,7 +341,9 @@ static void rx_mgmt_auth(struct wlantest *wt, const u8 *data, size_t len) " (alg=%u trans=%u status=%u)", MAC2STR(mgmt->sa), MAC2STR(mgmt->da), alg, trans, status); - if (alg == 0 && trans == 2 && status == 0) { + if (status == WLAN_STATUS_SUCCESS && + ((alg == WLAN_AUTH_OPEN && trans == 2) || + (alg == WLAN_AUTH_SAE && trans == 2 && from_ap))) { if (sta->state == STATE1) { add_note(wt, MSG_DEBUG, "STA " MACSTR " moved to State 2 with " MACSTR,