From 503901e72d7ac0249079ab933ab6a613fc4dd945 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Tue, 9 Mar 2021 17:29:48 +0200 Subject: [PATCH] wlantest: Check all configured TKs if no matching GTK is known This allows group-addressed frames to be decrypted by listing all possible GTKs in the PTK file. Signed-off-by: Jouni Malinen --- wlantest/rx_data.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/wlantest/rx_data.c b/wlantest/rx_data.c index aedf9e824..428900f24 100644 --- a/wlantest/rx_data.c +++ b/wlantest/rx_data.c @@ -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)