[automerger skipped] Merge Android 14 am: 2387c18797 -s ours am: 399437be6e -s ours am: c5760a4b47 -s ours

am skip reason: Merged-In I9bd44593a9afd3c6a28bc8ddba365589f729ab2d with SHA-1 9c9bec0407 is already in history

Original change: https://android-review.googlesource.com/c/platform/external/wpa_supplicant_8/+/2776630

Change-Id: Ie02e5274d322e552f58e0aba165b619c38fa35ca
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c
index 253f87d..0909961 100644
--- a/wpa_supplicant/events.c
+++ b/wpa_supplicant/events.c
@@ -3889,6 +3889,7 @@
 			 * EVENT_PORT_AUTHORIZED handler when the driver is done
 			 * with the 4-way handshake.
 			 */
+			wpa_supplicant_set_state(wpa_s, WPA_4WAY_HANDSHAKE);
 			wpa_msg(wpa_s, MSG_INFO,
 				"ASSOC INFO: wait for driver port authorized indication");
 		}
@@ -5020,7 +5021,7 @@
 
 static void wpa_supplicant_event_port_authorized(struct wpa_supplicant *wpa_s)
 {
-	if (wpa_s->wpa_state == WPA_ASSOCIATED) {
+	if (wpa_s->wpa_state >= WPA_ASSOCIATED) {
 		wpa_supplicant_cancel_auth_timeout(wpa_s);
 		wpa_supplicant_set_state(wpa_s, WPA_COMPLETED);
 		eapol_sm_notify_portValid(wpa_s->eapol, true);
diff --git a/wpa_supplicant/wpa_supplicant_template.conf b/wpa_supplicant/wpa_supplicant_template.conf
index cec26c4..6a2fbd3 100644
--- a/wpa_supplicant/wpa_supplicant_template.conf
+++ b/wpa_supplicant/wpa_supplicant_template.conf
@@ -9,3 +9,4 @@
 sae_pwe=2
 p2p_optimize_listen_chan=1
 wowlan_disconnect_on_deinit=1
+sae_pmkid_in_assoc=1