mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2025-02-16 23:40:43 +01:00
eap-pwd: check if server point/scalar is valid
Reported-By: Mathy Vanhoef <Mathy.Vanhoef@nyu.edu>
This commit is contained in:
parent
f9d92d6cdd
commit
9192f506d3
@ -389,10 +389,16 @@ static void eap_pwd_handle_commit(struct eap_state *eap,
|
|||||||
pwd->element_s = l_ecc_point_from_data(pwd->curve,
|
pwd->element_s = l_ecc_point_from_data(pwd->curve,
|
||||||
L_ECC_POINT_TYPE_FULL,
|
L_ECC_POINT_TYPE_FULL,
|
||||||
pkt, nbytes * 2);
|
pkt, nbytes * 2);
|
||||||
if (!pwd->element_s)
|
if (!pwd->element_s) {
|
||||||
goto invalid_point;
|
l_error("Server sent invalid Element_S during commit");
|
||||||
|
goto error;
|
||||||
|
}
|
||||||
|
|
||||||
pwd->scalar_s = l_ecc_scalar_new(pwd->curve, pkt + nbytes * 2, nbytes);
|
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);
|
pwd->p_rand = l_ecc_scalar_new_random(pwd->curve);
|
||||||
p_mask = 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;
|
return;
|
||||||
|
|
||||||
invalid_point:
|
|
||||||
l_error("invalid point during commit exchange");
|
|
||||||
error:
|
error:
|
||||||
eap_method_error(eap);
|
eap_method_error(eap);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user