From dd4722df9bb45f8133adff637eee25670257d94c Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sun, 26 Mar 2017 12:49:59 +0300 Subject: [PATCH] wlantest: Fix pcapng writer to include decrypted EAPOL-Key Key Data 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 --- wlantest/rx_eapol.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wlantest/rx_eapol.c b/wlantest/rx_eapol.c index 27011cbaa..c4f5e8da5 100644 --- a/wlantest/rx_eapol.c +++ b/wlantest/rx_eapol.c @@ -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;