Bladeren bron

esp_wifi: Update wifi lib

1. Add STA checks during STA PMF operations
2. Fix WPA2-Ent issue with Open AP
3. Skip WPA-TKIP profile if PMF is required
4. Skip & clear Supplicant PMK Cache with mismatching AP config
Nachiket Kukade 5 jaren geleden
bovenliggende
commit
6ae4b3ef48

+ 1 - 1
components/esp_wifi/lib

@@ -1 +1 @@
-Subproject commit 36c2ddc619e177a88be8ad9206ba8bffee6f9749
+Subproject commit d64b0a7abbb91d348cbce644186cb27b7883c2f0

+ 1 - 0
components/wpa_supplicant/src/esp_supplicant/esp_wifi_driver.h

@@ -236,5 +236,6 @@ uint16_t esp_wifi_sta_pmf_enabled(void);
 wifi_cipher_type_t esp_wifi_sta_get_mgmt_group_cipher(void);
 int esp_wifi_set_igtk_internal(uint8_t if_index, const wifi_wpa_igtk_t *igtk);
 esp_err_t esp_wifi_internal_issue_disconnect(uint8_t reason_code);
+bool esp_wifi_skip_supp_pmkcaching(void);
 
 #endif /* _ESP_WIFI_DRIVER_H_ */

+ 14 - 3
components/wpa_supplicant/src/rsn_supp/wpa.c

@@ -2142,9 +2142,20 @@ int wpa_set_bss(char *macddr, char * bssid, u8 pairwise_cipher, u8 group_cipher,
     sm->ap_notify_completed_rsne = esp_wifi_sta_is_ap_notify_completed_rsne_internal();
 
     if (sm->key_mgmt == WPA_KEY_MGMT_SAE ||
-	is_wpa2_enterprise_connection()) {
-        pmksa_cache_set_current(sm, NULL, (const u8*) bssid, 0, 0);
-        wpa_sm_set_pmk_from_pmksa(sm);
+        is_wpa2_enterprise_connection()) {
+        if (!esp_wifi_skip_supp_pmkcaching()) {
+            pmksa_cache_set_current(sm, NULL, (const u8*) bssid, 0, 0);
+            wpa_sm_set_pmk_from_pmksa(sm);
+        } else {
+            struct rsn_pmksa_cache_entry *entry = NULL;
+
+            if (sm->pmksa) {
+                entry = pmksa_cache_get(sm->pmksa, (const u8 *)bssid, NULL, NULL);
+            }
+            if (entry) {
+                pmksa_cache_flush(sm->pmksa, NULL, entry->pmk, entry->pmk_len);
+            }
+        }
     }
 
     sm->eapol1_count = 0;