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.

216 lines
5.3 KiB

  1. /*++
  2. Copyright (c) 2000, Microsoft Corporation
  3. Module Name:
  4. eleap.h
  5. Abstract:
  6. e This module contains the definitions and declarations related to
  7. EAP protocol
  8. Revision History:
  9. sachins, Apr 23 2000, Created
  10. --*/
  11. #ifndef _EAPOL_EAP_H_
  12. #define _EAPOL_EAP_H_
  13. //#define EAP_DUMPW(X,Y) TraceDumpEx(g_dwTraceIdEap,1,(LPBYTE)X,Y,4,1,NULL)
  14. //#define EAP_DUMPB(X,Y) TraceDumpEx(g_dwTraceIdEap,1,(LPBYTE)X,Y,1,1,NULL)
  15. //
  16. // Structure used to hold information about EAP DLLs that are loaded
  17. //
  18. typedef struct _EAP_INFO
  19. {
  20. // Handle to loaded EAP DLL
  21. HINSTANCE hInstance;
  22. // Struture holding pointer to mandatory EAP DLL entrypoints
  23. PPP_EAP_INFO RasEapInfo;
  24. } EAP_INFO, *PEAP_INFO;
  25. //
  26. // Structure used to hold port/connection configuration blob
  27. // received from the EAP DLL, using RasEapInvokeConfigUI
  28. //
  29. typedef struct _ELEAP_SET_CUSTOM_AUTH_DATA
  30. {
  31. BYTE *pConnectionData;
  32. DWORD dwSizeOfConnectionData;
  33. } ELEAP_SET_CUSTOM_AUTH_DATA;
  34. //
  35. // Structure used to hold data blob
  36. // received from the EAP DLL, using RasEapInvokeInteractiveUI
  37. //
  38. typedef struct _ELEAP_INVOKE_EAP_UI
  39. {
  40. DWORD dwEapTypeId;
  41. DWORD dwContextId;
  42. BYTE *pbUIContextData;
  43. DWORD dwSizeOfUIContextData;
  44. } ELEAP_INVOKE_EAP_UI;
  45. //
  46. // Structure used to pass results and data between EAP processing and EAPOL
  47. //
  48. typedef struct _ELEAP_RESULT
  49. {
  50. ELEAP_ACTION Action;
  51. //
  52. // The packet ID which will cause the timeout for this send to be removed
  53. // from the timer queue. Otherwise, the timer queue is not touched. The
  54. // packet received is returned to the AP regardless of whether the timer
  55. // queue is changed.
  56. //
  57. BYTE bIdExpected;
  58. //
  59. // dwError is valid only with an Action code of Done or SendAndDone. 0
  60. // indicates succesful authentication. Non-0 indicates unsuccessful
  61. // authentication with the value indicating the error that occurred.
  62. //
  63. DWORD dwError;
  64. //
  65. // Valid only when dwError is non-0. Indicates whether client is allowed
  66. // to retry without restarting authentication. (Will be true in MS
  67. // extended CHAP only)
  68. //
  69. BOOL fRetry;
  70. CHAR szUserName[ UNLEN + 1 ];
  71. //
  72. // Set to attributes to be used for this user. If this is NULL, attributes
  73. // from the authenticator will be used for this user. It is upto the
  74. // allocater of this memory to free it. Must be freed during the RasCpEnd
  75. // call.
  76. //
  77. OPTIONAL RAS_AUTH_ATTRIBUTE * pUserAttributes;
  78. //
  79. // Used by MS-CHAP to pass the challenge used during the authentication
  80. // protocol. These 8 bytes are used as the variant for the 128 bit
  81. // encryption keys.
  82. //
  83. BYTE abChallenge[MAX_CHALLENGE_SIZE];
  84. BYTE abResponse[MAX_RESPONSE_SIZE];
  85. // Size of EAP packet constructed by EAP DLL
  86. WORD wSizeOfEapPkt;
  87. // Does RasEapInvokeInteractiveUI entrypoint need to be invoked?
  88. BOOL fInvokeEapUI;
  89. // Data obtained via RasEapInvokeInteractiveUI entrypoint of the DLL
  90. ELEAP_INVOKE_EAP_UI InvokeEapUIData;
  91. // EAP type e.g. for EAP-TLS = 13
  92. DWORD dwEapTypeId;
  93. // Does user data blob created by EAP DLL need to be stored in the
  94. // registry
  95. BOOL fSaveUserData;
  96. // User data blob created by EAP DLL
  97. BYTE *pUserData;
  98. // Size of user data blob created by EAP DLL
  99. DWORD dwSizeOfUserData;
  100. // Does connection data blob created by EAP DLL need to be stored in the
  101. // registry
  102. BOOL fSaveConnectionData;
  103. // Connection data blob created by EAP DLL
  104. ELEAP_SET_CUSTOM_AUTH_DATA SetCustomAuthData;
  105. // Notification text extracted from EAP-Notification message
  106. CHAR *pszReplyMessage;
  107. } ELEAP_RESULT;
  108. //
  109. //
  110. // FUNCTION DECLARATIONS
  111. //
  112. DWORD
  113. ElEapInit (
  114. IN BOOL fInitialize
  115. );
  116. DWORD
  117. ElEapBegin (
  118. IN EAPOL_PCB *pPCB
  119. );
  120. DWORD
  121. ElEapEnd (
  122. IN EAPOL_PCB *pPCB
  123. );
  124. DWORD
  125. ElEapMakeMessage (
  126. IN EAPOL_PCB *pPCB,
  127. IN PPP_EAP_PACKET *pReceiveBuf,
  128. IN OUT PPP_EAP_PACKET *pSendBuf,
  129. IN DWORD dwSizeOfSendBuf,
  130. IN OUT ELEAP_RESULT *pResult
  131. );
  132. DWORD
  133. ElMakeSupplicantMessage (
  134. IN EAPOL_PCB *pPCB,
  135. IN PPP_EAP_PACKET *pReceiveBuf,
  136. IN OUT PPP_EAP_PACKET *pSendBuf,
  137. IN DWORD dwSizeOfSendBuf,
  138. IN OUT ELEAP_RESULT *pResult
  139. );
  140. DWORD
  141. ElEapDllBegin (
  142. IN EAPOL_PCB *pPCB,
  143. IN DWORD dwEapIndex
  144. );
  145. DWORD
  146. ElEapDllWork (
  147. IN EAPOL_PCB *pPCB,
  148. IN PPP_EAP_PACKET *pReceiveBuf,
  149. IN OUT PPP_EAP_PACKET *pSendBuf,
  150. IN DWORD dwSizeOfSendBuf,
  151. IN OUT ELEAP_RESULT *pResult
  152. );
  153. DWORD
  154. ElEapDllEnd (
  155. IN EAPOL_PCB *pPCB
  156. );
  157. DWORD
  158. ElGetEapTypeIndex (
  159. IN DWORD dwEapType
  160. );
  161. #endif // _EAPOL_EAP_H_