summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJouni Malinen <quic_jouni@quicinc.com>2023-04-25 13:30:08 +0300
committerJouni Malinen <j@w1.fi>2023-04-25 13:30:08 +0300
commitb9c3b57a99e824c1e3beeed9695d1cdfb83eb45b (patch)
tree611e14a42634a7ebab71469d9d746ea70d782b85
parent566ab39a728035d83098f4c155cbac7876c0c119 (diff)
downloadhostap-b9c3b57a99e824c1e3beeed9695d1cdfb83eb45b.tar.gz
Update AP RSNE/RSNXE to RSN state machine on driver-selected BSS cases
The driver-initiated BSS selection case and the "Network configuration found for the current AP" case ended up clearing the RSN state machine information on AP RSNE/RSNXE. That could result in incorrect behavior if some key management operations depended on accurate information. For example, this could result in not deriving the KDK as part of the PTK derivation and failing to complete 4-way handshake if both the AP and the STA indicated support for Secure LTF. If the scan results for the selected BSS are available, use those to update the RSN state machine AP RSNE/RSNXE similarly to the way this is done with wpa_supplicant selects the BSS instead of clearing that information in the RSN state machine. Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
-rw-r--r--wpa_supplicant/events.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c
index 2eb2b9e31..a05dd26a2 100644
--- a/wpa_supplicant/events.c
+++ b/wpa_supplicant/events.c
@@ -190,6 +190,7 @@ static int wpa_supplicant_select_config(struct wpa_supplicant *wpa_s,
union wpa_event_data *data)
{
struct wpa_ssid *ssid, *old_ssid;
+ struct wpa_bss *bss;
u8 drv_ssid[SSID_MAX_LEN];
size_t drv_ssid_len;
int res;
@@ -265,6 +266,7 @@ static int wpa_supplicant_select_config(struct wpa_supplicant *wpa_s,
wpa_dbg(wpa_s, MSG_DEBUG, "Network configuration found for the "
"current AP");
+ bss = wpa_supplicant_update_current_bss(wpa_s, wpa_s->bssid);
if (wpa_key_mgmt_wpa_any(ssid->key_mgmt)) {
u8 wpa_ie[80];
size_t wpa_ie_len = sizeof(wpa_ie);
@@ -274,7 +276,7 @@ static int wpa_supplicant_select_config(struct wpa_supplicant *wpa_s,
* driver indicated the actual values used in the
* (Re)Association Request frame. */
skip_default_rsne = data && data->assoc_info.req_ies;
- if (wpa_supplicant_set_suites(wpa_s, NULL, ssid,
+ if (wpa_supplicant_set_suites(wpa_s, bss, ssid,
wpa_ie, &wpa_ie_len,
skip_default_rsne) < 0)
wpa_dbg(wpa_s, MSG_DEBUG, "Could not set WPA suites");
@@ -287,8 +289,6 @@ static int wpa_supplicant_select_config(struct wpa_supplicant *wpa_s,
old_ssid = wpa_s->current_ssid;
wpa_s->current_ssid = ssid;
- wpa_supplicant_update_current_bss(wpa_s, wpa_s->bssid);
-
wpa_supplicant_rsn_supp_set_config(wpa_s, wpa_s->current_ssid);
wpa_supplicant_initiate_eapol(wpa_s);
if (old_ssid != wpa_s->current_ssid)