]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
SAE H2E: Fix RSNXE override in EAPOL-Key msg 2/4 for testing purposes
authorJouni Malinen <jouni@codeaurora.org>
Fri, 13 Dec 2019 01:05:38 +0000 (03:05 +0200)
committerJouni Malinen <jouni@codeaurora.org>
Fri, 13 Dec 2019 01:08:27 +0000 (03:08 +0200)
The previous implementation missed the case where EAPOL-Key frame may be
reported as having been received before the association event is
processed. This would have resulted in not using the RSNXE override for
EAPOL-Key msg 2/4 when the pending EAPOL-Key frame gets processed
immediately after processing the association event. Fix this by moving
the override case to be handled before that.

Fixes: 132565539784 ("SAE H2E: RSNXE override for testing purposes")
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
wpa_supplicant/events.c

index 2316037e26181109d8954c12e3ec732c99918587..852f41e40d2030c6a232131fdf0d94c3192296cd 100644 (file)
@@ -2946,6 +2946,16 @@ static void wpa_supplicant_event_assoc(struct wpa_supplicant *wpa_s,
 
        wpa_s->last_eapol_matches_bssid = 0;
 
+#ifdef CONFIG_TESTING_OPTIONS
+       if (wpa_s->rsnxe_override_eapol) {
+               wpa_printf(MSG_DEBUG,
+                          "TESTING: RSNXE EAPOL-Key msg 2/4 override");
+               wpa_sm_set_assoc_rsnxe(wpa_s->wpa,
+                                      wpabuf_head(wpa_s->rsnxe_override_eapol),
+                                      wpabuf_len(wpa_s->rsnxe_override_eapol));
+       }
+#endif /* CONFIG_TESTING_OPTIONS */
+
        if (wpa_s->pending_eapol_rx) {
                struct os_reltime now, age;
                os_get_reltime(&now);
@@ -3017,16 +3027,6 @@ static void wpa_supplicant_event_assoc(struct wpa_supplicant *wpa_s,
 #ifdef CONFIG_MBO
        wpas_mbo_check_pmf(wpa_s, bss, wpa_s->current_ssid);
 #endif /* CONFIG_MBO */
-
-#ifdef CONFIG_TESTING_OPTIONS
-       if (wpa_s->rsnxe_override_eapol) {
-               wpa_printf(MSG_DEBUG,
-                          "TESTING: RSNXE EAPOL-Key msg 2/4 override");
-               wpa_sm_set_assoc_rsnxe(wpa_s->wpa,
-                                      wpabuf_head(wpa_s->rsnxe_override_eapol),
-                                      wpabuf_len(wpa_s->rsnxe_override_eapol));
-       }
-#endif /* CONFIG_TESTING_OPTIONS */
 }