Clear OKC-based PMKSA caching entries if PMK is changed

Whenever PMK gets changed (e.g., due to re-authentication), all PMKSA
caching entries that were created using the previous PMK needs to be
replaced. Previously, only the entry for the current AP was cleared.
Flush the other entries based on network_ctx matches to get rid of the
OKC entries. These entries can then be re-creating using OKC with the
new PMK.
This commit is contained in:
Jouni Malinen 2011-10-02 19:36:37 +03:00
parent 0098ce6d29
commit c3fea27274
1 changed files with 8 additions and 0 deletions

View File

@ -186,6 +186,14 @@ pmksa_cache_add(struct rsn_pmksa_cache *pmksa, const u8 *pmk, size_t pmk_len,
wpa_printf(MSG_DEBUG, "RSN: Replace PMKSA entry for "
"the current AP");
pmksa_cache_free_entry(pmksa, pos, 1);
/*
* If OKC is used, there may be other PMKSA cache
* entries based on the same PMK. These needs to be
* flushed so that a new entry can be created based on
* the new PMK.
*/
pmksa_cache_flush(pmksa, network_ctx);
break;
}
prev = pos;