eap-mschapv2: Fix length check for successful responses on the client

While wrong, this isn't an issue in practice as AUTH_RESPONSE_LEN is
long enough that subtracting HEADER_LEN is fine.

Fixes: f98cdf7a47 ("adding plugin for EAP-MS-CHAPv2")
This commit is contained in:
Tobias Brunner
2025-10-27 14:02:59 +01:00
committed by Andreas Steffen
parent 4cf88da4d7
commit 9ef637e782
@@ -889,7 +889,7 @@ static status_t process_peer_success(private_eap_mschapv2_t *this,
data = in->get_data(in);
eap = (eap_mschapv2_header_t*)data.ptr;
if (data.len < AUTH_RESPONSE_LEN)
if (data.len < HEADER_LEN + AUTH_RESPONSE_LEN)
{
DBG1(DBG_IKE, "received invalid EAP-MS-CHAPv2 message: too short");
return FAILED;