mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-02 11:10:54 +03:00
bugfix(wifi): Clear Sta TX queue to prevent key 2 send failure
Also, Ensure correct return values for key 2 and key 4.
This commit is contained in:
+1
-1
Submodule components/esp_wifi/lib updated: 36bb033d2f...5c5338ebbd
@@ -249,7 +249,7 @@ int wpa_eapol_key_send(struct wpa_sm *sm, const u8 *kck, size_t kck_len,
|
|||||||
MAC2STR(dest));
|
MAC2STR(dest));
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
return ret;
|
goto out;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
if (key_mic &&
|
if (key_mic &&
|
||||||
@@ -263,8 +263,13 @@ int wpa_eapol_key_send(struct wpa_sm *sm, const u8 *kck, size_t kck_len,
|
|||||||
wpa_hexdump_key(MSG_DEBUG, "WPA: KCK", kck, kck_len);
|
wpa_hexdump_key(MSG_DEBUG, "WPA: KCK", kck, kck_len);
|
||||||
wpa_hexdump(MSG_DEBUG, "WPA: Derived Key MIC", key_mic, wpa_mic_len(sm->key_mgmt, sm->pmk_len));
|
wpa_hexdump(MSG_DEBUG, "WPA: Derived Key MIC", key_mic, wpa_mic_len(sm->key_mgmt, sm->pmk_len));
|
||||||
wpa_hexdump(MSG_MSGDUMP, "WPA: TX EAPOL-Key", msg, msg_len);
|
wpa_hexdump(MSG_MSGDUMP, "WPA: TX EAPOL-Key", msg, msg_len);
|
||||||
return wpa_sm_ether_send(sm, dest, proto, msg, msg_len);
|
ret = wpa_sm_ether_send(sm, dest, proto, msg, msg_len);
|
||||||
out:
|
out:
|
||||||
|
#ifdef ESP_SUPPLICANT
|
||||||
|
wpa_sm_free_eapol(msg);
|
||||||
|
#else
|
||||||
|
os_free(msg);
|
||||||
|
#endif
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -338,7 +343,6 @@ static void wpa_sm_key_request(struct wpa_sm *sm, int error, int pairwise)
|
|||||||
error, pairwise, sm->ptk_set, (unsigned long) rlen);
|
error, pairwise, sm->ptk_set, (unsigned long) rlen);
|
||||||
wpa_eapol_key_send(sm, sm->ptk.kck, sm->ptk.kck_len, ver, wpa_sm_get_auth_addr(sm),
|
wpa_eapol_key_send(sm, sm->ptk.kck, sm->ptk.kck_len, ver, wpa_sm_get_auth_addr(sm),
|
||||||
ETH_P_EAPOL, rbuf, rlen, key_mic);
|
ETH_P_EAPOL, rbuf, rlen, key_mic);
|
||||||
wpa_sm_free_eapol(rbuf);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void wpa_sm_pmksa_free_cb(struct rsn_pmksa_cache_entry *entry,
|
static void wpa_sm_pmksa_free_cb(struct rsn_pmksa_cache_entry *entry,
|
||||||
@@ -680,11 +684,8 @@ int wpa_supplicant_send_2_of_4(struct wpa_sm *sm, const unsigned char *dst,
|
|||||||
|
|
||||||
wpa_printf(MSG_DEBUG, "WPA Send EAPOL-Key 2/4");
|
wpa_printf(MSG_DEBUG, "WPA Send EAPOL-Key 2/4");
|
||||||
|
|
||||||
wpa_eapol_key_send(sm, ptk->kck, ptk->kck_len, ver, dst, ETH_P_EAPOL,
|
return wpa_eapol_key_send(sm, ptk->kck, ptk->kck_len, ver, dst, ETH_P_EAPOL,
|
||||||
rbuf, rlen, key_mic);
|
rbuf, rlen, key_mic);
|
||||||
wpa_sm_free_eapol(rbuf);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int wpa_derive_ptk(struct wpa_sm *sm, const unsigned char *src_addr,
|
static int wpa_derive_ptk(struct wpa_sm *sm, const unsigned char *src_addr,
|
||||||
@@ -1353,11 +1354,8 @@ static int wpa_supplicant_send_4_of_4(struct wpa_sm *sm, const unsigned char *ds
|
|||||||
WPA_PUT_BE16(reply->key_data_length, 0);
|
WPA_PUT_BE16(reply->key_data_length, 0);
|
||||||
|
|
||||||
wpa_printf(MSG_DEBUG, "WPA Send EAPOL-Key 4/4");
|
wpa_printf(MSG_DEBUG, "WPA Send EAPOL-Key 4/4");
|
||||||
wpa_eapol_key_send(sm, ptk->kck, ptk->kck_len, ver, dst, ETH_P_EAPOL,
|
return wpa_eapol_key_send(sm, ptk->kck, ptk->kck_len, ver, dst, ETH_P_EAPOL,
|
||||||
rbuf, rlen, key_mic);
|
rbuf, rlen, key_mic);
|
||||||
wpa_sm_free_eapol(rbuf);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void wpa_sm_set_seq(struct wpa_sm *sm, struct wpa_eapol_key *key, u8 isptk)
|
static void wpa_sm_set_seq(struct wpa_sm *sm, struct wpa_eapol_key *key, u8 isptk)
|
||||||
@@ -1869,11 +1867,8 @@ static int wpa_supplicant_send_2_of_2(struct wpa_sm *sm,
|
|||||||
|
|
||||||
wpa_printf(MSG_DEBUG, "WPA Send 2/2 Group key");
|
wpa_printf(MSG_DEBUG, "WPA Send 2/2 Group key");
|
||||||
|
|
||||||
wpa_eapol_key_send(sm, sm->ptk.kck, sm->ptk.kck_len, ver, sm->bssid, ETH_P_EAPOL,
|
return wpa_eapol_key_send(sm, sm->ptk.kck, sm->ptk.kck_len, ver, sm->bssid, ETH_P_EAPOL,
|
||||||
rbuf, rlen, key_mic);
|
rbuf, rlen, key_mic);
|
||||||
wpa_sm_free_eapol(rbuf);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void wpa_supplicant_process_1_of_2(struct wpa_sm *sm,
|
static void wpa_supplicant_process_1_of_2(struct wpa_sm *sm,
|
||||||
|
|||||||
Reference in New Issue
Block a user