mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
Merge branch 'bugfix/fix_some_wifi_bugs_231121_v5.0' into 'release/v5.0'
fix(wifi): fix some wifi bugs(Backport v5.0) See merge request espressif/esp-idf!27306
This commit is contained in:
commit
cba997763d
@ -1 +1 @@
|
||||
Subproject commit 7a2b9863c00c4f9df8e28d7160f3fe379af0153c
|
||||
Subproject commit e162ae0d3dd92486aef14b4900a870396154d0cc
|
@ -1034,37 +1034,37 @@ int wpa_supplicant_pairwise_gtk(struct wpa_sm *sm,
|
||||
static int wpa_supplicant_install_igtk(struct wpa_sm *sm,
|
||||
const wifi_wpa_igtk_t *igtk)
|
||||
{
|
||||
size_t len = wpa_cipher_key_len(sm->mgmt_group_cipher);
|
||||
u16 keyidx = WPA_GET_LE16(igtk->keyid);
|
||||
size_t len = wpa_cipher_key_len(sm->mgmt_group_cipher);
|
||||
u16 keyidx = WPA_GET_LE16(igtk->keyid);
|
||||
|
||||
/* Detect possible key reinstallation */
|
||||
if (sm->igtk.igtk_len == len &&
|
||||
os_memcmp(sm->igtk.igtk, igtk->igtk, sm->igtk.igtk_len) == 0) {
|
||||
wpa_printf(MSG_DEBUG,
|
||||
"WPA: Not reinstalling already in-use IGTK to the driver (keyidx=%d)",
|
||||
keyidx);
|
||||
return 0;
|
||||
}
|
||||
/* Detect possible key reinstallation */
|
||||
if (sm->igtk.igtk_len == len &&
|
||||
os_memcmp(sm->igtk.igtk, igtk->igtk, sm->igtk.igtk_len) == 0) {
|
||||
wpa_printf(MSG_DEBUG,
|
||||
"WPA: Not reinstalling already in-use IGTK to the driver (keyidx=%d)",
|
||||
keyidx);
|
||||
return 0;
|
||||
}
|
||||
|
||||
wpa_printf(MSG_DEBUG,
|
||||
"WPA: IGTK keyid %d pn %02x%02x%02x%02x%02x%02x",
|
||||
keyidx, MAC2STR(igtk->pn));
|
||||
wpa_hexdump_key(MSG_DEBUG, "WPA: IGTK", igtk->igtk, len);
|
||||
if (keyidx > 4095) {
|
||||
wpa_printf(MSG_WARNING,
|
||||
"WPA: Invalid IGTK KeyID %d", keyidx);
|
||||
return -1;
|
||||
}
|
||||
if (esp_wifi_set_igtk_internal(WIFI_IF_STA, igtk) < 0) {
|
||||
wpa_printf(MSG_WARNING,
|
||||
"WPA: Failed to configure IGTK to the driver");
|
||||
return -1;
|
||||
}
|
||||
wpa_printf(MSG_DEBUG,
|
||||
"WPA: IGTK keyid %d pn %02x%02x%02x%02x%02x%02x",
|
||||
keyidx, MAC2STR(igtk->pn));
|
||||
wpa_hexdump_key(MSG_DEBUG, "WPA: IGTK", igtk->igtk, len);
|
||||
|
||||
sm->igtk.igtk_len = len;
|
||||
os_memcpy(sm->igtk.igtk, igtk->igtk, sm->igtk.igtk_len);
|
||||
if (esp_wifi_set_igtk_internal(WIFI_IF_STA, igtk) < 0) {
|
||||
if (keyidx > 4095) {
|
||||
wpa_printf(MSG_WARNING,
|
||||
"WPA: Invalid IGTK KeyID %d", keyidx);
|
||||
}
|
||||
wpa_printf(MSG_WARNING,
|
||||
"WPA: Failed to configure IGTK to the driver");
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
sm->igtk.igtk_len = len;
|
||||
os_memcpy(sm->igtk.igtk, igtk->igtk, sm->igtk.igtk_len);
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif /* CONFIG_IEEE80211W */
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user