• Home
  • History
  • Annotate
  • only in this directory
NameDateSize

..14-Mar-20147

ap.cH A D14-Mar-201412.2 KiB

ap.hH A D14-Mar-20141.8 KiB

bgscan.cH A D14-Mar-20142.5 KiB

bgscan.hH A D14-Mar-20141.6 KiB

bgscan_simple.cH A D14-Mar-20146.2 KiB

blacklist.cH A D14-Mar-20143.3 KiB

blacklist.hH A D14-Mar-2014879

bss.cH A D14-Mar-201414.7 KiB

bss.hH A D14-Mar-20143.1 KiB

ChangeLogH A D14-Mar-201470.2 KiB

config.cH A D14-Mar-201450.7 KiB

config.hH A D14-Mar-201414.2 KiB

config_file.cH A D14-Mar-201422.3 KiB

config_none.cH A D14-Mar-20141.4 KiB

config_ssid.hH A D14-Mar-201410.7 KiB

config_winreg.cH A D14-Mar-201422.8 KiB

ctrl_iface.cH A D14-Mar-201451.6 KiB

ctrl_iface.hH A D14-Mar-20145.4 KiB

ctrl_iface_named_pipe.cH A D14-Mar-201419.9 KiB

ctrl_iface_udp.cH A D14-Mar-201413 KiB

ctrl_iface_unix.cH A D14-Mar-201417.2 KiB

dbus/H14-Mar-201424

defconfigH A D14-Mar-201414 KiB

doc/H14-Mar-20143

driver_i.hH A D14-Mar-201412.6 KiB

eap_register.cH A D14-Mar-20144.6 KiB

eap_testing.txtH A D14-Mar-201414.4 KiB

eapol_test.cH A D14-Mar-201430.8 KiB

events.cH A D14-Mar-201445.6 KiB

examples/H14-Mar-201414

ibss_rsn.cH A D14-Mar-201412.1 KiB

ibss_rsn.hH A D14-Mar-20141.2 KiB

main.cH A D14-Mar-20147 KiB

main_none.cH A D14-Mar-20141 KiB

main_symbian.cppH A D14-Mar-20141 KiB

main_winmain.cH A D14-Mar-20141.9 KiB

main_winsvc.cH A D14-Mar-201411.4 KiB

MakefileH A D17-Jan-201630.2 KiB

mlme.cH A D14-Mar-201485.1 KiB

mlme.hH A D14-Mar-20143.3 KiB

nmake.makH A D14-Mar-20146.6 KiB

notify.cH A D14-Mar-20147.5 KiB

notify.hH A D14-Mar-20143.4 KiB

preauth_test.cH A D14-Mar-20148.8 KiB

READMEH A D14-Mar-201437.9 KiB

README-Windows.txtH A D14-Mar-201418.9 KiB

README-WPSH A D14-Mar-20147.6 KiB

scan.cH A D14-Mar-201416 KiB

scan.hH A D14-Mar-20141.4 KiB

sme.cH A D14-Mar-201414.5 KiB

sme.hH A D14-Mar-20142.1 KiB

symbian/H14-Mar-20145

tests/H14-Mar-20145

todo.txtH A D14-Mar-20145 KiB

vs2005/H14-Mar-20145

win_example.regH A D14-Mar-20141.2 KiB

win_if_list.cH A D14-Mar-20143.9 KiB

wpa_cli.cH A D14-Mar-201455.4 KiB

wpa_gui/H14-Mar-201416

wpa_gui-qt4/H14-Mar-201432

wpa_passphrase.cH A D14-Mar-20141.6 KiB

wpa_priv.cH A D14-Mar-201423.4 KiB

wpa_supplicant.cH A D14-Mar-201470.9 KiB

wpa_supplicant.confH A D14-Mar-201434 KiB

wpa_supplicant.nsiH A D14-Mar-20143.3 KiB

wpa_supplicant_i.hH A D14-Mar-201414.4 KiB

wpas_glue.cH A D14-Mar-201418.1 KiB

wpas_glue.hH A D14-Mar-2014733

wps_supplicant.cH A D14-Mar-201430.7 KiB

wps_supplicant.hH A D14-Mar-20143.3 KiB

xcode/H14-Mar-20143

README

1WPA Supplicant
2==============
3
4Copyright (c) 2003-2010, Jouni Malinen <j@w1.fi> and contributors
5All Rights Reserved.
6
7This program is dual-licensed under both the GPL version 2 and BSD
8license. Either license may be used at your option.
9
10
11
12License
13-------
14
15GPL v2:
16
17This program is free software; you can redistribute it and/or modify
18it under the terms of the GNU General Public License version 2 as
19published by the Free Software Foundation.
20
21This program is distributed in the hope that it will be useful,
22but WITHOUT ANY WARRANTY; without even the implied warranty of
23MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
24GNU General Public License for more details.
25
26You should have received a copy of the GNU General Public License
27along with this program; if not, write to the Free Software
28Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
29
30(this copy of the license is in COPYING file)
31
32
33Alternatively, this software may be distributed, used, and modified
34under the terms of BSD license:
35
36Redistribution and use in source and binary forms, with or without
37modification, are permitted provided that the following conditions are
38met:
39
401. Redistributions of source code must retain the above copyright
41   notice, this list of conditions and the following disclaimer.
42
432. Redistributions in binary form must reproduce the above copyright
44   notice, this list of conditions and the following disclaimer in the
45   documentation and/or other materials provided with the distribution.
46
473. Neither the name(s) of the above-listed copyright holder(s) nor the
48   names of its contributors may be used to endorse or promote products
49   derived from this software without specific prior written permission.
50
51THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
52"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
53LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
54A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
55OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
56SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
57LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
58DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
59THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
60(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
61OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
62
63
64
65Features
66--------
67
68Supported WPA/IEEE 802.11i features:
69- WPA-PSK ("WPA-Personal")
70- WPA with EAP (e.g., with RADIUS authentication server) ("WPA-Enterprise")
71  Following authentication methods are supported with an integrate IEEE 802.1X
72  Supplicant:
73  * EAP-TLS
74  * EAP-PEAP/MSCHAPv2 (both PEAPv0 and PEAPv1)
75  * EAP-PEAP/TLS (both PEAPv0 and PEAPv1)
76  * EAP-PEAP/GTC (both PEAPv0 and PEAPv1)
77  * EAP-PEAP/OTP (both PEAPv0 and PEAPv1)
78  * EAP-PEAP/MD5-Challenge (both PEAPv0 and PEAPv1)
79  * EAP-TTLS/EAP-MD5-Challenge
80  * EAP-TTLS/EAP-GTC
81  * EAP-TTLS/EAP-OTP
82  * EAP-TTLS/EAP-MSCHAPv2
83  * EAP-TTLS/EAP-TLS
84  * EAP-TTLS/MSCHAPv2
85  * EAP-TTLS/MSCHAP
86  * EAP-TTLS/PAP
87  * EAP-TTLS/CHAP
88  * EAP-SIM
89  * EAP-AKA
90  * EAP-PSK
91  * EAP-PAX
92  * EAP-SAKE
93  * EAP-IKEv2
94  * EAP-GPSK
95  * LEAP (note: requires special support from the driver for IEEE 802.11
96	  authentication)
97  (following methods are supported, but since they do not generate keying
98   material, they cannot be used with WPA or IEEE 802.1X WEP keying)
99  * EAP-MD5-Challenge 
100  * EAP-MSCHAPv2
101  * EAP-GTC
102  * EAP-OTP
103- key management for CCMP, TKIP, WEP104, WEP40
104- RSN/WPA2 (IEEE 802.11i)
105  * pre-authentication
106  * PMKSA caching
107
108Supported TLS/crypto libraries:
109- OpenSSL (default)
110- GnuTLS
111
112Internal TLS/crypto implementation (optional):
113- can be used in place of an external TLS/crypto library
114- TLSv1
115- X.509 certificate processing
116- PKCS #1
117- ASN.1
118- RSA
119- bignum
120- minimal size (ca. 50 kB binary, parts of which are already needed for WPA;
121  TLSv1/X.509/ASN.1/RSA/bignum parts are about 25 kB on x86)
122
123
124Requirements
125------------
126
127Current hardware/software requirements:
128- Linux kernel 2.4.x or 2.6.x with Linux Wireless Extensions v15 or newer
129- FreeBSD 6-CURRENT
130- NetBSD-current
131- Microsoft Windows with WinPcap (at least WinXP, may work with other versions)
132- drivers:
133	Linux drivers that support WPA/WPA2 configuration with the generic
134	Linux wireless extensions (WE-18 or newer). Even though there are
135	number of driver specific interface included in wpa_supplicant, please
136	note that Linux drivers are moving to use generic wireless extensions
137	and driver_wext (-Dwext on wpa_supplicant command line) should be the
138	default option to start with before falling back to driver specific
139	interface.
140
141	Host AP driver for Prism2/2.5/3 (development snapshot/v0.2.x)
142	(http://hostap.epitest.fi/)
143	Driver need to be set in Managed mode ('iwconfig wlan0 mode managed').
144	Please note that station firmware version needs to be 1.7.0 or newer
145	to work in WPA mode.
146
147	Linuxant DriverLoader (http://www.linuxant.com/driverloader/)
148	with Windows NDIS driver for your wlan card supporting WPA.
149
150	Agere Systems Inc. Linux Driver
151	(http://www.agere.com/support/drivers/)
152	Please note that the driver interface file (driver_hermes.c) and
153	hardware specific include files are not included in the
154	wpa_supplicant distribution. You will need to copy these from the
155	source package of the Agere driver.
156
157	madwifi driver for cards based on Atheros chip set (ar521x)
158	(http://sourceforge.net/projects/madwifi/)
159	Please note that you will need to modify the wpa_supplicant .config
160	file to use the correct path for the madwifi driver root directory
161	(CFLAGS += -I../madwifi/wpa line in example defconfig).
162
163	ATMEL AT76C5XXx driver for USB and PCMCIA cards
164	(http://atmelwlandriver.sourceforge.net/).
165
166	Linux ndiswrapper (http://ndiswrapper.sourceforge.net/) with
167	Windows NDIS driver.
168
169	Broadcom wl.o driver (old version only)
170	This is a generic Linux driver for Broadcom IEEE 802.11a/g cards.
171	However, it is proprietary driver that is not publicly available
172	except for couple of exceptions, mainly Broadcom-based APs/wireless
173	routers that use Linux. The driver binary can be downloaded, e.g.,
174	from Linksys support site (http://www.linksys.com/support/gpl.asp)
175	for Linksys WRT54G. The GPL tarball includes cross-compiler and
176	the needed header file, wlioctl.h, for compiling wpa_supplicant.
177	This driver support in wpa_supplicant is expected to work also with
178	other devices based on Broadcom driver (assuming the driver includes
179	client mode support). Please note that the newer Broadcom driver
180	("hybrid Linux driver") supports Linux wireless extensions and does
181	not need (or even work) with the specific driver wrapper. Use -Dwext
182	with that driver.
183
184	Intel ipw2100 driver
185	(http://sourceforge.net/projects/ipw2100/)
186
187	Intel ipw2200 driver
188	(http://sourceforge.net/projects/ipw2200/)
189
190	In theory, any driver that supports Linux wireless extensions can be
191	used with IEEE 802.1X (i.e., not WPA) when using ap_scan=0 option in
192	configuration file.
193
194	Wired Ethernet drivers (with ap_scan=0)
195
196	BSD net80211 layer (e.g., Atheros driver)
197	At the moment, this is for FreeBSD 6-CURRENT branch and NetBSD-current.
198
199	Windows NDIS
200	The current Windows port requires WinPcap (http://winpcap.polito.it/).
201	See README-Windows.txt for more information.
202
203wpa_supplicant was designed to be portable for different drivers and
204operating systems. Hopefully, support for more wlan cards and OSes will be
205added in the future. See developer's documentation
206(http://hostap.epitest.fi/wpa_supplicant/devel/) for more information about the
207design of wpa_supplicant and porting to other drivers. One main goal
208is to add full WPA/WPA2 support to Linux wireless extensions to allow
209new drivers to be supported without having to implement new
210driver-specific interface code in wpa_supplicant.
211
212Optional libraries for layer2 packet processing:
213- libpcap (tested with 0.7.2, most relatively recent versions assumed to work,
214	this is likely to be available with most distributions,
215	http://tcpdump.org/)
216- libdnet (tested with v1.4, most versions assumed to work,
217	http://libdnet.sourceforge.net/)
218
219These libraries are _not_ used in the default Linux build. Instead,
220internal Linux specific implementation is used. libpcap/libdnet are
221more portable and they can be used by adding CONFIG_L2_PACKET=pcap into
222.config. They may also be selected automatically for other operating
223systems. In case of Windows builds, WinPcap is used by default
224(CONFIG_L2_PACKET=winpcap).
225
226
227Optional libraries for EAP-TLS, EAP-PEAP, and EAP-TTLS:
228- OpenSSL (tested with 0.9.7c and 0.9.7d, and 0.9.8 versions; assumed to
229  work with most relatively recent versions; this is likely to be
230  available with most distributions, http://www.openssl.org/)
231- GnuTLS
232- internal TLSv1 implementation
233
234TLS options for EAP-FAST:
235- OpenSSL 0.9.8d _with_ openssl-0.9.8d-tls-extensions.patch applied
236  (i.e., the default OpenSSL package does not include support for
237  extensions needed for EAP-FAST)
238- internal TLSv1 implementation
239
240One of these libraries is needed when EAP-TLS, EAP-PEAP, EAP-TTLS, or
241EAP-FAST support is enabled. WPA-PSK mode does not require this or EAPOL/EAP
242implementation. A configuration file, .config, for compilation is
243needed to enable IEEE 802.1X/EAPOL and EAP methods. Note that EAP-MD5,
244EAP-GTC, EAP-OTP, and EAP-MSCHAPV2 cannot be used alone with WPA, so
245they should only be enabled if testing the EAPOL/EAP state
246machines. However, there can be used as inner authentication
247algorithms with EAP-PEAP and EAP-TTLS.
248
249See Building and installing section below for more detailed
250information about the wpa_supplicant build time configuration.
251
252
253
254WPA
255---
256
257The original security mechanism of IEEE 802.11 standard was not
258designed to be strong and has proven to be insufficient for most
259networks that require some kind of security. Task group I (Security)
260of IEEE 802.11 working group (http://www.ieee802.org/11/) has worked
261to address the flaws of the base standard and has in practice
262completed its work in May 2004. The IEEE 802.11i amendment to the IEEE
263802.11 standard was approved in June 2004 and published in July 2004.
264
265Wi-Fi Alliance (http://www.wi-fi.org/) used a draft version of the
266IEEE 802.11i work (draft 3.0) to define a subset of the security
267enhancements that can be implemented with existing wlan hardware. This
268is called Wi-Fi Protected Access<TM> (WPA). This has now become a
269mandatory component of interoperability testing and certification done
270by Wi-Fi Alliance. Wi-Fi provides information about WPA at its web
271site (http://www.wi-fi.org/OpenSection/protected_access.asp).
272
273IEEE 802.11 standard defined wired equivalent privacy (WEP) algorithm
274for protecting wireless networks. WEP uses RC4 with 40-bit keys,
27524-bit initialization vector (IV), and CRC32 to protect against packet
276forgery. All these choices have proven to be insufficient: key space is
277too small against current attacks, RC4 key scheduling is insufficient
278(beginning of the pseudorandom stream should be skipped), IV space is
279too small and IV reuse makes attacks easier, there is no replay
280protection, and non-keyed authentication does not protect against bit
281flipping packet data.
282
283WPA is an intermediate solution for the security issues. It uses
284Temporal Key Integrity Protocol (TKIP) to replace WEP. TKIP is a
285compromise on strong security and possibility to use existing
286hardware. It still uses RC4 for the encryption like WEP, but with
287per-packet RC4 keys. In addition, it implements replay protection,
288keyed packet authentication mechanism (Michael MIC).
289
290Keys can be managed using two different mechanisms. WPA can either use
291an external authentication server (e.g., RADIUS) and EAP just like
292IEEE 802.1X is using or pre-shared keys without need for additional
293servers. Wi-Fi calls these "WPA-Enterprise" and "WPA-Personal",
294respectively. Both mechanisms will generate a master session key for
295the Authenticator (AP) and Supplicant (client station).
296
297WPA implements a new key handshake (4-Way Handshake and Group Key
298Handshake) for generating and exchanging data encryption keys between
299the Authenticator and Supplicant. This handshake is also used to
300verify that both Authenticator and Supplicant know the master session
301key. These handshakes are identical regardless of the selected key
302management mechanism (only the method for generating master session
303key changes).
304
305
306
307IEEE 802.11i / WPA2
308-------------------
309
310The design for parts of IEEE 802.11i that were not included in WPA has
311finished (May 2004) and this amendment to IEEE 802.11 was approved in
312June 2004. Wi-Fi Alliance is using the final IEEE 802.11i as a new
313version of WPA called WPA2. This includes, e.g., support for more
314robust encryption algorithm (CCMP: AES in Counter mode with CBC-MAC)
315to replace TKIP and optimizations for handoff (reduced number of
316messages in initial key handshake, pre-authentication, and PMKSA caching).
317
318
319
320wpa_supplicant
321--------------
322
323wpa_supplicant is an implementation of the WPA Supplicant component,
324i.e., the part that runs in the client stations. It implements WPA key
325negotiation with a WPA Authenticator and EAP authentication with
326Authentication Server. In addition, it controls the roaming and IEEE
327802.11 authentication/association of the wlan driver.
328
329wpa_supplicant is designed to be a "daemon" program that runs in the
330background and acts as the backend component controlling the wireless
331connection. wpa_supplicant supports separate frontend programs and an
332example text-based frontend, wpa_cli, is included with wpa_supplicant.
333
334Following steps are used when associating with an AP using WPA:
335
336- wpa_supplicant requests the kernel driver to scan neighboring BSSes
337- wpa_supplicant selects a BSS based on its configuration
338- wpa_supplicant requests the kernel driver to associate with the chosen
339  BSS
340- If WPA-EAP: integrated IEEE 802.1X Supplicant completes EAP
341  authentication with the authentication server (proxied by the
342  Authenticator in the AP)
343- If WPA-EAP: master key is received from the IEEE 802.1X Supplicant
344- If WPA-PSK: wpa_supplicant uses PSK as the master session key
345- wpa_supplicant completes WPA 4-Way Handshake and Group Key Handshake
346  with the Authenticator (AP)
347- wpa_supplicant configures encryption keys for unicast and broadcast
348- normal data packets can be transmitted and received
349
350
351
352Building and installing
353-----------------------
354
355In order to be able to build wpa_supplicant, you will first need to
356select which parts of it will be included. This is done by creating a
357build time configuration file, .config, in the wpa_supplicant root
358directory. Configuration options are text lines using following
359format: CONFIG_<option>=y. Lines starting with # are considered
360comments and are ignored. See defconfig file for an example configuration
361and a list of available options and additional notes.
362
363The build time configuration can be used to select only the needed
364features and limit the binary size and requirements for external
365libraries. The main configuration parts are the selection of which
366driver interfaces (e.g., hostap, madwifi, ..) and which authentication
367methods (e.g., EAP-TLS, EAP-PEAP, ..) are included.
368
369Following build time configuration options are used to control IEEE
370802.1X/EAPOL and EAP state machines and all EAP methods. Including
371TLS, PEAP, or TTLS will require linking wpa_supplicant with OpenSSL
372library for TLS implementation. Alternatively, GnuTLS or the internal
373TLSv1 implementation can be used for TLS functionaly.
374
375CONFIG_IEEE8021X_EAPOL=y
376CONFIG_EAP_MD5=y
377CONFIG_EAP_MSCHAPV2=y
378CONFIG_EAP_TLS=y
379CONFIG_EAP_PEAP=y
380CONFIG_EAP_TTLS=y
381CONFIG_EAP_GTC=y
382CONFIG_EAP_OTP=y
383CONFIG_EAP_SIM=y
384CONFIG_EAP_AKA=y
385CONFIG_EAP_PSK=y
386CONFIG_EAP_SAKE=y
387CONFIG_EAP_GPSK=y
388CONFIG_EAP_PAX=y
389CONFIG_EAP_LEAP=y
390CONFIG_EAP_IKEV2=y
391
392Following option can be used to include GSM SIM/USIM interface for GSM/UMTS
393authentication algorithm (for EAP-SIM/EAP-AKA). This requires pcsc-lite
394(http://www.linuxnet.com/) for smart card access.
395
396CONFIG_PCSC=y
397
398Following options can be added to .config to select which driver
399interfaces are included. Hermes driver interface needs to be downloaded
400from Agere (see above).
401
402CONFIG_DRIVER_HOSTAP=y
403CONFIG_DRIVER_HERMES=y
404CONFIG_DRIVER_MADWIFI=y
405CONFIG_DRIVER_ATMEL=y
406CONFIG_DRIVER_WEXT=y
407CONFIG_DRIVER_RALINK=y
408CONFIG_DRIVER_NDISWRAPPER=y
409CONFIG_DRIVER_BROADCOM=y
410CONFIG_DRIVER_IPW=y
411CONFIG_DRIVER_BSD=y
412CONFIG_DRIVER_NDIS=y
413
414Following example includes all features and driver interfaces that are
415included in the wpa_supplicant package:
416
417CONFIG_DRIVER_HOSTAP=y
418CONFIG_DRIVER_HERMES=y
419CONFIG_DRIVER_MADWIFI=y
420CONFIG_DRIVER_ATMEL=y
421CONFIG_DRIVER_WEXT=y
422CONFIG_DRIVER_NDISWRAPPER=y
423CONFIG_DRIVER_BROADCOM=y
424CONFIG_DRIVER_IPW=y
425CONFIG_DRIVER_BSD=y
426CONFIG_DRIVER_NDIS=y
427CONFIG_IEEE8021X_EAPOL=y
428CONFIG_EAP_MD5=y
429CONFIG_EAP_MSCHAPV2=y
430CONFIG_EAP_TLS=y
431CONFIG_EAP_PEAP=y
432CONFIG_EAP_TTLS=y
433CONFIG_EAP_GTC=y
434CONFIG_EAP_OTP=y
435CONFIG_EAP_SIM=y
436CONFIG_EAP_AKA=y
437CONFIG_EAP_PSK=y
438CONFIG_EAP_SAKE=y
439CONFIG_EAP_GPSK=y
440CONFIG_EAP_PAX=y
441CONFIG_EAP_LEAP=y
442CONFIG_EAP_IKEV2=y
443CONFIG_PCSC=y
444
445EAP-PEAP and EAP-TTLS will automatically include configured EAP
446methods (MD5, OTP, GTC, MSCHAPV2) for inner authentication selection.
447
448
449After you have created a configuration file, you can build
450wpa_supplicant and wpa_cli with 'make' command. You may then install
451the binaries to a suitable system directory, e.g., /usr/local/bin.
452
453Example commands:
454
455# build wpa_supplicant and wpa_cli
456make
457# install binaries (this may need root privileges)
458cp wpa_cli wpa_supplicant /usr/local/bin
459
460
461You will need to make a configuration file, e.g.,
462/etc/wpa_supplicant.conf, with network configuration for the networks
463you are going to use. Configuration file section below includes
464explanation fo the configuration file format and includes various
465examples. Once the configuration is ready, you can test whether the
466configuration work by first running wpa_supplicant with following
467command to start it on foreground with debugging enabled:
468
469wpa_supplicant -iwlan0 -c/etc/wpa_supplicant.conf -d
470
471Assuming everything goes fine, you can start using following command
472to start wpa_supplicant on background without debugging:
473
474wpa_supplicant -iwlan0 -c/etc/wpa_supplicant.conf -B
475
476Please note that if you included more than one driver interface in the
477build time configuration (.config), you may need to specify which
478interface to use by including -D<driver name> option on the command
479line. See following section for more details on command line options
480for wpa_supplicant.
481
482
483
484Command line options
485--------------------
486
487usage:
488  wpa_supplicant [-BddfhKLqqtuvwW] [-P<pid file>] [-g<global ctrl>] \
489        -i<ifname> -c<config file> [-C<ctrl>] [-D<driver>] [-p<driver_param>] \
490        [-b<br_ifname> [-N -i<ifname> -c<conf> [-C<ctrl>] [-D<driver>] \
491        [-p<driver_param>] [-b<br_ifname>] ...]
492
493options:
494  -b = optional bridge interface name
495  -B = run daemon in the background
496  -c = Configuration file
497  -C = ctrl_interface parameter (only used if -c is not)
498  -i = interface name
499  -d = increase debugging verbosity (-dd even more)
500  -D = driver name (can be multiple drivers: nl80211,wext)
501  -f = Log output to default log location (normally /tmp)
502  -g = global ctrl_interface
503  -K = include keys (passwords, etc.) in debug output
504  -t = include timestamp in debug messages
505  -h = show this help text
506  -L = show license (GPL and BSD)
507  -p = driver parameters
508  -P = PID file
509  -q = decrease debugging verbosity (-qq even less)
510  -u = enable DBus control interface
511  -v = show version
512  -w = wait for interface to be added, if needed
513  -W = wait for a control interface monitor before starting
514  -N = start describing new interface
515
516drivers:
517  hostap = Host AP driver (Intersil Prism2/2.5/3) [default]
518	(this can also be used with Linuxant DriverLoader)
519  hermes = Agere Systems Inc. driver (Hermes-I/Hermes-II)
520  madwifi = MADWIFI 802.11 support (Atheros, etc.) (deprecated; use wext)
521  atmel = ATMEL AT76C5XXx (USB, PCMCIA)
522  wext = Linux wireless extensions (generic)
523  ralink = Ralink Client driver
524  ndiswrapper = Linux ndiswrapper (deprecated; use wext)
525  broadcom = Broadcom wl.o driver
526  ipw = Intel ipw2100/2200 driver (old; use wext with Linux 2.6.13 or newer)
527  wired = wpa_supplicant wired Ethernet driver
528  roboswitch = wpa_supplicant Broadcom switch driver
529  bsd = BSD 802.11 support (Atheros, etc.)
530  ndis = Windows NDIS driver
531
532In most common cases, wpa_supplicant is started with
533
534wpa_supplicant -B -c/etc/wpa_supplicant.conf -iwlan0
535
536This makes the process fork into background.
537
538The easiest way to debug problems, and to get debug log for bug
539reports, is to start wpa_supplicant on foreground with debugging
540enabled:
541
542wpa_supplicant -c/etc/wpa_supplicant.conf -iwlan0 -d
543
544If the specific driver wrapper is not known beforehand, it is possible
545to specify multiple comma separated driver wrappers on the command
546line. wpa_supplicant will use the first driver wrapper that is able to
547initialize the interface.
548
549wpa_supplicant -Dnl80211,wext -c/etc/wpa_supplicant.conf -iwlan0
550
551
552wpa_supplicant can control multiple interfaces (radios) either by
553running one process for each interface separately or by running just
554one process and list of options at command line. Each interface is
555separated with -N argument. As an example, following command would
556start wpa_supplicant for two interfaces:
557
558wpa_supplicant \
559	-c wpa1.conf -i wlan0 -D hostap -N \
560	-c wpa2.conf -i ath0 -D madwifi
561
562
563If the interface is added in a Linux bridge (e.g., br0), the bridge
564interface needs to be configured to wpa_supplicant in addition to the
565main interface:
566
567wpa_supplicant -cw.conf -Dmadwifi -iath0 -bbr0
568
569
570Configuration file
571------------------
572
573wpa_supplicant is configured using a text file that lists all accepted
574networks and security policies, including pre-shared keys. See
575example configuration file, wpa_supplicant.conf, for detailed
576information about the configuration format and supported fields.
577
578Changes to configuration file can be reloaded be sending SIGHUP signal
579to wpa_supplicant ('killall -HUP wpa_supplicant'). Similarly,
580reloading can be triggered with 'wpa_cli reconfigure' command.
581
582Configuration file can include one or more network blocks, e.g., one
583for each used SSID. wpa_supplicant will automatically select the best
584betwork based on the order of network blocks in the configuration
585file, network security level (WPA/WPA2 is preferred), and signal
586strength.
587
588Example configuration files for some common configurations:
589
5901) WPA-Personal (PSK) as home network and WPA-Enterprise with EAP-TLS as work
591   network
592
593# allow frontend (e.g., wpa_cli) to be used by all users in 'wheel' group
594ctrl_interface=/var/run/wpa_supplicant
595ctrl_interface_group=wheel
596#
597# home network; allow all valid ciphers
598network={
599	ssid="home"
600	scan_ssid=1
601	key_mgmt=WPA-PSK
602	psk="very secret passphrase"
603}
604#
605# work network; use EAP-TLS with WPA; allow only CCMP and TKIP ciphers
606network={
607	ssid="work"
608	scan_ssid=1
609	key_mgmt=WPA-EAP
610	pairwise=CCMP TKIP
611	group=CCMP TKIP
612	eap=TLS
613	identity="user@example.com"
614	ca_cert="/etc/cert/ca.pem"
615	client_cert="/etc/cert/user.pem"
616	private_key="/etc/cert/user.prv"
617	private_key_passwd="password"
618}
619
620
6212) WPA-RADIUS/EAP-PEAP/MSCHAPv2 with RADIUS servers that use old peaplabel
622   (e.g., Funk Odyssey and SBR, Meetinghouse Aegis, Interlink RAD-Series)
623
624ctrl_interface=/var/run/wpa_supplicant
625ctrl_interface_group=wheel
626network={
627	ssid="example"
628	scan_ssid=1
629	key_mgmt=WPA-EAP
630	eap=PEAP
631	identity="user@example.com"
632	password="foobar"
633	ca_cert="/etc/cert/ca.pem"
634	phase1="peaplabel=0"
635	phase2="auth=MSCHAPV2"
636}
637
638
6393) EAP-TTLS/EAP-MD5-Challenge configuration with anonymous identity for the
640   unencrypted use. Real identity is sent only within an encrypted TLS tunnel.
641
642ctrl_interface=/var/run/wpa_supplicant
643ctrl_interface_group=wheel
644network={
645	ssid="example"
646	scan_ssid=1
647	key_mgmt=WPA-EAP
648	eap=TTLS
649	identity="user@example.com"
650	anonymous_identity="anonymous@example.com"
651	password="foobar"
652	ca_cert="/etc/cert/ca.pem"
653	phase2="auth=MD5"
654}
655
656
6574) IEEE 802.1X (i.e., no WPA) with dynamic WEP keys (require both unicast and
658   broadcast); use EAP-TLS for authentication
659
660ctrl_interface=/var/run/wpa_supplicant
661ctrl_interface_group=wheel
662network={
663	ssid="1x-test"
664	scan_ssid=1
665	key_mgmt=IEEE8021X
666	eap=TLS
667	identity="user@example.com"
668	ca_cert="/etc/cert/ca.pem"
669	client_cert="/etc/cert/user.pem"
670	private_key="/etc/cert/user.prv"
671	private_key_passwd="password"
672	eapol_flags=3
673}
674
675
6765) Catch all example that allows more or less all configuration modes. The
677   configuration options are used based on what security policy is used in the
678   selected SSID. This is mostly for testing and is not recommended for normal
679   use.
680
681ctrl_interface=/var/run/wpa_supplicant
682ctrl_interface_group=wheel
683network={
684	ssid="example"
685	scan_ssid=1
686	key_mgmt=WPA-EAP WPA-PSK IEEE8021X NONE
687	pairwise=CCMP TKIP
688	group=CCMP TKIP WEP104 WEP40
689	psk="very secret passphrase"
690	eap=TTLS PEAP TLS
691	identity="user@example.com"
692	password="foobar"
693	ca_cert="/etc/cert/ca.pem"
694	client_cert="/etc/cert/user.pem"
695	private_key="/etc/cert/user.prv"
696	private_key_passwd="password"
697	phase1="peaplabel=0"
698	ca_cert2="/etc/cert/ca2.pem"
699	client_cert2="/etc/cer/user.pem"
700	private_key2="/etc/cer/user.prv"
701	private_key2_passwd="password"
702}
703
704
7056) Authentication for wired Ethernet. This can be used with 'wired' or
706   'roboswitch' interface (-Dwired or -Droboswitch on command line).
707
708ctrl_interface=/var/run/wpa_supplicant
709ctrl_interface_group=wheel
710ap_scan=0
711network={
712	key_mgmt=IEEE8021X
713	eap=MD5
714	identity="user"
715	password="password"
716	eapol_flags=0
717}
718
719
720
721Certificates
722------------
723
724Some EAP authentication methods require use of certificates. EAP-TLS
725uses both server side and client certificates whereas EAP-PEAP and
726EAP-TTLS only require the server side certificate. When client
727certificate is used, a matching private key file has to also be
728included in configuration. If the private key uses a passphrase, this
729has to be configured in wpa_supplicant.conf ("private_key_passwd").
730
731wpa_supplicant supports X.509 certificates in PEM and DER
732formats. User certificate and private key can be included in the same
733file.
734
735If the user certificate and private key is received in PKCS#12/PFX
736format, they need to be converted to suitable PEM/DER format for
737wpa_supplicant. This can be done, e.g., with following commands:
738
739# convert client certificate and private key to PEM format
740openssl pkcs12 -in example.pfx -out user.pem -clcerts
741# convert CA certificate (if included in PFX file) to PEM format
742openssl pkcs12 -in example.pfx -out ca.pem -cacerts -nokeys
743
744
745
746wpa_cli
747-------
748
749wpa_cli is a text-based frontend program for interacting with
750wpa_supplicant. It is used to query current status, change
751configuration, trigger events, and request interactive user input.
752
753wpa_cli can show the current authentication status, selected security
754mode, dot11 and dot1x MIBs, etc. In addition, it can configure some
755variables like EAPOL state machine parameters and trigger events like
756reassociation and IEEE 802.1X logoff/logon. wpa_cli provides a user
757interface to request authentication information, like username and
758password, if these are not included in the configuration. This can be
759used to implement, e.g., one-time-passwords or generic token card
760authentication where the authentication is based on a
761challenge-response that uses an external device for generating the
762response.
763
764The control interface of wpa_supplicant can be configured to allow
765non-root user access (ctrl_interface_group in the configuration
766file). This makes it possible to run wpa_cli with a normal user
767account.
768
769wpa_cli supports two modes: interactive and command line. Both modes
770share the same command set and the main difference is in interactive
771mode providing access to unsolicited messages (event messages,
772username/password requests).
773
774Interactive mode is started when wpa_cli is executed without including
775the command as a command line parameter. Commands are then entered on
776the wpa_cli prompt. In command line mode, the same commands are
777entered as command line arguments for wpa_cli.
778
779
780Interactive authentication parameters request
781
782When wpa_supplicant need authentication parameters, like username and
783password, which are not present in the configuration file, it sends a
784request message to all attached frontend programs, e.g., wpa_cli in
785interactive mode. wpa_cli shows these requests with
786"CTRL-REQ-<type>-<id>:<text>" prefix. <type> is IDENTITY, PASSWORD, or
787OTP (one-time-password). <id> is a unique identifier for the current
788network. <text> is description of the request. In case of OTP request,
789it includes the challenge from the authentication server.
790
791The reply to these requests can be given with 'identity', 'password',
792and 'otp' commands. <id> needs to be copied from the the matching
793request. 'password' and 'otp' commands can be used regardless of
794whether the request was for PASSWORD or OTP. The main difference
795between these two commands is that values given with 'password' are
796remembered as long as wpa_supplicant is running whereas values given
797with 'otp' are used only once and then forgotten, i.e., wpa_supplicant
798will ask frontend for a new value for every use. This can be used to
799implement one-time-password lists and generic token card -based
800authentication.
801
802Example request for password and a matching reply:
803
804CTRL-REQ-PASSWORD-1:Password needed for SSID foobar
805> password 1 mysecretpassword
806
807Example request for generic token card challenge-response:
808
809CTRL-REQ-OTP-2:Challenge 1235663 needed for SSID foobar
810> otp 2 9876
811
812
813wpa_cli commands
814
815  status = get current WPA/EAPOL/EAP status
816  mib = get MIB variables (dot1x, dot11)
817  help = show this usage help
818  interface [ifname] = show interfaces/select interface
819  level <debug level> = change debug level
820  license = show full wpa_cli license
821  logoff = IEEE 802.1X EAPOL state machine logoff
822  logon = IEEE 802.1X EAPOL state machine logon
823  set = set variables (shows list of variables when run without arguments)
824  pmksa = show PMKSA cache
825  reassociate = force reassociation
826  reconfigure = force wpa_supplicant to re-read its configuration file
827  preauthenticate <BSSID> = force preauthentication
828  identity <network id> <identity> = configure identity for an SSID
829  password <network id> <password> = configure password for an SSID
830  pin <network id> <pin> = configure pin for an SSID
831  otp <network id> <password> = configure one-time-password for an SSID
832  passphrase <network id> <passphrase> = configure private key passphrase
833    for an SSID
834  bssid <network id> <BSSID> = set preferred BSSID for an SSID
835  list_networks = list configured networks
836  select_network <network id> = select a network (disable others)
837  enable_network <network id> = enable a network
838  disable_network <network id> = disable a network
839  add_network = add a network
840  remove_network <network id> = remove a network
841  set_network <network id> <variable> <value> = set network variables (shows
842    list of variables when run without arguments)
843  get_network <network id> <variable> = get network variables
844  save_config = save the current configuration
845  disconnect = disconnect and wait for reassociate command before connecting
846  scan = request new BSS scan
847  scan_results = get latest scan results
848  get_capability <eap/pairwise/group/key_mgmt/proto/auth_alg> = get capabilies
849  terminate = terminate wpa_supplicant
850  quit = exit wpa_cli
851
852
853wpa_cli command line options
854
855wpa_cli [-p<path to ctrl sockets>] [-i<ifname>] [-hvB] [-a<action file>] \
856        [-P<pid file>] [-g<global ctrl>]  [command..]
857  -h = help (show this usage text)
858  -v = shown version information
859  -a = run in daemon mode executing the action file based on events from
860       wpa_supplicant
861  -B = run a daemon in the background
862  default path: /var/run/wpa_supplicant
863  default interface: first interface found in socket path
864
865
866Using wpa_cli to run external program on connect/disconnect
867-----------------------------------------------------------
868
869wpa_cli can used to run external programs whenever wpa_supplicant
870connects or disconnects from a network. This can be used, e.g., to
871update network configuration and/or trigget DHCP client to update IP
872addresses, etc.
873
874One wpa_cli process in "action" mode needs to be started for each
875interface. For example, the following command starts wpa_cli for the
876default ingterface (-i can be used to select the interface in case of
877more than one interface being used at the same time):
878
879wpa_cli -a/sbin/wpa_action.sh -B
880
881The action file (-a option, /sbin/wpa_action.sh in this example) will
882be executed whenever wpa_supplicant completes authentication (connect
883event) or detects disconnection). The action script will be called
884with two command line arguments: interface name and event (CONNECTED
885or DISCONNECTED). If the action script needs to get more information
886about the current network, it can use 'wpa_cli status' to query
887wpa_supplicant for more information.
888
889Following example can be used as a simple template for an action
890script:
891
892#!/bin/sh
893
894IFNAME=$1
895CMD=$2
896
897if [ "$CMD" == "CONNECTED" ]; then
898    SSID=`wpa_cli -i$IFNAME status | grep ^ssid= | cut -f2- -d=`
899    # configure network, signal DHCP client, etc.
900fi
901
902if [ "$CMD" == "DISCONNECTED" ]; then
903    # remove network configuration, if needed
904fi
905
906
907
908Integrating with pcmcia-cs/cardmgr scripts
909------------------------------------------
910
911wpa_supplicant needs to be running when using a wireless network with
912WPA. It can be started either from system startup scripts or from
913pcmcia-cs/cardmgr scripts (when using PC Cards). WPA handshake must be
914completed before data frames can be exchanged, so wpa_supplicant
915should be started before DHCP client.
916
917For example, following small changes to pcmcia-cs scripts can be used
918to enable WPA support:
919
920Add MODE="Managed" and WPA="y" to the network scheme in
921/etc/pcmcia/wireless.opts.
922
923Add the following block to the end of 'start' action handler in
924/etc/pcmcia/wireless:
925
926    if [ "$WPA" = "y" -a -x /usr/local/bin/wpa_supplicant ]; then
927	/usr/local/bin/wpa_supplicant -B -c/etc/wpa_supplicant.conf \
928		-i$DEVICE
929    fi
930
931Add the following block to the end of 'stop' action handler (may need
932to be separated from other actions) in /etc/pcmcia/wireless:
933
934    if [ "$WPA" = "y" -a -x /usr/local/bin/wpa_supplicant ]; then
935	killall wpa_supplicant
936    fi
937
938This will make cardmgr start wpa_supplicant when the card is plugged
939in.
940
941
942
943Dynamic interface add and operation without configuration files
944---------------------------------------------------------------
945
946wpa_supplicant can be started without any configuration files or
947network interfaces. When used in this way, a global (i.e., per
948wpa_supplicant process) control interface is used to add and remove
949network interfaces. Each network interface can then be configured
950through a per-network interface control interface. For example,
951following commands show how to start wpa_supplicant without any
952network interfaces and then add a network interface and configure a
953network (SSID):
954
955# Start wpa_supplicant in the background
956wpa_supplicant -g/var/run/wpa_supplicant-global -B
957
958# Add a new interface (wlan0, no configuration file, driver=wext, and
959# enable control interface)
960wpa_cli -g/var/run/wpa_supplicant-global interface_add wlan0 \
961	"" wext /var/run/wpa_supplicant
962
963# Configure a network using the newly added network interface:
964wpa_cli -iwlan0 add_network
965wpa_cli -iwlan0 set_network 0 ssid '"test"'
966wpa_cli -iwlan0 set_network 0 key_mgmt WPA-PSK
967wpa_cli -iwlan0 set_network 0 psk '"12345678"'
968wpa_cli -iwlan0 set_network 0 pairwise TKIP
969wpa_cli -iwlan0 set_network 0 group TKIP
970wpa_cli -iwlan0 set_network 0 proto WPA
971wpa_cli -iwlan0 enable_network 0
972
973# At this point, the new network interface should start trying to associate
974# with the WPA-PSK network using SSID test.
975
976# Remove network interface
977wpa_cli -g/var/run/wpa_supplicant-global interface_remove wlan0
978
979
980Privilege separation
981--------------------
982
983To minimize the size of code that needs to be run with root privileges
984(e.g., to control wireless interface operation), wpa_supplicant
985supports optional privilege separation. If enabled, this separates the
986privileged operations into a separate process (wpa_priv) while leaving
987rest of the code (e.g., EAP authentication and WPA handshakes) into an
988unprivileged process (wpa_supplicant) that can be run as non-root
989user. Privilege separation restricts the effects of potential software
990errors by containing the majority of the code in an unprivileged
991process to avoid full system compromise.
992
993Privilege separation is not enabled by default and it can be enabled
994by adding CONFIG_PRIVSEP=y to the build configuration (.config). When
995enabled, the privileged operations (driver wrapper and l2_packet) are
996linked into a separate daemon program, wpa_priv. The unprivileged
997program, wpa_supplicant, will be built with a special driver/l2_packet
998wrappers that communicate with the privileged wpa_priv process to
999perform the needed operations. wpa_priv can control what privileged
1000are allowed.
1001
1002wpa_priv needs to be run with network admin privileges (usually, root
1003user). It opens a UNIX domain socket for each interface that is
1004included on the command line; any other interface will be off limits
1005for wpa_supplicant in this kind of configuration. After this,
1006wpa_supplicant can be run as a non-root user (e.g., all standard users
1007on a laptop or as a special non-privileged user account created just
1008for this purpose to limit access to user files even further).
1009
1010
1011Example configuration:
1012- create user group for users that are allowed to use wpa_supplicant
1013  ('wpapriv' in this example) and assign users that should be able to
1014  use wpa_supplicant into that group
1015- create /var/run/wpa_priv directory for UNIX domain sockets and control
1016  user access by setting it accessible only for the wpapriv group:
1017  mkdir /var/run/wpa_priv
1018  chown root:wpapriv /var/run/wpa_priv
1019  chmod 0750 /var/run/wpa_priv
1020- start wpa_priv as root (e.g., from system startup scripts) with the
1021  enabled interfaces configured on the command line:
1022  wpa_priv -B -P /var/run/wpa_priv.pid wext:ath0
1023- run wpa_supplicant as non-root with a user that is in wpapriv group:
1024  wpa_supplicant -i ath0 -c wpa_supplicant.conf
1025
1026wpa_priv does not use the network interface before wpa_supplicant is
1027started, so it is fine to include network interfaces that are not
1028available at the time wpa_priv is started. As an alternative, wpa_priv
1029can be started when an interface is added (hotplug/udev/etc. scripts).
1030wpa_priv can control multiple interface with one process, but it is
1031also possible to run multiple wpa_priv processes at the same time, if
1032desired.
1033

README-Windows.txt

1wpa_supplicant for Windows
2==========================
3
4Copyright (c) 2003-2009, Jouni Malinen <j@w1.fi> and contributors
5All Rights Reserved.
6
7This program is dual-licensed under both the GPL version 2 and BSD
8license. Either license may be used at your option.
9
10This product includes software developed by the OpenSSL Project
11for use in the OpenSSL Toolkit (http://www.openssl.org/). This
12product includes cryptographic software written by Eric Young
13(eay@cryptsoft.com).
14
15
16wpa_supplicant has support for being used as a WPA/WPA2/IEEE 802.1X
17Supplicant on Windows. The current port requires that WinPcap
18(http://winpcap.polito.it/) is installed for accessing packets and the
19driver interface. Both release versions 3.0 and 3.1 are supported.
20
21The current port is still somewhat experimental. It has been tested
22mainly on Windows XP (SP2) with limited set of NDIS drivers. In
23addition, the current version has been reported to work with Windows
242000.
25
26All security modes have been verified to work (at least complete
27authentication and successfully ping a wired host):
28- plaintext
29- static WEP / open system authentication
30- static WEP / shared key authentication
31- IEEE 802.1X with dynamic WEP keys
32- WPA-PSK, TKIP, CCMP, TKIP+CCMP
33- WPA-EAP, TKIP, CCMP, TKIP+CCMP
34- WPA2-PSK, TKIP, CCMP, TKIP+CCMP
35- WPA2-EAP, TKIP, CCMP, TKIP+CCMP
36
37
38Binary version
39--------------
40
41Compiled binary version of the wpa_supplicant and additional tools is
42available from http://w1.fi/wpa_supplicant/. These binaries can be
43used after installing WinPcap.
44
45wpa_gui uses Qt 4 framework and may need additional dynamic libraries
46(DLLs). These libraries are available from
47http://w1.fi/wpa_supplicant/qt4/wpa_gui-qt433-windows-dll.zip
48You can copy the DLL files from this ZIP package into the same directory
49with wpa_gui.exe to allow wpa_gui to be started.
50
51
52Building wpa_supplicant with mingw
53----------------------------------
54
55The default build setup for wpa_supplicant is to use MinGW and
56cross-compiling from Linux to MinGW/Windows. It should also be
57possible to build this under Windows using the MinGW tools, but that
58is not tested nor supported and is likely to require some changes to
59the Makefile unless cygwin is used.
60
61
62Building wpa_supplicant with MSVC
63---------------------------------
64
65wpa_supplicant can be built with Microsoft Visual C++ compiler. This
66has been tested with Microsoft Visual C++ Toolkit 2003 and Visual
67Studio 2005 using the included nmake.mak as a Makefile for nmake. IDE
68can also be used by creating a project that includes the files and
69defines mentioned in nmake.mak. Example VS2005 solution and project
70files are included in vs2005 subdirectory. This can be used as a
71starting point for building the programs with VS2005 IDE. Visual Studio
722008 Express Edition is also able to use these project files.
73
74WinPcap development package is needed for the build and this can be
75downloaded from http://www.winpcap.org/install/bin/WpdPack_4_0_2.zip. The
76default nmake.mak expects this to be unpacked into C:\dev\WpdPack so
77that Include and Lib directories are in this directory. The files can be
78stored elsewhere as long as the WINPCAPDIR in nmake.mak is updated to
79match with the selected directory. In case a project file in the IDE is
80used, these Include and Lib directories need to be added to project
81properties as additional include/library directories.
82
83OpenSSL source package can be downloaded from
84http://www.openssl.org/source/openssl-0.9.8i.tar.gz and built and
85installed following instructions in INSTALL.W32. Note that if EAP-FAST
86support will be included in the wpa_supplicant, OpenSSL needs to be
87patched to# support it openssl-0.9.8i-tls-extensions.patch. The example
88nmake.mak file expects OpenSSL to be installed into C:\dev\openssl, but
89this directory can be modified by changing OPENSSLDIR variable in
90nmake.mak.
91
92If you do not need EAP-FAST support, you may also be able to use Win32
93binary installation package of OpenSSL from
94http://www.slproweb.com/products/Win32OpenSSL.html instead of building
95the library yourself. In this case, you will need to copy Include and
96Lib directories in suitable directory, e.g., C:\dev\openssl for the
97default nmake.mak. Copy {Win32OpenSSLRoot}\include into
98C:\dev\openssl\include and make C:\dev\openssl\lib subdirectory with
99files from {Win32OpenSSLRoot}\VC (i.e., libeay*.lib and ssleay*.lib).
100This will end up using dynamically linked OpenSSL (i.e., .dll files are
101needed) for it. Alternative, you can copy files from
102{Win32OpenSSLRoot}\VC\static to create a static build (no OpenSSL .dll
103files needed).
104
105
106Building wpa_supplicant for cygwin
107----------------------------------
108
109wpa_supplicant can be built for cygwin by installing the needed
110development packages for cygwin. This includes things like compiler,
111make, openssl development package, etc. In addition, developer's pack
112for WinPcap (WPdpack.zip) from
113http://winpcap.polito.it/install/default.htm is needed.
114
115.config file should enable only one driver interface,
116CONFIG_DRIVER_NDIS. In addition, include directories may need to be
117added to match the system. An example configuration is available in
118defconfig. The library and include files for WinPcap will either need
119to be installed in compiler/linker default directories or their
120location will need to be adding to .config when building
121wpa_supplicant.
122
123Othen than this, the build should be more or less identical to Linux
124version, i.e., just run make after having created .config file. An
125additional tool, win_if_list.exe, can be built by running "make
126win_if_list".
127
128
129Building wpa_gui
130----------------
131
132wpa_gui uses Qt application framework from Trolltech. It can be built
133with the open source version of Qt4 and MinGW. Following commands can
134be used to build the binary in the Qt 4 Command Prompt:
135
136# go to the root directory of wpa_supplicant source code
137cd wpa_gui-qt4
138qmake -o Makefile wpa_gui.pro
139make
140# the wpa_gui.exe binary is created into 'release' subdirectory
141
142
143Using wpa_supplicant for Windows
144--------------------------------
145
146wpa_supplicant, wpa_cli, and wpa_gui behave more or less identically to
147Linux version, so instructions in README and example wpa_supplicant.conf
148should be applicable for most parts. In addition, there is another
149version of wpa_supplicant, wpasvc.exe, which can be used as a Windows
150service and which reads its configuration from registry instead of
151text file.
152
153When using access points in "hidden SSID" mode, ap_scan=2 mode need to
154be used (see wpa_supplicant.conf for more information).
155
156Windows NDIS/WinPcap uses quite long interface names, so some care
157will be needed when starting wpa_supplicant. Alternatively, the
158adapter description can be used as the interface name which may be
159easier since it is usually in more human-readable
160format. win_if_list.exe can be used to find out the proper interface
161name.
162
163Example steps in starting up wpa_supplicant:
164
165# win_if_list.exe
166ifname: \Device\NPF_GenericNdisWanAdapter
167description: Generic NdisWan adapter
168
169ifname: \Device\NPF_{769E012B-FD17-4935-A5E3-8090C38E25D2}
170description: Atheros Wireless Network Adapter (Microsoft's Packet Scheduler)
171
172ifname: \Device\NPF_{732546E7-E26C-48E3-9871-7537B020A211}
173description: Intel 8255x-based Integrated Fast Ethernet (Microsoft's Packet Scheduler)
174
175
176Since the example configuration used Atheros WLAN card, the middle one
177is the correct interface in this case. The interface name for -i
178command line option is the full string following "ifname:" (the
179"\Device\NPF_" prefix can be removed). In other words, wpa_supplicant
180would be started with the following command:
181
182# wpa_supplicant.exe -i'{769E012B-FD17-4935-A5E3-8090C38E25D2}' -c wpa_supplicant.conf -d
183
184-d optional enables some more debugging (use -dd for even more, if
185needed). It can be left out if debugging information is not needed.
186
187With the alternative mechanism for selecting the interface, this
188command has identical results in this case:
189
190# wpa_supplicant.exe -iAtheros -c wpa_supplicant.conf -d
191
192
193Simple configuration example for WPA-PSK:
194
195#ap_scan=2
196ctrl_interface=
197network={
198	ssid="test"
199	key_mgmt=WPA-PSK
200	proto=WPA
201	pairwise=TKIP
202	psk="secret passphrase"
203}
204
205(remove '#' from the comment out ap_scan line to enable mode in which
206wpa_supplicant tries to associate with the SSID without doing
207scanning; this allows APs with hidden SSIDs to be used)
208
209
210wpa_cli.exe and wpa_gui.exe can be used to interact with the
211wpa_supplicant.exe program in the same way as with Linux. Note that
212ctrl_interface is using UNIX domain sockets when built for cygwin, but
213the native build for Windows uses named pipes and the contents of the
214ctrl_interface configuration item is used to control access to the
215interface. Anyway, this variable has to be included in the configuration
216to enable the control interface.
217
218
219Example SDDL string formats:
220
221(local admins group has permission, but nobody else):
222
223ctrl_interface=SDDL=D:(A;;GA;;;BA)
224
225("A" == "access allowed", "GA" == GENERIC_ALL == all permissions, and
226"BA" == "builtin administrators" == the local admins.  The empty fields
227are for flags and object GUIDs, none of which should be required in this
228case.)
229
230(local admins and the local "power users" group have permissions,
231but nobody else):
232
233ctrl_interface=SDDL=D:(A;;GA;;;BA)(A;;GA;;;PU)
234
235(One ACCESS_ALLOWED ACE for GENERIC_ALL for builtin administrators, and
236one ACCESS_ALLOWED ACE for GENERIC_ALL for power users.)
237
238(close to wide open, but you have to be a valid user on
239the machine):
240
241ctrl_interface=SDDL=D:(A;;GA;;;AU)
242
243(One ACCESS_ALLOWED ACE for GENERIC_ALL for the "authenticated users"
244group.)
245
246This one would allow absolutely everyone (including anonymous
247users) -- this is *not* recommended, since named pipes can be attached
248to from anywhere on the network (i.e. there's no "this machine only"
249like there is with 127.0.0.1 sockets):
250
251ctrl_interface=SDDL=D:(A;;GA;;;BU)(A;;GA;;;AN)
252
253(BU == "builtin users", "AN" == "anonymous")
254
255See also [1] for the format of ACEs, and [2] for the possible strings
256that can be used for principal names.
257
258[1]
259http://msdn.microsoft.com/library/default.asp?url=/library/en-us/secauthz/security/ace_strings.asp
260[2]
261http://msdn.microsoft.com/library/default.asp?url=/library/en-us/secauthz/security/sid_strings.asp
262
263
264Starting wpa_supplicant as a Windows service (wpasvc.exe)
265---------------------------------------------------------
266
267wpa_supplicant can be started as a Windows service by using wpasvc.exe
268program that is alternative build of wpa_supplicant.exe. Most of the
269core functionality of wpasvc.exe is identical to wpa_supplicant.exe,
270but it is using Windows registry for configuration information instead
271of a text file and command line parameters. In addition, it can be
272registered as a service that can be started automatically or manually
273like any other Windows service.
274
275The root of wpa_supplicant configuration in registry is
276HKEY_LOCAL_MACHINE\SOFTWARE\wpa_supplicant. This level includes global
277parameters and a 'interfaces' subkey with all the interface configuration
278(adapter to confname mapping). Each such mapping is a subkey that has
279'adapter', 'config', and 'ctrl_interface' values.
280
281This program can be run either as a normal command line application,
282e.g., for debugging, with 'wpasvc.exe app' or as a Windows service.
283Service need to be registered with 'wpasvc.exe reg <full path to
284wpasvc.exe>'. Alternatively, 'wpasvc.exe reg' can be used to register
285the service with the current location of wpasvc.exe. After this, wpasvc
286can be started like any other Windows service (e.g., 'net start wpasvc')
287or it can be configured to start automatically through the Services tool
288in administrative tasks. The service can be unregistered with
289'wpasvc.exe unreg'.
290
291If the service is set to start during system bootup to make the
292network connection available before any user has logged in, there may
293be a long (half a minute or so) delay in starting up wpa_supplicant
294due to WinPcap needing a driver called "Network Monitor Driver" which
295is started by default on demand.
296
297To speed up wpa_supplicant start during system bootup, "Network
298Monitor Driver" can be configured to be started sooner by setting its
299startup type to System instead of the default Demand. To do this, open
300up Device Manager, select Show Hidden Devices, expand the "Non
301Plug-and-Play devices" branch, double click "Network Monitor Driver",
302go to the Driver tab, and change the Demand setting to System instead.
303
304Configuration data is in HKEY_LOCAL_MACHINE\SOFTWARE\wpa_supplicant\configs
305key. Each configuration profile has its own key under this. In terms of text
306files, each profile would map to a separate text file with possibly multiple
307networks. Under each profile, there is a networks key that lists all
308networks as a subkey. Each network has set of values in the same way as
309network block in the configuration file. In addition, blobs subkey has
310possible blobs as values.
311
312HKEY_LOCAL_MACHINE\SOFTWARE\wpa_supplicant\configs\test\networks\0000
313   ssid="example"
314   key_mgmt=WPA-PSK
315
316See win_example.reg for an example on how to setup wpasvc.exe
317parameters in registry. It can also be imported to registry as a
318starting point for the configuration.
319
320
321
322License information for third party software used in this product:
323
324  OpenSSL License
325  ---------------
326
327/* ====================================================================
328 * Copyright (c) 1998-2004 The OpenSSL Project.  All rights reserved.
329 *
330 * Redistribution and use in source and binary forms, with or without
331 * modification, are permitted provided that the following conditions
332 * are met:
333 *
334 * 1. Redistributions of source code must retain the above copyright
335 *    notice, this list of conditions and the following disclaimer. 
336 *
337 * 2. Redistributions in binary form must reproduce the above copyright
338 *    notice, this list of conditions and the following disclaimer in
339 *    the documentation and/or other materials provided with the
340 *    distribution.
341 *
342 * 3. All advertising materials mentioning features or use of this
343 *    software must display the following acknowledgment:
344 *    "This product includes software developed by the OpenSSL Project
345 *    for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
346 *
347 * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
348 *    endorse or promote products derived from this software without
349 *    prior written permission. For written permission, please contact
350 *    openssl-core@openssl.org.
351 *
352 * 5. Products derived from this software may not be called "OpenSSL"
353 *    nor may "OpenSSL" appear in their names without prior written
354 *    permission of the OpenSSL Project.
355 *
356 * 6. Redistributions of any form whatsoever must retain the following
357 *    acknowledgment:
358 *    "This product includes software developed by the OpenSSL Project
359 *    for use in the OpenSSL Toolkit (http://www.openssl.org/)"
360 *
361 * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
362 * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
363 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
364 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OpenSSL PROJECT OR
365 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
366 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
367 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
368 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
369 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
370 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
371 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
372 * OF THE POSSIBILITY OF SUCH DAMAGE.
373 * ====================================================================
374 *
375 * This product includes cryptographic software written by Eric Young
376 * (eay@cryptsoft.com).  This product includes software written by Tim
377 * Hudson (tjh@cryptsoft.com).
378 *
379 */
380
381 Original SSLeay License
382 -----------------------
383
384/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
385 * All rights reserved.
386 *
387 * This package is an SSL implementation written
388 * by Eric Young (eay@cryptsoft.com).
389 * The implementation was written so as to conform with Netscapes SSL.
390 * 
391 * This library is free for commercial and non-commercial use as long as
392 * the following conditions are aheared to.  The following conditions
393 * apply to all code found in this distribution, be it the RC4, RSA,
394 * lhash, DES, etc., code; not just the SSL code.  The SSL documentation
395 * included with this distribution is covered by the same copyright terms
396 * except that the holder is Tim Hudson (tjh@cryptsoft.com).
397 * 
398 * Copyright remains Eric Young's, and as such any Copyright notices in
399 * the code are not to be removed.
400 * If this package is used in a product, Eric Young should be given attribution
401 * as the author of the parts of the library used.
402 * This can be in the form of a textual message at program startup or
403 * in documentation (online or textual) provided with the package.
404 * 
405 * Redistribution and use in source and binary forms, with or without
406 * modification, are permitted provided that the following conditions
407 * are met:
408 * 1. Redistributions of source code must retain the copyright
409 *    notice, this list of conditions and the following disclaimer.
410 * 2. Redistributions in binary form must reproduce the above copyright
411 *    notice, this list of conditions and the following disclaimer in the
412 *    documentation and/or other materials provided with the distribution.
413 * 3. All advertising materials mentioning features or use of this software
414 *    must display the following acknowledgement:
415 *    "This product includes cryptographic software written by
416 *     Eric Young (eay@cryptsoft.com)"
417 *    The word 'cryptographic' can be left out if the rouines from the library
418 *    being used are not cryptographic related :-).
419 * 4. If you include any Windows specific code (or a derivative thereof) from 
420 *    the apps directory (application code) you must include an acknowledgement:
421 *    "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
422 * 
423 * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
424 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
425 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
426 * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
427 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
428 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
429 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
430 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
431 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
432 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
433 * SUCH DAMAGE.
434 * 
435 * The licence and distribution terms for any publically available version or
436 * derivative of this code cannot be changed.  i.e. this code cannot simply be
437 * copied and put under another distribution licence
438 * [including the GNU Public Licence.]
439 */
440
441
442
443   Qt Open Source Edition
444   ----------------------
445
446The Qt GUI Toolkit is Copyright (C) 1994-2007 Trolltech ASA.
447Qt Open Source Edition is licensed under GPL version 2.
448
449Source code for the library is available at
450http://w1.fi/wpa_supplicant/qt4/qt-win-opensource-src-4.3.3.zip
451

README-WPS

1wpa_supplicant and Wi-Fi Protected Setup (WPS)
2==============================================
3
4This document describes how the WPS implementation in wpa_supplicant
5can be configured and how an external component on the client (e.g.,
6management GUI) is used to enable WPS enrollment and registrar
7registration.
8
9
10Introduction to WPS
11-------------------
12
13Wi-Fi Protected Setup (WPS) is a mechanism for easy configuration of a
14wireless network. It allows automated generation of random keys (WPA
15passphrase/PSK) and configuration of an access point and client
16devices. WPS includes number of methods for setting up connections
17with PIN method and push-button configuration (PBC) being the most
18commonly deployed options.
19
20While WPS can enable more home networks to use encryption in the
21wireless network, it should be noted that the use of the PIN and
22especially PBC mechanisms for authenticating the initial key setup is
23not very secure. As such, use of WPS may not be suitable for
24environments that require secure network access without chance for
25allowing outsiders to gain access during the setup phase.
26
27WPS uses following terms to describe the entities participating in the
28network setup:
29- access point: the WLAN access point
30- Registrar: a device that control a network and can authorize
31  addition of new devices); this may be either in the AP ("internal
32  Registrar") or in an external device, e.g., a laptop, ("external
33  Registrar")
34- Enrollee: a device that is being authorized to use the network
35
36It should also be noted that the AP and a client device may change
37roles (i.e., AP acts as an Enrollee and client device as a Registrar)
38when WPS is used to configure the access point.
39
40
41More information about WPS is available from Wi-Fi Alliance:
42http://www.wi-fi.org/wifi-protected-setup
43
44
45wpa_supplicant implementation
46-----------------------------
47
48wpa_supplicant includes an optional WPS component that can be used as
49an Enrollee to enroll new network credential or as a Registrar to
50configure an AP. The current version of wpa_supplicant does not
51support operation as an external WLAN Management Registrar for adding
52new client devices or configuring the AP over UPnP.
53
54
55wpa_supplicant configuration
56----------------------------
57
58WPS is an optional component that needs to be enabled in
59wpa_supplicant build configuration (.config). Here is an example
60configuration that includes WPS support and Linux wireless extensions
61-based driver interface:
62
63CONFIG_DRIVER_WEXT=y
64CONFIG_WPS=y
65
66
67WPS needs the Universally Unique IDentifier (UUID; see RFC 4122) for
68the device. This is configured in the runtime configuration for
69wpa_supplicant (if not set, UUID will be generated based on local MAC
70address):
71
72# example UUID for WPS
73uuid=12345678-9abc-def0-1234-56789abcdef0
74
75The network configuration blocks needed for WPS are added
76automatically based on control interface commands, so they do not need
77to be added explicitly in the configuration file.
78
79WPS registration will generate new network blocks for the acquired
80credentials. If these are to be stored for future use (after
81restarting wpa_supplicant), wpa_supplicant will need to be configured
82to allow configuration file updates:
83
84update_config=1
85
86
87
88External operations
89-------------------
90
91WPS requires either a device PIN code (usually, 8-digit number) or a
92pushbutton event (for PBC) to allow a new WPS Enrollee to join the
93network. wpa_supplicant uses the control interface as an input channel
94for these events.
95
96If the client device has a display, a random PIN has to be generated
97for each WPS registration session. wpa_supplicant can do this with a
98control interface request, e.g., by calling wpa_cli:
99
100wpa_cli wps_pin any
101
102This will return the generated 8-digit PIN which will then need to be
103entered at the Registrar to complete WPS registration. At that point,
104the client will be enrolled with credentials needed to connect to the
105AP to access the network.
106
107
108If the client device does not have a display that could show the
109random PIN, a hardcoded PIN that is printed on a label can be
110used. wpa_supplicant is notified this with a control interface
111request, e.g., by calling wpa_cli:
112
113wpa_cli wps_pin any 12345670
114
115This starts the WPS negotiation in the same way as above with the
116generated PIN.
117
118
119If the client design wants to support optional WPS PBC mode, this can
120be enabled by either a physical button in the client device or a
121virtual button in the user interface. The PBC operation requires that
122a button is also pressed at the AP/Registrar at about the same time (2
123minute window). wpa_supplicant is notified of the local button event
124over the control interface, e.g., by calling wpa_cli:
125
126wpa_cli wps_pbc
127
128At this point, the AP/Registrar has two minutes to complete WPS
129negotiation which will generate a new WPA PSK in the same way as the
130PIN method described above.
131
132
133If the client wants to operate in the Registrar role to learn the
134current AP configuration and optionally, to configure an AP,
135wpa_supplicant is notified over the control interface, e.g., with
136wpa_cli:
137
138wpa_cli wps_reg <AP BSSID> <AP PIN>
139(example: wpa_cli wps_reg 02:34:56:78:9a:bc 12345670)
140
141This is used to fetch the current AP settings instead of actually
142changing them. The main difference with the wps_pin command is that
143wps_reg uses the AP PIN (e.g., from a label on the AP) instead of a
144PIN generated at the client.
145
146In order to change the AP configuration, the new configuration
147parameters are given to the wps_reg command:
148
149wpa_cli wps_reg <AP BSSID> <AP PIN> <new SSID> <auth> <encr> <new key>
150examples:
151  wpa_cli wps_reg 02:34:56:78:9a:bc 12345670 testing WPA2PSK CCMP 12345678
152  wpa_cli wps_reg 02:34:56:78:9a:bc 12345670 clear OPEN NONE ""
153
154<auth> must be one of the following: OPEN WPAPSK WPA2PSK
155<encr> must be one of the following: NONE WEP TKIP CCMP
156
157
158Scanning
159--------
160
161Scan results ('wpa_cli scan_results' or 'wpa_cli bss <idx>') include a
162flags field that is used to indicate whether the BSS support WPS. If
163the AP support WPS, but has not recently activated a Registrar, [WPS]
164flag will be included. If PIN method has been recently selected,
165[WPS-PIN] is shown instead. Similarly, [WPS-PBC] is shown if PBC mode
166is in progress. GUI programs can use these as triggers for suggesting
167a guided WPS configuration to the user. In addition, control interface
168monitor events WPS-AP-AVAILABLE{,-PBC,-PIN} can be used to find out if
169there are WPS enabled APs in scan results without having to go through
170all the details in the GUI. These notification could be used, e.g., to
171suggest possible WPS connection to the user.
172
173
174wpa_gui
175-------
176
177wpa_gui-qt4 directory contains a sample GUI that shows an example of
178how WPS support can be integrated into the GUI. Its main window has a
179WPS tab that guides user through WPS registration with automatic AP
180selection. In addition, it shows how WPS can be started manually by
181selecting an AP from scan results.
182
183
184Credential processing
185---------------------
186
187By default, wpa_supplicant processes received credentials and updates
188its configuration internally. However, it is possible to
189control these operations from external programs, if desired.
190
191This internal processing can be disabled with wps_cred_processing=1
192option. When this is used, an external program is responsible for
193processing the credential attributes and updating wpa_supplicant
194configuration based on them.
195
196Following control interface messages are sent out for external programs:
197
198WPS-CRED-RECEIVED  <hexdump of Credential attribute(s)>
199For example:
200<2>WPS-CRED-RECEIVED 100e006f10260001011045000c6a6b6d2d7770732d74657374100300020020100f000200081027004030653462303435366332363666653064333961643135353461316634626637313234333761636664623766333939653534663166316230323061643434386235102000060266a0ee1727
201