]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Fix RSN pre-authentication regression with pre-connection scan results
authorJouni Malinen <jouni@qca.qualcomm.com>
Tue, 12 Sep 2017 13:42:01 +0000 (16:42 +0300)
committerJouni Malinen <j@w1.fi>
Tue, 12 Sep 2017 13:47:02 +0000 (16:47 +0300)
The introduction of radio works and a delayed callback to complete
association/connection requests ended up breaking RSN pre-authentication
candidate list generation for the case of pre-connection scan results.
Previously, wpa_supplicant_associate() set the RSN state machine
configuration before returning and the calls to
wpa_supplicant_rsn_preauth_scan_results() immediately after this
function call were working fine. However, with the radio work callback,
the RSN state machine configuration started to happen only in that
callback which would be called soon after this code path has completed.
This resulted in the RSN state machine not knowing the selected SSID and
as such, rejecting all pre-authentication candidates.

Fix this by setting the RSN state machine configuration from
wpa_supplicant_associate() so that the existing callers of
wpa_supplicant_rsn_preauth_scan_results() can be used as-is to add
candidates for pre-authentication.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
wpa_supplicant/wpa_supplicant.c

index 00ef3a4b5e1842873f8185099a01688aaf488d02..b8c1da44e61efc2adbe18e193bd435fc1c30f7ca 100644 (file)
@@ -1857,6 +1857,15 @@ void wpa_supplicant_associate(struct wpa_supplicant *wpa_s,
                return;
        }
 
+       /*
+        * Set WPA state machine configuration to match the selected network now
+        * so that the information is available before wpas_start_assoc_cb()
+        * gets called. This is needed at least for RSN pre-authentication where
+        * candidate APs are added to a list based on scan result processing
+        * before completion of the first association.
+        */
+       wpa_supplicant_rsn_supp_set_config(wpa_s, ssid);
+
 #ifdef CONFIG_DPP
        if (wpas_dpp_check_connect(wpa_s, ssid, bss) != 0)
                return;