]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
wlantest: Fix pcapng writer to include decrypted EAPOL-Key Key Data
authorJouni Malinen <j@w1.fi>
Sun, 26 Mar 2017 09:49:59 +0000 (12:49 +0300)
committerJouni Malinen <j@w1.fi>
Sun, 26 Mar 2017 18:13:21 +0000 (21:13 +0300)
This was only written to pcapng files if both pcap and pcapng writing
was requested. Fix this for the case where only a pcapng file is being
written.

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

index 27011cbaa4c37fd83e174ad60f4034646e95911a..c4f5e8da50a9484efdd456d6d960ec8ba18624dd 100644 (file)
@@ -638,7 +638,7 @@ static void rx_data_eapol_key_3_of_4(struct wlantest *wt, const u8 *dst,
                wpa_hexdump(MSG_DEBUG, "Decrypted EAPOL-Key Key Data",
                            decrypted, decrypted_len);
        }
-       if (wt->write_pcap_dumper && decrypted != key_data) {
+       if ((wt->write_pcap_dumper || wt->pcapng) && decrypted != key_data) {
                /* Fill in a dummy Data frame header */
                u8 buf[24 + 8 + sizeof(*eapol) + sizeof(*hdr) + 64];
                struct ieee80211_hdr *h;
@@ -841,7 +841,7 @@ static void rx_data_eapol_key_1_of_2(struct wlantest *wt, const u8 *dst,
        }
        wpa_hexdump(MSG_DEBUG, "Decrypted EAPOL-Key Key Data",
                    decrypted, decrypted_len);
-       if (wt->write_pcap_dumper) {
+       if (wt->write_pcap_dumper || wt->pcapng) {
                /* Fill in a dummy Data frame header */
                u8 buf[24 + 8 + sizeof(*eapol) + sizeof(*hdr) + 64];
                struct ieee80211_hdr *h;