aboutsummaryrefslogtreecommitdiffstats
path: root/wlantest
diff options
context:
space:
mode:
authorJouni Malinen <jouni@qca.qualcomm.com>2017-03-24 18:53:54 (GMT)
committerJouni Malinen <j@w1.fi>2017-03-26 18:13:10 (GMT)
commit19e7ddf7fbdc40f2eeef625a63eda2fc17a3739d (patch)
tree6a92359dbce4035a0ccf9cd4a8f25667eccd2324 /wlantest
parent6c2056abe559aaaa516c9f45b9adf8b955383f81 (diff)
downloadhostap-19e7ddf7fbdc40f2eeef625a63eda2fc17a3739d.zip
hostap-19e7ddf7fbdc40f2eeef625a63eda2fc17a3739d.tar.gz
hostap-19e7ddf7fbdc40f2eeef625a63eda2fc17a3739d.tar.bz2
wlantest: Fix EAPOL buffer length with variable MIC length
struct wpa_eapol_key does not include the MIC field anymore, so need to add it explicitly. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Diffstat (limited to 'wlantest')
-rw-r--r--wlantest/rx_eapol.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/wlantest/rx_eapol.c b/wlantest/rx_eapol.c
index aa0566d..3366ad4 100644
--- a/wlantest/rx_eapol.c
+++ b/wlantest/rx_eapol.c
@@ -640,7 +640,7 @@ static void rx_data_eapol_key_3_of_4(struct wlantest *wt, const u8 *dst,
}
if (wt->write_pcap_dumper && decrypted != key_data) {
/* Fill in a dummy Data frame header */
- u8 buf[24 + 8 + sizeof(*eapol) + sizeof(*hdr)];
+ u8 buf[24 + 8 + sizeof(*eapol) + sizeof(*hdr) + 64];
struct ieee80211_hdr *h;
struct wpa_eapol_key *k;
const u8 *p;
@@ -675,7 +675,8 @@ static void rx_data_eapol_key_3_of_4(struct wlantest *wt, const u8 *dst,
WPA_PUT_BE16(k->key_info,
key_info & ~WPA_KEY_INFO_ENCR_KEY_DATA);
WPA_PUT_BE16(pos, plain_len);
- write_pcap_decrypted(wt, buf, sizeof(buf),
+ write_pcap_decrypted(wt, buf, 24 + 8 + sizeof(*eapol) +
+ sizeof(*hdr) + mic_len + 2,
decrypted, plain_len);
}
@@ -835,7 +836,7 @@ static void rx_data_eapol_key_1_of_2(struct wlantest *wt, const u8 *dst,
decrypted, decrypted_len);
if (wt->write_pcap_dumper) {
/* Fill in a dummy Data frame header */
- u8 buf[24 + 8 + sizeof(*eapol) + sizeof(*hdr)];
+ u8 buf[24 + 8 + sizeof(*eapol) + sizeof(*hdr) + 64];
struct ieee80211_hdr *h;
struct wpa_eapol_key *k;
u8 *pos;
@@ -869,7 +870,8 @@ static void rx_data_eapol_key_1_of_2(struct wlantest *wt, const u8 *dst,
WPA_PUT_BE16(k->key_info,
key_info & ~WPA_KEY_INFO_ENCR_KEY_DATA);
WPA_PUT_BE16(pos, plain_len);
- write_pcap_decrypted(wt, buf, sizeof(buf),
+ write_pcap_decrypted(wt, buf, 24 + 8 + sizeof(*eapol) +
+ sizeof(*hdr) + mic_len + 2,
decrypted, plain_len);
}
if (sta->proto & WPA_PROTO_RSN)