Merge branch 'bugfix/pmf_softap_coex_issue' into 'master'

Fix issues related to PMF and WPA2-Enterprise

Closes WIFI-2852, WIFI-2704, and WIFI-2863

See merge request espressif/esp-idf!10523
This commit is contained in:
Jiang Jiang Jian
2020-10-13 11:43:41 +08:00
3 changed files with 16 additions and 4 deletions

View File

@@ -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_ */

View File

@@ -2143,8 +2143,19 @@ int wpa_set_bss(char *macddr, char * bssid, u8 pairwise_cipher, u8 group_cipher,
if (sm->key_mgmt == WPA_KEY_MGMT_SAE ||
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;