pmksa_cache.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*
  2. * hostapd - PMKSA cache for IEEE 802.11i RSN
  3. * Copyright (c) 2004-2008, Jouni Malinen <j@w1.fi>
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License version 2 as
  7. * published by the Free Software Foundation.
  8. *
  9. * Alternatively, this software may be distributed under the terms of BSD
  10. * license.
  11. *
  12. * See README and COPYING for more details.
  13. */
  14. #ifndef PMKSA_CACHE_H
  15. #define PMKSA_CACHE_H
  16. /**
  17. * struct rsn_pmksa_cache_entry - PMKSA cache entry
  18. */
  19. struct rsn_pmksa_cache_entry {
  20. struct rsn_pmksa_cache_entry *next, *hnext;
  21. u8 pmkid[PMKID_LEN];
  22. u8 pmk[PMK_LEN];
  23. size_t pmk_len;
  24. os_time_t expiration;
  25. int akmp; /* WPA_KEY_MGMT_* */
  26. u8 spa[ETH_ALEN];
  27. u8 *identity;
  28. size_t identity_len;
  29. struct radius_class_data radius_class;
  30. u8 eap_type_authsrv;
  31. int vlan_id;
  32. int opportunistic;
  33. };
  34. struct rsn_pmksa_cache;
  35. struct rsn_pmksa_cache *
  36. pmksa_cache_auth_init(void (*free_cb)(struct rsn_pmksa_cache_entry *entry,
  37. void *ctx), void *ctx);
  38. void pmksa_cache_auth_deinit(struct rsn_pmksa_cache *pmksa);
  39. struct rsn_pmksa_cache_entry *
  40. pmksa_cache_auth_get(struct rsn_pmksa_cache *pmksa,
  41. const u8 *spa, const u8 *pmkid);
  42. struct rsn_pmksa_cache_entry * pmksa_cache_get_okc(
  43. struct rsn_pmksa_cache *pmksa, const u8 *spa, const u8 *aa,
  44. const u8 *pmkid);
  45. struct rsn_pmksa_cache_entry *
  46. pmksa_cache_auth_add(struct rsn_pmksa_cache *pmksa,
  47. const u8 *pmk, size_t pmk_len,
  48. const u8 *aa, const u8 *spa, int session_timeout,
  49. struct eapol_state_machine *eapol, int akmp);
  50. struct rsn_pmksa_cache_entry *
  51. pmksa_cache_add_okc(struct rsn_pmksa_cache *pmksa,
  52. const struct rsn_pmksa_cache_entry *old_entry,
  53. const u8 *aa, const u8 *pmkid);
  54. void pmksa_cache_to_eapol_data(struct rsn_pmksa_cache_entry *entry,
  55. struct eapol_state_machine *eapol);
  56. #endif /* PMKSA_CACHE_H */