wpa_printf(MSG_INFO,
"PASN: Success handling transaction == 3. Store PTK");
- ptksa_cache_add(hapd->ptksa, sta->addr, sta->pasn->cipher, 43200,
- &sta->pasn->ptk);
+ ptksa_cache_add(hapd->ptksa, hapd->own_addr, sta->addr,
+ sta->pasn->cipher, 43200, &sta->pasn->ptk);
fail:
ap_free_sta(hapd, sta);
}
{
struct hostapd_data *hapd = ctx;
- ptksa_cache_add(hapd->ptksa, addr, cipher, life_time, ptk);
+ ptksa_cache_add(hapd->ptksa, hapd->own_addr, addr, cipher, life_time,
+ ptk);
}
/*
* ptksa_cache_add - Add a PTKSA cache entry
* @ptksa: Pointer to PTKSA cache data from ptksa_cache_init()
+ * @own_addr: Own MAC address
* @addr: Peer address
* @cipher: The cipher used
* @life_time: The PTK life time in seconds
* this entry will be replaced with the new entry.
*/
struct ptksa_cache_entry * ptksa_cache_add(struct ptksa_cache *ptksa,
+ const u8 *own_addr,
const u8 *addr, u32 cipher,
u32 life_time,
const struct wpa_ptk *ptk)
dl_list_init(&entry->list);
os_memcpy(entry->addr, addr, ETH_ALEN);
entry->cipher = cipher;
+ if (own_addr)
+ os_memcpy(entry->own_addr, own_addr, ETH_ALEN);
os_memcpy(&entry->ptk, ptk, sizeof(entry->ptk));
os_time_t expiration;
u32 cipher;
u8 addr[ETH_ALEN];
+ u8 own_addr[ETH_ALEN];
};
#ifdef CONFIG_PTKSA_CACHE
const u8 *addr, u32 cipher);
int ptksa_cache_list(struct ptksa_cache *ptksa, char *buf, size_t len);
struct ptksa_cache_entry * ptksa_cache_add(struct ptksa_cache *ptksa,
+ const u8 *own_addr,
const u8 *addr, u32 cipher,
u32 life_time,
const struct wpa_ptk *ptk);
}
static inline struct ptksa_cache_entry *
-ptksa_cache_add(struct ptksa_cache *ptksa, const u8 *addr, u32 cipher,
- u32 life_time, const struct wpa_ptk *ptk)
+ptksa_cache_add(struct ptksa_cache *ptksa, const u8 *own_addr, const u8 *addr,
+ u32 cipher, u32 life_time, const struct wpa_ptk *ptk)
{
return NULL;
}
wpa_printf(MSG_DEBUG, "PASN: Success sending last frame. Store PTK");
- ptksa_cache_add(wpa_s->ptksa, pasn->bssid, pasn->cipher,
- dot11RSNAConfigPMKLifetime, &pasn->ptk);
+ ptksa_cache_add(wpa_s->ptksa, wpa_s->own_addr, pasn->bssid,
+ pasn->cipher, dot11RSNAConfigPMKLifetime, &pasn->ptk);
forced_memzero(&pasn->ptk, sizeof(pasn->ptk));
{
struct wpa_supplicant *wpa_s = ctx;
- ptksa_cache_add(wpa_s->ptksa, addr, cipher, life_time, ptk);
+ ptksa_cache_add(wpa_s->ptksa, wpa_s->own_addr, addr, cipher, life_time,
+ ptk);
}
#endif /* CONFIG_NO_WPA */