pmksa_cache.c File Reference

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"
Include dependency graph for pmksa_cache.c:

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_entrypmksa_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_entrypmksa_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_entrypmksa_cache_auth_get (struct rsn_pmksa_cache *pmksa, const u8 *spa, const u8 *pmkid)
 Fetch a PMKSA cache entry.
struct rsn_pmksa_cache_entrypmksa_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_cachepmksa_cache_auth_init (void(*free_cb)(struct rsn_pmksa_cache_entry *entry, void *ctx), void *ctx)
 Initialize PMKSA cache.

Detailed Description

hostapd - PMKSA cache for IEEE 802.11i RSN

Copyright
Copyright (c) 2004-2008, Jouni Malinen <j@w1.fi>

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.


Function Documentation

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.

Parameters:
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
Returns:
Pointer to the added PMKSA cache entry or NULL on error

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.

Here is the call graph for this function:

void pmksa_cache_auth_deinit ( struct rsn_pmksa_cache pmksa  ) 

Free all entries in PMKSA cache.

Parameters:
pmksa Pointer to PMKSA cache data from pmksa_cache_auth_init()

Definition at line 322 of file pmksa_cache.c.

Here is the call graph for this function:

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.

Parameters:
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
Returns:
Pointer to PMKSA cache entry or NULL if no match was found

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.

Parameters:
free_cb Callback function to be called when a PMKSA cache entry is freed
ctx Context pointer for free_cb function
Returns:
Pointer to PMKSA cache data or NULL on failure

Definition at line 413 of file pmksa_cache.c.

Here is the call graph for this function:

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.

Parameters:
pmksa Pointer to PMKSA cache data from pmksa_cache_auth_init()
aa Authenticator address
spa Supplicant address
pmkid PMKID
Returns:
Pointer to PMKSA cache entry or NULL if no match was found

Use opportunistic key caching (OKC) to find a PMK for a supplicant.

Definition at line 384 of file pmksa_cache.c.

Here is the call graph for this function:

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines

Generated on Sat Nov 21 23:17:42 2009 for hostapd by  doxygen 1.6.1