Merge branch 'bugfix/backport_wifi_fixes_v4.4' into 'release/v4.4'

backported some wifi fixes (backport v4.4)

See merge request espressif/esp-idf!21448
pull/11369/head
Jiang Jiang Jian 2022-12-06 10:25:02 +08:00
commit e5b0abcc57
4 zmienionych plików z 16 dodań i 5 usunięć

Wyświetl plik

@ -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) { switch (sae_msg_type) {
case SAE_MSG_COMMIT: 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)) if (ESP_OK != wpa3_build_sae_commit(bssid))
return NULL; return NULL;
*sae_msg_len = wpabuf_len(g_sae_commit); *sae_msg_len = wpabuf_len(g_sae_commit);

Wyświetl plik

@ -618,7 +618,7 @@ wps_parse_scan_result(struct wps_scan_ie *scan)
} }
esp_wifi_enable_sta_privacy_internal(); esp_wifi_enable_sta_privacy_internal();
os_memset(sm->config.ssid, 0, sizeof(sm->config.ssid)); os_memset(sm->config.ssid, 0, sizeof(sm->config.ssid));
strncpy((char *)sm->config.ssid, (char *)&scan->ssid[2], (int)scan->ssid[1]); os_memcpy(sm->config.ssid, (char *)&scan->ssid[2], (int)scan->ssid[1]);
if (scan->bssid && memcmp(sm->config.bssid, scan->bssid, ETH_ALEN) != 0) { if (scan->bssid && memcmp(sm->config.bssid, scan->bssid, ETH_ALEN) != 0) {
printf("sm BSSid: "MACSTR " scan BSSID " MACSTR "\n", MAC2STR(sm->config.bssid), MAC2STR(scan->bssid)); printf("sm BSSid: "MACSTR " scan BSSID " MACSTR "\n", MAC2STR(sm->config.bssid), MAC2STR(scan->bssid));
sm->discover_ssid_cnt++; sm->discover_ssid_cnt++;
@ -2145,7 +2145,7 @@ int wifi_wps_enable_internal(const esp_wps_config_t *config)
ret = wifi_station_wps_init(); ret = wifi_station_wps_init();
if (ret != 0) { if (ret != 0) {
wps_set_type(WPS_STATUS_DISABLE); wps_set_type(WPS_TYPE_DISABLE);
wps_set_status(WPS_STATUS_DISABLE); wps_set_status(WPS_STATUS_DISABLE);
return ESP_FAIL; return ESP_FAIL;
} }

Wyświetl plik

@ -1104,7 +1104,7 @@ static struct wpabuf * eap_peap_process(struct eap_sm *sm, void *priv,
} }
if (tls_connection_established(sm->ssl_ctx, data->ssl.conn)) { if (tls_connection_established(sm->ssl_ctx, data->ssl.conn)) {
char label[24]; char label[24] = {0};
wpa_printf(MSG_DEBUG, "EAP-PEAP: TLS done, proceed to Phase 2"); wpa_printf(MSG_DEBUG, "EAP-PEAP: TLS done, proceed to Phase 2");
os_free(data->key_data); os_free(data->key_data);
/* draft-josefsson-ppext-eap-tls-eap-05.txt /* draft-josefsson-ppext-eap-tls-eap-05.txt

Wyświetl plik

@ -2275,8 +2275,15 @@ int wpa_set_bss(char *macddr, char * bssid, u8 pairwise_cipher, u8 group_cipher,
if (sm->key_mgmt == WPA_KEY_MGMT_SAE || if (sm->key_mgmt == WPA_KEY_MGMT_SAE ||
is_wpa2_enterprise_connection()) { is_wpa2_enterprise_connection()) {
if (!esp_wifi_skip_supp_pmkcaching() && use_pmk_cache) { if (!esp_wifi_skip_supp_pmkcaching() && use_pmk_cache) {
pmksa_cache_set_current(sm, NULL, (const u8*) bssid, 0, 0); if (pmksa_cache_set_current(sm, NULL, (const u8*) bssid, 0, 0) == 0) {
wpa_sm_set_pmk_from_pmksa(sm); struct rsn_pmksa_cache_entry *pmksa = pmksa_cache_get_current(sm);
if (pmksa && (pmksa->akmp != sm->key_mgmt)) {
pmksa_cache_clear_current(sm);
pmksa_cache_flush(sm->pmksa, NULL, pmksa->pmk, pmksa->pmk_len);
}
} else {
wpa_sm_set_pmk_from_pmksa(sm);
}
} else { } else {
struct rsn_pmksa_cache_entry *entry = NULL; struct rsn_pmksa_cache_entry *entry = NULL;