README
1 WPA Supplicant
2 ==============
3
4 Copyright (c) 2003-2011, Jouni Malinen <j (a] w1.fi> and contributors
5 All Rights Reserved.
6
7 This program is dual-licensed under both the GPL version 2 and BSD
8 license. Either license may be used at your option.
9
10
11
12 License
13 -------
14
15 GPL v2:
16
17 This program is free software; you can redistribute it and/or modify
18 it under the terms of the GNU General Public License version 2 as
19 published by the Free Software Foundation.
20
21 This program is distributed in the hope that it will be useful,
22 but WITHOUT ANY WARRANTY; without even the implied warranty of
23 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 GNU General Public License for more details.
25
26 You should have received a copy of the GNU General Public License
27 along with this program; if not, write to the Free Software
28 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
29
30 (this copy of the license is in COPYING file)
31
32
33 Alternatively, this software may be distributed, used, and modified
34 under the terms of BSD license:
35
36 Redistribution and use in source and binary forms, with or without
37 modification, are permitted provided that the following conditions are
38 met:
39
40 1. Redistributions of source code must retain the above copyright
41 notice, this list of conditions and the following disclaimer.
42
43 2. 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
47 3. 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
51 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
52 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
53 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
54 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
55 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
56 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
57 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
58 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
59 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
60 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
61 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
62
63
64
65 Features
66 --------
67
68 Supported 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
108 Supported TLS/crypto libraries:
109 - OpenSSL (default)
110 - GnuTLS
111
112 Internal 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
124 Requirements
125 ------------
126
127 Current 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
187 wpa_supplicant was designed to be portable for different drivers and
188 operating systems. Hopefully, support for more wlan cards and OSes will be
189 added in the future. See developer's documentation
190 (http://hostap.epitest.fi/wpa_supplicant/devel/) for more information about the
191 design of wpa_supplicant and porting to other drivers. One main goal
192 is to add full WPA/WPA2 support to Linux wireless extensions to allow
193 new drivers to be supported without having to implement new
194 driver-specific interface code in wpa_supplicant.
195
196 Optional 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
203 These libraries are _not_ used in the default Linux build. Instead,
204 internal Linux specific implementation is used. libpcap/libdnet are
205 more portable and they can be used by adding CONFIG_L2_PACKET=pcap into
206 .config. They may also be selected automatically for other operating
207 systems. In case of Windows builds, WinPcap is used by default
208 (CONFIG_L2_PACKET=winpcap).
209
210
211 Optional 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
218 TLS 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
224 One of these libraries is needed when EAP-TLS, EAP-PEAP, EAP-TTLS, or
225 EAP-FAST support is enabled. WPA-PSK mode does not require this or EAPOL/EAP
226 implementation. A configuration file, .config, for compilation is
227 needed to enable IEEE 802.1X/EAPOL and EAP methods. Note that EAP-MD5,
228 EAP-GTC, EAP-OTP, and EAP-MSCHAPV2 cannot be used alone with WPA, so
229 they should only be enabled if testing the EAPOL/EAP state
230 machines. However, there can be used as inner authentication
231 algorithms with EAP-PEAP and EAP-TTLS.
232
233 See Building and installing section below for more detailed
234 information about the wpa_supplicant build time configuration.
235
236
237
238 WPA
239 ---
240
241 The original security mechanism of IEEE 802.11 standard was not
242 designed to be strong and has proven to be insufficient for most
243 networks that require some kind of security. Task group I (Security)
244 of IEEE 802.11 working group (http://www.ieee802.org/11/) has worked
245 to address the flaws of the base standard and has in practice
246 completed its work in May 2004. The IEEE 802.11i amendment to the IEEE
247 802.11 standard was approved in June 2004 and published in July 2004.
248
249 Wi-Fi Alliance (http://www.wi-fi.org/) used a draft version of the
250 IEEE 802.11i work (draft 3.0) to define a subset of the security
251 enhancements that can be implemented with existing wlan hardware. This
252 is called Wi-Fi Protected Access<TM> (WPA). This has now become a
253 mandatory component of interoperability testing and certification done
254 by Wi-Fi Alliance. Wi-Fi provides information about WPA at its web
255 site (http://www.wi-fi.org/OpenSection/protected_access.asp).
256
257 IEEE 802.11 standard defined wired equivalent privacy (WEP) algorithm
258 for protecting wireless networks. WEP uses RC4 with 40-bit keys,
259 24-bit initialization vector (IV), and CRC32 to protect against packet
260 forgery. All these choices have proven to be insufficient: key space is
261 too small against current attacks, RC4 key scheduling is insufficient
262 (beginning of the pseudorandom stream should be skipped), IV space is
263 too small and IV reuse makes attacks easier, there is no replay
264 protection, and non-keyed authentication does not protect against bit
265 flipping packet data.
266
267 WPA is an intermediate solution for the security issues. It uses
268 Temporal Key Integrity Protocol (TKIP) to replace WEP. TKIP is a
269 compromise on strong security and possibility to use existing
270 hardware. It still uses RC4 for the encryption like WEP, but with
271 per-packet RC4 keys. In addition, it implements replay protection,
272 keyed packet authentication mechanism (Michael MIC).
273
274 Keys can be managed using two different mechanisms. WPA can either use
275 an external authentication server (e.g., RADIUS) and EAP just like
276 IEEE 802.1X is using or pre-shared keys without need for additional
277 servers. Wi-Fi calls these "WPA-Enterprise" and "WPA-Personal",
278 respectively. Both mechanisms will generate a master session key for
279 the Authenticator (AP) and Supplicant (client station).
280
281 WPA implements a new key handshake (4-Way Handshake and Group Key
282 Handshake) for generating and exchanging data encryption keys between
283 the Authenticator and Supplicant. This handshake is also used to
284 verify that both Authenticator and Supplicant know the master session
285 key. These handshakes are identical regardless of the selected key
286 management mechanism (only the method for generating master session
287 key changes).
288
289
290
291 IEEE 802.11i / WPA2
292 -------------------
293
294 The design for parts of IEEE 802.11i that were not included in WPA has
295 finished (May 2004) and this amendment to IEEE 802.11 was approved in
296 June 2004. Wi-Fi Alliance is using the final IEEE 802.11i as a new
297 version of WPA called WPA2. This includes, e.g., support for more
298 robust encryption algorithm (CCMP: AES in Counter mode with CBC-MAC)
299 to replace TKIP and optimizations for handoff (reduced number of
300 messages in initial key handshake, pre-authentication, and PMKSA caching).
301
302
303
304 wpa_supplicant
305 --------------
306
307 wpa_supplicant is an implementation of the WPA Supplicant component,
308 i.e., the part that runs in the client stations. It implements WPA key
309 negotiation with a WPA Authenticator and EAP authentication with
310 Authentication Server. In addition, it controls the roaming and IEEE
311 802.11 authentication/association of the wlan driver.
312
313 wpa_supplicant is designed to be a "daemon" program that runs in the
314 background and acts as the backend component controlling the wireless
315 connection. wpa_supplicant supports separate frontend programs and an
316 example text-based frontend, wpa_cli, is included with wpa_supplicant.
317
318 Following 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
336 Building and installing
337 -----------------------
338
339 In order to be able to build wpa_supplicant, you will first need to
340 select which parts of it will be included. This is done by creating a
341 build time configuration file, .config, in the wpa_supplicant root
342 directory. Configuration options are text lines using following
343 format: CONFIG_<option>=y. Lines starting with # are considered
344 comments and are ignored. See defconfig file for an example configuration
345 and a list of available options and additional notes.
346
347 The build time configuration can be used to select only the needed
348 features and limit the binary size and requirements for external
349 libraries. The main configuration parts are the selection of which
350 driver interfaces (e.g., hostap, madwifi, ..) and which authentication
351 methods (e.g., EAP-TLS, EAP-PEAP, ..) are included.
352
353 Following build time configuration options are used to control IEEE
354 802.1X/EAPOL and EAP state machines and all EAP methods. Including
355 TLS, PEAP, or TTLS will require linking wpa_supplicant with OpenSSL
356 library for TLS implementation. Alternatively, GnuTLS or the internal
357 TLSv1 implementation can be used for TLS functionaly.
358
359 CONFIG_IEEE8021X_EAPOL=y
360 CONFIG_EAP_MD5=y
361 CONFIG_EAP_MSCHAPV2=y
362 CONFIG_EAP_TLS=y
363 CONFIG_EAP_PEAP=y
364 CONFIG_EAP_TTLS=y
365 CONFIG_EAP_GTC=y
366 CONFIG_EAP_OTP=y
367 CONFIG_EAP_SIM=y
368 CONFIG_EAP_AKA=y
369 CONFIG_EAP_PSK=y
370 CONFIG_EAP_SAKE=y
371 CONFIG_EAP_GPSK=y
372 CONFIG_EAP_PAX=y
373 CONFIG_EAP_LEAP=y
374 CONFIG_EAP_IKEV2=y
375
376 Following option can be used to include GSM SIM/USIM interface for GSM/UMTS
377 authentication algorithm (for EAP-SIM/EAP-AKA). This requires pcsc-lite
378 (http://www.linuxnet.com/) for smart card access.
379
380 CONFIG_PCSC=y
381
382 Following options can be added to .config to select which driver
383 interfaces are included.
384
385 CONFIG_DRIVER_HOSTAP=y
386 CONFIG_DRIVER_MADWIFI=y
387 CONFIG_DRIVER_WEXT=y
388 CONFIG_DRIVER_RALINK=y
389 CONFIG_DRIVER_BROADCOM=y
390 CONFIG_DRIVER_BSD=y
391 CONFIG_DRIVER_NDIS=y
392
393 Following example includes all features and driver interfaces that are
394 included in the wpa_supplicant package:
395
396 CONFIG_DRIVER_HOSTAP=y
397 CONFIG_DRIVER_MADWIFI=y
398 CONFIG_DRIVER_WEXT=y
399 CONFIG_DRIVER_BROADCOM=y
400 CONFIG_DRIVER_BSD=y
401 CONFIG_DRIVER_NDIS=y
402 CONFIG_IEEE8021X_EAPOL=y
403 CONFIG_EAP_MD5=y
404 CONFIG_EAP_MSCHAPV2=y
405 CONFIG_EAP_TLS=y
406 CONFIG_EAP_PEAP=y
407 CONFIG_EAP_TTLS=y
408 CONFIG_EAP_GTC=y
409 CONFIG_EAP_OTP=y
410 CONFIG_EAP_SIM=y
411 CONFIG_EAP_AKA=y
412 CONFIG_EAP_PSK=y
413 CONFIG_EAP_SAKE=y
414 CONFIG_EAP_GPSK=y
415 CONFIG_EAP_PAX=y
416 CONFIG_EAP_LEAP=y
417 CONFIG_EAP_IKEV2=y
418 CONFIG_PCSC=y
419
420 EAP-PEAP and EAP-TTLS will automatically include configured EAP
421 methods (MD5, OTP, GTC, MSCHAPV2) for inner authentication selection.
422
423
424 After you have created a configuration file, you can build
425 wpa_supplicant and wpa_cli with 'make' command. You may then install
426 the binaries to a suitable system directory, e.g., /usr/local/bin.
427
428 Example commands:
429
430 # build wpa_supplicant and wpa_cli
431 make
432 # install binaries (this may need root privileges)
433 cp wpa_cli wpa_supplicant /usr/local/bin
434
435
436 You will need to make a configuration file, e.g.,
437 /etc/wpa_supplicant.conf, with network configuration for the networks
438 you are going to use. Configuration file section below includes
439 explanation fo the configuration file format and includes various
440 examples. Once the configuration is ready, you can test whether the
441 configuration work by first running wpa_supplicant with following
442 command to start it on foreground with debugging enabled:
443
444 wpa_supplicant -iwlan0 -c/etc/wpa_supplicant.conf -d
445
446 Assuming everything goes fine, you can start using following command
447 to start wpa_supplicant on background without debugging:
448
449 wpa_supplicant -iwlan0 -c/etc/wpa_supplicant.conf -B
450
451 Please note that if you included more than one driver interface in the
452 build time configuration (.config), you may need to specify which
453 interface to use by including -D<driver name> option on the command
454 line. See following section for more details on command line options
455 for wpa_supplicant.
456
457
458
459 Command line options
460 --------------------
461
462 usage:
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
468 options:
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
491 drivers:
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
503 In most common cases, wpa_supplicant is started with
504
505 wpa_supplicant -B -c/etc/wpa_supplicant.conf -iwlan0
506
507 This makes the process fork into background.
508
509 The easiest way to debug problems, and to get debug log for bug
510 reports, is to start wpa_supplicant on foreground with debugging
511 enabled:
512
513 wpa_supplicant -c/etc/wpa_supplicant.conf -iwlan0 -d
514
515 If the specific driver wrapper is not known beforehand, it is possible
516 to specify multiple comma separated driver wrappers on the command
517 line. wpa_supplicant will use the first driver wrapper that is able to
518 initialize the interface.
519
520 wpa_supplicant -Dnl80211,wext -c/etc/wpa_supplicant.conf -iwlan0
521
522
523 wpa_supplicant can control multiple interfaces (radios) either by
524 running one process for each interface separately or by running just
525 one process and list of options at command line. Each interface is
526 separated with -N argument. As an example, following command would
527 start wpa_supplicant for two interfaces:
528
529 wpa_supplicant \
530 -c wpa1.conf -i wlan0 -D hostap -N \
531 -c wpa2.conf -i ath0 -D madwifi
532
533
534 If the interface is added in a Linux bridge (e.g., br0), the bridge
535 interface needs to be configured to wpa_supplicant in addition to the
536 main interface:
537
538 wpa_supplicant -cw.conf -Dmadwifi -iath0 -bbr0
539
540
541 Configuration file
542 ------------------
543
544 wpa_supplicant is configured using a text file that lists all accepted
545 networks and security policies, including pre-shared keys. See
546 example configuration file, wpa_supplicant.conf, for detailed
547 information about the configuration format and supported fields.
548
549 Changes to configuration file can be reloaded be sending SIGHUP signal
550 to wpa_supplicant ('killall -HUP wpa_supplicant'). Similarly,
551 reloading can be triggered with 'wpa_cli reconfigure' command.
552
553 Configuration file can include one or more network blocks, e.g., one
554 for each used SSID. wpa_supplicant will automatically select the best
555 betwork based on the order of network blocks in the configuration
556 file, network security level (WPA/WPA2 is preferred), and signal
557 strength.
558
559 Example configuration files for some common configurations:
560
561 1) 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
565 ctrl_interface=/var/run/wpa_supplicant
566 ctrl_interface_group=wheel
567 #
568 # home network; allow all valid ciphers
569 network={
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
577 network={
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 (a] 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
592 2) 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
595 ctrl_interface=/var/run/wpa_supplicant
596 ctrl_interface_group=wheel
597 network={
598 ssid="example"
599 scan_ssid=1
600 key_mgmt=WPA-EAP
601 eap=PEAP
602 identity="user (a] example.com"
603 password="foobar"
604 ca_cert="/etc/cert/ca.pem"
605 phase1="peaplabel=0"
606 phase2="auth=MSCHAPV2"
607 }
608
609
610 3) 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
613 ctrl_interface=/var/run/wpa_supplicant
614 ctrl_interface_group=wheel
615 network={
616 ssid="example"
617 scan_ssid=1
618 key_mgmt=WPA-EAP
619 eap=TTLS
620 identity="user (a] example.com"
621 anonymous_identity="anonymous (a] example.com"
622 password="foobar"
623 ca_cert="/etc/cert/ca.pem"
624 phase2="auth=MD5"
625 }
626
627
628 4) IEEE 802.1X (i.e., no WPA) with dynamic WEP keys (require both unicast and
629 broadcast); use EAP-TLS for authentication
630
631 ctrl_interface=/var/run/wpa_supplicant
632 ctrl_interface_group=wheel
633 network={
634 ssid="1x-test"
635 scan_ssid=1
636 key_mgmt=IEEE8021X
637 eap=TLS
638 identity="user (a] 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
647 5) 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
652 ctrl_interface=/var/run/wpa_supplicant
653 ctrl_interface_group=wheel
654 network={
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 (a] 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
676 6) Authentication for wired Ethernet. This can be used with 'wired' or
677 'roboswitch' interface (-Dwired or -Droboswitch on command line).
678
679 ctrl_interface=/var/run/wpa_supplicant
680 ctrl_interface_group=wheel
681 ap_scan=0
682 network={
683 key_mgmt=IEEE8021X
684 eap=MD5
685 identity="user"
686 password="password"
687 eapol_flags=0
688 }
689
690
691
692 Certificates
693 ------------
694
695 Some EAP authentication methods require use of certificates. EAP-TLS
696 uses both server side and client certificates whereas EAP-PEAP and
697 EAP-TTLS only require the server side certificate. When client
698 certificate is used, a matching private key file has to also be
699 included in configuration. If the private key uses a passphrase, this
700 has to be configured in wpa_supplicant.conf ("private_key_passwd").
701
702 wpa_supplicant supports X.509 certificates in PEM and DER
703 formats. User certificate and private key can be included in the same
704 file.
705
706 If the user certificate and private key is received in PKCS#12/PFX
707 format, they need to be converted to suitable PEM/DER format for
708 wpa_supplicant. This can be done, e.g., with following commands:
709
710 # convert client certificate and private key to PEM format
711 openssl pkcs12 -in example.pfx -out user.pem -clcerts
712 # convert CA certificate (if included in PFX file) to PEM format
713 openssl pkcs12 -in example.pfx -out ca.pem -cacerts -nokeys
714
715
716
717 wpa_cli
718 -------
719
720 wpa_cli is a text-based frontend program for interacting with
721 wpa_supplicant. It is used to query current status, change
722 configuration, trigger events, and request interactive user input.
723
724 wpa_cli can show the current authentication status, selected security
725 mode, dot11 and dot1x MIBs, etc. In addition, it can configure some
726 variables like EAPOL state machine parameters and trigger events like
727 reassociation and IEEE 802.1X logoff/logon. wpa_cli provides a user
728 interface to request authentication information, like username and
729 password, if these are not included in the configuration. This can be
730 used to implement, e.g., one-time-passwords or generic token card
731 authentication where the authentication is based on a
732 challenge-response that uses an external device for generating the
733 response.
734
735 The control interface of wpa_supplicant can be configured to allow
736 non-root user access (ctrl_interface_group in the configuration
737 file). This makes it possible to run wpa_cli with a normal user
738 account.
739
740 wpa_cli supports two modes: interactive and command line. Both modes
741 share the same command set and the main difference is in interactive
742 mode providing access to unsolicited messages (event messages,
743 username/password requests).
744
745 Interactive mode is started when wpa_cli is executed without including
746 the command as a command line parameter. Commands are then entered on
747 the wpa_cli prompt. In command line mode, the same commands are
748 entered as command line arguments for wpa_cli.
749
750
751 Interactive authentication parameters request
752
753 When wpa_supplicant need authentication parameters, like username and
754 password, which are not present in the configuration file, it sends a
755 request message to all attached frontend programs, e.g., wpa_cli in
756 interactive mode. wpa_cli shows these requests with
757 "CTRL-REQ-<type>-<id>:<text>" prefix. <type> is IDENTITY, PASSWORD, or
758 OTP (one-time-password). <id> is a unique identifier for the current
759 network. <text> is description of the request. In case of OTP request,
760 it includes the challenge from the authentication server.
761
762 The reply to these requests can be given with 'identity', 'password',
763 and 'otp' commands. <id> needs to be copied from the the matching
764 request. 'password' and 'otp' commands can be used regardless of
765 whether the request was for PASSWORD or OTP. The main difference
766 between these two commands is that values given with 'password' are
767 remembered as long as wpa_supplicant is running whereas values given
768 with 'otp' are used only once and then forgotten, i.e., wpa_supplicant
769 will ask frontend for a new value for every use. This can be used to
770 implement one-time-password lists and generic token card -based
771 authentication.
772
773 Example request for password and a matching reply:
774
775 CTRL-REQ-PASSWORD-1:Password needed for SSID foobar
776 > password 1 mysecretpassword
777
778 Example request for generic token card challenge-response:
779
780 CTRL-REQ-OTP-2:Challenge 1235663 needed for SSID foobar
781 > otp 2 9876
782
783
784 wpa_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
824 wpa_cli command line options
825
826 wpa_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
837 Using wpa_cli to run external program on connect/disconnect
838 -----------------------------------------------------------
839
840 wpa_cli can used to run external programs whenever wpa_supplicant
841 connects or disconnects from a network. This can be used, e.g., to
842 update network configuration and/or trigget DHCP client to update IP
843 addresses, etc.
844
845 One wpa_cli process in "action" mode needs to be started for each
846 interface. For example, the following command starts wpa_cli for the
847 default ingterface (-i can be used to select the interface in case of
848 more than one interface being used at the same time):
849
850 wpa_cli -a/sbin/wpa_action.sh -B
851
852 The action file (-a option, /sbin/wpa_action.sh in this example) will
853 be executed whenever wpa_supplicant completes authentication (connect
854 event) or detects disconnection). The action script will be called
855 with two command line arguments: interface name and event (CONNECTED
856 or DISCONNECTED). If the action script needs to get more information
857 about the current network, it can use 'wpa_cli status' to query
858 wpa_supplicant for more information.
859
860 Following example can be used as a simple template for an action
861 script:
862
863 #!/bin/sh
864
865 IFNAME=$1
866 CMD=$2
867
868 if [ "$CMD" = "CONNECTED" ]; then
869 SSID=`wpa_cli -i$IFNAME status | grep ^ssid= | cut -f2- -d=`
870 # configure network, signal DHCP client, etc.
871 fi
872
873 if [ "$CMD" = "DISCONNECTED" ]; then
874 # remove network configuration, if needed
875 SSID=
876 fi
877
878
879
880 Integrating with pcmcia-cs/cardmgr scripts
881 ------------------------------------------
882
883 wpa_supplicant needs to be running when using a wireless network with
884 WPA. It can be started either from system startup scripts or from
885 pcmcia-cs/cardmgr scripts (when using PC Cards). WPA handshake must be
886 completed before data frames can be exchanged, so wpa_supplicant
887 should be started before DHCP client.
888
889 For example, following small changes to pcmcia-cs scripts can be used
890 to enable WPA support:
891
892 Add MODE="Managed" and WPA="y" to the network scheme in
893 /etc/pcmcia/wireless.opts.
894
895 Add 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
903 Add the following block to the end of 'stop' action handler (may need
904 to 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
910 This will make cardmgr start wpa_supplicant when the card is plugged
911 in.
912
913
914
915 Dynamic interface add and operation without configuration files
916 ---------------------------------------------------------------
917
918 wpa_supplicant can be started without any configuration files or
919 network interfaces. When used in this way, a global (i.e., per
920 wpa_supplicant process) control interface is used to add and remove
921 network interfaces. Each network interface can then be configured
922 through a per-network interface control interface. For example,
923 following commands show how to start wpa_supplicant without any
924 network interfaces and then add a network interface and configure a
925 network (SSID):
926
927 # Start wpa_supplicant in the background
928 wpa_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)
932 wpa_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:
936 wpa_cli -iwlan0 add_network
937 wpa_cli -iwlan0 set_network 0 ssid '"test"'
938 wpa_cli -iwlan0 set_network 0 key_mgmt WPA-PSK
939 wpa_cli -iwlan0 set_network 0 psk '"12345678"'
940 wpa_cli -iwlan0 set_network 0 pairwise TKIP
941 wpa_cli -iwlan0 set_network 0 group TKIP
942 wpa_cli -iwlan0 set_network 0 proto WPA
943 wpa_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
949 wpa_cli -g/var/run/wpa_supplicant-global interface_remove wlan0
950
951
952 Privilege separation
953 --------------------
954
955 To minimize the size of code that needs to be run with root privileges
956 (e.g., to control wireless interface operation), wpa_supplicant
957 supports optional privilege separation. If enabled, this separates the
958 privileged operations into a separate process (wpa_priv) while leaving
959 rest of the code (e.g., EAP authentication and WPA handshakes) into an
960 unprivileged process (wpa_supplicant) that can be run as non-root
961 user. Privilege separation restricts the effects of potential software
962 errors by containing the majority of the code in an unprivileged
963 process to avoid full system compromise.
964
965 Privilege separation is not enabled by default and it can be enabled
966 by adding CONFIG_PRIVSEP=y to the build configuration (.config). When
967 enabled, the privileged operations (driver wrapper and l2_packet) are
968 linked into a separate daemon program, wpa_priv. The unprivileged
969 program, wpa_supplicant, will be built with a special driver/l2_packet
970 wrappers that communicate with the privileged wpa_priv process to
971 perform the needed operations. wpa_priv can control what privileged
972 are allowed.
973
974 wpa_priv needs to be run with network admin privileges (usually, root
975 user). It opens a UNIX domain socket for each interface that is
976 included on the command line; any other interface will be off limits
977 for wpa_supplicant in this kind of configuration. After this,
978 wpa_supplicant can be run as a non-root user (e.g., all standard users
979 on a laptop or as a special non-privileged user account created just
980 for this purpose to limit access to user files even further).
981
982
983 Example 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
998 wpa_priv does not use the network interface before wpa_supplicant is
999 started, so it is fine to include network interfaces that are not
1000 available at the time wpa_priv is started. As an alternative, wpa_priv
1001 can be started when an interface is added (hotplug/udev/etc. scripts).
1002 wpa_priv can control multiple interface with one process, but it is
1003 also possible to run multiple wpa_priv processes at the same time, if
1004 desired.
1005
README-P2P
1 wpa_supplicant and Wi-Fi P2P
2 ============================
3
4 This document describes how the Wi-Fi P2P implementation in
5 wpa_supplicant can be configured and how an external component on the
6 client (e.g., management GUI) is used to enable WPS enrollment and
7 registrar registration.
8
9
10 Introduction to Wi-Fi P2P
11 -------------------------
12
13 TODO
14
15 More information about Wi-Fi P2P is available from Wi-Fi Alliance:
16 http://www.wi-fi.org/Wi-Fi_Direct.php
17
18
19 wpa_supplicant implementation
20 -----------------------------
21
22 TODO
23
24
25 wpa_supplicant configuration
26 ----------------------------
27
28 Wi-Fi P2P is an optional component that needs to be enabled in the
29 wpa_supplicant build configuration (.config). Here is an example
30 configuration that includes Wi-Fi P2P support and Linux nl80211
31 -based driver interface:
32
33 CONFIG_DRIVER_NL80211=y
34 CONFIG_CTRL_IFACE=y
35 CONFIG_P2P=y
36 CONFIG_AP=y
37 CONFIG_WPS=y
38
39
40 In run-time configuration file (wpa_supplicant.conf), some parameters
41 for P2P may be set. In order to make the devices easier to recognize,
42 device_name and device_type should be specified. For example,
43 something like this should be included:
44
45 ctrl_interface=/var/run/wpa_supplicant
46 device_name=My P2P Device
47 device_type=1-0050F204-1
48
49
50 wpa_cli
51 -------
52
53 Actual Wi-Fi P2P operations are requested during runtime. These can be
54 done for example using wpa_cli (which is described below) or a GUI
55 like wpa_gui-qt4.
56
57
58 wpa_cli starts in interactive mode if no command string is included on
59 the command line. By default, it will select the first network interface
60 that it can find (and that wpa_supplicant controls). If more than one
61 interface is in use, it may be necessary to select one of the explicitly
62 by adding -i argument on the command line (e.g., 'wpa_cli -i wlan1').
63
64 Most of the P2P operations are done on the main interface (e.g., the
65 interface that is automatically added when the driver is loaded, e.g.,
66 wlan0). When using a separate virtual interface for group operations
67 (e.g., wlan1), the control interface for that group interface may need
68 to be used for some operations (mainly WPS activation in GO). This may
69 change in the future so that all the needed operations could be done
70 over the main control interface.
71
72 Device Discovery
73
74 p2p_find [timeout in seconds] [type=<social|progressive>]
75
76 The default behavior is to run a single full scan in the beginning and
77 then scan only social channels. type=social will scan only social
78 channels, i.e., it skips the initial full scan. type=progressive is
79 like the default behavior, but it will scan through all the channels
80 progressively one channel at the time in the Search state rounds. This
81 will help in finding new groups or groups missed during the initial
82 full scan.
83
84 p2p_listen [timeout in seconds]
85
86 Start Listen-only state (become discoverable without searching for
87 other devices). Optional parameter can be used to specify the duration
88 for the Listen operation in seconds. This command may not be of that
89 much use during normal operations and is mainly designed for
90 testing. It can also be used to keep the device discoverable without
91 having to maintain a group.
92
93 p2p_stop_find
94
95 Stop ongoing P2P device discovery or other operation (connect, listen
96 mode).
97
98 p2p_flush
99
100 Flush P2P peer table and state.
101
102 Group Formation
103
104 p2p_prov_disc <peer device address> <display|keypad|pbc>
105
106 Send P2P provision discovery request to the specified peer. The
107 parameters for this command are the P2P device address of the peer and
108 the desired configuration method. For example, "p2p_prov_disc
109 02:01:02:03:04:05 display" would request the peer to display a PIN for
110 us and "p2p_prov_disc 02:01:02:03:04:05 keypad" would request the peer
111 to enter a PIN that we display.
112
113 p2p_connect <peer device address> <pbc|pin|PIN#> [label|display|keypad]
114 [persistent] [join|auth] [go_intent=<0..15>] [freq=<in MHz>]
115
116 Start P2P group formation with a discovered P2P peer. This includes
117 optional group owner negotiation, group interface setup, provisioning,
118 and establishing data connection.
119
120 The <pbc|pin|PIN#> parameter specifies the WPS provisioning
121 method. "pbc" string starts pushbutton method, "pin" string start PIN
122 method using an automatically generated PIN (which will be returned as
123 the command return code), PIN# means that a pre-selected PIN can be
124 used (e.g., 12345670). [label|display|keypad] is used with PIN method
125 to specify which PIN is used (label=PIN from local label,
126 display=dynamically generated random PIN from local display,
127 keypad=PIN entered from peer device label or display). "persistent"
128 parameter 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
131 client. It skips the GO Negotiation part. This will send a Provision
132 Discovery Request message to the target GO before associating for WPS
133 provisioning.
134
135 "auth" indicates that the WPS parameters are authorized for the peer
136 device without actually starting GO Negotiation (i.e., the peer is
137 expected to initiate GO Negotiation). This is mainly for testing
138 purposes.
139
140 "go_intent" can be used to override the default GO Intent for this GO
141 Negotiation.
142
143 "freq" can be used to set a forced operating channel (e.g., freq=2412
144 to select 2.4 GHz channel 1).
145
146 p2p_group_add [persistent|persistent=<network id>] [freq=<freq in MHz>]
147
148 Set up a P2P group owner manually (i.e., without group owner
149 negotiation with a specific peer). This is also known as autonomous
150 GO. Optional persistent=<network id> can be used to specify restart of
151 a persistent group. Optional freq=<freq in MHz> can be used to force
152 the GO to be started on a specific frequency. Special freq=2 or freq=5
153 options can be used to request the best 2.4 GHz or 5 GHz band channel
154 to be selected automatically.
155
156 p2p_reject <peer device address>
157
158 Reject connection attempt from a peer (specified with a device
159 address). This is a mechanism to reject a pending GO Negotiation with
160 a peer and request to automatically block any further connection or
161 discovery of the peer.
162
163 p2p_group_remove <group interface>
164
165 Terminate a P2P group. If a new virtual network interface was used for
166 the group, it will also be removed. The network interface name of the
167 group interface is used as a parameter for this command.
168
169 p2p_cancel
170
171 Cancel an ongoing P2P group formation related operation.
172
173 Service Discovery
174
175 p2p_serv_disc_req
176
177 Schedule a P2P service discovery request. The parameters for this
178 command are the device address of the peer device (or 00:00:00:00:00:00
179 for wildcard query that is sent to every discovered P2P peer that
180 supports service discovery) and P2P Service Query TLV(s) as hexdump. For
181 example,
182
183 p2p_serv_disc_req 00:00:00:00:00:00 02000001
184
185 schedules a request for listing all available services of all service
186 discovery protocols and requests this to be sent to all discovered
187 peers (note: this can result in long response frames). The pending
188 requests are sent during device discovery (see p2p_find).
189
190 Only a single pending wildcard query is supported, but there can be
191 multiple pending peer device specific queries (each will be sent in
192 sequence whenever the peer is found).
193
194 This command returns an identifier for the pending query (e.g.,
195 "1f77628") that can be used to cancel the request. Directed requests
196 will be automatically removed when the specified peer has replied to
197 it.
198
199 For UPnP, an alternative command format can be used to specify a
200 single query TLV (i.e., a service discovery for a specific UPnP
201 service):
202
203 p2p_serv_disc_req 00:00:00:00:00:00 upnp <version hex> <ST: from M-SEARCH>
204
205 For example:
206
207 p2p_serv_disc_req 00:00:00:00:00:00 upnp 10 urn:schemas-upnp-org:device:InternetGatewayDevice:1
208
209 Additional examples for queries:
210
211 # list of all Bonjour services
212 p2p_serv_disc_req 00:00:00:00:00:00 02000101
213
214 # list of all UPnP services
215 p2p_serv_disc_req 00:00:00:00:00:00 02000201
216
217 # list of all WS-Discovery services
218 p2p_serv_disc_req 00:00:00:00:00:00 02000301
219
220 # list of all Bonjour and UPnP services
221 p2p_serv_disc_req 00:00:00:00:00:00 0200010102000202
222
223 # Apple File Sharing over TCP
224 p2p_serv_disc_req 00:00:00:00:00:00 130001010b5f6166706f766572746370c00c000c01
225
226 # Bonjour SSTH (supported service type hash)
227 p2p_serv_disc_req 00:00:00:00:00:00 05000101000000
228
229 # UPnP examples
230 p2p_serv_disc_req 00:00:00:00:00:00 upnp 10 ssdp:all
231 p2p_serv_disc_req 00:00:00:00:00:00 upnp 10 upnp:rootdevice
232 p2p_serv_disc_req 00:00:00:00:00:00 upnp 10 urn:schemas-upnp-org:service:ContentDirectory:2
233 p2p_serv_disc_req 00:00:00:00:00:00 upnp 10 uuid:6859dede-8574-59ab-9332-123456789012
234 p2p_serv_disc_req 00:00:00:00:00:00 upnp 10 urn:schemas-upnp-org:device:InternetGatewayDevice:1
235
236 p2p_serv_disc_cancel_req <query identifier>
237
238 Cancel a pending P2P service discovery request. This command takes a
239 single parameter: identifier for the pending query (the value returned
240 by p2p_serv_disc_req, e.g., "p2p_serv_disc_cancel_req 1f77628".
241
242 p2p_serv_disc_resp
243
244 Reply to a service discovery query. This command takes following
245 parameters: frequency in MHz, destination address, dialog token,
246 response TLV(s). The first three parameters are copied from the
247 request event. For example, "p2p_serv_disc_resp 2437 02:40:61:c2:f3:b7
248 1 0300000101". This command is used only if external program is used
249 to process the request (see p2p_serv_disc_external).
250
251 p2p_service_update
252
253 Indicate that local services have changed. This is used to increment
254 the P2P service indicator value so that peers know when previously
255 cached information may have changed. This is only needed when external
256 service discovery processing is enabled since the commands to
257 pre-configure services for internal processing will increment the
258 indicator automatically.
259
260 p2p_serv_disc_external <0|1>
261
262 Configure external processing of P2P service requests: 0 (default) =
263 no external processing of requests (i.e., internal code will process
264 each request based on pre-configured services), 1 = external
265 processing of requests (external program is responsible for replying
266 to service discovery requests with p2p_serv_disc_resp). Please note
267 that there is quite strict limit on how quickly the response needs to
268 be transmitted, so use of the internal processing is strongly
269 recommended.
270
271 p2p_service_add bonjour <query hexdump> <RDATA hexdump>
272
273 Add a local Bonjour service for internal SD query processing.
274
275 Examples:
276
277 # AFP Over TCP (PTR)
278 p2p_service_add bonjour 0b5f6166706f766572746370c00c000c01 074578616d706c65c027
279 # AFP Over TCP (TXT) (RDATA=null)
280 p2p_service_add bonjour 076578616d706c650b5f6166706f766572746370c00c001001 00
281
282 # IP Printing over TCP (PTR) (RDATA=MyPrinter._ipp._tcp.local.)
283 p2p_service_add bonjour 045f697070c00c000c01 094d795072696e746572c027
284 # IP Printing over TCP (TXT) (RDATA=txtvers=1,pdl=application/postscript)
285 p2p_service_add bonjour 096d797072696e746572045f697070c00c001001 09747874766572733d311a70646c3d6170706c69636174696f6e2f706f7374736372797074
286
287 # Supported Service Type Hash (SSTH)
288 p2p_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
291 p2p_service_del bonjour <query hexdump>
292
293 Remove a local Bonjour service from internal SD query processing.
294
295 p2p_service_add upnp <version hex> <service>
296
297 Add a local UPnP service for internal SD query processing.
298
299 Examples:
300
301 p2p_service_add upnp 10 uuid:6859dede-8574-59ab-9332-123456789012::upnp:rootdevice
302 p2p_service_add upnp 10 uuid:5566d33e-9774-09ab-4822-333456785632::upnp:rootdevice
303 p2p_service_add upnp 10 uuid:1122de4e-8574-59ab-9322-333456789044::urn:schemas-upnp-org:service:ContentDirectory:2
304 p2p_service_add upnp 10 uuid:5566d33e-9774-09ab-4822-333456785632::urn:schemas-upnp-org:service:ContentDirectory:2
305 p2p_service_add upnp 10 uuid:6859dede-8574-59ab-9332-123456789012::urn:schemas-upnp-org:device:InternetGatewayDevice:1
306
307 p2p_service_del upnp <version hex> <service>
308
309 Remove a local UPnP service from internal SD query processing.
310
311 p2p_service_flush
312
313 Remove all local services from internal SD query processing.
314
315 Invitation
316
317 p2p_invite [persistent=<network id>|group=<group ifname>] [peer=address]
318 [go_dev_addr=address]
319
320 Invite a peer to join a group (e.g., group=wlan1) or to reinvoke a
321 persistent group (e.g., persistent=4). If the peer device is the GO of
322 the persisten group, the peer parameter is not needed. Otherwise it is
323 used to specify which device to invite. go_dev_addr parameter can be
324 used to override the GO device address for Invitation Request should
325 it be not known for some reason (this should not be needed in most
326 cases).
327
328 Group Operations
329
330 (These are used on the group interface.)
331
332 wps_pin <any|address> <PIN>
333
334 Start WPS PIN method. This allows a single WPS Enrollee to connect to
335 the AP/GO. This is used on the GO when a P2P client joins an existing
336 group. 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
338 the PIN for one-time-use). PIN is the Enrollee PIN read either from a
339 label or display on the P2P Client/WPS Enrollee.
340
341 wps_pbc
342
343 Start WPS PBC method (i.e., push the button). This allows a single WPS
344 Enrollee to connect to the AP/GO. This is used on the GO when a P2P
345 client joins an existing group.
346
347 p2p_get_passphrase
348
349 Get the passphrase for a group (only available when acting as a GO).
350
351 p2p_presence_req [<duration> <interval>] [<duration> <interval>]
352
353 Send a P2P Presence Request to the GO (this is only available when
354 acting as a P2P client). If no duration/interval pairs are given, the
355 request indicates that this client has no special needs for GO
356 presence. the first parameter pair gives the preferred duration and
357 interval values in microseconds. If the second pair is included, that
358 indicates which value would be acceptable.
359
360 Parameters
361
362 p2p_ext_listen [<period> <interval>]
363
364 Configure Extended Listen Timing. If the parameters are omitted, this
365 feature is disabled. If the parameters are included, Listen State will
366 be entered every interval msec for at least period msec. Both values
367 have acceptable range of 1-65535 (with interval obviously having to be
368 larger than or equal to duration). If the P2P module is not idle at
369 the time the Extended Listen Timing timeout occurs, the Listen State
370 operation will be skipped.
371
372 The configured values will also be advertised to other P2P Devices. The
373 received values are available in the p2p_peer command output:
374
375 ext_listen_period=100 ext_listen_interval=5000
376
377 p2p_set <field> <value>
378
379 Change dynamic P2P parameters
380
381 p2p_set discoverability <0/1>
382
383 Disable/enable advertisement of client discoverability. This is
384 enabled by default and this parameter is mainly used to allow testing
385 of device discoverability.
386
387 p2p_set managed <0/1>
388
389 Disable/enable managed P2P Device operations. This is disabled by
390 default.
391
392 p2p_set listen_channel <1/6/11>
393
394 Set P2P Listen channel. This is mainly meant for testing purposes and
395 changing the Listen channel during normal operations can result in
396 protocol failures.
397
398 p2p_set ssid_postfix <postfix>
399
400 Set postfix string to be added to the automatically generated P2P SSID
401 (DIRECT-<two random characters>). For example, postfix of "-testing"
402 could result in the SSID becoming DIRECT-ab-testing.
403
404 set <field> <value>
405
406 Set global configuration parameters which may also affect P2P
407 operations. The format on these parameters is same as is used in
408 wpa_supplicant.conf. Only the parameters listen here should be
409 changed. Modifying other parameters may result in incorrect behavior
410 since not all existing users of the parameters are updated.
411
412 set uuid <UUID>
413
414 Set WPS UUID (by default, this is generated based on the MAC address).
415
416 set device_name <device name>
417
418 Set WPS Device Name (also included in some P2P messages).
419
420 set manufacturer <manufacturer>
421
422 Set WPS Manufacturer.
423
424 set model_name <model name>
425
426 Set WPS Model Name.
427
428 set model_number <model number>
429
430 Set WPS Model Number.
431
432 set serial_number <serial number>
433
434 Set WPS Serial Number.
435
436 set device_type <device type>
437
438 Set WPS Device Type.
439
440 set os_version <OS version>
441
442 Set WPS OS Version.
443
444 set config_methods <config methods>
445
446 Set WPS Configuration Methods.
447
448 set sec_device_type <device type>
449
450 Add a new Secondary Device Type.
451
452 set p2p_go_intent <GO intent>
453
454 Set the default P2P GO Intent. Note: This value can be overridden in
455 p2p_connect command and as such, there should be no need to change the
456 default value here during normal operations.
457
458 set p2p_ssid_postfix <P2P SSID postfix>
459
460 Set P2P SSID postfix.
461
462 set persistent_reconnect <0/1>
463
464 Disable/enabled persistent reconnect for reinvocation of persistent
465 groups. If enabled, invitations to reinvoke a persistent group will be
466 accepted without separate authorization (e.g., user interaction).
467
468 set country <two character country code>
469
470 Set country code (this is included in some P2P messages).
471
472 Status
473
474 p2p_peers [discovered]
475
476 List P2P Device Addresses of all the P2P peers we know. The optional
477 "discovered" parameter filters out the peers that we have not fully
478 discovered, i.e., which we have only seen in a received Probe Request
479 frame.
480
481 p2p_peer <P2P Device Address>
482
483 Fetch information about a known P2P peer.
484
485 Group Status
486
487 (These are used on the group interface.)
488
489 status
490
491 Show status information (connection state, role, use encryption
492 parameters, IP address, etc.).
493
494 sta
495
496 Show information about an associated station (when acting in AP/GO role).
497
498 all_sta
499
500 Lists the currently associated stations.
501
502 Configuration data
503
504 list_networks
505
506 Lists the configured networks, including stored information for
507 persistent groups. The identifier in this list is used with
508 p2p_group_add and p2p_invite to indicate which persistent group is to
509 be reinvoked.
510
511 remove_network <network id>
512
513 Remove a network entry from configuration.
514
515
516 wpa_cli action script
517 ---------------------
518
519 See examples/p2p-action.sh
520
521 TODO: describe DHCP/DNS setup
522 TODO: cross-connection
523
README-Windows.txt
1 wpa_supplicant for Windows
2 ==========================
3
4 Copyright (c) 2003-2009, Jouni Malinen <j (a] w1.fi> and contributors
5 All Rights Reserved.
6
7 This program is dual-licensed under both the GPL version 2 and BSD
8 license. Either license may be used at your option.
9
10 This product includes software developed by the OpenSSL Project
11 for use in the OpenSSL Toolkit (http://www.openssl.org/). This
12 product includes cryptographic software written by Eric Young
13 (eay (a] cryptsoft.com).
14
15
16 wpa_supplicant has support for being used as a WPA/WPA2/IEEE 802.1X
17 Supplicant on Windows. The current port requires that WinPcap
18 (http://winpcap.polito.it/) is installed for accessing packets and the
19 driver interface. Both release versions 3.0 and 3.1 are supported.
20
21 The current port is still somewhat experimental. It has been tested
22 mainly on Windows XP (SP2) with limited set of NDIS drivers. In
23 addition, the current version has been reported to work with Windows
24 2000.
25
26 All security modes have been verified to work (at least complete
27 authentication 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
38 Binary version
39 --------------
40
41 Compiled binary version of the wpa_supplicant and additional tools is
42 available from http://w1.fi/wpa_supplicant/. These binaries can be
43 used after installing WinPcap.
44
45 wpa_gui uses Qt 4 framework and may need additional dynamic libraries
46 (DLLs). These libraries are available from
47 http://w1.fi/wpa_supplicant/qt4/wpa_gui-qt433-windows-dll.zip
48 You can copy the DLL files from this ZIP package into the same directory
49 with wpa_gui.exe to allow wpa_gui to be started.
50
51
52 Building wpa_supplicant with mingw
53 ----------------------------------
54
55 The default build setup for wpa_supplicant is to use MinGW and
56 cross-compiling from Linux to MinGW/Windows. It should also be
57 possible to build this under Windows using the MinGW tools, but that
58 is not tested nor supported and is likely to require some changes to
59 the Makefile unless cygwin is used.
60
61
62 Building wpa_supplicant with MSVC
63 ---------------------------------
64
65 wpa_supplicant can be built with Microsoft Visual C++ compiler. This
66 has been tested with Microsoft Visual C++ Toolkit 2003 and Visual
67 Studio 2005 using the included nmake.mak as a Makefile for nmake. IDE
68 can also be used by creating a project that includes the files and
69 defines mentioned in nmake.mak. Example VS2005 solution and project
70 files are included in vs2005 subdirectory. This can be used as a
71 starting point for building the programs with VS2005 IDE. Visual Studio
72 2008 Express Edition is also able to use these project files.
73
74 WinPcap development package is needed for the build and this can be
75 downloaded from http://www.winpcap.org/install/bin/WpdPack_4_0_2.zip. The
76 default nmake.mak expects this to be unpacked into C:\dev\WpdPack so
77 that Include and Lib directories are in this directory. The files can be
78 stored elsewhere as long as the WINPCAPDIR in nmake.mak is updated to
79 match with the selected directory. In case a project file in the IDE is
80 used, these Include and Lib directories need to be added to project
81 properties as additional include/library directories.
82
83 OpenSSL source package can be downloaded from
84 http://www.openssl.org/source/openssl-0.9.8i.tar.gz and built and
85 installed following instructions in INSTALL.W32. Note that if EAP-FAST
86 support will be included in the wpa_supplicant, OpenSSL needs to be
87 patched to# support it openssl-0.9.8i-tls-extensions.patch. The example
88 nmake.mak file expects OpenSSL to be installed into C:\dev\openssl, but
89 this directory can be modified by changing OPENSSLDIR variable in
90 nmake.mak.
91
92 If you do not need EAP-FAST support, you may also be able to use Win32
93 binary installation package of OpenSSL from
94 http://www.slproweb.com/products/Win32OpenSSL.html instead of building
95 the library yourself. In this case, you will need to copy Include and
96 Lib directories in suitable directory, e.g., C:\dev\openssl for the
97 default nmake.mak. Copy {Win32OpenSSLRoot}\include into
98 C:\dev\openssl\include and make C:\dev\openssl\lib subdirectory with
99 files from {Win32OpenSSLRoot}\VC (i.e., libeay*.lib and ssleay*.lib).
100 This will end up using dynamically linked OpenSSL (i.e., .dll files are
101 needed) for it. Alternative, you can copy files from
102 {Win32OpenSSLRoot}\VC\static to create a static build (no OpenSSL .dll
103 files needed).
104
105
106 Building wpa_supplicant for cygwin
107 ----------------------------------
108
109 wpa_supplicant can be built for cygwin by installing the needed
110 development packages for cygwin. This includes things like compiler,
111 make, openssl development package, etc. In addition, developer's pack
112 for WinPcap (WPdpack.zip) from
113 http://winpcap.polito.it/install/default.htm is needed.
114
115 .config file should enable only one driver interface,
116 CONFIG_DRIVER_NDIS. In addition, include directories may need to be
117 added to match the system. An example configuration is available in
118 defconfig. The library and include files for WinPcap will either need
119 to be installed in compiler/linker default directories or their
120 location will need to be adding to .config when building
121 wpa_supplicant.
122
123 Othen than this, the build should be more or less identical to Linux
124 version, i.e., just run make after having created .config file. An
125 additional tool, win_if_list.exe, can be built by running "make
126 win_if_list".
127
128
129 Building wpa_gui
130 ----------------
131
132 wpa_gui uses Qt application framework from Trolltech. It can be built
133 with the open source version of Qt4 and MinGW. Following commands can
134 be used to build the binary in the Qt 4 Command Prompt:
135
136 # go to the root directory of wpa_supplicant source code
137 cd wpa_gui-qt4
138 qmake -o Makefile wpa_gui.pro
139 make
140 # the wpa_gui.exe binary is created into 'release' subdirectory
141
142
143 Using wpa_supplicant for Windows
144 --------------------------------
145
146 wpa_supplicant, wpa_cli, and wpa_gui behave more or less identically to
147 Linux version, so instructions in README and example wpa_supplicant.conf
148 should be applicable for most parts. In addition, there is another
149 version of wpa_supplicant, wpasvc.exe, which can be used as a Windows
150 service and which reads its configuration from registry instead of
151 text file.
152
153 When using access points in "hidden SSID" mode, ap_scan=2 mode need to
154 be used (see wpa_supplicant.conf for more information).
155
156 Windows NDIS/WinPcap uses quite long interface names, so some care
157 will be needed when starting wpa_supplicant. Alternatively, the
158 adapter description can be used as the interface name which may be
159 easier since it is usually in more human-readable
160 format. win_if_list.exe can be used to find out the proper interface
161 name.
162
163 Example steps in starting up wpa_supplicant:
164
165 # win_if_list.exe
166 ifname: \Device\NPF_GenericNdisWanAdapter
167 description: Generic NdisWan adapter
168
169 ifname: \Device\NPF_{769E012B-FD17-4935-A5E3-8090C38E25D2}
170 description: Atheros Wireless Network Adapter (Microsoft's Packet Scheduler)
171
172 ifname: \Device\NPF_{732546E7-E26C-48E3-9871-7537B020A211}
173 description: Intel 8255x-based Integrated Fast Ethernet (Microsoft's Packet Scheduler)
174
175
176 Since the example configuration used Atheros WLAN card, the middle one
177 is the correct interface in this case. The interface name for -i
178 command line option is the full string following "ifname:" (the
179 "\Device\NPF_" prefix can be removed). In other words, wpa_supplicant
180 would 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
185 needed). It can be left out if debugging information is not needed.
186
187 With the alternative mechanism for selecting the interface, this
188 command has identical results in this case:
189
190 # wpa_supplicant.exe -iAtheros -c wpa_supplicant.conf -d
191
192
193 Simple configuration example for WPA-PSK:
194
195 #ap_scan=2
196 ctrl_interface=
197 network={
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
206 wpa_supplicant tries to associate with the SSID without doing
207 scanning; this allows APs with hidden SSIDs to be used)
208
209
210 wpa_cli.exe and wpa_gui.exe can be used to interact with the
211 wpa_supplicant.exe program in the same way as with Linux. Note that
212 ctrl_interface is using UNIX domain sockets when built for cygwin, but
213 the native build for Windows uses named pipes and the contents of the
214 ctrl_interface configuration item is used to control access to the
215 interface. Anyway, this variable has to be included in the configuration
216 to enable the control interface.
217
218
219 Example SDDL string formats:
220
221 (local admins group has permission, but nobody else):
222
223 ctrl_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
227 are for flags and object GUIDs, none of which should be required in this
228 case.)
229
230 (local admins and the local "power users" group have permissions,
231 but nobody else):
232
233 ctrl_interface=SDDL=D:(A;;GA;;;BA)(A;;GA;;;PU)
234
235 (One ACCESS_ALLOWED ACE for GENERIC_ALL for builtin administrators, and
236 one ACCESS_ALLOWED ACE for GENERIC_ALL for power users.)
237
238 (close to wide open, but you have to be a valid user on
239 the machine):
240
241 ctrl_interface=SDDL=D:(A;;GA;;;AU)
242
243 (One ACCESS_ALLOWED ACE for GENERIC_ALL for the "authenticated users"
244 group.)
245
246 This one would allow absolutely everyone (including anonymous
247 users) -- this is *not* recommended, since named pipes can be attached
248 to from anywhere on the network (i.e. there's no "this machine only"
249 like there is with 127.0.0.1 sockets):
250
251 ctrl_interface=SDDL=D:(A;;GA;;;BU)(A;;GA;;;AN)
252
253 (BU == "builtin users", "AN" == "anonymous")
254
255 See also [1] for the format of ACEs, and [2] for the possible strings
256 that can be used for principal names.
257
258 [1]
259 http://msdn.microsoft.com/library/default.asp?url=/library/en-us/secauthz/security/ace_strings.asp
260 [2]
261 http://msdn.microsoft.com/library/default.asp?url=/library/en-us/secauthz/security/sid_strings.asp
262
263
264 Starting wpa_supplicant as a Windows service (wpasvc.exe)
265 ---------------------------------------------------------
266
267 wpa_supplicant can be started as a Windows service by using wpasvc.exe
268 program that is alternative build of wpa_supplicant.exe. Most of the
269 core functionality of wpasvc.exe is identical to wpa_supplicant.exe,
270 but it is using Windows registry for configuration information instead
271 of a text file and command line parameters. In addition, it can be
272 registered as a service that can be started automatically or manually
273 like any other Windows service.
274
275 The root of wpa_supplicant configuration in registry is
276 HKEY_LOCAL_MACHINE\SOFTWARE\wpa_supplicant. This level includes global
277 parameters 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
281 This program can be run either as a normal command line application,
282 e.g., for debugging, with 'wpasvc.exe app' or as a Windows service.
283 Service need to be registered with 'wpasvc.exe reg <full path to
284 wpasvc.exe>'. Alternatively, 'wpasvc.exe reg' can be used to register
285 the service with the current location of wpasvc.exe. After this, wpasvc
286 can be started like any other Windows service (e.g., 'net start wpasvc')
287 or it can be configured to start automatically through the Services tool
288 in administrative tasks. The service can be unregistered with
289 'wpasvc.exe unreg'.
290
291 If the service is set to start during system bootup to make the
292 network connection available before any user has logged in, there may
293 be a long (half a minute or so) delay in starting up wpa_supplicant
294 due to WinPcap needing a driver called "Network Monitor Driver" which
295 is started by default on demand.
296
297 To speed up wpa_supplicant start during system bootup, "Network
298 Monitor Driver" can be configured to be started sooner by setting its
299 startup type to System instead of the default Demand. To do this, open
300 up Device Manager, select Show Hidden Devices, expand the "Non
301 Plug-and-Play devices" branch, double click "Network Monitor Driver",
302 go to the Driver tab, and change the Demand setting to System instead.
303
304 Configuration data is in HKEY_LOCAL_MACHINE\SOFTWARE\wpa_supplicant\configs
305 key. Each configuration profile has its own key under this. In terms of text
306 files, each profile would map to a separate text file with possibly multiple
307 networks. Under each profile, there is a networks key that lists all
308 networks as a subkey. Each network has set of values in the same way as
309 network block in the configuration file. In addition, blobs subkey has
310 possible blobs as values.
311
312 HKEY_LOCAL_MACHINE\SOFTWARE\wpa_supplicant\configs\test\networks\0000
313 ssid="example"
314 key_mgmt=WPA-PSK
315
316 See win_example.reg for an example on how to setup wpasvc.exe
317 parameters in registry. It can also be imported to registry as a
318 starting point for the configuration.
319
320
321
322 License 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 (a] 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 (a] cryptsoft.com). This product includes software written by Tim
377 * Hudson (tjh (a] cryptsoft.com).
378 *
379 */
380
381 Original SSLeay License
382 -----------------------
383
384 /* Copyright (C) 1995-1998 Eric Young (eay (a] cryptsoft.com)
385 * All rights reserved.
386 *
387 * This package is an SSL implementation written
388 * by Eric Young (eay (a] 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 (a] 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 (a] 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 (a] 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
446 The Qt GUI Toolkit is Copyright (C) 1994-2007 Trolltech ASA.
447 Qt Open Source Edition is licensed under GPL version 2.
448
449 Source code for the library is available at
450 http://w1.fi/wpa_supplicant/qt4/qt-win-opensource-src-4.3.3.zip
451
README-WPS
1 wpa_supplicant and Wi-Fi Protected Setup (WPS)
2 ==============================================
3
4 This document describes how the WPS implementation in wpa_supplicant
5 can be configured and how an external component on the client (e.g.,
6 management GUI) is used to enable WPS enrollment and registrar
7 registration.
8
9
10 Introduction to WPS
11 -------------------
12
13 Wi-Fi Protected Setup (WPS) is a mechanism for easy configuration of a
14 wireless network. It allows automated generation of random keys (WPA
15 passphrase/PSK) and configuration of an access point and client
16 devices. WPS includes number of methods for setting up connections
17 with PIN method and push-button configuration (PBC) being the most
18 commonly deployed options.
19
20 While WPS can enable more home networks to use encryption in the
21 wireless network, it should be noted that the use of the PIN and
22 especially PBC mechanisms for authenticating the initial key setup is
23 not very secure. As such, use of WPS may not be suitable for
24 environments that require secure network access without chance for
25 allowing outsiders to gain access during the setup phase.
26
27 WPS uses following terms to describe the entities participating in the
28 network 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
36 It should also be noted that the AP and a client device may change
37 roles (i.e., AP acts as an Enrollee and client device as a Registrar)
38 when WPS is used to configure the access point.
39
40
41 More information about WPS is available from Wi-Fi Alliance:
42 http://www.wi-fi.org/wifi-protected-setup
43
44
45 wpa_supplicant implementation
46 -----------------------------
47
48 wpa_supplicant includes an optional WPS component that can be used as
49 an Enrollee to enroll new network credential or as a Registrar to
50 configure an AP.
51
52
53 wpa_supplicant configuration
54 ----------------------------
55
56 WPS is an optional component that needs to be enabled in
57 wpa_supplicant build configuration (.config). Here is an example
58 configuration that includes WPS support and Linux nl80211 -based
59 driver interface:
60
61 CONFIG_DRIVER_NL80211=y
62 CONFIG_WPS=y
63 CONFIG_WPS2=y
64
65 If you want to enable WPS external registrar (ER) functionality, you
66 will also need to add following line:
67
68 CONFIG_WPS_ER=y
69
70
71 WPS needs the Universally Unique IDentifier (UUID; see RFC 4122) for
72 the device. This is configured in the runtime configuration for
73 wpa_supplicant (if not set, UUID will be generated based on local MAC
74 address):
75
76 # example UUID for WPS
77 uuid=12345678-9abc-def0-1234-56789abcdef0
78
79 The network configuration blocks needed for WPS are added
80 automatically based on control interface commands, so they do not need
81 to be added explicitly in the configuration file.
82
83 WPS registration will generate new network blocks for the acquired
84 credentials. If these are to be stored for future use (after
85 restarting wpa_supplicant), wpa_supplicant will need to be configured
86 to allow configuration file updates:
87
88 update_config=1
89
90
91
92 External operations
93 -------------------
94
95 WPS requires either a device PIN code (usually, 8-digit number) or a
96 pushbutton event (for PBC) to allow a new WPS Enrollee to join the
97 network. wpa_supplicant uses the control interface as an input channel
98 for these events.
99
100 The PIN value used in the commands must be processed by an UI to
101 remove non-digit characters and potentially, to verify the checksum
102 digit. "wpa_cli wps_check_pin <PIN>" can be used to do such processing.
103 It returns FAIL if the PIN is invalid, or FAIL-CHECKSUM if the checksum
104 digit is incorrect, or the processed PIN (non-digit characters removed)
105 if the PIN is valid.
106
107 If the client device has a display, a random PIN has to be generated
108 for each WPS registration session. wpa_supplicant can do this with a
109 control interface request, e.g., by calling wpa_cli:
110
111 wpa_cli wps_pin any
112
113 This will return the generated 8-digit PIN which will then need to be
114 entered at the Registrar to complete WPS registration. At that point,
115 the client will be enrolled with credentials needed to connect to the
116 AP to access the network.
117
118
119 If the client device does not have a display that could show the
120 random PIN, a hardcoded PIN that is printed on a label can be
121 used. wpa_supplicant is notified this with a control interface
122 request, e.g., by calling wpa_cli:
123
124 wpa_cli wps_pin any 12345670
125
126 This starts the WPS negotiation in the same way as above with the
127 generated PIN.
128
129
130 If the client design wants to support optional WPS PBC mode, this can
131 be enabled by either a physical button in the client device or a
132 virtual button in the user interface. The PBC operation requires that
133 a button is also pressed at the AP/Registrar at about the same time (2
134 minute window). wpa_supplicant is notified of the local button event
135 over the control interface, e.g., by calling wpa_cli:
136
137 wpa_cli wps_pbc
138
139 At this point, the AP/Registrar has two minutes to complete WPS
140 negotiation which will generate a new WPA PSK in the same way as the
141 PIN method described above.
142
143
144 If the client wants to operate in the Registrar role to learn the
145 current AP configuration and optionally, to configure an AP,
146 wpa_supplicant is notified over the control interface, e.g., with
147 wpa_cli:
148
149 wpa_cli wps_reg <AP BSSID> <AP PIN>
150 (example: wpa_cli wps_reg 02:34:56:78:9a:bc 12345670)
151
152 This is used to fetch the current AP settings instead of actually
153 changing them. The main difference with the wps_pin command is that
154 wps_reg uses the AP PIN (e.g., from a label on the AP) instead of a
155 PIN generated at the client.
156
157 In order to change the AP configuration, the new configuration
158 parameters are given to the wps_reg command:
159
160 wpa_cli wps_reg <AP BSSID> <AP PIN> <new SSID> <auth> <encr> <new key>
161 examples:
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
169 Scanning
170 --------
171
172 Scan results ('wpa_cli scan_results' or 'wpa_cli bss <idx>') include a
173 flags field that is used to indicate whether the BSS support WPS. If
174 the AP support WPS, but has not recently activated a Registrar, [WPS]
175 flag will be included. If PIN method has been recently selected,
176 [WPS-PIN] is shown instead. Similarly, [WPS-PBC] is shown if PBC mode
177 is in progress. GUI programs can use these as triggers for suggesting
178 a guided WPS configuration to the user. In addition, control interface
179 monitor events WPS-AP-AVAILABLE{,-PBC,-PIN} can be used to find out if
180 there are WPS enabled APs in scan results without having to go through
181 all the details in the GUI. These notification could be used, e.g., to
182 suggest possible WPS connection to the user.
183
184
185 wpa_gui
186 -------
187
188 wpa_gui-qt4 directory contains a sample GUI that shows an example of
189 how WPS support can be integrated into the GUI. Its main window has a
190 WPS tab that guides user through WPS registration with automatic AP
191 selection. In addition, it shows how WPS can be started manually by
192 selecting an AP from scan results.
193
194
195 Credential processing
196 ---------------------
197
198 By default, wpa_supplicant processes received credentials and updates
199 its configuration internally. However, it is possible to
200 control these operations from external programs, if desired.
201
202 This internal processing can be disabled with wps_cred_processing=1
203 option. When this is used, an external program is responsible for
204 processing the credential attributes and updating wpa_supplicant
205 configuration based on them.
206
207 Following control interface messages are sent out for external programs:
208
209 WPS-CRED-RECEIVED <hexdump of Credential attribute(s)>
210 For example:
211 <2>WPS-CRED-RECEIVED 100e006f10260001011045000c6a6b6d2d7770732d74657374100300020020100f000200081027004030653462303435366332363666653064333961643135353461316634626637313234333761636664623766333939653534663166316230323061643434386235102000060266a0ee1727
212
213
214 wpa_supplicant as WPS External Registrar (ER)
215 ---------------------------------------------
216
217 wpa_supplicant can be used as a WPS ER to configure an AP or enroll
218 new Enrollee to join the network. This functionality uses UPnP and
219 requires that a working IP connectivity is available with the AP (this
220 can be either over a wired or wireless connection).
221
222 Separate wpa_supplicant process can be started for WPS ER
223 operations. A special "none" driver can be used in such a case to
224 indicate that no local network interface is actually controlled. For
225 example, following command could be used to start the ER:
226
227 wpa_supplicant -Dnone -c er.conf -ieth0
228
229 Sample er.conf:
230
231 ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=admin
232 device_name=WPS External Registrar
233
234
235 wpa_cli commands for ER functionality:
236
237 wps_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
244 wps_er_stop
245 - stop WPS ER functionality
246
247 wps_er_learn <UUID> <AP PIN>
248 - learn AP configuration
249
250 wps_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
256 wps_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
265 wps_er_pbc <Enrollee UUID>
266 - accept an Enrollee PBC using External Registrar
267
268 wps_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
275 WPS ER events:
276
277 WPS_EVENT_ER_AP_ADD
278 - WPS ER discovered an AP
279
280 WPS-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
282 WPS_EVENT_ER_AP_REMOVE
283 - WPS ER removed an AP entry
284
285 WPS-ER-AP-REMOVE 87654321-9abc-def0-1234-56789abc0002
286
287 WPS_EVENT_ER_ENROLLEE_ADD
288 - WPS ER discovered a new Enrollee
289
290 WPS-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
292 WPS_EVENT_ER_ENROLLEE_REMOVE
293 - WPS ER removed an Enrollee entry
294
295 WPS-ER-ENROLLEE-REMOVE 2b7093f1-d6fb-5108-adbb-bea66bb87333 02:66:a0:ee:17:27
296
297 WPS-ER-AP-SETTINGS
298 - WPS ER learned AP settings
299
300 WPS-ER-AP-SETTINGS uuid=fd91b4ec-e3fa-5891-a57d-8c59efeed1d2 ssid=test-wps auth_type=0x0020 encr_type=0x0008 key=12345678
301