mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-11-22 14:49:24 +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,
|
||||
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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user