aboutsummaryrefslogtreecommitdiffstats
path: root/wlantest
diff options
context:
space:
mode:
authorJouni Malinen <jouni@qca.qualcomm.com>2017-03-24 21:34:19 (GMT)
committerJouni Malinen <j@w1.fi>2017-03-26 18:13:19 (GMT)
commitfaf0fef1dc1898b16d03b96aa2f39028f7faa528 (patch)
tree5430fbba1e859e39122e621f26fa82f0fcef1dcf /wlantest
parentf58afccdddd66bcb28aa0005fc4c90a7cd29d8d5 (diff)
downloadhostap-faf0fef1dc1898b16d03b96aa2f39028f7faa528.zip
hostap-faf0fef1dc1898b16d03b96aa2f39028f7faa528.tar.gz
hostap-faf0fef1dc1898b16d03b96aa2f39028f7faa528.tar.bz2
wlantest: Fix EAPOL-Key Key Data padding removal
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Diffstat (limited to 'wlantest')
-rw-r--r--wlantest/rx_eapol.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/wlantest/rx_eapol.c b/wlantest/rx_eapol.c
index 3366ad4..27011cb 100644
--- a/wlantest/rx_eapol.c
+++ b/wlantest/rx_eapol.c
@@ -653,10 +653,17 @@ static void rx_data_eapol_key_3_of_4(struct wlantest *wt, const u8 *dst,
if (p[0] == 0xdd && p[1] == 0x00) {
/* Remove padding */
plain_len = p - decrypted;
+ p = NULL;
break;
}
p += 2 + p[1];
}
+ if (p && p > decrypted && *p == 0xdd &&
+ p + 1 == decrypted + decrypted_len) {
+ /* Remove padding */
+ p--;
+ plain_len = p - decrypted;
+ }
os_memset(buf, 0, sizeof(buf));
h = (struct ieee80211_hdr *) buf;