• Home
Name Date Size #Lines LOC

..--

dbus/03-May-2024-15,71710,730

doc/docbook/03-May-2024-1,8261,544

examples/03-May-2024-988673

src/03-May-2024-

tests/03-May-2024-518360

wpa_gui/03-May-2024-3,0522,707

wpa_gui-qt4/03-May-2024-12,22210,919

.configD03-May-202413.7 KiB400319

Android.mkD03-May-202431 KiB1,4531,224

ChangeLogD03-May-202469.4 KiB1,2961,256

MakefileD03-May-202432.1 KiB1,4741,275

READMED03-May-202436.9 KiB1,005807

README-P2PD03-May-202417.4 KiB523351

README-WPSD03-May-202410.9 KiB301211

README-Windows.txtD03-May-202418.9 KiB451362

ap.cD03-May-202423.6 KiB910717

ap.hD03-May-20242.3 KiB5335

bgscan.cD03-May-20242.9 KiB12490

bgscan.hD03-May-20242 KiB7950

bgscan_learn.cD03-May-202414.3 KiB615475

bgscan_simple.cD03-May-20247.8 KiB275190

blacklist.cD03-May-20243.3 KiB13472

blacklist.hD03-May-2024879 3113

bss.cD03-May-202414.6 KiB616473

bss.hD03-May-20243.3 KiB9651

config.cD03-May-202460.6 KiB2,5331,932

config.hD03-May-202416.9 KiB505116

config_file.cD03-May-202418 KiB756608

config_none.cD03-May-20241.4 KiB5823

config_ssid.hD03-May-202411.6 KiB41474

config_winreg.cD03-May-202423.8 KiB1,026814

ctrl_iface.cD03-May-202491.2 KiB3,7673,183

ctrl_iface.hD03-May-20245.4 KiB16045

ctrl_iface_named_pipe.cD03-May-202419.9 KiB836642

ctrl_iface_udp.cD03-May-202413 KiB562426

ctrl_iface_unix.cD03-May-202417.7 KiB735604

defconfigD03-May-202416.7 KiB458374

driver_i.hD03-May-202418.6 KiB716622

eap_register.cD03-May-20244.8 KiB245177

eap_testing.txtD03-May-202414.4 KiB393363

eapol_test.cD03-May-202431.6 KiB1,2451,029

events.cD03-May-202462.2 KiB2,2821,881

ibss_rsn.cD03-May-202414.1 KiB605447

ibss_rsn.hD03-May-20241.2 KiB5127

main.cD03-May-20247.1 KiB291246

main_none.cD03-May-20241 KiB4722

main_symbian.cppD03-May-20241 KiB4924

main_winmain.cD03-May-20241.9 KiB8555

main_winsvc.cD03-May-202411.4 KiB465352

mlme.cD03-May-202484.8 KiB3,1822,613

mlme.hD03-May-20243.1 KiB12287

nmake.makD03-May-20246.6 KiB241200

notify.cD03-May-202413.8 KiB591392

notify.hD03-May-20245.3 KiB127104

p2p_supplicant.cD03-May-2024124.1 KiB4,4993,550

p2p_supplicant.hD03-May-20246.5 KiB137119

preauth_test.cD03-May-20248.8 KiB377277

scan.cD03-May-202420.5 KiB857641

scan.hD03-May-20241.5 KiB4023

sme.cD03-May-202421.7 KiB749594

sme.hD03-May-20242.9 KiB10775

todo.txtD03-May-20245 KiB8685

win_if_list.cD03-May-20243.9 KiB180128

wpa_cli.cD03-May-202481.3 KiB3,3912,820

wpa_passphrase.cD03-May-20241.6 KiB7449

wpa_priv.cD03-May-202423.4 KiB1,041835

wpa_supplicant.cD03-May-202481.6 KiB2,8492,076

wpa_supplicant.confD03-May-2024132 75

wpa_supplicant.conf.origD03-May-202434.1 KiB893822

wpa_supplicant_conf.mkD03-May-20241.7 KiB4417

wpa_supplicant_conf.shD03-May-2024901 266

wpa_supplicant_i.hD03-May-202418.8 KiB662397

wpas_glue.cD03-May-202419.5 KiB741549

wpas_glue.hD03-May-2024733 247

wps_supplicant.cD03-May-202446.2 KiB1,6971,406

wps_supplicant.hD03-May-20243.7 KiB12693

README

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

README-P2P

1wpa_supplicant and Wi-Fi P2P
2============================
3
4This document describes how the Wi-Fi P2P implementation in
5wpa_supplicant can be configured and how an external component on the
6client (e.g., management GUI) is used to enable WPS enrollment and
7registrar registration.
8
9
10Introduction to Wi-Fi P2P
11-------------------------
12
13TODO
14
15More information about Wi-Fi P2P is available from Wi-Fi Alliance:
16http://www.wi-fi.org/Wi-Fi_Direct.php
17
18
19wpa_supplicant implementation
20-----------------------------
21
22TODO
23
24
25wpa_supplicant configuration
26----------------------------
27
28Wi-Fi P2P is an optional component that needs to be enabled in the
29wpa_supplicant build configuration (.config). Here is an example
30configuration that includes Wi-Fi P2P support and Linux nl80211
31-based driver interface:
32
33CONFIG_DRIVER_NL80211=y
34CONFIG_CTRL_IFACE=y
35CONFIG_P2P=y
36CONFIG_AP=y
37CONFIG_WPS=y
38
39
40In run-time configuration file (wpa_supplicant.conf), some parameters
41for P2P may be set. In order to make the devices easier to recognize,
42device_name and device_type should be specified. For example,
43something like this should be included:
44
45ctrl_interface=/var/run/wpa_supplicant
46device_name=My P2P Device
47device_type=1-0050F204-1
48
49
50wpa_cli
51-------
52
53Actual Wi-Fi P2P operations are requested during runtime. These can be
54done for example using wpa_cli (which is described below) or a GUI
55like wpa_gui-qt4.
56
57
58wpa_cli starts in interactive mode if no command string is included on
59the command line. By default, it will select the first network interface
60that it can find (and that wpa_supplicant controls). If more than one
61interface is in use, it may be necessary to select one of the explicitly
62by adding -i argument on the command line (e.g., 'wpa_cli -i wlan1').
63
64Most of the P2P operations are done on the main interface (e.g., the
65interface that is automatically added when the driver is loaded, e.g.,
66wlan0). When using a separate virtual interface for group operations
67(e.g., wlan1), the control interface for that group interface may need
68to be used for some operations (mainly WPS activation in GO). This may
69change in the future so that all the needed operations could be done
70over the main control interface.
71
72Device Discovery
73
74p2p_find [timeout in seconds] [type=<social|progressive>]
75
76The default behavior is to run a single full scan in the beginning and
77then scan only social channels. type=social will scan only social
78channels, i.e., it skips the initial full scan. type=progressive is
79like the default behavior, but it will scan through all the channels
80progressively one channel at the time in the Search state rounds. This
81will help in finding new groups or groups missed during the initial
82full scan.
83
84p2p_listen [timeout in seconds]
85
86Start Listen-only state (become discoverable without searching for
87other devices). Optional parameter can be used to specify the duration
88for the Listen operation in seconds. This command may not be of that
89much use during normal operations and is mainly designed for
90testing. It can also be used to keep the device discoverable without
91having to maintain a group.
92
93p2p_stop_find
94
95Stop ongoing P2P device discovery or other operation (connect, listen
96mode).
97
98p2p_flush
99
100Flush P2P peer table and state.
101
102Group Formation
103
104p2p_prov_disc <peer device address> <display|keypad|pbc>
105
106Send P2P provision discovery request to the specified peer. The
107parameters for this command are the P2P device address of the peer and
108the desired configuration method. For example, "p2p_prov_disc
10902:01:02:03:04:05 display" would request the peer to display a PIN for
110us and "p2p_prov_disc 02:01:02:03:04:05 keypad" would request the peer
111to enter a PIN that we display.
112
113p2p_connect <peer device address> <pbc|pin|PIN#> [label|display|keypad]
114	[persistent] [join|auth] [go_intent=<0..15>] [freq=<in MHz>]
115
116Start P2P group formation with a discovered P2P peer. This includes
117optional group owner negotiation, group interface setup, provisioning,
118and establishing data connection.
119
120The <pbc|pin|PIN#> parameter specifies the WPS provisioning
121method. "pbc" string starts pushbutton method, "pin" string start PIN
122method using an automatically generated PIN (which will be returned as
123the command return code), PIN# means that a pre-selected PIN can be
124used (e.g., 12345670). [label|display|keypad] is used with PIN method
125to specify which PIN is used (label=PIN from local label,
126display=dynamically generated random PIN from local display,
127keypad=PIN entered from peer device label or display). "persistent"
128parameter can be used to request a persistent group to be formed.
129
130"join" indicates that this is a command to join an existing group as a
131client. It skips the GO Negotiation part. This will send a Provision
132Discovery Request message to the target GO before associating for WPS
133provisioning.
134
135"auth" indicates that the WPS parameters are authorized for the peer
136device without actually starting GO Negotiation (i.e., the peer is
137expected to initiate GO Negotiation). This is mainly for testing
138purposes.
139
140"go_intent" can be used to override the default GO Intent for this GO
141Negotiation.
142
143"freq" can be used to set a forced operating channel (e.g., freq=2412
144to select 2.4 GHz channel 1).
145
146p2p_group_add [persistent|persistent=<network id>] [freq=<freq in MHz>]
147
148Set up a P2P group owner manually (i.e., without group owner
149negotiation with a specific peer). This is also known as autonomous
150GO. Optional persistent=<network id> can be used to specify restart of
151a persistent group. Optional freq=<freq in MHz> can be used to force
152the GO to be started on a specific frequency. Special freq=2 or freq=5
153options can be used to request the best 2.4 GHz or 5 GHz band channel
154to be selected automatically.
155
156p2p_reject <peer device address>
157
158Reject connection attempt from a peer (specified with a device
159address). This is a mechanism to reject a pending GO Negotiation with
160a peer and request to automatically block any further connection or
161discovery of the peer.
162
163p2p_group_remove <group interface>
164
165Terminate a P2P group. If a new virtual network interface was used for
166the group, it will also be removed. The network interface name of the
167group interface is used as a parameter for this command.
168
169p2p_cancel
170
171Cancel an ongoing P2P group formation related operation.
172
173Service Discovery
174
175p2p_serv_disc_req
176
177Schedule a P2P service discovery request. The parameters for this
178command are the device address of the peer device (or 00:00:00:00:00:00
179for wildcard query that is sent to every discovered P2P peer that
180supports service discovery) and P2P Service Query TLV(s) as hexdump. For
181example,
182
183p2p_serv_disc_req 00:00:00:00:00:00 02000001
184
185schedules a request for listing all available services of all service
186discovery protocols and requests this to be sent to all discovered
187peers (note: this can result in long response frames). The pending
188requests are sent during device discovery (see p2p_find).
189
190Only a single pending wildcard query is supported, but there can be
191multiple pending peer device specific queries (each will be sent in
192sequence whenever the peer is found).
193
194This command returns an identifier for the pending query (e.g.,
195"1f77628") that can be used to cancel the request. Directed requests
196will be automatically removed when the specified peer has replied to
197it.
198
199For UPnP, an alternative command format can be used to specify a
200single query TLV (i.e., a service discovery for a specific UPnP
201service):
202
203p2p_serv_disc_req 00:00:00:00:00:00 upnp <version hex> <ST: from M-SEARCH>
204
205For example:
206
207p2p_serv_disc_req 00:00:00:00:00:00 upnp 10 urn:schemas-upnp-org:device:InternetGatewayDevice:1
208
209Additional examples for queries:
210
211# list of all Bonjour services
212p2p_serv_disc_req 00:00:00:00:00:00 02000101
213
214# list of all UPnP services
215p2p_serv_disc_req 00:00:00:00:00:00 02000201
216
217# list of all WS-Discovery services
218p2p_serv_disc_req 00:00:00:00:00:00 02000301
219
220# list of all Bonjour and UPnP services
221p2p_serv_disc_req 00:00:00:00:00:00 0200010102000202
222
223# Apple File Sharing over TCP
224p2p_serv_disc_req 00:00:00:00:00:00 130001010b5f6166706f766572746370c00c000c01
225
226# Bonjour SSTH (supported service type hash)
227p2p_serv_disc_req 00:00:00:00:00:00 05000101000000
228
229# UPnP examples
230p2p_serv_disc_req 00:00:00:00:00:00 upnp 10 ssdp:all
231p2p_serv_disc_req 00:00:00:00:00:00 upnp 10 upnp:rootdevice
232p2p_serv_disc_req 00:00:00:00:00:00 upnp 10 urn:schemas-upnp-org:service:ContentDirectory:2
233p2p_serv_disc_req 00:00:00:00:00:00 upnp 10 uuid:6859dede-8574-59ab-9332-123456789012
234p2p_serv_disc_req 00:00:00:00:00:00 upnp 10 urn:schemas-upnp-org:device:InternetGatewayDevice:1
235
236p2p_serv_disc_cancel_req <query identifier>
237
238Cancel a pending P2P service discovery request. This command takes a
239single parameter: identifier for the pending query (the value returned
240by p2p_serv_disc_req, e.g., "p2p_serv_disc_cancel_req 1f77628".
241
242p2p_serv_disc_resp
243
244Reply to a service discovery query. This command takes following
245parameters: frequency in MHz, destination address, dialog token,
246response TLV(s). The first three parameters are copied from the
247request event. For example, "p2p_serv_disc_resp 2437 02:40:61:c2:f3:b7
2481 0300000101". This command is used only if external program is used
249to process the request (see p2p_serv_disc_external).
250
251p2p_service_update
252
253Indicate that local services have changed. This is used to increment
254the P2P service indicator value so that peers know when previously
255cached information may have changed. This is only needed when external
256service discovery processing is enabled since the commands to
257pre-configure services for internal processing will increment the
258indicator automatically.
259
260p2p_serv_disc_external <0|1>
261
262Configure external processing of P2P service requests: 0 (default) =
263no external processing of requests (i.e., internal code will process
264each request based on pre-configured services), 1 = external
265processing of requests (external program is responsible for replying
266to service discovery requests with p2p_serv_disc_resp). Please note
267that there is quite strict limit on how quickly the response needs to
268be transmitted, so use of the internal processing is strongly
269recommended.
270
271p2p_service_add bonjour <query hexdump> <RDATA hexdump>
272
273Add a local Bonjour service for internal SD query processing.
274
275Examples:
276
277# AFP Over TCP (PTR)
278p2p_service_add bonjour 0b5f6166706f766572746370c00c000c01 074578616d706c65c027
279# AFP Over TCP (TXT) (RDATA=null)
280p2p_service_add bonjour 076578616d706c650b5f6166706f766572746370c00c001001 00
281
282# IP Printing over TCP (PTR) (RDATA=MyPrinter._ipp._tcp.local.)
283p2p_service_add bonjour 045f697070c00c000c01 094d795072696e746572c027
284# IP Printing over TCP (TXT) (RDATA=txtvers=1,pdl=application/postscript)
285p2p_service_add bonjour 096d797072696e746572045f697070c00c001001 09747874766572733d311a70646c3d6170706c69636174696f6e2f706f7374736372797074
286
287# Supported Service Type Hash (SSTH)
288p2p_service_add bonjour 000000 <32-byte bitfield as hexdump>
289(note: see P2P spec Annex E.4 for information on how to construct the bitfield)
290
291p2p_service_del bonjour <query hexdump>
292
293Remove a local Bonjour service from internal SD query processing.
294
295p2p_service_add upnp <version hex> <service>
296
297Add a local UPnP service for internal SD query processing.
298
299Examples:
300
301p2p_service_add upnp 10 uuid:6859dede-8574-59ab-9332-123456789012::upnp:rootdevice
302p2p_service_add upnp 10 uuid:5566d33e-9774-09ab-4822-333456785632::upnp:rootdevice
303p2p_service_add upnp 10 uuid:1122de4e-8574-59ab-9322-333456789044::urn:schemas-upnp-org:service:ContentDirectory:2
304p2p_service_add upnp 10 uuid:5566d33e-9774-09ab-4822-333456785632::urn:schemas-upnp-org:service:ContentDirectory:2
305p2p_service_add upnp 10 uuid:6859dede-8574-59ab-9332-123456789012::urn:schemas-upnp-org:device:InternetGatewayDevice:1
306
307p2p_service_del upnp <version hex> <service>
308
309Remove a local UPnP service from internal SD query processing.
310
311p2p_service_flush
312
313Remove all local services from internal SD query processing.
314
315Invitation
316
317p2p_invite [persistent=<network id>|group=<group ifname>] [peer=address]
318	[go_dev_addr=address]
319
320Invite a peer to join a group (e.g., group=wlan1) or to reinvoke a
321persistent group (e.g., persistent=4). If the peer device is the GO of
322the persisten group, the peer parameter is not needed. Otherwise it is
323used to specify which device to invite. go_dev_addr parameter can be
324used to override the GO device address for Invitation Request should
325it be not known for some reason (this should not be needed in most
326cases).
327
328Group Operations
329
330(These are used on the group interface.)
331
332wps_pin <any|address> <PIN>
333
334Start WPS PIN method. This allows a single WPS Enrollee to connect to
335the AP/GO. This is used on the GO when a P2P client joins an existing
336group. The second parameter is the address of the Enrollee or a string
337"any" to allow any station to use the entered PIN (which will restrict
338the PIN for one-time-use). PIN is the Enrollee PIN read either from a
339label or display on the P2P Client/WPS Enrollee.
340
341wps_pbc
342
343Start WPS PBC method (i.e., push the button). This allows a single WPS
344Enrollee to connect to the AP/GO. This is used on the GO when a P2P
345client joins an existing group.
346
347p2p_get_passphrase
348
349Get the passphrase for a group (only available when acting as a GO).
350
351p2p_presence_req [<duration> <interval>] [<duration> <interval>]
352
353Send a P2P Presence Request to the GO (this is only available when
354acting as a P2P client). If no duration/interval pairs are given, the
355request indicates that this client has no special needs for GO
356presence. the first parameter pair gives the preferred duration and
357interval values in microseconds. If the second pair is included, that
358indicates which value would be acceptable.
359
360Parameters
361
362p2p_ext_listen [<period> <interval>]
363
364Configure Extended Listen Timing. If the parameters are omitted, this
365feature is disabled. If the parameters are included, Listen State will
366be entered every interval msec for at least period msec. Both values
367have acceptable range of 1-65535 (with interval obviously having to be
368larger than or equal to duration). If the P2P module is not idle at
369the time the Extended Listen Timing timeout occurs, the Listen State
370operation will be skipped.
371
372The configured values will also be advertised to other P2P Devices. The
373received values are available in the p2p_peer command output:
374
375ext_listen_period=100 ext_listen_interval=5000
376
377p2p_set <field> <value>
378
379Change dynamic P2P parameters
380
381p2p_set discoverability <0/1>
382
383Disable/enable advertisement of client discoverability. This is
384enabled by default and this parameter is mainly used to allow testing
385of device discoverability.
386
387p2p_set managed <0/1>
388
389Disable/enable managed P2P Device operations. This is disabled by
390default.
391
392p2p_set listen_channel <1/6/11>
393
394Set P2P Listen channel. This is mainly meant for testing purposes and
395changing the Listen channel during normal operations can result in
396protocol failures.
397
398p2p_set ssid_postfix <postfix>
399
400Set postfix string to be added to the automatically generated P2P SSID
401(DIRECT-<two random characters>). For example, postfix of "-testing"
402could result in the SSID becoming DIRECT-ab-testing.
403
404set <field> <value>
405
406Set global configuration parameters which may also affect P2P
407operations. The format on these parameters is same as is used in
408wpa_supplicant.conf. Only the parameters listen here should be
409changed. Modifying other parameters may result in incorrect behavior
410since not all existing users of the parameters are updated.
411
412set uuid <UUID>
413
414Set WPS UUID (by default, this is generated based on the MAC address).
415
416set device_name <device name>
417
418Set WPS Device Name (also included in some P2P messages).
419
420set manufacturer <manufacturer>
421
422Set WPS Manufacturer.
423
424set model_name <model name>
425
426Set WPS Model Name.
427
428set model_number <model number>
429
430Set WPS Model Number.
431
432set serial_number <serial number>
433
434Set WPS Serial Number.
435
436set device_type <device type>
437
438Set WPS Device Type.
439
440set os_version <OS version>
441
442Set WPS OS Version.
443
444set config_methods <config methods>
445
446Set WPS Configuration Methods.
447
448set sec_device_type <device type>
449
450Add a new Secondary Device Type.
451
452set p2p_go_intent <GO intent>
453
454Set the default P2P GO Intent. Note: This value can be overridden in
455p2p_connect command and as such, there should be no need to change the
456default value here during normal operations.
457
458set p2p_ssid_postfix <P2P SSID postfix>
459
460Set P2P SSID postfix.
461
462set persistent_reconnect <0/1>
463
464Disable/enabled persistent reconnect for reinvocation of persistent
465groups. If enabled, invitations to reinvoke a persistent group will be
466accepted without separate authorization (e.g., user interaction).
467
468set country <two character country code>
469
470Set country code (this is included in some P2P messages).
471
472Status
473
474p2p_peers [discovered]
475
476List P2P Device Addresses of all the P2P peers we know. The optional
477"discovered" parameter filters out the peers that we have not fully
478discovered, i.e., which we have only seen in a received Probe Request
479frame.
480
481p2p_peer <P2P Device Address>
482
483Fetch information about a known P2P peer.
484
485Group Status
486
487(These are used on the group interface.)
488
489status
490
491Show status information (connection state, role, use encryption
492parameters, IP address, etc.).
493
494sta
495
496Show information about an associated station (when acting in AP/GO role).
497
498all_sta
499
500Lists the currently associated stations.
501
502Configuration data
503
504list_networks
505
506Lists the configured networks, including stored information for
507persistent groups. The identifier in this list is used with
508p2p_group_add and p2p_invite to indicate which persistent group is to
509be reinvoked.
510
511remove_network <network id>
512
513Remove a network entry from configuration.
514
515
516wpa_cli action script
517---------------------
518
519See examples/p2p-action.sh
520
521TODO: describe DHCP/DNS setup
522TODO: cross-connection
523

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.
51
52
53wpa_supplicant configuration
54----------------------------
55
56WPS is an optional component that needs to be enabled in
57wpa_supplicant build configuration (.config). Here is an example
58configuration that includes WPS support and Linux nl80211 -based
59driver interface:
60
61CONFIG_DRIVER_NL80211=y
62CONFIG_WPS=y
63CONFIG_WPS2=y
64
65If you want to enable WPS external registrar (ER) functionality, you
66will also need to add following line:
67
68CONFIG_WPS_ER=y
69
70
71WPS needs the Universally Unique IDentifier (UUID; see RFC 4122) for
72the device. This is configured in the runtime configuration for
73wpa_supplicant (if not set, UUID will be generated based on local MAC
74address):
75
76# example UUID for WPS
77uuid=12345678-9abc-def0-1234-56789abcdef0
78
79The network configuration blocks needed for WPS are added
80automatically based on control interface commands, so they do not need
81to be added explicitly in the configuration file.
82
83WPS registration will generate new network blocks for the acquired
84credentials. If these are to be stored for future use (after
85restarting wpa_supplicant), wpa_supplicant will need to be configured
86to allow configuration file updates:
87
88update_config=1
89
90
91
92External operations
93-------------------
94
95WPS requires either a device PIN code (usually, 8-digit number) or a
96pushbutton event (for PBC) to allow a new WPS Enrollee to join the
97network. wpa_supplicant uses the control interface as an input channel
98for these events.
99
100The PIN value used in the commands must be processed by an UI to
101remove non-digit characters and potentially, to verify the checksum
102digit. "wpa_cli wps_check_pin <PIN>" can be used to do such processing.
103It returns FAIL if the PIN is invalid, or FAIL-CHECKSUM if the checksum
104digit is incorrect, or the processed PIN (non-digit characters removed)
105if the PIN is valid.
106
107If the client device has a display, a random PIN has to be generated
108for each WPS registration session. wpa_supplicant can do this with a
109control interface request, e.g., by calling wpa_cli:
110
111wpa_cli wps_pin any
112
113This will return the generated 8-digit PIN which will then need to be
114entered at the Registrar to complete WPS registration. At that point,
115the client will be enrolled with credentials needed to connect to the
116AP to access the network.
117
118
119If the client device does not have a display that could show the
120random PIN, a hardcoded PIN that is printed on a label can be
121used. wpa_supplicant is notified this with a control interface
122request, e.g., by calling wpa_cli:
123
124wpa_cli wps_pin any 12345670
125
126This starts the WPS negotiation in the same way as above with the
127generated PIN.
128
129
130If the client design wants to support optional WPS PBC mode, this can
131be enabled by either a physical button in the client device or a
132virtual button in the user interface. The PBC operation requires that
133a button is also pressed at the AP/Registrar at about the same time (2
134minute window). wpa_supplicant is notified of the local button event
135over the control interface, e.g., by calling wpa_cli:
136
137wpa_cli wps_pbc
138
139At this point, the AP/Registrar has two minutes to complete WPS
140negotiation which will generate a new WPA PSK in the same way as the
141PIN method described above.
142
143
144If the client wants to operate in the Registrar role to learn the
145current AP configuration and optionally, to configure an AP,
146wpa_supplicant is notified over the control interface, e.g., with
147wpa_cli:
148
149wpa_cli wps_reg <AP BSSID> <AP PIN>
150(example: wpa_cli wps_reg 02:34:56:78:9a:bc 12345670)
151
152This is used to fetch the current AP settings instead of actually
153changing them. The main difference with the wps_pin command is that
154wps_reg uses the AP PIN (e.g., from a label on the AP) instead of a
155PIN generated at the client.
156
157In order to change the AP configuration, the new configuration
158parameters are given to the wps_reg command:
159
160wpa_cli wps_reg <AP BSSID> <AP PIN> <new SSID> <auth> <encr> <new key>
161examples:
162  wpa_cli wps_reg 02:34:56:78:9a:bc 12345670 testing WPA2PSK CCMP 12345678
163  wpa_cli wps_reg 02:34:56:78:9a:bc 12345670 clear OPEN NONE ""
164
165<auth> must be one of the following: OPEN WPAPSK WPA2PSK
166<encr> must be one of the following: NONE WEP TKIP CCMP
167
168
169Scanning
170--------
171
172Scan results ('wpa_cli scan_results' or 'wpa_cli bss <idx>') include a
173flags field that is used to indicate whether the BSS support WPS. If
174the AP support WPS, but has not recently activated a Registrar, [WPS]
175flag will be included. If PIN method has been recently selected,
176[WPS-PIN] is shown instead. Similarly, [WPS-PBC] is shown if PBC mode
177is in progress. GUI programs can use these as triggers for suggesting
178a guided WPS configuration to the user. In addition, control interface
179monitor events WPS-AP-AVAILABLE{,-PBC,-PIN} can be used to find out if
180there are WPS enabled APs in scan results without having to go through
181all the details in the GUI. These notification could be used, e.g., to
182suggest possible WPS connection to the user.
183
184
185wpa_gui
186-------
187
188wpa_gui-qt4 directory contains a sample GUI that shows an example of
189how WPS support can be integrated into the GUI. Its main window has a
190WPS tab that guides user through WPS registration with automatic AP
191selection. In addition, it shows how WPS can be started manually by
192selecting an AP from scan results.
193
194
195Credential processing
196---------------------
197
198By default, wpa_supplicant processes received credentials and updates
199its configuration internally. However, it is possible to
200control these operations from external programs, if desired.
201
202This internal processing can be disabled with wps_cred_processing=1
203option. When this is used, an external program is responsible for
204processing the credential attributes and updating wpa_supplicant
205configuration based on them.
206
207Following control interface messages are sent out for external programs:
208
209WPS-CRED-RECEIVED  <hexdump of Credential attribute(s)>
210For example:
211<2>WPS-CRED-RECEIVED 100e006f10260001011045000c6a6b6d2d7770732d74657374100300020020100f000200081027004030653462303435366332363666653064333961643135353461316634626637313234333761636664623766333939653534663166316230323061643434386235102000060266a0ee1727
212
213
214wpa_supplicant as WPS External Registrar (ER)
215---------------------------------------------
216
217wpa_supplicant can be used as a WPS ER to configure an AP or enroll
218new Enrollee to join the network. This functionality uses UPnP and
219requires that a working IP connectivity is available with the AP (this
220can be either over a wired or wireless connection).
221
222Separate wpa_supplicant process can be started for WPS ER
223operations. A special "none" driver can be used in such a case to
224indicate that no local network interface is actually controlled. For
225example, following command could be used to start the ER:
226
227wpa_supplicant -Dnone -c er.conf -ieth0
228
229Sample er.conf:
230
231ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=admin
232device_name=WPS External Registrar
233
234
235wpa_cli commands for ER functionality:
236
237wps_er_start [IP address]
238- start WPS ER functionality
239- the optional IP address parameter can be used to filter operations only
240  to include a single AP
241- if run again while ER is active, the stored information (discovered APs
242  and Enrollees) are shown again
243
244wps_er_stop
245- stop WPS ER functionality
246
247wps_er_learn <UUID> <AP PIN>
248- learn AP configuration
249
250wps_er_set_config <UUID> <network id>
251- use AP configuration from a locally configured network (e.g., from
252  wps_reg command); this does not change the AP's configuration, but
253  only prepares a configuration to be used when enrolling a new device
254  to the AP
255
256wps_er_config <UUID> <AP PIN> <new SSID> <auth> <encr> <new key>
257- examples:
258  wps_er_config 87654321-9abc-def0-1234-56789abc0002 12345670 testing WPA2PSK CCMP 12345678
259  wpa_er_config 87654321-9abc-def0-1234-56789abc0002 12345670 clear OPEN NONE ""
260
261<auth> must be one of the following: OPEN WPAPSK WPA2PSK
262<encr> must be one of the following: NONE WEP TKIP CCMP
263
264
265wps_er_pbc <Enrollee UUID>
266- accept an Enrollee PBC using External Registrar
267
268wps_er_pin <Enrollee UUID> <PIN> [Enrollee MAC address]
269- add an Enrollee PIN to External Registrar
270- if Enrollee UUID is not known, "any" can be used to add a wildcard PIN
271- if the MAC address of the enrollee is known, it should be configured
272  to allow the AP to advertise list of authorized enrollees
273
274
275WPS ER events:
276
277WPS_EVENT_ER_AP_ADD
278- WPS ER discovered an AP
279
280WPS-ER-AP-ADD 87654321-9abc-def0-1234-56789abc0002 02:11:22:33:44:55 pri_dev_type=6-0050F204-1 wps_state=1 |Very friendly name|Company|Long description of the model|WAP|http://w1.fi/|http://w1.fi/hostapd/
281
282WPS_EVENT_ER_AP_REMOVE
283- WPS ER removed an AP entry
284
285WPS-ER-AP-REMOVE 87654321-9abc-def0-1234-56789abc0002
286
287WPS_EVENT_ER_ENROLLEE_ADD
288- WPS ER discovered a new Enrollee
289
290WPS-ER-ENROLLEE-ADD 2b7093f1-d6fb-5108-adbb-bea66bb87333 02:66:a0:ee:17:27 M1=1 config_methods=0x14d dev_passwd_id=0 pri_dev_type=1-0050F204-1 |Wireless Client|Company|cmodel|123|12345|
291
292WPS_EVENT_ER_ENROLLEE_REMOVE
293- WPS ER removed an Enrollee entry
294
295WPS-ER-ENROLLEE-REMOVE 2b7093f1-d6fb-5108-adbb-bea66bb87333 02:66:a0:ee:17:27
296
297WPS-ER-AP-SETTINGS
298- WPS ER learned AP settings
299
300WPS-ER-AP-SETTINGS uuid=fd91b4ec-e3fa-5891-a57d-8c59efeed1d2 ssid=test-wps auth_type=0x0020 encr_type=0x0008 key=12345678
301

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