2008-02-28 02:34:43 +01:00
|
|
|
/*
|
|
|
|
* hostapd - PMKSA cache for IEEE 802.11i RSN
|
2012-06-17 18:51:57 +02:00
|
|
|
* Copyright (c) 2004-2008, 2012, Jouni Malinen <j@w1.fi>
|
2008-02-28 02:34:43 +01:00
|
|
|
*
|
2012-02-11 15:46:35 +01:00
|
|
|
* This software may be distributed under the terms of the BSD license.
|
|
|
|
* See README for more details.
|
2008-02-28 02:34:43 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef PMKSA_CACHE_H
|
|
|
|
#define PMKSA_CACHE_H
|
|
|
|
|
2009-11-29 22:16:04 +01:00
|
|
|
#include "radius/radius.h"
|
|
|
|
|
2008-02-28 02:34:43 +01:00
|
|
|
/**
|
|
|
|
* struct rsn_pmksa_cache_entry - PMKSA cache entry
|
|
|
|
*/
|
|
|
|
struct rsn_pmksa_cache_entry {
|
|
|
|
struct rsn_pmksa_cache_entry *next, *hnext;
|
|
|
|
u8 pmkid[PMKID_LEN];
|
2015-10-14 00:18:11 +02:00
|
|
|
u8 pmk[PMK_LEN_MAX];
|
2008-02-28 02:34:43 +01:00
|
|
|
size_t pmk_len;
|
|
|
|
os_time_t expiration;
|
|
|
|
int akmp; /* WPA_KEY_MGMT_* */
|
|
|
|
u8 spa[ETH_ALEN];
|
|
|
|
|
|
|
|
u8 *identity;
|
|
|
|
size_t identity_len;
|
2012-06-17 18:51:57 +02:00
|
|
|
struct wpabuf *cui;
|
2008-02-28 02:34:43 +01:00
|
|
|
struct radius_class_data radius_class;
|
|
|
|
u8 eap_type_authsrv;
|
2016-01-21 14:51:56 +01:00
|
|
|
struct vlan_description *vlan_desc;
|
2008-08-03 19:17:58 +02:00
|
|
|
int opportunistic;
|
2014-10-18 09:20:24 +02:00
|
|
|
|
2016-01-24 12:37:46 +01:00
|
|
|
u64 acct_multi_session_id;
|
2008-02-28 02:34:43 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
struct rsn_pmksa_cache;
|
2017-10-09 11:08:12 +02:00
|
|
|
struct radius_das_attrs;
|
2008-02-28 02:34:43 +01:00
|
|
|
|
|
|
|
struct rsn_pmksa_cache *
|
2009-01-14 21:01:26 +01:00
|
|
|
pmksa_cache_auth_init(void (*free_cb)(struct rsn_pmksa_cache_entry *entry,
|
|
|
|
void *ctx), void *ctx);
|
|
|
|
void pmksa_cache_auth_deinit(struct rsn_pmksa_cache *pmksa);
|
|
|
|
struct rsn_pmksa_cache_entry *
|
|
|
|
pmksa_cache_auth_get(struct rsn_pmksa_cache *pmksa,
|
|
|
|
const u8 *spa, const u8 *pmkid);
|
2008-08-03 19:17:58 +02:00
|
|
|
struct rsn_pmksa_cache_entry * pmksa_cache_get_okc(
|
|
|
|
struct rsn_pmksa_cache *pmksa, const u8 *spa, const u8 *aa,
|
|
|
|
const u8 *pmkid);
|
2008-02-28 02:34:43 +01:00
|
|
|
struct rsn_pmksa_cache_entry *
|
2009-01-14 21:01:26 +01:00
|
|
|
pmksa_cache_auth_add(struct rsn_pmksa_cache *pmksa,
|
2016-02-15 03:23:37 +01:00
|
|
|
const u8 *pmk, size_t pmk_len, const u8 *pmkid,
|
2014-11-16 12:22:46 +01:00
|
|
|
const u8 *kck, size_t kck_len,
|
2009-01-14 21:01:26 +01:00
|
|
|
const u8 *aa, const u8 *spa, int session_timeout,
|
|
|
|
struct eapol_state_machine *eapol, int akmp);
|
2008-08-03 19:17:58 +02:00
|
|
|
struct rsn_pmksa_cache_entry *
|
2017-01-02 11:32:07 +01:00
|
|
|
pmksa_cache_auth_create_entry(const u8 *pmk, size_t pmk_len, const u8 *pmkid,
|
|
|
|
const u8 *kck, size_t kck_len, const u8 *aa,
|
|
|
|
const u8 *spa, int session_timeout,
|
|
|
|
struct eapol_state_machine *eapol, int akmp);
|
|
|
|
int pmksa_cache_auth_add_entry(struct rsn_pmksa_cache *pmksa,
|
|
|
|
struct rsn_pmksa_cache_entry *entry);
|
|
|
|
struct rsn_pmksa_cache_entry *
|
2008-08-03 19:17:58 +02:00
|
|
|
pmksa_cache_add_okc(struct rsn_pmksa_cache *pmksa,
|
|
|
|
const struct rsn_pmksa_cache_entry *old_entry,
|
|
|
|
const u8 *aa, const u8 *pmkid);
|
2016-01-21 14:51:56 +01:00
|
|
|
void pmksa_cache_to_eapol_data(struct hostapd_data *hapd,
|
|
|
|
struct rsn_pmksa_cache_entry *entry,
|
2008-02-28 02:34:43 +01:00
|
|
|
struct eapol_state_machine *eapol);
|
2013-04-05 17:55:32 +02:00
|
|
|
void pmksa_cache_free_entry(struct rsn_pmksa_cache *pmksa,
|
|
|
|
struct rsn_pmksa_cache_entry *entry);
|
2015-01-16 14:55:39 +01:00
|
|
|
int pmksa_cache_auth_radius_das_disconnect(struct rsn_pmksa_cache *pmksa,
|
|
|
|
struct radius_das_attrs *attr);
|
2016-03-09 10:16:12 +01:00
|
|
|
int pmksa_cache_auth_list(struct rsn_pmksa_cache *pmksa, char *buf, size_t len);
|
2016-03-09 10:16:13 +01:00
|
|
|
void pmksa_cache_auth_flush(struct rsn_pmksa_cache *pmksa);
|
2017-01-02 11:32:07 +01:00
|
|
|
int pmksa_cache_auth_list_mesh(struct rsn_pmksa_cache *pmksa, const u8 *addr,
|
|
|
|
char *buf, size_t len);
|
2008-02-28 02:34:43 +01:00
|
|
|
|
|
|
|
#endif /* PMKSA_CACHE_H */
|