mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2025-01-31 09:14:03 -05:00
FT: Move wpa_ft_rrb_build_r0() special case to caller
Handle the special case of no PMK-R0 entry in the caller instead of having to have wpa_ft_rrb_build_r0() aware of the possibility of pmk_r0 being NULL. Signed-off-by: Michael Braun <michael-dev@fami-braun.de>
This commit is contained in:
parent
8c345234fd
commit
9fbe292ff3
@ -3018,11 +3018,6 @@ static int wpa_ft_rrb_build_r0(const u8 *key, const size_t key_len,
|
|||||||
{ .type = FT_RRB_LAST_EMPTY, .len = 0, .data = NULL },
|
{ .type = FT_RRB_LAST_EMPTY, .len = 0, .data = NULL },
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!pmk_r0)
|
|
||||||
return wpa_ft_rrb_build(key, key_len, tlvs, NULL, tlv_auth,
|
|
||||||
NULL, src_addr, type,
|
|
||||||
packet, packet_len);
|
|
||||||
|
|
||||||
if (wpa_derive_pmk_r1(pmk_r0->pmk_r0, pmk_r0->pmk_r0_name, r1kh_id,
|
if (wpa_derive_pmk_r1(pmk_r0->pmk_r0, pmk_r0->pmk_r0_name, r1kh_id,
|
||||||
s1kh_id, pmk_r1, pmk_r1_name) < 0)
|
s1kh_id, pmk_r1, pmk_r1_name) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
@ -3172,13 +3167,18 @@ static int wpa_ft_rrb_rx_pull(struct wpa_authenticator *wpa_auth,
|
|||||||
resp_auth[4].len = 0;
|
resp_auth[4].len = 0;
|
||||||
resp_auth[4].data = NULL;
|
resp_auth[4].data = NULL;
|
||||||
|
|
||||||
if (wpa_ft_fetch_pmk_r0(wpa_auth, f_s1kh_id, f_pmk_r0_name, &r0) < 0)
|
if (wpa_ft_fetch_pmk_r0(wpa_auth, f_s1kh_id, f_pmk_r0_name, &r0) < 0) {
|
||||||
wpa_printf(MSG_DEBUG, "FT: No matching PMK-R0-Name found");
|
wpa_printf(MSG_DEBUG, "FT: No matching PMK-R0-Name found");
|
||||||
|
ret = wpa_ft_rrb_build(key, key_len, resp, NULL, resp_auth,
|
||||||
ret = wpa_ft_rrb_build_r0(key, key_len, resp, r0, f_r1kh_id, f_s1kh_id,
|
NULL, wpa_auth->addr,
|
||||||
resp_auth, wpa_auth->addr,
|
FT_PACKET_R0KH_R1KH_RESP,
|
||||||
FT_PACKET_R0KH_R1KH_RESP,
|
&packet, &packet_len);
|
||||||
&packet, &packet_len);
|
} else {
|
||||||
|
ret = wpa_ft_rrb_build_r0(key, key_len, resp, r0, f_r1kh_id,
|
||||||
|
f_s1kh_id, resp_auth, wpa_auth->addr,
|
||||||
|
FT_PACKET_R0KH_R1KH_RESP,
|
||||||
|
&packet, &packet_len);
|
||||||
|
}
|
||||||
|
|
||||||
if (!ret)
|
if (!ret)
|
||||||
wpa_ft_rrb_oui_send(wpa_auth, src_addr,
|
wpa_ft_rrb_oui_send(wpa_auth, src_addr,
|
||||||
|
Loading…
Reference in New Issue
Block a user