]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
wlantest: Do not report decryption failures for WEP keys if no keys
authorJouni Malinen <j@w1.fi>
Fri, 3 Apr 2020 20:56:10 +0000 (23:56 +0300)
committerJouni Malinen <j@w1.fi>
Fri, 3 Apr 2020 20:56:10 +0000 (23:56 +0300)
If no WEP keys are available, there is not going to be an attempt to
decrypt the frame, so don't claim decryption failed.

Signed-off-by: Jouni Malinen <j@w1.fi>
wlantest/rx_data.c

index fa8df77beeeec0e7d02e85f16ddea0cdfa613a3e..e8160c3f6f9ea20617729c256fae60dd9535d8f2 100644 (file)
@@ -260,8 +260,9 @@ static void rx_data_bss_prot_group(struct wlantest *wt,
 
        check_plaintext_prot(wt, hdr, data, len);
        keyid = data[3] >> 6;
-       if (bss->gtk_len[keyid] == 0 && bss->group_cipher != WPA_CIPHER_WEP40)
-       {
+       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)",
                         MAC2STR(hdr->addr2), keyid);