Add helper functions for parsing RSNXE capabilities
Simplify the implementation by using shared functions for parsing the capabilities instead of using various similar but not exactly identical checks throughout the implementation. Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
parent
663e190b72
commit
d675d3b15b
11 changed files with 75 additions and 55 deletions
|
@ -609,8 +609,8 @@ static int wpa_derive_ptk(struct wpa_sm *sm, const unsigned char *src_addr,
|
|||
#endif /* CONFIG_OWE */
|
||||
|
||||
if (sm->force_kdk_derivation ||
|
||||
(sm->secure_ltf && sm->ap_rsnxe && sm->ap_rsnxe_len >= 4 &&
|
||||
sm->ap_rsnxe[3] & BIT(WLAN_RSNX_CAPAB_SECURE_LTF - 8)))
|
||||
(sm->secure_ltf &&
|
||||
ieee802_11_rsnx_capab(sm->ap_rsnxe, WLAN_RSNX_CAPAB_SECURE_LTF)))
|
||||
kdk_len = WPA_KDK_MAX_LEN;
|
||||
else
|
||||
kdk_len = 0;
|
||||
|
@ -4376,8 +4376,8 @@ int fils_process_auth(struct wpa_sm *sm, const u8 *bssid, const u8 *data,
|
|||
}
|
||||
|
||||
if (sm->force_kdk_derivation ||
|
||||
(sm->secure_ltf && sm->ap_rsnxe && sm->ap_rsnxe_len >= 4 &&
|
||||
sm->ap_rsnxe[3] & BIT(WLAN_RSNX_CAPAB_SECURE_LTF - 8)))
|
||||
(sm->secure_ltf &&
|
||||
ieee802_11_rsnx_capab(sm->ap_rsnxe, WLAN_RSNX_CAPAB_SECURE_LTF)))
|
||||
kdk_len = WPA_KDK_MAX_LEN;
|
||||
else
|
||||
kdk_len = 0;
|
||||
|
|
|
@ -69,8 +69,8 @@ int wpa_derive_ptk_ft(struct wpa_sm *sm, const unsigned char *src_addr,
|
|||
wpa_ft_pasn_store_r1kh(sm, src_addr);
|
||||
|
||||
if (sm->force_kdk_derivation ||
|
||||
(sm->secure_ltf && sm->ap_rsnxe && sm->ap_rsnxe_len >= 4 &&
|
||||
sm->ap_rsnxe[3] & BIT(WLAN_RSNX_CAPAB_SECURE_LTF - 8)))
|
||||
(sm->secure_ltf &&
|
||||
ieee802_11_rsnx_capab(sm->ap_rsnxe, WLAN_RSNX_CAPAB_SECURE_LTF)))
|
||||
kdk_len = WPA_KDK_MAX_LEN;
|
||||
else
|
||||
kdk_len = 0;
|
||||
|
@ -672,8 +672,8 @@ int wpa_ft_process_response(struct wpa_sm *sm, const u8 *ies, size_t ies_len,
|
|||
wpa_ft_pasn_store_r1kh(sm, bssid);
|
||||
|
||||
if (sm->force_kdk_derivation ||
|
||||
(sm->secure_ltf && sm->ap_rsnxe && sm->ap_rsnxe_len >= 4 &&
|
||||
sm->ap_rsnxe[3] & BIT(WLAN_RSNX_CAPAB_SECURE_LTF - 8)))
|
||||
(sm->secure_ltf &&
|
||||
ieee802_11_rsnx_capab(sm->ap_rsnxe, WLAN_RSNX_CAPAB_SECURE_LTF)))
|
||||
kdk_len = WPA_KDK_MAX_LEN;
|
||||
else
|
||||
kdk_len = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue