eap_defs.h 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. /*
  2. * EAP server/peer: Shared EAP definitions
  3. * Copyright (c) 2004-2007, 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 EAP_DEFS_H
  9. #define EAP_DEFS_H
  10. /* RFC 3748 - Extensible Authentication Protocol (EAP) */
  11. #ifdef _MSC_VER
  12. #pragma pack(push, 1)
  13. #endif /* _MSC_VER */
  14. struct eap_hdr {
  15. u8 code;
  16. u8 identifier;
  17. be16 length; /* including code and identifier; network byte order */
  18. /* followed by length-4 octets of data */
  19. } STRUCT_PACKED;
  20. #ifdef _MSC_VER
  21. #pragma pack(pop)
  22. #endif /* _MSC_VER */
  23. enum { EAP_CODE_REQUEST = 1, EAP_CODE_RESPONSE = 2, EAP_CODE_SUCCESS = 3,
  24. EAP_CODE_FAILURE = 4 };
  25. /* EAP Request and Response data begins with one octet Type. Success and
  26. * Failure do not have additional data. */
  27. /*
  28. * EAP Method Types as allocated by IANA:
  29. * http://www.iana.org/assignments/eap-numbers
  30. */
  31. typedef enum {
  32. EAP_TYPE_NONE = 0,
  33. EAP_TYPE_IDENTITY = 1 /* RFC 3748 */,
  34. EAP_TYPE_NOTIFICATION = 2 /* RFC 3748 */,
  35. EAP_TYPE_NAK = 3 /* Response only, RFC 3748 */,
  36. EAP_TYPE_MD5 = 4, /* RFC 3748 */
  37. EAP_TYPE_OTP = 5 /* RFC 3748 */,
  38. EAP_TYPE_GTC = 6, /* RFC 3748 */
  39. EAP_TYPE_TLS = 13 /* RFC 2716 */,
  40. EAP_TYPE_LEAP = 17 /* Cisco proprietary */,
  41. EAP_TYPE_SIM = 18 /* RFC 4186 */,
  42. EAP_TYPE_TTLS = 21 /* RFC 5281 */,
  43. EAP_TYPE_AKA = 23 /* RFC 4187 */,
  44. EAP_TYPE_PEAP = 25 /* draft-josefsson-pppext-eap-tls-eap-06.txt */,
  45. EAP_TYPE_MSCHAPV2 = 26 /* draft-kamath-pppext-eap-mschapv2-00.txt */,
  46. EAP_TYPE_TLV = 33 /* draft-josefsson-pppext-eap-tls-eap-07.txt */,
  47. EAP_TYPE_TNC = 38 /* TNC IF-T v1.0-r3; note: tentative assignment;
  48. * type 38 has previously been allocated for
  49. * EAP-HTTP Digest, (funk.com) */,
  50. EAP_TYPE_FAST = 43 /* RFC 4851 */,
  51. EAP_TYPE_PAX = 46 /* RFC 4746 */,
  52. EAP_TYPE_PSK = 47 /* RFC 4764 */,
  53. EAP_TYPE_SAKE = 48 /* RFC 4763 */,
  54. EAP_TYPE_IKEV2 = 49 /* RFC 5106 */,
  55. EAP_TYPE_AKA_PRIME = 50 /* RFC 5448 */,
  56. EAP_TYPE_GPSK = 51 /* RFC 5433 */,
  57. EAP_TYPE_PWD = 52 /* RFC 5931 */,
  58. EAP_TYPE_EKE = 53 /* RFC 6124 */,
  59. EAP_TYPE_EXPANDED = 254 /* RFC 3748 */
  60. } EapType;
  61. /* SMI Network Management Private Enterprise Code for vendor specific types */
  62. enum {
  63. EAP_VENDOR_IETF = 0,
  64. EAP_VENDOR_MICROSOFT = 0x000137 /* Microsoft */,
  65. EAP_VENDOR_WFA = 0x00372A /* Wi-Fi Alliance (moved to WBA) */,
  66. EAP_VENDOR_HOSTAP = 39068 /* hostapd/wpa_supplicant project */,
  67. EAP_VENDOR_WFA_NEW = 40808 /* Wi-Fi Alliance */
  68. };
  69. #define EAP_VENDOR_UNAUTH_TLS EAP_VENDOR_HOSTAP
  70. #define EAP_VENDOR_TYPE_UNAUTH_TLS 1
  71. #define EAP_VENDOR_WFA_UNAUTH_TLS 13
  72. #define EAP_MSK_LEN 64
  73. #define EAP_EMSK_LEN 64
  74. #endif /* EAP_DEFS_H */