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.

503 lines
10 KiB

  1. /*++
  2. Copyright (c) 2000, Microsoft Corporation
  3. Module Name:
  4. eapolutil.h
  5. Abstract:
  6. Definitions for tools and ends
  7. Revision History:
  8. sachins, May 04 2000, Created
  9. --*/
  10. #ifndef _EAPOLUTIL_H_
  11. #define _EAPOLUTIL_H_
  12. //
  13. // EAPOL_ZC_INTF
  14. //
  15. // Used to transfer data between 802.1X and Zero Config
  16. //
  17. typedef struct _EAPOL_ZC_INTF
  18. {
  19. DWORD dwAuthFailCount;
  20. EAPOL_AUTHENTICATION_TYPE PreviousAuthenticationType;
  21. DWORD dwSizeOfSSID;
  22. BYTE bSSID[MAX_SSID_LEN];
  23. } EAPOL_ZC_INTF, *PEAPOL_ZC_INTF;
  24. //
  25. // STRUCT: EAPOLUIRESPFUNC
  26. //
  27. typedef DWORD (*EAPOLUIRESPFUNC) (EAPOL_EAP_UI_CONTEXT, EAPOLUI_RESP);
  28. //
  29. // STRUCT: EAPOLUIRESPFUNCMAP
  30. //
  31. typedef struct _EAPOLUIRESPFUNCMAP
  32. {
  33. DWORD dwEAPOLUIMsgType;
  34. EAPOLUIRESPFUNC EapolRespUIFunc;
  35. DWORD dwNumBlobs;
  36. } EAPOLUIRESPFUNCMAP, *PEAPOLUIRESPFUNCMAP;
  37. //
  38. // Definitions and structures used in creating default EAP-TLS connection
  39. // blob in the registry
  40. // Ensure that the EAP-TLS structures defined below are always in sync
  41. // with those defined in EAP-TLS code directory
  42. //
  43. #define EAPTLS_CONN_FLAG_REGISTRY 0x00000001
  44. #define EAPTLS_CONN_FLAG_NO_VALIDATE_CERT 0x00000002
  45. #define EAPTLS_CONN_FLAG_NO_VALIDATE_NAME 0x00000004
  46. typedef struct _EAPTLS_CONN_PROPERTIES
  47. {
  48. DWORD dwVersion;
  49. DWORD dwSize;
  50. DWORD fFlags;
  51. DWORD cbHash;
  52. BYTE pbHash[20]; // MAX_HASH_SIZE = 20
  53. WCHAR awszServerName[1];
  54. } EAPTLS_CONN_PROPERTIES, *PEAPTLS_CONN_PROPERTIES;
  55. //
  56. // FUNCTION DECLARATIONS
  57. //
  58. extern
  59. HANDLE
  60. GetCurrentUserTokenW (
  61. WCHAR Winsta[],
  62. DWORD DesiredAccess
  63. );
  64. VOID
  65. HostToWireFormat16(
  66. IN WORD wHostFormat,
  67. IN OUT PBYTE pWireFormat
  68. );
  69. WORD
  70. WireToHostFormat16(
  71. IN PBYTE pWireFormat
  72. );
  73. VOID
  74. HostToWireFormat32(
  75. IN DWORD dwHostFormat,
  76. IN OUT PBYTE pWireFormat
  77. );
  78. DWORD
  79. WireToHostFormat32(
  80. IN PBYTE pWireFormat
  81. );
  82. DWORD
  83. ElSetCustomAuthData (
  84. IN WCHAR *pwszGuid,
  85. IN DWORD dwEapTypeId,
  86. IN DWORD dwSizeOfSSID,
  87. IN BYTE *pbSSID,
  88. IN BYTE *pbConnInfo,
  89. IN DWORD *pdwInfoSize
  90. );
  91. DWORD
  92. ElGetCustomAuthData (
  93. IN WCHAR *pwszGuid,
  94. IN DWORD dwEapTypeId,
  95. IN DWORD dwSizeOfSSID,
  96. IN BYTE *pbSSID,
  97. IN OUT BYTE *pbConnInfo,
  98. IN OUT DWORD *pdwInfoSize
  99. );
  100. DWORD
  101. ElReAuthenticateInterface (
  102. IN WCHAR *pwszGuid);
  103. DWORD
  104. WINAPI
  105. ElReAuthenticateInterfaceWorker (
  106. IN PVOID pvContext);
  107. DWORD
  108. ElSetEapUserInfo (
  109. IN HANDLE hToken,
  110. IN WCHAR *pwszGuid,
  111. IN DWORD dwEapTypeId,
  112. IN DWORD dwSizeOfSSID,
  113. IN BYTE *pbSSID,
  114. IN BYTE *pbUserInfo,
  115. IN DWORD dwInfoSize
  116. );
  117. DWORD
  118. ElGetEapUserInfo (
  119. IN HANDLE hToken,
  120. IN WCHAR *pwszGuid,
  121. IN DWORD dwEapTypeId,
  122. IN DWORD dwSizeOfSSID,
  123. IN BYTE *pbSSID,
  124. IN OUT BYTE *pbUserInfo,
  125. IN OUT DWORD *pdwInfoSize
  126. );
  127. DWORD
  128. ElDeleteEapUserInfo (
  129. IN HANDLE hToken,
  130. IN WCHAR *pwszGUID,
  131. IN DWORD dwEapTypeId,
  132. IN DWORD dwSizeOfSSID,
  133. IN BYTE *pbSSID
  134. );
  135. DWORD
  136. ElSetInterfaceParams (
  137. IN WCHAR *pwszGUID,
  138. IN EAPOL_INTF_PARAMS *pIntfParams
  139. );
  140. DWORD
  141. ElGetInterfaceParams (
  142. IN WCHAR *pwszGUID,
  143. IN OUT EAPOL_INTF_PARAMS *pIntfParams
  144. );
  145. DWORD
  146. ElQueryInterfaceState (
  147. IN WCHAR *pwszGUID,
  148. IN OUT EAPOL_INTF_STATE *pIntfState
  149. );
  150. DWORD
  151. ElGetEapData (
  152. IN DWORD dwEapType,
  153. IN DWORD dwSizeOfIn,
  154. IN BYTE *pbBufferIn,
  155. IN DWORD dwOffset,
  156. IN DWORD *pdwSizeOfOut,
  157. IN PBYTE *ppbBufferOut
  158. );
  159. DWORD
  160. ElSetEapData (
  161. IN DWORD dwEapType,
  162. IN DWORD *pdwSizeOfIn,
  163. IN PBYTE *ppbBufferIn,
  164. IN DWORD dwOffset,
  165. IN DWORD dwAuthData,
  166. IN PBYTE pbAuthData
  167. );
  168. DWORD
  169. ElGetEapKeyFromToken (
  170. IN HANDLE hUserToken,
  171. OUT HKEY *phkey
  172. );
  173. DWORD
  174. ElInitRegPortData (
  175. IN WCHAR *pszDeviceGUID
  176. );
  177. DWORD
  178. ElCreateDefaultEapData (
  179. IN OUT DWORD *pdwSizeOfEapData,
  180. IN OUT BYTE *pbEapData
  181. );
  182. RAS_AUTH_ATTRIBUTE *
  183. ElAuthAttributeGetVendorSpecific (
  184. IN DWORD dwVendorId,
  185. IN DWORD dwVendorType,
  186. IN RAS_AUTH_ATTRIBUTE *pAttributes
  187. );
  188. RAS_AUTH_ATTRIBUTE *
  189. ElAuthAttributeGetFirst (
  190. IN RAS_AUTH_ATTRIBUTE_TYPE raaType,
  191. IN RAS_AUTH_ATTRIBUTE *pAttributes,
  192. OUT HANDLE *phAttribute
  193. );
  194. RAS_AUTH_ATTRIBUTE *
  195. ElAuthAttributeGetNext (
  196. IN OUT HANDLE *phAttribute,
  197. IN RAS_AUTH_ATTRIBUTE_TYPE raaType
  198. );
  199. RAS_AUTH_ATTRIBUTE *
  200. ElAuthAttributeGet (
  201. IN RAS_AUTH_ATTRIBUTE_TYPE raaType,
  202. IN RAS_AUTH_ATTRIBUTE *pAttributes
  203. );
  204. VOID
  205. ElReverseString (
  206. IN CHAR *psz
  207. );
  208. CHAR*
  209. ElEncodePw (
  210. IN OUT CHAR *pszPassword
  211. );
  212. CHAR*
  213. ElDecodePw (
  214. IN OUT CHAR *pszPassword
  215. );
  216. DWORD
  217. ElSecureEncodePw (
  218. IN BYTE *pbPassword,
  219. IN DWORD dwSizeOfPassword,
  220. OUT DATA_BLOB *pDataBlob
  221. );
  222. DWORD
  223. ElSecureDecodePw (
  224. IN DATA_BLOB *pDataBlob,
  225. OUT PBYTE *ppbPassword,
  226. OUT DWORD *pdwSizeOfPassword
  227. );
  228. VOID
  229. ElEncryptBlockUsingMD5 (
  230. IN BYTE *pbSecret,
  231. IN ULONG ulSecretLen,
  232. IN OUT BYTE *pbBuf,
  233. IN ULONG ulBufLen
  234. );
  235. VOID
  236. ElDecryptBlockUsingMD5 (
  237. IN BYTE *pbSecret,
  238. IN ULONG ulSecretLen,
  239. IN OUT BYTE *pbBuf,
  240. IN ULONG ulBufLen
  241. );
  242. VOID
  243. ElGetHMACMD5Digest (
  244. IN BYTE *pbBuf,
  245. IN DWORD dwBufLen,
  246. IN BYTE *pbKey,
  247. IN DWORD dwKeyLen,
  248. IN OUT VOID *pvDigest
  249. );
  250. DWORD
  251. ElWmiGetValue (
  252. IN GUID *pGuid,
  253. IN CHAR *pszInstanceName,
  254. IN OUT BYTE *pbOutputBuffer,
  255. IN OUT DWORD *pdwOutputBufferSize
  256. );
  257. DWORD
  258. ElWmiSetValue (
  259. IN GUID *pGuid,
  260. IN CHAR *pszInstanceName,
  261. IN BYTE *pbInputBuffer,
  262. IN DWORD dwInputBufferSize
  263. );
  264. DWORD
  265. ElNdisuioSetOIDValue (
  266. IN HANDLE hInterface,
  267. IN NDIS_OID Oid,
  268. IN BYTE *pbOidData,
  269. IN ULONG ulOidDataLength
  270. );
  271. DWORD
  272. ElNdisuioQueryOIDValue (
  273. IN HANDLE hInterface,
  274. IN NDIS_OID Oid,
  275. IN BYTE *pbOidData,
  276. IN ULONG *pulOidDataLength
  277. );
  278. DWORD
  279. ElGuidFromString (
  280. IN OUT GUID *pGuid,
  281. IN WCHAR *pwszGuidString
  282. );
  283. DWORD
  284. ElGetLoggedOnUserName (
  285. IN HANDLE hToken,
  286. OUT PWCHAR *ppwszActiveUserName
  287. );
  288. DWORD
  289. ElGetMachineName (
  290. IN EAPOL_PCB *pPCB
  291. );
  292. DWORD
  293. ElUpdateRegistryInterfaceList (
  294. IN PNDIS_ENUM_INTF Interfaces
  295. );
  296. DWORD
  297. ElEnumAndUpdateRegistryInterfaceList (
  298. );
  299. DWORD
  300. WINAPI
  301. ElWatchGlobalRegistryParams (
  302. IN PVOID pvContext
  303. );
  304. DWORD
  305. ElReadGlobalRegistryParams ();
  306. DWORD
  307. WINAPI
  308. ElWatchEapConfigRegistryParams (
  309. IN PVOID pvContext
  310. );
  311. DWORD
  312. ElReadGlobalRegistryParams ();
  313. DWORD
  314. ElPostEapConfigChanged (
  315. IN WCHAR *pwszGuid,
  316. IN EAPOL_INTF_PARAMS *pIntfParams
  317. );
  318. DWORD
  319. WINAPI
  320. ElProcessEapConfigChange (
  321. IN PVOID pvContext
  322. );
  323. VOID
  324. ElStringToGuid (
  325. IN WCHAR *pwszGuid,
  326. OUT LPGUID pGuid
  327. );
  328. DWORD
  329. ElGetIdentity (
  330. IN EAPOL_PCB *pPCB
  331. );
  332. HANDLE
  333. ElNLAConnectLPC ();
  334. VOID
  335. ElNLACleanupLPC ();
  336. VOID
  337. ElNLARegister_802_1X (
  338. IN PLOCATION_802_1X plocation
  339. );
  340. VOID
  341. ElNLADelete_802_1X (
  342. IN PLOCATION_802_1X plocation
  343. );
  344. DWORD
  345. ElGetInterfaceNdisStatistics (
  346. IN WCHAR *pszInterfaceName,
  347. IN OUT NIC_STATISTICS *pStats
  348. );
  349. DWORD
  350. ElCheckUserLoggedOn (
  351. );
  352. DWORD
  353. ElCheckUserModuleReady (
  354. );
  355. DWORD
  356. ElGetWinStationUserToken (
  357. IN DWORD dwSessionId,
  358. IN PHANDLE pUserToken
  359. );
  360. #ifdef ZEROCONFIG_LINKED
  361. DWORD
  362. ElZeroConfigEvent (
  363. IN DWORD dwHandle,
  364. IN WCHAR *pwszGuid,
  365. IN NDIS_802_11_SSID ndSSID,
  366. IN PRAW_DATA prdUserData
  367. );
  368. DWORD
  369. ElZeroConfigNotify (
  370. IN DWORD dwHandle,
  371. IN DWORD dwCmdCode,
  372. IN WCHAR *pwszGuid,
  373. IN EAPOL_ZC_INTF *pZCData
  374. );
  375. #endif // ZEROCONFIG_LINKED
  376. DWORD
  377. ElNetmanNotify (
  378. IN EAPOL_PCB *pPCB,
  379. IN EAPOL_NCS_STATUS Status,
  380. IN WCHAR *pwszDisplayMessage
  381. );
  382. DWORD
  383. ElPostShowBalloonMessage (
  384. IN EAPOL_PCB *pPCB,
  385. IN DWORD cbCookie,
  386. IN BYTE *pbCookie,
  387. IN DWORD cbMessageLen,
  388. IN WCHAR *pwszMessage
  389. );
  390. DWORD
  391. ElProcessReauthResponse (
  392. IN EAPOL_EAP_UI_CONTEXT EapolUIContext,
  393. IN EAPOLUI_RESP EapolUIResp
  394. );
  395. DWORD
  396. WINAPI
  397. ElIPPnPWorker (
  398. IN PVOID pvContext
  399. );
  400. DWORD
  401. ElUpdateRegistry (
  402. );
  403. DWORD
  404. ElRegistryUpdateXPBeta2 (
  405. );
  406. DWORD
  407. ElRegistryUpdateXPSP1 (
  408. );
  409. DWORD
  410. ElReadPolicyParams (
  411. );
  412. #endif // _EAPOLUTIL_H_