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.

238 lines
6.1 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. // CONSTANTS DECLARATIONS
  110. //
  111. // Default EAP type at startup for the system
  112. #define EAPCFG_DefaultKey EAP_TYPE_TLS
  113. //
  114. // EAP DLL configuration entrypoints. These definitions must match the
  115. // raseapif.h prototypes for RasEapInvokeConfigUI, RasEapFreeUserData and
  116. // RasEapGetIdentity. For each EAP DLL, a check will be made to see if these
  117. // entrypoints exists for the Dll, if they exist the entrypoints will be
  118. // stored as variables of the types below for usage
  119. //
  120. typedef DWORD (APIENTRY * EAPOLEAPFREE)( PBYTE );
  121. typedef DWORD (APIENTRY * EAPOLEAPINVOKECONFIGUI)( DWORD, HWND, DWORD, PBYTE, DWORD, PBYTE*, DWORD*);
  122. typedef DWORD (APIENTRY * EAPOLEAPGETIDENTITY)( DWORD, HWND, DWORD, const WCHAR*, const WCHAR*, PBYTE, DWORD, PBYTE, DWORD, PBYTE*, DWORD*, WCHAR** );
  123. typedef DWORD (APIENTRY * EAPOLEAPINVOKEINTERACTIVEUI)( DWORD, HWND, PBYTE, DWORD, PBYTE*, DWORD* );
  124. //
  125. //
  126. // FUNCTION DECLARATIONS
  127. //
  128. DWORD
  129. ElEapInit (
  130. IN BOOL fInitialize
  131. );
  132. DWORD
  133. ElEapBegin (
  134. IN EAPOL_PCB *pPCB
  135. );
  136. DWORD
  137. ElEapEnd (
  138. IN EAPOL_PCB *pPCB
  139. );
  140. DWORD
  141. ElEapMakeMessage (
  142. IN EAPOL_PCB *pPCB,
  143. IN PPP_EAP_PACKET *pReceiveBuf,
  144. IN OUT PPP_EAP_PACKET *pSendBuf,
  145. IN DWORD dwSizeOfSendBuf,
  146. IN OUT ELEAP_RESULT *pResult
  147. );
  148. DWORD
  149. ElMakeSupplicantMessage (
  150. IN EAPOL_PCB *pPCB,
  151. IN PPP_EAP_PACKET *pReceiveBuf,
  152. IN OUT PPP_EAP_PACKET *pSendBuf,
  153. IN DWORD dwSizeOfSendBuf,
  154. IN OUT ELEAP_RESULT *pResult
  155. );
  156. DWORD
  157. ElEapDllBegin (
  158. IN EAPOL_PCB *pPCB,
  159. IN DWORD dwEapIndex
  160. );
  161. DWORD
  162. ElEapDllWork (
  163. IN EAPOL_PCB *pPCB,
  164. IN PPP_EAP_PACKET *pReceiveBuf,
  165. IN OUT PPP_EAP_PACKET *pSendBuf,
  166. IN DWORD dwSizeOfSendBuf,
  167. IN OUT ELEAP_RESULT *pResult
  168. );
  169. DWORD
  170. ElEapDllEnd (
  171. IN EAPOL_PCB *pPCB
  172. );
  173. DWORD
  174. ElGetEapTypeIndex (
  175. IN DWORD dwEapType
  176. );
  177. #endif // _EAPOL_EAP_H_