3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-12-22 21:22:37 +01:00

eap-pwd: check if server point/scalar is valid

Reported-By: Mathy Vanhoef <Mathy.Vanhoef@nyu.edu>
This commit is contained in:
James Prestwood 2019-04-10 11:54:13 -07:00 committed by Denis Kenzior
parent f9d92d6cdd
commit 9192f506d3

View File

@ -389,10 +389,16 @@ static void eap_pwd_handle_commit(struct eap_state *eap,
pwd->element_s = l_ecc_point_from_data(pwd->curve,
L_ECC_POINT_TYPE_FULL,
pkt, nbytes * 2);
if (!pwd->element_s)
goto invalid_point;
if (!pwd->element_s) {
l_error("Server sent invalid Element_S during commit");
goto error;
}
pwd->scalar_s = l_ecc_scalar_new(pwd->curve, pkt + nbytes * 2, nbytes);
if (!pwd->scalar_s) {
l_error("Server sent invalid Scalar_S during commit");
goto error;
}
pwd->p_rand = l_ecc_scalar_new_random(pwd->curve);
p_mask = l_ecc_scalar_new_random(pwd->curve);
@ -423,8 +429,6 @@ static void eap_pwd_handle_commit(struct eap_state *eap,
return;
invalid_point:
l_error("invalid point during commit exchange");
error:
eap_method_error(eap);
}