From 5caf842f7235242b7bc47f6b1440dcc0161365ed Mon Sep 17 00:00:00 2001 From: muhaidong Date: Wed, 19 Apr 2023 19:57:27 +0800 Subject: [PATCH] esp_supplicant: wpa pmf should be disabled --- .../wpa_supplicant/esp_supplicant/src/esp_hostap.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/components/wpa_supplicant/esp_supplicant/src/esp_hostap.c b/components/wpa_supplicant/esp_supplicant/src/esp_hostap.c index 10bdcb5534..157357056a 100644 --- a/components/wpa_supplicant/esp_supplicant/src/esp_hostap.c +++ b/components/wpa_supplicant/esp_supplicant/src/esp_hostap.c @@ -32,7 +32,7 @@ void *hostap_init(void) struct wpa_auth_config *auth_conf; u16 spp_attrubute = 0; u8 pairwise_cipher; - wifi_pmf_config_t pmf_cfg; + wifi_pmf_config_t pmf_cfg = {0}; hapd = (struct hostapd_data *)os_zalloc(sizeof(struct hostapd_data)); @@ -69,11 +69,12 @@ void *hostap_init(void) pairwise_cipher = esp_wifi_ap_get_prof_pairwise_cipher_internal(); #ifdef CONFIG_IEEE80211W - - esp_wifi_get_pmf_config_internal(&pmf_cfg, WIFI_IF_AP); - - if (pmf_cfg.required) { - pairwise_cipher = WIFI_CIPHER_TYPE_CCMP; + if((auth_conf->wpa & WPA_PROTO_RSN) == WPA_PROTO_RSN) + { + esp_wifi_get_pmf_config_internal(&pmf_cfg, WIFI_IF_AP); + if (pmf_cfg.required) { + pairwise_cipher = WIFI_CIPHER_TYPE_CCMP; + } } #endif /* CONFIG_IEEE80211W */