README-Windows.txt 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299
  1. wpa_supplicant for Windows
  2. ==========================
  3. Copyright (c) 2003-2009, Jouni Malinen <j@w1.fi> and contributors
  4. All Rights Reserved.
  5. This program is licensed under the BSD license (the one with
  6. advertisement clause removed).
  7. wpa_supplicant has support for being used as a WPA/WPA2/IEEE 802.1X
  8. Supplicant on Windows. The current port requires that WinPcap
  9. (http://winpcap.polito.it/) is installed for accessing packets and the
  10. driver interface. Both release versions 3.0 and 3.1 are supported.
  11. The current port is still somewhat experimental. It has been tested
  12. mainly on Windows XP (SP2) with limited set of NDIS drivers. In
  13. addition, the current version has been reported to work with Windows
  14. 2000.
  15. All security modes have been verified to work (at least complete
  16. authentication and successfully ping a wired host):
  17. - plaintext
  18. - static WEP / open system authentication
  19. - static WEP / shared key authentication
  20. - IEEE 802.1X with dynamic WEP keys
  21. - WPA-PSK, TKIP, CCMP, TKIP+CCMP
  22. - WPA-EAP, TKIP, CCMP, TKIP+CCMP
  23. - WPA2-PSK, TKIP, CCMP, TKIP+CCMP
  24. - WPA2-EAP, TKIP, CCMP, TKIP+CCMP
  25. Building wpa_supplicant with mingw
  26. ----------------------------------
  27. The default build setup for wpa_supplicant is to use MinGW and
  28. cross-compiling from Linux to MinGW/Windows. It should also be
  29. possible to build this under Windows using the MinGW tools, but that
  30. is not tested nor supported and is likely to require some changes to
  31. the Makefile unless cygwin is used.
  32. Building wpa_supplicant with MSVC
  33. ---------------------------------
  34. wpa_supplicant can be built with Microsoft Visual C++ compiler. This
  35. has been tested with Microsoft Visual C++ Toolkit 2003 and Visual
  36. Studio 2005 using the included nmake.mak as a Makefile for nmake. IDE
  37. can also be used by creating a project that includes the files and
  38. defines mentioned in nmake.mak. Example VS2005 solution and project
  39. files are included in vs2005 subdirectory. This can be used as a
  40. starting point for building the programs with VS2005 IDE. Visual Studio
  41. 2008 Express Edition is also able to use these project files.
  42. WinPcap development package is needed for the build and this can be
  43. downloaded from http://www.winpcap.org/install/bin/WpdPack_4_0_2.zip. The
  44. default nmake.mak expects this to be unpacked into C:\dev\WpdPack so
  45. that Include and Lib directories are in this directory. The files can be
  46. stored elsewhere as long as the WINPCAPDIR in nmake.mak is updated to
  47. match with the selected directory. In case a project file in the IDE is
  48. used, these Include and Lib directories need to be added to project
  49. properties as additional include/library directories.
  50. OpenSSL source package can be downloaded from
  51. http://www.openssl.org/source/openssl-0.9.8i.tar.gz and built and
  52. installed following instructions in INSTALL.W32. Note that if EAP-FAST
  53. support will be included in the wpa_supplicant, OpenSSL needs to be
  54. patched to# support it openssl-0.9.8i-tls-extensions.patch. The example
  55. nmake.mak file expects OpenSSL to be installed into C:\dev\openssl, but
  56. this directory can be modified by changing OPENSSLDIR variable in
  57. nmake.mak.
  58. If you do not need EAP-FAST support, you may also be able to use Win32
  59. binary installation package of OpenSSL from
  60. http://www.slproweb.com/products/Win32OpenSSL.html instead of building
  61. the library yourself. In this case, you will need to copy Include and
  62. Lib directories in suitable directory, e.g., C:\dev\openssl for the
  63. default nmake.mak. Copy {Win32OpenSSLRoot}\include into
  64. C:\dev\openssl\include and make C:\dev\openssl\lib subdirectory with
  65. files from {Win32OpenSSLRoot}\VC (i.e., libeay*.lib and ssleay*.lib).
  66. This will end up using dynamically linked OpenSSL (i.e., .dll files are
  67. needed) for it. Alternative, you can copy files from
  68. {Win32OpenSSLRoot}\VC\static to create a static build (no OpenSSL .dll
  69. files needed).
  70. Building wpa_supplicant for cygwin
  71. ----------------------------------
  72. wpa_supplicant can be built for cygwin by installing the needed
  73. development packages for cygwin. This includes things like compiler,
  74. make, openssl development package, etc. In addition, developer's pack
  75. for WinPcap (WPdpack.zip) from
  76. http://winpcap.polito.it/install/default.htm is needed.
  77. .config file should enable only one driver interface,
  78. CONFIG_DRIVER_NDIS. In addition, include directories may need to be
  79. added to match the system. An example configuration is available in
  80. defconfig. The library and include files for WinPcap will either need
  81. to be installed in compiler/linker default directories or their
  82. location will need to be adding to .config when building
  83. wpa_supplicant.
  84. Othen than this, the build should be more or less identical to Linux
  85. version, i.e., just run make after having created .config file. An
  86. additional tool, win_if_list.exe, can be built by running "make
  87. win_if_list".
  88. Building wpa_gui
  89. ----------------
  90. wpa_gui uses Qt application framework from Trolltech. It can be built
  91. with the open source version of Qt4 and MinGW. Following commands can
  92. be used to build the binary in the Qt 4 Command Prompt:
  93. # go to the root directory of wpa_supplicant source code
  94. cd wpa_gui-qt4
  95. qmake -o Makefile wpa_gui.pro
  96. make
  97. # the wpa_gui.exe binary is created into 'release' subdirectory
  98. Using wpa_supplicant for Windows
  99. --------------------------------
  100. wpa_supplicant, wpa_cli, and wpa_gui behave more or less identically to
  101. Linux version, so instructions in README and example wpa_supplicant.conf
  102. should be applicable for most parts. In addition, there is another
  103. version of wpa_supplicant, wpasvc.exe, which can be used as a Windows
  104. service and which reads its configuration from registry instead of
  105. text file.
  106. When using access points in "hidden SSID" mode, ap_scan=2 mode need to
  107. be used (see wpa_supplicant.conf for more information).
  108. Windows NDIS/WinPcap uses quite long interface names, so some care
  109. will be needed when starting wpa_supplicant. Alternatively, the
  110. adapter description can be used as the interface name which may be
  111. easier since it is usually in more human-readable
  112. format. win_if_list.exe can be used to find out the proper interface
  113. name.
  114. Example steps in starting up wpa_supplicant:
  115. # win_if_list.exe
  116. ifname: \Device\NPF_GenericNdisWanAdapter
  117. description: Generic NdisWan adapter
  118. ifname: \Device\NPF_{769E012B-FD17-4935-A5E3-8090C38E25D2}
  119. description: Atheros Wireless Network Adapter (Microsoft's Packet Scheduler)
  120. ifname: \Device\NPF_{732546E7-E26C-48E3-9871-7537B020A211}
  121. description: Intel 8255x-based Integrated Fast Ethernet (Microsoft's Packet Scheduler)
  122. Since the example configuration used Atheros WLAN card, the middle one
  123. is the correct interface in this case. The interface name for -i
  124. command line option is the full string following "ifname:" (the
  125. "\Device\NPF_" prefix can be removed). In other words, wpa_supplicant
  126. would be started with the following command:
  127. # wpa_supplicant.exe -i'{769E012B-FD17-4935-A5E3-8090C38E25D2}' -c wpa_supplicant.conf -d
  128. -d optional enables some more debugging (use -dd for even more, if
  129. needed). It can be left out if debugging information is not needed.
  130. With the alternative mechanism for selecting the interface, this
  131. command has identical results in this case:
  132. # wpa_supplicant.exe -iAtheros -c wpa_supplicant.conf -d
  133. Simple configuration example for WPA-PSK:
  134. #ap_scan=2
  135. ctrl_interface=
  136. network={
  137. ssid="test"
  138. key_mgmt=WPA-PSK
  139. proto=WPA
  140. pairwise=TKIP
  141. psk="secret passphrase"
  142. }
  143. (remove '#' from the comment out ap_scan line to enable mode in which
  144. wpa_supplicant tries to associate with the SSID without doing
  145. scanning; this allows APs with hidden SSIDs to be used)
  146. wpa_cli.exe and wpa_gui.exe can be used to interact with the
  147. wpa_supplicant.exe program in the same way as with Linux. Note that
  148. ctrl_interface is using UNIX domain sockets when built for cygwin, but
  149. the native build for Windows uses named pipes and the contents of the
  150. ctrl_interface configuration item is used to control access to the
  151. interface. Anyway, this variable has to be included in the configuration
  152. to enable the control interface.
  153. Example SDDL string formats:
  154. (local admins group has permission, but nobody else):
  155. ctrl_interface=SDDL=D:(A;;GA;;;BA)
  156. ("A" == "access allowed", "GA" == GENERIC_ALL == all permissions, and
  157. "BA" == "builtin administrators" == the local admins. The empty fields
  158. are for flags and object GUIDs, none of which should be required in this
  159. case.)
  160. (local admins and the local "power users" group have permissions,
  161. but nobody else):
  162. ctrl_interface=SDDL=D:(A;;GA;;;BA)(A;;GA;;;PU)
  163. (One ACCESS_ALLOWED ACE for GENERIC_ALL for builtin administrators, and
  164. one ACCESS_ALLOWED ACE for GENERIC_ALL for power users.)
  165. (close to wide open, but you have to be a valid user on
  166. the machine):
  167. ctrl_interface=SDDL=D:(A;;GA;;;AU)
  168. (One ACCESS_ALLOWED ACE for GENERIC_ALL for the "authenticated users"
  169. group.)
  170. This one would allow absolutely everyone (including anonymous
  171. users) -- this is *not* recommended, since named pipes can be attached
  172. to from anywhere on the network (i.e. there's no "this machine only"
  173. like there is with 127.0.0.1 sockets):
  174. ctrl_interface=SDDL=D:(A;;GA;;;BU)(A;;GA;;;AN)
  175. (BU == "builtin users", "AN" == "anonymous")
  176. See also [1] for the format of ACEs, and [2] for the possible strings
  177. that can be used for principal names.
  178. [1]
  179. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/secauthz/security/ace_strings.asp
  180. [2]
  181. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/secauthz/security/sid_strings.asp
  182. Starting wpa_supplicant as a Windows service (wpasvc.exe)
  183. ---------------------------------------------------------
  184. wpa_supplicant can be started as a Windows service by using wpasvc.exe
  185. program that is alternative build of wpa_supplicant.exe. Most of the
  186. core functionality of wpasvc.exe is identical to wpa_supplicant.exe,
  187. but it is using Windows registry for configuration information instead
  188. of a text file and command line parameters. In addition, it can be
  189. registered as a service that can be started automatically or manually
  190. like any other Windows service.
  191. The root of wpa_supplicant configuration in registry is
  192. HKEY_LOCAL_MACHINE\SOFTWARE\wpa_supplicant. This level includes global
  193. parameters and a 'interfaces' subkey with all the interface configuration
  194. (adapter to confname mapping). Each such mapping is a subkey that has
  195. 'adapter', 'config', and 'ctrl_interface' values.
  196. This program can be run either as a normal command line application,
  197. e.g., for debugging, with 'wpasvc.exe app' or as a Windows service.
  198. Service need to be registered with 'wpasvc.exe reg <full path to
  199. wpasvc.exe>'. Alternatively, 'wpasvc.exe reg' can be used to register
  200. the service with the current location of wpasvc.exe. After this, wpasvc
  201. can be started like any other Windows service (e.g., 'net start wpasvc')
  202. or it can be configured to start automatically through the Services tool
  203. in administrative tasks. The service can be unregistered with
  204. 'wpasvc.exe unreg'.
  205. If the service is set to start during system bootup to make the
  206. network connection available before any user has logged in, there may
  207. be a long (half a minute or so) delay in starting up wpa_supplicant
  208. due to WinPcap needing a driver called "Network Monitor Driver" which
  209. is started by default on demand.
  210. To speed up wpa_supplicant start during system bootup, "Network
  211. Monitor Driver" can be configured to be started sooner by setting its
  212. startup type to System instead of the default Demand. To do this, open
  213. up Device Manager, select Show Hidden Devices, expand the "Non
  214. Plug-and-Play devices" branch, double click "Network Monitor Driver",
  215. go to the Driver tab, and change the Demand setting to System instead.
  216. Configuration data is in HKEY_LOCAL_MACHINE\SOFTWARE\wpa_supplicant\configs
  217. key. Each configuration profile has its own key under this. In terms of text
  218. files, each profile would map to a separate text file with possibly multiple
  219. networks. Under each profile, there is a networks key that lists all
  220. networks as a subkey. Each network has set of values in the same way as
  221. network block in the configuration file. In addition, blobs subkey has
  222. possible blobs as values.
  223. HKEY_LOCAL_MACHINE\SOFTWARE\wpa_supplicant\configs\test\networks\0000
  224. ssid="example"
  225. key_mgmt=WPA-PSK
  226. See win_example.reg for an example on how to setup wpasvc.exe
  227. parameters in registry. It can also be imported to registry as a
  228. starting point for the configuration.