3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-12-26 01:02:35 +01:00

eap-wsc: Validate enrollee_nonce (N1) in M{2,4,6,8}

This commit is contained in:
Andrew Zaborowski 2020-08-13 02:53:25 +02:00 committed by Denis Kenzior
parent c826dd0052
commit 45d74ac1ed

View File

@ -479,6 +479,10 @@ static void eap_wsc_handle_m8(struct eap_state *eap,
return;
}
if (memcmp(m8.enrollee_nonce, wsc->m1->enrollee_nonce,
sizeof(m8.enrollee_nonce)))
return;
if (!authenticator_check(wsc, pdu, len))
return;
@ -580,6 +584,10 @@ static void eap_wsc_handle_m6(struct eap_state *eap,
if (wsc_parse_m6(pdu, len, &m6, &encrypted) != 0)
goto send_nack;
if (memcmp(m6.enrollee_nonce, wsc->m1->enrollee_nonce,
sizeof(m6.enrollee_nonce)))
return;
if (!authenticator_check(wsc, pdu, len))
return;
@ -677,6 +685,10 @@ static void eap_wsc_handle_m4(struct eap_state *eap,
if (wsc_parse_m4(pdu, len, &m4, &encrypted) != 0)
goto send_nack;
if (memcmp(m4.enrollee_nonce, wsc->m1->enrollee_nonce,
sizeof(m4.enrollee_nonce)))
return;
if (!authenticator_check(wsc, pdu, len))
return;
@ -815,6 +827,10 @@ static void eap_wsc_handle_m2(struct eap_state *eap,
return;
}
if (memcmp(wsc->m2->enrollee_nonce, wsc->m1->enrollee_nonce,
sizeof(wsc->m2->enrollee_nonce)))
return;
if (!l_key_validate_dh_payload(wsc->m2->public_key,
sizeof(wsc->m2->public_key),
crypto_dh5_prime,