Skip to content

Commit

Permalink
Merge branch 'bugfix/ignore_eapol_nonkey_v4.4' into 'release/v4.4'
Browse files Browse the repository at this point in the history
Ignore EAPOL non-key frames in EAPOL txdone callback (Backport v4.4)

See merge request espressif/esp-idf!25454
  • Loading branch information
jack0c committed Aug 23, 2023
2 parents 37cf841 + 29d9e6f commit b9e8e0e
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions components/wpa_supplicant/src/rsn_supp/wpa.c
Original file line number Diff line number Diff line change
Expand Up @@ -2653,11 +2653,19 @@ void eapol_txcb(uint8_t *eapol_payload, size_t len, bool tx_failure)
struct wpa_sm *sm = &gWpaSm;
u8 isdeauth = 0; //no_zero value is the reason for deauth

if (len < (sizeof(struct ieee802_1x_hdr) + sizeof(struct wpa_eapol_key))) {
wpa_printf(MSG_ERROR, "EAPOL TxDone with invalid payload len! (len - %d)", len);
if (len < sizeof(struct ieee802_1x_hdr)) {
/* Invalid 802.1X header, ignore */
return;
}
hdr = (struct ieee802_1x_hdr *) eapol_payload;
if (hdr->type != IEEE802_1X_TYPE_EAPOL_KEY) {
/* Ignore EAPOL non-key frames */
return;
}
if (len < (sizeof(struct ieee802_1x_hdr) + sizeof(struct wpa_eapol_key))) {
wpa_printf(MSG_ERROR, "EAPOL TxDone with invalid payload len! (len - %zu)", len);
return;
}
key = (struct wpa_eapol_key *) (hdr + 1);

switch(WPA_SM_STATE(sm)) {
Expand Down

0 comments on commit b9e8e0e

Please sign in to comment.