wpa_supplicant / hostapd
2.5
|
wpa_supplicant - WPA2/RSN PMKSA cache functions More...
Go to the source code of this file.
Data Structures | |
struct | rsn_pmksa_cache_entry |
PMKSA cache entry. More... | |
Enumerations | |
enum | pmksa_free_reason { PMKSA_FREE, PMKSA_REPLACE, PMKSA_EXPIRE } |
Functions | |
struct rsn_pmksa_cache * | pmksa_cache_init (void(*free_cb)(struct rsn_pmksa_cache_entry *entry, void *ctx, enum pmksa_free_reason reason), void *ctx, struct wpa_sm *sm) |
Initialize PMKSA cache. More... | |
void | pmksa_cache_deinit (struct rsn_pmksa_cache *pmksa) |
Free all entries in PMKSA cache. More... | |
struct rsn_pmksa_cache_entry * | pmksa_cache_get (struct rsn_pmksa_cache *pmksa, const u8 *aa, const u8 *pmkid, const void *network_ctx) |
Fetch a PMKSA cache entry. More... | |
int | pmksa_cache_list (struct rsn_pmksa_cache *pmksa, char *buf, size_t len) |
Dump text list of entries in PMKSA cache. More... | |
struct rsn_pmksa_cache_entry * | pmksa_cache_add (struct rsn_pmksa_cache *pmksa, const u8 *pmk, size_t pmk_len, const u8 *kck, size_t kck_len, const u8 *aa, const u8 *spa, void *network_ctx, int akmp) |
Add a PMKSA cache entry. More... | |
struct rsn_pmksa_cache_entry * | pmksa_cache_get_current (struct wpa_sm *sm) |
Get the current used PMKSA entry. More... | |
void | pmksa_cache_clear_current (struct wpa_sm *sm) |
Clear the current PMKSA entry selection. More... | |
int | pmksa_cache_set_current (struct wpa_sm *sm, const u8 *pmkid, const u8 *bssid, void *network_ctx, int try_opportunistic) |
Set the current PMKSA entry selection. More... | |
struct rsn_pmksa_cache_entry * | pmksa_cache_get_opportunistic (struct rsn_pmksa_cache *pmksa, void *network_ctx, const u8 *aa) |
Try to get an opportunistic PMKSA entry. More... | |
void | pmksa_cache_flush (struct rsn_pmksa_cache *pmksa, void *network_ctx, const u8 *pmk, size_t pmk_len) |
Flush PMKSA cache entries for a specific network. More... | |
wpa_supplicant - WPA2/RSN PMKSA cache functions
struct rsn_pmksa_cache_entry* pmksa_cache_add | ( | struct rsn_pmksa_cache * | pmksa, |
const u8 * | pmk, | ||
size_t | pmk_len, | ||
const u8 * | kck, | ||
size_t | kck_len, | ||
const u8 * | aa, | ||
const u8 * | spa, | ||
void * | network_ctx, | ||
int | akmp | ||
) |
Add a PMKSA cache entry.
pmksa | Pointer to PMKSA cache data from pmksa_cache_init() |
pmk | The new pairwise master key |
pmk_len | PMK length in bytes, usually PMK_LEN (32) |
kck | Key confirmation key or NULL if not yet derived |
kck_len | KCK length in bytes |
aa | Authenticator address |
spa | Supplicant address |
network_ctx | Network configuration context for this PMK |
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 Authenticator, this entry will be replaced with the new entry. PMKID will be calculated based on the PMK and the driver interface is notified of the new PMKID.
void pmksa_cache_clear_current | ( | struct wpa_sm * | sm | ) |
Clear the current PMKSA entry selection.
sm | Pointer to WPA state machine data from wpa_sm_init() |
void pmksa_cache_deinit | ( | struct rsn_pmksa_cache * | pmksa | ) |
Free all entries in PMKSA cache.
pmksa | Pointer to PMKSA cache data from pmksa_cache_init() |
void pmksa_cache_flush | ( | struct rsn_pmksa_cache * | pmksa, |
void * | network_ctx, | ||
const u8 * | pmk, | ||
size_t | pmk_len | ||
) |
Flush PMKSA cache entries for a specific network.
pmksa | Pointer to PMKSA cache data from pmksa_cache_init() |
network_ctx | Network configuration context or NULL to flush all entries |
pmk | PMK to match for or NYLL to match all PMKs |
pmk_len | PMK length |
struct rsn_pmksa_cache_entry* pmksa_cache_get | ( | struct rsn_pmksa_cache * | pmksa, |
const u8 * | aa, | ||
const u8 * | pmkid, | ||
const void * | network_ctx | ||
) |
Fetch a PMKSA cache entry.
pmksa | Pointer to PMKSA cache data from pmksa_cache_init() |
aa | Authenticator address or NULL to match any |
pmkid | PMKID or NULL to match any |
network_ctx | Network context or NULL to match any |
struct rsn_pmksa_cache_entry* pmksa_cache_get_current | ( | struct wpa_sm * | sm | ) |
Get the current used PMKSA entry.
sm | Pointer to WPA state machine data from wpa_sm_init() |
struct rsn_pmksa_cache_entry* pmksa_cache_get_opportunistic | ( | struct rsn_pmksa_cache * | pmksa, |
void * | network_ctx, | ||
const u8 * | aa | ||
) |
Try to get an opportunistic PMKSA entry.
pmksa | Pointer to PMKSA cache data from pmksa_cache_init() |
network_ctx | Network configuration context |
aa | Authenticator address for the new AP |
Try to create a new PMKSA cache entry opportunistically by guessing that the new AP is sharing the same PMK as another AP that has the same SSID and has already an entry in PMKSA cache.
struct rsn_pmksa_cache* pmksa_cache_init | ( | void(*)(struct rsn_pmksa_cache_entry *entry, void *ctx, enum pmksa_free_reason reason) | free_cb, |
void * | ctx, | ||
struct wpa_sm * | sm | ||
) |
Initialize PMKSA cache.
free_cb | Callback function to be called when a PMKSA cache entry is freed |
ctx | Context pointer for free_cb function |
sm | Pointer to WPA state machine data from wpa_sm_init() |
int pmksa_cache_list | ( | struct rsn_pmksa_cache * | pmksa, |
char * | buf, | ||
size_t | len | ||
) |
Dump text list of entries in PMKSA cache.
pmksa | Pointer to PMKSA cache data from pmksa_cache_init() |
buf | Buffer for the list |
len | Length of the buffer |
This function is used to generate a text format representation of the current PMKSA cache contents for the ctrl_iface PMKSA command.
int pmksa_cache_set_current | ( | struct wpa_sm * | sm, |
const u8 * | pmkid, | ||
const u8 * | bssid, | ||
void * | network_ctx, | ||
int | try_opportunistic | ||
) |
Set the current PMKSA entry selection.
sm | Pointer to WPA state machine data from wpa_sm_init() |
pmkid | PMKID for selecting PMKSA or NULL if not used |
bssid | BSSID for PMKSA or NULL if not used |
network_ctx | Network configuration context |
try_opportunistic | Whether to allow opportunistic PMKSA caching |