Moved proto == RSN validation from pmksa_cache.c into the caller

This commit is contained in:
Jouni Malinen 2009-01-13 20:15:06 +02:00
parent 010dc06853
commit f5a51b58d4
2 changed files with 6 additions and 4 deletions

View file

@ -167,7 +167,7 @@ pmksa_cache_add(struct rsn_pmksa_cache *pmksa, const u8 *pmk, size_t pmk_len,
struct rsn_pmksa_cache_entry *entry, *pos, *prev; struct rsn_pmksa_cache_entry *entry, *pos, *prev;
struct os_time now; struct os_time now;
if (pmksa->sm->proto != WPA_PROTO_RSN || pmk_len > PMK_LEN) if (pmk_len > PMK_LEN)
return NULL; return NULL;
entry = os_zalloc(sizeof(*entry)); entry = os_zalloc(sizeof(*entry));

View file

@ -246,9 +246,11 @@ static int wpa_supplicant_get_pmk(struct wpa_sm *sm,
wpa_hexdump_key(MSG_DEBUG, "WPA: PMK from EAPOL state " wpa_hexdump_key(MSG_DEBUG, "WPA: PMK from EAPOL state "
"machines", sm->pmk, pmk_len); "machines", sm->pmk, pmk_len);
sm->pmk_len = pmk_len; sm->pmk_len = pmk_len;
pmksa_cache_add(sm->pmksa, sm->pmk, pmk_len, src_addr, if (sm->proto == WPA_PROTO_RSN) {
sm->own_addr, sm->network_ctx, pmksa_cache_add(sm->pmksa, sm->pmk, pmk_len,
sm->key_mgmt); src_addr, sm->own_addr,
sm->network_ctx, sm->key_mgmt);
}
if (!sm->cur_pmksa && pmkid && if (!sm->cur_pmksa && pmkid &&
pmksa_cache_get(sm->pmksa, src_addr, pmkid)) { pmksa_cache_get(sm->pmksa, src_addr, pmkid)) {
wpa_printf(MSG_DEBUG, "RSN: the new PMK " wpa_printf(MSG_DEBUG, "RSN: the new PMK "