From 5d5c2cb2be7e7e7d83bca4edb8de64058cefc13e Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Thu, 29 Sep 2022 11:59:54 +0300 Subject: [PATCH] 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 --- wlantest/rx_mgmt.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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,