path: root/wpa_supplicant/wpa_supplicant.c
diff options
authorJouni Malinen <jouni@qca.qualcomm.com>2017-09-12 13:42:01 (GMT)
committerJouni Malinen <j@w1.fi>2017-09-12 13:47:02 (GMT)
commit2efc6720752dc6ed02e15885cdc28174ac85086f (patch)
tree73c2cfe82f4aede50049fddcf4988de1525596d4 /wpa_supplicant/wpa_supplicant.c
parent73b3de01cecdd1e0af5901e9a279eb8a468ca995 (diff)
Fix RSN pre-authentication regression with pre-connection scan results
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>
Diffstat (limited to 'wpa_supplicant/wpa_supplicant.c')
1 files changed, 9 insertions, 0 deletions
diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c
index 00ef3a4..b8c1da4 100644
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
@@ -1857,6 +1857,15 @@ void wpa_supplicant_associate(struct wpa_supplicant *wpa_s,
+ /*
+ * 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);
if (wpas_dpp_check_connect(wpa_s, ssid, bss) != 0)