From 04824147432f4d856d0e56e33f4c58c09a5b64bb Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Wed, 30 Sep 2020 00:19:53 +0300 Subject: [PATCH] wlantest: Fix EAPOL-Key Key Data padding removal The case where a single 0xdd octet without any 0x00 octets is used as padding was addressed incorrectly and that ended up truncating one octet of the actual plaintext version of the Key Data value. Fix this by removing the unnecessary change to the p pointer before calculating the new length since p is already pointing to one past the last octet of the full plaintext. Signed-off-by: Jouni Malinen --- wlantest/rx_eapol.c | 1 - 1 file changed, 1 deletion(-) diff --git a/wlantest/rx_eapol.c b/wlantest/rx_eapol.c index 44388fdda..1e5d66735 100644 --- a/wlantest/rx_eapol.c +++ b/wlantest/rx_eapol.c @@ -725,7 +725,6 @@ static void rx_data_eapol_key_3_of_4(struct wlantest *wt, const u8 *dst, if (p && p > decrypted && p + 1 == decrypted + decrypted_len && *p == 0xdd) { /* Remove padding */ - p--; plain_len = p - decrypted; }