From 51dfbafce27da601bd389ba95f92163f49d5f1b2 Mon Sep 17 00:00:00 2001 From: Kapil Gupta Date: Thu, 1 Dec 2022 15:37:43 +0530 Subject: [PATCH] esp_wifi: Add changes to skip SAE handshake during WPS connection --- components/wpa_supplicant/esp_supplicant/src/esp_wpa3.c | 4 ++++ components/wpa_supplicant/esp_supplicant/src/esp_wps.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/components/wpa_supplicant/esp_supplicant/src/esp_wpa3.c b/components/wpa_supplicant/esp_supplicant/src/esp_wpa3.c index fa5b27402f..344257e00e 100644 --- a/components/wpa_supplicant/esp_supplicant/src/esp_wpa3.c +++ b/components/wpa_supplicant/esp_supplicant/src/esp_wpa3.c @@ -147,6 +147,10 @@ static u8 *wpa3_build_sae_msg(u8 *bssid, u32 sae_msg_type, size_t *sae_msg_len) switch (sae_msg_type) { case SAE_MSG_COMMIT: + /* Do not go for SAE when WPS is ongoing */ + if (esp_wifi_get_wps_status_internal() != WPS_STATUS_DISABLE) { + return NULL; + } if (ESP_OK != wpa3_build_sae_commit(bssid)) return NULL; *sae_msg_len = wpabuf_len(g_sae_commit); diff --git a/components/wpa_supplicant/esp_supplicant/src/esp_wps.c b/components/wpa_supplicant/esp_supplicant/src/esp_wps.c index d6d82c1875..360483ee31 100644 --- a/components/wpa_supplicant/esp_supplicant/src/esp_wps.c +++ b/components/wpa_supplicant/esp_supplicant/src/esp_wps.c @@ -1870,7 +1870,7 @@ int wifi_wps_enable_internal(const esp_wps_config_t *config) ret = wifi_station_wps_init(); if (ret != 0) { - wps_set_type(WPS_STATUS_DISABLE); + wps_set_type(WPS_TYPE_DISABLE); wps_set_status(WPS_STATUS_DISABLE); return ESP_FAIL; }