Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

202 lines
3.6 KiB

  1. /*++
  2. Copyright (c) 1999, Microsoft Corporation
  3. Module Name:
  4. elprotocol.h
  5. Abstract:
  6. This module contains definitions and declarations related to EAPOL
  7. protocol
  8. Revision History:
  9. sachins, Apr 30 2000, Created
  10. --*/
  11. #ifndef _EAPOL_PROTOCOL_H_
  12. #define _EAPOL_PROTOCOL_H_
  13. //
  14. // EAPOL packet types
  15. //
  16. typedef enum _EAPOL_PACKET_TYPE
  17. {
  18. EAP_Packet = 0,
  19. EAPOL_Start,
  20. EAPOL_Logoff,
  21. EAPOL_Key
  22. } EAPOL_PACKET_TYPE;
  23. //
  24. // Structure: EAPOL_PACKET
  25. //
  26. typedef struct _EAPOL_PACKET
  27. {
  28. BYTE EthernetType[2];
  29. BYTE ProtocolVersion;
  30. BYTE PacketType;
  31. BYTE PacketBodyLength[2];
  32. BYTE PacketBody[1];
  33. } EAPOL_PACKET, *PEAPOL_PACKET;
  34. //
  35. // Structure: EAPOL_KEY_PACKET
  36. //
  37. typedef struct _EAPOL_KEY_DESCRIPTOR
  38. {
  39. BYTE DescriptorType;
  40. BYTE KeyLength[2];
  41. BYTE ReplayCounter[8];
  42. BYTE Key_IV[16];
  43. BYTE KeyIndex;
  44. BYTE KeySignature[16];
  45. BYTE Key[1];
  46. } EAPOL_KEY_DESC, *PEAPOL_KEY_DESC;
  47. //
  48. // Structure: EAPOL_KEY_MATERIAL
  49. //
  50. typedef struct _EAPOL_KEY_MATERIAL
  51. {
  52. BYTE KeyMaterialLength[2];
  53. BYTE KeyMaterial[1];
  54. } EAPOL_KEY_MATERIAL, *PEAPOL_KEY_MATERIAL;
  55. //
  56. // CONSTANTS
  57. //
  58. #define MAX_EAPOL_PACKET_TYPE EAPOL_Key
  59. #define EAPOL_KEY_DESC_RC4 1
  60. #define EAPOL_KEY_DESC_PER_STA 2
  61. #define MAX_KEY_DESC EAPOL_KEY_DESC_PER_STA
  62. #define KEY_IV_LENGTH 16
  63. #define RC4_PAD_LENGTH 256
  64. #define EAPOL_TRANSMIT_KEY_INTERVAL 5 // seconds
  65. //
  66. // FUNCTION DECLARATIONS
  67. //
  68. DWORD
  69. WINAPI
  70. ElProcessReceivedPacket (
  71. IN PVOID pvContext
  72. );
  73. DWORD
  74. FSMDisconnected (
  75. IN EAPOL_PCB *pPCB,
  76. IN EAPOL_PACKET *pEapolPkt
  77. );
  78. DWORD
  79. FSMLogoff (
  80. IN EAPOL_PCB *pPCB,
  81. IN EAPOL_PACKET *pEapolPkt
  82. );
  83. DWORD
  84. FSMConnecting (
  85. IN EAPOL_PCB *pPCB,
  86. IN EAPOL_PACKET *pEapolPkt
  87. );
  88. DWORD
  89. FSMAcquired (
  90. IN EAPOL_PCB *pPCB,
  91. IN EAPOL_PACKET *pEapolPkt
  92. );
  93. DWORD
  94. FSMAuthenticating (
  95. IN EAPOL_PCB *pPCB,
  96. IN EAPOL_PACKET *pEapolPkt
  97. );
  98. DWORD
  99. FSMHeld (
  100. IN EAPOL_PCB *pPCB,
  101. IN EAPOL_PACKET *pEapolPkt
  102. );
  103. DWORD
  104. FSMAuthenticated (
  105. IN EAPOL_PCB *pPCB,
  106. IN EAPOL_PACKET *pEapolPkt
  107. );
  108. DWORD
  109. FSMKeyReceive (
  110. IN EAPOL_PCB *pPCB,
  111. IN EAPOL_PACKET *pEapolPkt
  112. );
  113. DWORD
  114. ElKeyReceiveRC4 (
  115. IN EAPOL_PCB *pPCB,
  116. IN EAPOL_PACKET *pEapolPkt
  117. );
  118. DWORD
  119. ElKeyReceivePerSTA (
  120. IN EAPOL_PCB *pPCB,
  121. IN EAPOL_PACKET *pEapolPkt
  122. );
  123. VOID
  124. ElTimeoutCallbackRoutine (
  125. IN PVOID pvContext,
  126. IN BOOLEAN fTimerOfWaitFired
  127. );
  128. DWORD
  129. ElEapWork (
  130. IN EAPOL_PCB *pPCB,
  131. IN PPP_EAP_PACKET *pRecvPkt
  132. );
  133. DWORD
  134. ElExtractMPPESendRecvKeys (
  135. IN EAPOL_PCB *pPCB,
  136. IN RAS_AUTH_ATTRIBUTE *pUserAttributes,
  137. IN BYTE *pChallenge,
  138. IN BYTE *pResponse
  139. );
  140. DWORD
  141. ElProcessEapSuccess (
  142. IN EAPOL_PCB *pPCB,
  143. IN EAPOL_PACKET *pEapolPkt
  144. );
  145. DWORD
  146. ElProcessEapFail (
  147. IN EAPOL_PCB *pPCB,
  148. IN EAPOL_PACKET *pEapolPkt
  149. );
  150. DWORD
  151. ElSetEAPOLKeyReceivedTimer (
  152. IN EAPOL_PCB *pPCB
  153. );
  154. DWORD
  155. ElVerifyEAPOLKeyReceived (
  156. IN EAPOL_PCB *pPCB
  157. );
  158. #endif // _EAPOL_PROTOCOL_H_