From: Vinay Gannevaram Date: Sun, 20 Mar 2022 13:56:02 +0000 (+0530) Subject: Store secure ranging driver capabilities in WPA state machine X-Git-Tag: hostap_2_11~1749 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d0d585c481157c5456c36edaf8991279cb924125;p=thirdparty%2Fhostap.git Store secure ranging driver capabilities in WPA state machine Signed-off-by: Jouni Malinen --- diff --git a/src/rsn_supp/wpa.c b/src/rsn_supp/wpa.c index cf9b21039..3e39947a5 100644 --- a/src/rsn_supp/wpa.c +++ b/src/rsn_supp/wpa.c @@ -5281,6 +5281,7 @@ void wpa_sm_set_dpp_z(struct wpa_sm *sm, const struct wpabuf *z) #ifdef CONFIG_PASN + void wpa_pasn_pmksa_cache_add(struct wpa_sm *sm, const u8 *pmk, size_t pmk_len, const u8 *pmkid, const u8 *bssid, int key_mgmt) { @@ -5288,6 +5289,18 @@ void wpa_pasn_pmksa_cache_add(struct wpa_sm *sm, const u8 *pmk, size_t pmk_len, bssid, sm->own_addr, NULL, key_mgmt, 0); } + + +void wpa_pasn_sm_set_caps(struct wpa_sm *sm, unsigned int flags2) +{ + if (flags2 & WPA_DRIVER_FLAGS2_SEC_LTF_STA) + sm->secure_ltf = 1; + if (flags2 & WPA_DRIVER_FLAGS2_SEC_RTT_STA) + sm->secure_rtt = 1; + if (flags2 & WPA_DRIVER_FLAGS2_PROT_RANGE_NEG_STA) + sm->prot_range_neg = 1; +} + #endif /* CONFIG_PASN */ diff --git a/src/rsn_supp/wpa.h b/src/rsn_supp/wpa.h index be70f4156..df32240c6 100644 --- a/src/rsn_supp/wpa.h +++ b/src/rsn_supp/wpa.h @@ -562,5 +562,6 @@ void wpa_sm_set_fils_cache_id(struct wpa_sm *sm, const u8 *fils_cache_id); void wpa_sm_set_dpp_z(struct wpa_sm *sm, const struct wpabuf *z); void wpa_pasn_pmksa_cache_add(struct wpa_sm *sm, const u8 *pmk, size_t pmk_len, const u8 *pmkid, const u8 *bssid, int key_mgmt); +void wpa_pasn_sm_set_caps(struct wpa_sm *sm, unsigned int flags2); #endif /* WPA_H */ diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c index 09ba7cda9..deb51a721 100644 --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c @@ -6900,6 +6900,9 @@ static int wpa_supplicant_init_iface(struct wpa_supplicant *wpa_s, wpa_s->extended_capa[2] & 0x40) wpa_s->multi_bss_support = 1; } +#ifdef CONFIG_PASN + wpa_pasn_sm_set_caps(wpa_s->wpa, wpa_s->drv_flags2); +#endif /* CONFIG_PASN */ if (wpa_s->max_remain_on_chan == 0) wpa_s->max_remain_on_chan = 1000;