ath9k: add a few calibration related fixes
[openwrt.git] / package / network / services / hostapd / patches / 001-fix_pmksa_cache.patch
1 From 9c829900bb01d6fb22e78ba78195c78de39f64b9 Mon Sep 17 00:00:00 2001
2 From: Jouni Malinen <j@w1.fi>
3 Date: Sat, 04 Oct 2014 19:11:00 +0000
4 Subject: Fix authenticator OKC fetch from PMKSA cache to avoid infinite loop
5
6 If the first entry in the PMKSA cache did not match the station's MAC
7 address, an infinite loop could be reached in pmksa_cache_get_okc() when
8 trying to find a PMKSA cache entry for opportunistic key caching cases.
9 This would only happen if OKC is enabled (okc=1 included in the
10 configuration file).
11
12 Signed-off-by: Jouni Malinen <j@w1.fi>
13 ---
14 --- a/src/ap/pmksa_cache_auth.c
15 +++ b/src/ap/pmksa_cache_auth.c
16 @@ -394,15 +394,13 @@ struct rsn_pmksa_cache_entry * pmksa_cac
17         struct rsn_pmksa_cache_entry *entry;
18         u8 new_pmkid[PMKID_LEN];
19  
20 -       entry = pmksa->pmksa;
21 -       while (entry) {
22 +       for (entry = pmksa->pmksa; entry; entry = entry->next) {
23                 if (os_memcmp(entry->spa, spa, ETH_ALEN) != 0)
24                         continue;
25                 rsn_pmkid(entry->pmk, entry->pmk_len, aa, spa, new_pmkid,
26                           wpa_key_mgmt_sha256(entry->akmp));
27                 if (os_memcmp(new_pmkid, pmkid, PMKID_LEN) == 0)
28                         return entry;
29 -               entry = entry->next;
30         }
31         return NULL;
32  }