hostapd - PMKSA cache for IEEE 802.11i RSN More...
#include "includes.h"
#include "common.h"
#include "sta_info.h"
#include "config.h"
#include "eloop.h"
#include "sha1.h"
#include "sha256.h"
#include "eapol_sm.h"
#include "pmksa_cache.h"
Go to the source code of this file.
Data Structures | |
struct | rsn_pmksa_cache |
Defines | |
#define | PMKID_HASH_SIZE 128 |
#define | PMKID_HASH(pmkid) (unsigned int) ((pmkid)[0] & 0x7f) |
Functions | |
void | pmksa_cache_to_eapol_data (struct rsn_pmksa_cache_entry *entry, struct eapol_state_machine *eapol) |
struct rsn_pmksa_cache_entry * | pmksa_cache_auth_add (struct rsn_pmksa_cache *pmksa, const u8 *pmk, size_t pmk_len, const u8 *aa, const u8 *spa, int session_timeout, struct eapol_state_machine *eapol, int akmp) |
Add a PMKSA cache entry. | |
struct rsn_pmksa_cache_entry * | pmksa_cache_add_okc (struct rsn_pmksa_cache *pmksa, const struct rsn_pmksa_cache_entry *old_entry, const u8 *aa, const u8 *pmkid) |
void | pmksa_cache_auth_deinit (struct rsn_pmksa_cache *pmksa) |
Free all entries in PMKSA cache. | |
struct rsn_pmksa_cache_entry * | pmksa_cache_auth_get (struct rsn_pmksa_cache *pmksa, const u8 *spa, const u8 *pmkid) |
Fetch a PMKSA cache entry. | |
struct rsn_pmksa_cache_entry * | pmksa_cache_get_okc (struct rsn_pmksa_cache *pmksa, const u8 *aa, const u8 *spa, const u8 *pmkid) |
Fetch a PMKSA cache entry using OKC. | |
struct rsn_pmksa_cache * | pmksa_cache_auth_init (void(*free_cb)(struct rsn_pmksa_cache_entry *entry, void *ctx), void *ctx) |
Initialize PMKSA cache. |
hostapd - PMKSA cache for IEEE 802.11i RSN
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation.
Alternatively, this software may be distributed under the terms of BSD license.
See README and COPYING for more details.
Definition in file pmksa_cache.c.
struct rsn_pmksa_cache_entry* pmksa_cache_auth_add | ( | struct rsn_pmksa_cache * | pmksa, | |
const u8 * | pmk, | |||
size_t | pmk_len, | |||
const u8 * | aa, | |||
const u8 * | spa, | |||
int | session_timeout, | |||
struct eapol_state_machine * | eapol, | |||
int | akmp | |||
) | [read] |
Add a PMKSA cache entry.
pmksa | Pointer to PMKSA cache data from pmksa_cache_auth_init() | |
pmk | The new pairwise master key | |
pmk_len | PMK length in bytes, usually PMK_LEN (32) | |
aa | Authenticator address | |
spa | Supplicant address | |
session_timeout | Session timeout | |
eapol | Pointer to EAPOL state machine data | |
akmp | WPA_KEY_MGMT_* used in key derivation |
This function create a PMKSA entry for a new PMK and adds it to the PMKSA cache. If an old entry is already in the cache for the same Supplicant, this entry will be replaced with the new entry. PMKID will be calculated based on the PMK.
Definition at line 233 of file pmksa_cache.c.
void pmksa_cache_auth_deinit | ( | struct rsn_pmksa_cache * | pmksa | ) |
Free all entries in PMKSA cache.
pmksa | Pointer to PMKSA cache data from pmksa_cache_auth_init() |
Definition at line 322 of file pmksa_cache.c.
struct rsn_pmksa_cache_entry* pmksa_cache_auth_get | ( | struct rsn_pmksa_cache * | pmksa, | |
const u8 * | spa, | |||
const u8 * | pmkid | |||
) | [read] |
Fetch a PMKSA cache entry.
pmksa | Pointer to PMKSA cache data from pmksa_cache_auth_init() | |
spa | Supplicant address or NULL to match any | |
pmkid | PMKID or NULL to match any |
Definition at line 352 of file pmksa_cache.c.
struct rsn_pmksa_cache* pmksa_cache_auth_init | ( | void(*)(struct rsn_pmksa_cache_entry *entry, void *ctx) | free_cb, | |
void * | ctx | |||
) | [read] |
Initialize PMKSA cache.
free_cb | Callback function to be called when a PMKSA cache entry is freed | |
ctx | Context pointer for free_cb function |
Definition at line 413 of file pmksa_cache.c.
struct rsn_pmksa_cache_entry* pmksa_cache_get_okc | ( | struct rsn_pmksa_cache * | pmksa, | |
const u8 * | aa, | |||
const u8 * | spa, | |||
const u8 * | pmkid | |||
) | [read] |
Fetch a PMKSA cache entry using OKC.
pmksa | Pointer to PMKSA cache data from pmksa_cache_auth_init() | |
aa | Authenticator address | |
spa | Supplicant address | |
pmkid | PMKID |
Use opportunistic key caching (OKC) to find a PMK for a supplicant.
Definition at line 384 of file pmksa_cache.c.