]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
wlantest: Check all configured TKs if no matching GTK is known
authorJouni Malinen <jouni@codeaurora.org>
Tue, 9 Mar 2021 15:29:48 +0000 (17:29 +0200)
committerJouni Malinen <j@w1.fi>
Tue, 9 Mar 2021 15:29:48 +0000 (17:29 +0200)
This allows group-addressed frames to be decrypted by listing all
possible GTKs in the PTK file.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
wlantest/rx_data.c

index aedf9e824eb37a6a3b89dda9b637e5691e933050..428900f24c40548490e965ea4e94dcda2b6a415a 100644 (file)
@@ -250,8 +250,13 @@ static void rx_data_bss_prot_group(struct wlantest *wt,
        if (bss->gtk_len[keyid] == 0 &&
            (bss->group_cipher != WPA_CIPHER_WEP40 ||
             dl_list_empty(&wt->wep))) {
-               add_note(wt, MSG_MSGDUMP, "No GTK known to decrypt the frame "
-                        "(A2=" MACSTR " KeyID=%d)",
+               decrypted = try_all_ptk(wt, bss->group_cipher, hdr, keyid,
+                                       data, len, &dlen);
+               if (decrypted)
+                       goto process;
+               add_note(wt, MSG_MSGDUMP,
+                        "No GTK known to decrypt the frame (A2=" MACSTR
+                        " KeyID=%d)",
                         MAC2STR(hdr->addr2), keyid);
                return;
        }
@@ -304,6 +309,7 @@ skip_replay_det:
                wpa_snprintf_hex(gtk, sizeof(gtk), bss->gtk[keyid],
                                 bss->gtk_len[keyid]);
                add_note(wt, MSG_EXCESSIVE, "GTK[%d] %s", keyid, gtk);
+       process:
                rx_data_process(wt, bss->bssid, NULL, dst, src, decrypted,
                                dlen, 1, NULL);
                if (!replay)