]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
wlantest: Fix EAPOL-Key Key Data padding removal
authorJouni Malinen <jouni@codeaurora.org>
Tue, 29 Sep 2020 21:19:53 +0000 (00:19 +0300)
committerJouni Malinen <j@w1.fi>
Tue, 29 Sep 2020 21:19:53 +0000 (00:19 +0300)
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 <jouni@codeaurora.org>
wlantest/rx_eapol.c

index 44388fdda4e064fb91128c5c9540a52ec64448d6..1e5d66735510e8056854ba1aab330acd70854538 100644 (file)
@@ -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;
                }