From a845601ffe322f93d1ed9b22e8fa5f2110e2411f Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Thu, 31 Aug 2023 21:10:54 +0300 Subject: [PATCH] wlantest: Derive PTK in MLO using MLD MAC addresses for FT over-the-air IEEE P802.11be/D4.0 does not seem to have changed the rules for deriving PTK in FT hierarchy since there were no changes to 12.7.1.6.5 (PTK) where BSSID and STA-ADDR are used. However, the MLO changes for FT and for PTK derivation in non-FT cases seem to imply that this FT case is also supposed to use MLD MAC addresses. Commit 628b9f10223d ("wlantest: Derive PMK-R1 and PTK using AA/SPA for MLO FT over-the-DS") did this already for FT over-the-DS, so do the same for FT over-the-air. Signed-off-by: Jouni Malinen --- wlantest/rx_mgmt.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/wlantest/rx_mgmt.c b/wlantest/rx_mgmt.c index 7f3fffe86..990c09914 100644 --- a/wlantest/rx_mgmt.c +++ b/wlantest/rx_mgmt.c @@ -528,7 +528,7 @@ static void process_ft_auth(struct wlantest *wt, struct wlantest_bss *bss, u8 ptk_name[WPA_PMK_NAME_LEN]; struct wlantest_bss *old_bss; struct wlantest_sta *old_sta = NULL; - const u8 *spa; + const u8 *spa, *aa; struct ieee802_11_elems elems; const u8 *ie; size_t ie_len; @@ -566,6 +566,7 @@ static void process_ft_auth(struct wlantest *wt, struct wlantest_bss *bss, goto out; spa = elems.basic_mle ? sta->mld_mac_addr : sta->addr; + aa = elems.basic_mle ? bss->mld_mac_addr : bss->bssid; if (!parse.fte_snonce || os_memcmp(sta->snonce, parse.fte_snonce, WPA_NONCE_LEN) != 0) { @@ -607,7 +608,7 @@ static void process_ft_auth(struct wlantest *wt, struct wlantest_bss *bss, if (!parse.fte_anonce || !parse.fte_snonce || wpa_pmk_r1_to_ptk(sta->pmk_r1, sta->pmk_r1_len, parse.fte_snonce, - parse.fte_anonce, sta->addr, bss->bssid, + parse.fte_anonce, spa, aa, sta->pmk_r1_name, &ptk, ptk_name, sta->key_mgmt, sta->pairwise_cipher, 0) < 0) goto out;