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 <jouni@codeaurora.org>
master
Jouni Malinen 4 years ago committed by Jouni Malinen
parent 13feeaa104
commit 0482414743

@ -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;
}

Loading…
Cancel
Save