pmksa_cache_auth.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /*
  2. * hostapd - PMKSA cache for IEEE 802.11i RSN
  3. * Copyright (c) 2004-2008, 2012, Jouni Malinen <j@w1.fi>
  4. *
  5. * This software may be distributed under the terms of the BSD license.
  6. * See README for more details.
  7. */
  8. #ifndef PMKSA_CACHE_H
  9. #define PMKSA_CACHE_H
  10. #include "radius/radius.h"
  11. /**
  12. * struct rsn_pmksa_cache_entry - PMKSA cache entry
  13. */
  14. struct rsn_pmksa_cache_entry {
  15. struct rsn_pmksa_cache_entry *next, *hnext;
  16. u8 pmkid[PMKID_LEN];
  17. u8 pmk[PMK_LEN];
  18. size_t pmk_len;
  19. os_time_t expiration;
  20. int akmp; /* WPA_KEY_MGMT_* */
  21. u8 spa[ETH_ALEN];
  22. u8 *identity;
  23. size_t identity_len;
  24. struct wpabuf *cui;
  25. struct radius_class_data radius_class;
  26. u8 eap_type_authsrv;
  27. int vlan_id;
  28. int opportunistic;
  29. u32 acct_multi_session_id_hi;
  30. u32 acct_multi_session_id_lo;
  31. };
  32. struct rsn_pmksa_cache;
  33. struct rsn_pmksa_cache *
  34. pmksa_cache_auth_init(void (*free_cb)(struct rsn_pmksa_cache_entry *entry,
  35. void *ctx), void *ctx);
  36. void pmksa_cache_auth_deinit(struct rsn_pmksa_cache *pmksa);
  37. struct rsn_pmksa_cache_entry *
  38. pmksa_cache_auth_get(struct rsn_pmksa_cache *pmksa,
  39. const u8 *spa, const u8 *pmkid);
  40. struct rsn_pmksa_cache_entry * pmksa_cache_get_okc(
  41. struct rsn_pmksa_cache *pmksa, const u8 *spa, const u8 *aa,
  42. const u8 *pmkid);
  43. struct rsn_pmksa_cache_entry *
  44. pmksa_cache_auth_add(struct rsn_pmksa_cache *pmksa,
  45. const u8 *pmk, size_t pmk_len,
  46. const u8 *kck, size_t kck_len,
  47. const u8 *aa, const u8 *spa, int session_timeout,
  48. struct eapol_state_machine *eapol, int akmp);
  49. struct rsn_pmksa_cache_entry *
  50. pmksa_cache_add_okc(struct rsn_pmksa_cache *pmksa,
  51. const struct rsn_pmksa_cache_entry *old_entry,
  52. const u8 *aa, const u8 *pmkid);
  53. void pmksa_cache_to_eapol_data(struct rsn_pmksa_cache_entry *entry,
  54. struct eapol_state_machine *eapol);
  55. void pmksa_cache_free_entry(struct rsn_pmksa_cache *pmksa,
  56. struct rsn_pmksa_cache_entry *entry);
  57. int pmksa_cache_auth_radius_das_disconnect(struct rsn_pmksa_cache *pmksa,
  58. struct radius_das_attrs *attr);
  59. #endif /* PMKSA_CACHE_H */