mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2025-01-17 18:34:03 -05:00
Fix authenticator OKC fetch from PMKSA cache to avoid infinite loop
If the first entry in the PMKSA cache did not match the station's MAC address, an infinite loop could be reached in pmksa_cache_get_okc() when trying to find a PMKSA cache entry for opportunistic key caching cases. This would only happen if OKC is enabled (okc=1 included in the configuration file). Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
parent
35a7646bb1
commit
9c829900bb
@ -394,15 +394,13 @@ struct rsn_pmksa_cache_entry * pmksa_cache_get_okc(
|
|||||||
struct rsn_pmksa_cache_entry *entry;
|
struct rsn_pmksa_cache_entry *entry;
|
||||||
u8 new_pmkid[PMKID_LEN];
|
u8 new_pmkid[PMKID_LEN];
|
||||||
|
|
||||||
entry = pmksa->pmksa;
|
for (entry = pmksa->pmksa; entry; entry = entry->next) {
|
||||||
while (entry) {
|
|
||||||
if (os_memcmp(entry->spa, spa, ETH_ALEN) != 0)
|
if (os_memcmp(entry->spa, spa, ETH_ALEN) != 0)
|
||||||
continue;
|
continue;
|
||||||
rsn_pmkid(entry->pmk, entry->pmk_len, aa, spa, new_pmkid,
|
rsn_pmkid(entry->pmk, entry->pmk_len, aa, spa, new_pmkid,
|
||||||
wpa_key_mgmt_sha256(entry->akmp));
|
wpa_key_mgmt_sha256(entry->akmp));
|
||||||
if (os_memcmp(new_pmkid, pmkid, PMKID_LEN) == 0)
|
if (os_memcmp(new_pmkid, pmkid, PMKID_LEN) == 0)
|
||||||
return entry;
|
return entry;
|
||||||
entry = entry->next;
|
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user