]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
wlantest: Derive PTK in MLO using MLD MAC addresses for FT over-the-air
authorJouni Malinen <quic_jouni@quicinc.com>
Thu, 31 Aug 2023 18:10:54 +0000 (21:10 +0300)
committerJouni Malinen <j@w1.fi>
Thu, 31 Aug 2023 18:10:54 +0000 (21:10 +0300)
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 <quic_jouni@quicinc.com>
wlantest/rx_mgmt.c

index 7f3fffe866759f406f118408ac5b59b50bf01750..990c09914a208e7c7f34d1509526196295c72e50 100644 (file)
@@ -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;