mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2025-11-26 06:07:26 +01:00
handshake: pass object to handshake_util_ap_ie_matches
This is to prepare for supporting a vendor quirk, where we'll need the handshake to lookup if the quirk to disable a specific check.
This commit is contained in:
parent
6e9e0928b0
commit
54c0dbb3c8
@ -1810,7 +1810,7 @@ static void eapol_handle_ptk_3_of_4(struct eapol_sm *sm,
|
|||||||
|
|
||||||
if ((rsne[1] != hs->authenticator_ie[1] ||
|
if ((rsne[1] != hs->authenticator_ie[1] ||
|
||||||
memcmp(rsne + 2, hs->authenticator_ie + 2, rsne[1])) &&
|
memcmp(rsne + 2, hs->authenticator_ie + 2, rsne[1])) &&
|
||||||
!handshake_util_ap_ie_matches(&rsn_info,
|
!handshake_util_ap_ie_matches(hs, &rsn_info,
|
||||||
hs->authenticator_ie,
|
hs->authenticator_ie,
|
||||||
hs->wpa_ie))
|
hs->wpa_ie))
|
||||||
goto error_ie_different;
|
goto error_ie_different;
|
||||||
|
|||||||
10
src/ft.c
10
src/ft.c
@ -223,7 +223,8 @@ static bool ft_parse_associate_resp_frame(const uint8_t *frame, size_t frame_len
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool ft_verify_rsne(const uint8_t *rsne, const uint8_t *pmk_r0_name,
|
static bool ft_verify_rsne(struct handshake_state *hs,
|
||||||
|
const uint8_t *rsne, const uint8_t *pmk_r0_name,
|
||||||
const uint8_t *authenticator_ie)
|
const uint8_t *authenticator_ie)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
@ -253,7 +254,7 @@ static bool ft_verify_rsne(const uint8_t *rsne, const uint8_t *pmk_r0_name,
|
|||||||
memcmp(msg2_rsne.pmkids, pmk_r0_name, 16))
|
memcmp(msg2_rsne.pmkids, pmk_r0_name, 16))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (!handshake_util_ap_ie_matches(&msg2_rsne, authenticator_ie, false))
|
if (!handshake_util_ap_ie_matches(hs, &msg2_rsne, authenticator_ie, false))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@ -301,7 +302,8 @@ static int parse_ies(struct handshake_state *hs,
|
|||||||
is_rsn = hs->supplicant_ie != NULL;
|
is_rsn = hs->supplicant_ie != NULL;
|
||||||
|
|
||||||
if (is_rsn) {
|
if (is_rsn) {
|
||||||
if (!ft_verify_rsne(rsne, hs->pmk_r0_name, authenticator_ie))
|
if (!ft_verify_rsne(hs, rsne, hs->pmk_r0_name,
|
||||||
|
authenticator_ie))
|
||||||
goto ft_error;
|
goto ft_error;
|
||||||
} else if (rsne)
|
} else if (rsne)
|
||||||
goto ft_error;
|
goto ft_error;
|
||||||
@ -480,7 +482,7 @@ int __ft_rx_associate(uint32_t ifindex, const uint8_t *frame, size_t frame_len)
|
|||||||
memcmp(msg4_rsne.pmkids, hs->pmk_r1_name, 16))
|
memcmp(msg4_rsne.pmkids, hs->pmk_r1_name, 16))
|
||||||
return -EBADMSG;
|
return -EBADMSG;
|
||||||
|
|
||||||
if (!handshake_util_ap_ie_matches(&msg4_rsne,
|
if (!handshake_util_ap_ie_matches(hs, &msg4_rsne,
|
||||||
hs->authenticator_ie,
|
hs->authenticator_ie,
|
||||||
false))
|
false))
|
||||||
return -EBADMSG;
|
return -EBADMSG;
|
||||||
|
|||||||
@ -877,7 +877,8 @@ void handshake_state_set_igtk(struct handshake_state *s, const uint8_t *key,
|
|||||||
* results vs the RSN/WPA IE obtained as part of the 4-way handshake. If they
|
* results vs the RSN/WPA IE obtained as part of the 4-way handshake. If they
|
||||||
* don't match, the EAPoL packet must be silently discarded.
|
* don't match, the EAPoL packet must be silently discarded.
|
||||||
*/
|
*/
|
||||||
bool handshake_util_ap_ie_matches(const struct ie_rsn_info *msg_info,
|
bool handshake_util_ap_ie_matches(struct handshake_state *s,
|
||||||
|
const struct ie_rsn_info *msg_info,
|
||||||
const uint8_t *scan_ie, bool is_wpa)
|
const uint8_t *scan_ie, bool is_wpa)
|
||||||
{
|
{
|
||||||
struct ie_rsn_info scan_info;
|
struct ie_rsn_info scan_info;
|
||||||
|
|||||||
@ -312,7 +312,8 @@ bool handshake_state_set_pmksa(struct handshake_state *s, struct pmksa *pmksa);
|
|||||||
void handshake_state_cache_pmksa(struct handshake_state *s);
|
void handshake_state_cache_pmksa(struct handshake_state *s);
|
||||||
bool handshake_state_remove_pmksa(struct handshake_state *s);
|
bool handshake_state_remove_pmksa(struct handshake_state *s);
|
||||||
|
|
||||||
bool handshake_util_ap_ie_matches(const struct ie_rsn_info *msg_info,
|
bool handshake_util_ap_ie_matches(struct handshake_state *s,
|
||||||
|
const struct ie_rsn_info *msg_info,
|
||||||
const uint8_t *scan_ie, bool is_wpa);
|
const uint8_t *scan_ie, bool is_wpa);
|
||||||
|
|
||||||
const uint8_t *handshake_util_find_kde(enum handshake_kde selector,
|
const uint8_t *handshake_util_find_kde(enum handshake_kde selector,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user