139beb93cSSam Lefflerwpa_supplicant and Wi-Fi Protected Setup (WPS) 239beb93cSSam Leffler============================================== 339beb93cSSam Leffler 439beb93cSSam LefflerThis document describes how the WPS implementation in wpa_supplicant 539beb93cSSam Lefflercan be configured and how an external component on the client (e.g., 639beb93cSSam Lefflermanagement GUI) is used to enable WPS enrollment and registrar 739beb93cSSam Lefflerregistration. 839beb93cSSam Leffler 939beb93cSSam Leffler 1039beb93cSSam LefflerIntroduction to WPS 1139beb93cSSam Leffler------------------- 1239beb93cSSam Leffler 1339beb93cSSam LefflerWi-Fi Protected Setup (WPS) is a mechanism for easy configuration of a 1439beb93cSSam Lefflerwireless network. It allows automated generation of random keys (WPA 1539beb93cSSam Lefflerpassphrase/PSK) and configuration of an access point and client 1639beb93cSSam Lefflerdevices. WPS includes number of methods for setting up connections 1739beb93cSSam Lefflerwith PIN method and push-button configuration (PBC) being the most 1839beb93cSSam Lefflercommonly deployed options. 1939beb93cSSam Leffler 2039beb93cSSam LefflerWhile WPS can enable more home networks to use encryption in the 2139beb93cSSam Lefflerwireless network, it should be noted that the use of the PIN and 2239beb93cSSam Lefflerespecially PBC mechanisms for authenticating the initial key setup is 2339beb93cSSam Lefflernot very secure. As such, use of WPS may not be suitable for 2439beb93cSSam Lefflerenvironments that require secure network access without chance for 2539beb93cSSam Lefflerallowing outsiders to gain access during the setup phase. 2639beb93cSSam Leffler 27*a90b9d01SCy SchubertWPS uses the following terms to describe the entities participating 28*a90b9d01SCy Schubertin the network setup: 2939beb93cSSam Leffler- access point: the WLAN access point 3039beb93cSSam Leffler- Registrar: a device that control a network and can authorize 3139beb93cSSam Leffler addition of new devices); this may be either in the AP ("internal 3239beb93cSSam Leffler Registrar") or in an external device, e.g., a laptop, ("external 3339beb93cSSam Leffler Registrar") 3439beb93cSSam Leffler- Enrollee: a device that is being authorized to use the network 3539beb93cSSam Leffler 3639beb93cSSam LefflerIt should also be noted that the AP and a client device may change 3739beb93cSSam Lefflerroles (i.e., AP acts as an Enrollee and client device as a Registrar) 3839beb93cSSam Lefflerwhen WPS is used to configure the access point. 3939beb93cSSam Leffler 4039beb93cSSam Leffler 4139beb93cSSam LefflerMore information about WPS is available from Wi-Fi Alliance: 4239beb93cSSam Lefflerhttp://www.wi-fi.org/wifi-protected-setup 4339beb93cSSam Leffler 4439beb93cSSam Leffler 4539beb93cSSam Lefflerwpa_supplicant implementation 4639beb93cSSam Leffler----------------------------- 4739beb93cSSam Leffler 4839beb93cSSam Lefflerwpa_supplicant includes an optional WPS component that can be used as 4939beb93cSSam Leffleran Enrollee to enroll new network credential or as a Registrar to 50f05cddf9SRui Pauloconfigure an AP. 5139beb93cSSam Leffler 5239beb93cSSam Leffler 5339beb93cSSam Lefflerwpa_supplicant configuration 5439beb93cSSam Leffler---------------------------- 5539beb93cSSam Leffler 5639beb93cSSam LefflerWPS is an optional component that needs to be enabled in 5739beb93cSSam Lefflerwpa_supplicant build configuration (.config). Here is an example 58f05cddf9SRui Pauloconfiguration that includes WPS support and Linux nl80211-based 59f05cddf9SRui Paulodriver interface: 6039beb93cSSam Leffler 61f05cddf9SRui PauloCONFIG_DRIVER_NL80211=y 6239beb93cSSam LefflerCONFIG_WPS=y 63f05cddf9SRui Paulo 64f05cddf9SRui PauloIf you want to enable WPS external registrar (ER) functionality, you 65*a90b9d01SCy Schubertwill also need to add the following line: 66f05cddf9SRui Paulo 67f05cddf9SRui PauloCONFIG_WPS_ER=y 68f05cddf9SRui Paulo 69*a90b9d01SCy SchubertThe following parameter can be used to enable support for NFC config 70*a90b9d01SCy Schubertmethod: 71f05cddf9SRui Paulo 72f05cddf9SRui PauloCONFIG_WPS_NFC=y 7339beb93cSSam Leffler 7439beb93cSSam LefflerWPS needs the Universally Unique IDentifier (UUID; see RFC 4122) for 7539beb93cSSam Lefflerthe device. This is configured in the runtime configuration for 7639beb93cSSam Lefflerwpa_supplicant (if not set, UUID will be generated based on local MAC 7739beb93cSSam Leffleraddress): 7839beb93cSSam Leffler 7939beb93cSSam Leffler# example UUID for WPS 8039beb93cSSam Leffleruuid=12345678-9abc-def0-1234-56789abcdef0 8139beb93cSSam Leffler 8239beb93cSSam LefflerThe network configuration blocks needed for WPS are added 8339beb93cSSam Lefflerautomatically based on control interface commands, so they do not need 8439beb93cSSam Lefflerto be added explicitly in the configuration file. 8539beb93cSSam Leffler 8639beb93cSSam LefflerWPS registration will generate new network blocks for the acquired 8739beb93cSSam Lefflercredentials. If these are to be stored for future use (after 8839beb93cSSam Lefflerrestarting wpa_supplicant), wpa_supplicant will need to be configured 8939beb93cSSam Lefflerto allow configuration file updates: 9039beb93cSSam Leffler 9139beb93cSSam Lefflerupdate_config=1 9239beb93cSSam Leffler 9339beb93cSSam Leffler 9439beb93cSSam LefflerExternal operations 9539beb93cSSam Leffler------------------- 9639beb93cSSam Leffler 9739beb93cSSam LefflerWPS requires either a device PIN code (usually, 8-digit number) or a 9839beb93cSSam Lefflerpushbutton event (for PBC) to allow a new WPS Enrollee to join the 9939beb93cSSam Lefflernetwork. wpa_supplicant uses the control interface as an input channel 10039beb93cSSam Lefflerfor these events. 10139beb93cSSam Leffler 102f05cddf9SRui PauloThe PIN value used in the commands must be processed by an UI to 103f05cddf9SRui Pauloremove non-digit characters and potentially, to verify the checksum 104f05cddf9SRui Paulodigit. "wpa_cli wps_check_pin <PIN>" can be used to do such processing. 105f05cddf9SRui PauloIt returns FAIL if the PIN is invalid, or FAIL-CHECKSUM if the checksum 106f05cddf9SRui Paulodigit is incorrect, or the processed PIN (non-digit characters removed) 107f05cddf9SRui Pauloif the PIN is valid. 108f05cddf9SRui Paulo 10939beb93cSSam LefflerIf the client device has a display, a random PIN has to be generated 11039beb93cSSam Lefflerfor each WPS registration session. wpa_supplicant can do this with a 11139beb93cSSam Lefflercontrol interface request, e.g., by calling wpa_cli: 11239beb93cSSam Leffler 11339beb93cSSam Lefflerwpa_cli wps_pin any 11439beb93cSSam Leffler 11539beb93cSSam LefflerThis will return the generated 8-digit PIN which will then need to be 11639beb93cSSam Lefflerentered at the Registrar to complete WPS registration. At that point, 11739beb93cSSam Lefflerthe client will be enrolled with credentials needed to connect to the 11839beb93cSSam LefflerAP to access the network. 11939beb93cSSam Leffler 12039beb93cSSam LefflerIf the client device does not have a display that could show the 12139beb93cSSam Lefflerrandom PIN, a hardcoded PIN that is printed on a label can be 12239beb93cSSam Lefflerused. wpa_supplicant is notified this with a control interface 12339beb93cSSam Lefflerrequest, e.g., by calling wpa_cli: 12439beb93cSSam Leffler 12539beb93cSSam Lefflerwpa_cli wps_pin any 12345670 12639beb93cSSam Leffler 12739beb93cSSam LefflerThis starts the WPS negotiation in the same way as above with the 12839beb93cSSam Lefflergenerated PIN. 12939beb93cSSam Leffler 130f05cddf9SRui PauloWhen the wps_pin command is issued for an AP (including P2P GO) mode 131f05cddf9SRui Paulointerface, an optional timeout parameter can be used to specify 132f05cddf9SRui Pauloexpiration timeout for the PIN in seconds. For example: 133f05cddf9SRui Paulo 134f05cddf9SRui Paulowpa_cli wps_pin any 12345670 300 135f05cddf9SRui Paulo 136f05cddf9SRui PauloIf a random PIN is needed for a user interface, "wpa_cli wps_pin get" 137f05cddf9SRui Paulocan be used to generate a new PIN without starting WPS negotiation. 138f05cddf9SRui PauloThis random PIN can then be passed as an argument to another wps_pin 139f05cddf9SRui Paulocall when the actual operation should be started. 14039beb93cSSam Leffler 14139beb93cSSam LefflerIf the client design wants to support optional WPS PBC mode, this can 14239beb93cSSam Lefflerbe enabled by either a physical button in the client device or a 14339beb93cSSam Lefflervirtual button in the user interface. The PBC operation requires that 14439beb93cSSam Lefflera button is also pressed at the AP/Registrar at about the same time (2 14539beb93cSSam Lefflerminute window). wpa_supplicant is notified of the local button event 14639beb93cSSam Lefflerover the control interface, e.g., by calling wpa_cli: 14739beb93cSSam Leffler 14839beb93cSSam Lefflerwpa_cli wps_pbc 14939beb93cSSam Leffler 15039beb93cSSam LefflerAt this point, the AP/Registrar has two minutes to complete WPS 15139beb93cSSam Lefflernegotiation which will generate a new WPA PSK in the same way as the 15239beb93cSSam LefflerPIN method described above. 15339beb93cSSam Leffler 154e28a4053SRui PauloIf the client wants to operate in the Registrar role to learn the 155e28a4053SRui Paulocurrent AP configuration and optionally, to configure an AP, 156e28a4053SRui Paulowpa_supplicant is notified over the control interface, e.g., with 15739beb93cSSam Lefflerwpa_cli: 15839beb93cSSam Leffler 15939beb93cSSam Lefflerwpa_cli wps_reg <AP BSSID> <AP PIN> 16039beb93cSSam Leffler(example: wpa_cli wps_reg 02:34:56:78:9a:bc 12345670) 16139beb93cSSam Leffler 162e28a4053SRui PauloThis is used to fetch the current AP settings instead of actually 163e28a4053SRui Paulochanging them. The main difference with the wps_pin command is that 164e28a4053SRui Paulowps_reg uses the AP PIN (e.g., from a label on the AP) instead of a 165e28a4053SRui PauloPIN generated at the client. 166e28a4053SRui Paulo 167e28a4053SRui PauloIn order to change the AP configuration, the new configuration 168e28a4053SRui Pauloparameters are given to the wps_reg command: 169e28a4053SRui Paulo 170e28a4053SRui Paulowpa_cli wps_reg <AP BSSID> <AP PIN> <new SSID> <auth> <encr> <new key> 171e28a4053SRui Pauloexamples: 172e28a4053SRui Paulo wpa_cli wps_reg 02:34:56:78:9a:bc 12345670 testing WPA2PSK CCMP 12345678 173e28a4053SRui Paulo wpa_cli wps_reg 02:34:56:78:9a:bc 12345670 clear OPEN NONE "" 174e28a4053SRui Paulo 175e28a4053SRui Paulo<auth> must be one of the following: OPEN WPAPSK WPA2PSK 176e28a4053SRui Paulo<encr> must be one of the following: NONE WEP TKIP CCMP 1773157ba21SRui Paulo 17839beb93cSSam Leffler 17939beb93cSSam LefflerScanning 18039beb93cSSam Leffler-------- 18139beb93cSSam Leffler 18239beb93cSSam LefflerScan results ('wpa_cli scan_results' or 'wpa_cli bss <idx>') include a 18339beb93cSSam Lefflerflags field that is used to indicate whether the BSS support WPS. If 18439beb93cSSam Lefflerthe AP support WPS, but has not recently activated a Registrar, [WPS] 18539beb93cSSam Lefflerflag will be included. If PIN method has been recently selected, 18639beb93cSSam Leffler[WPS-PIN] is shown instead. Similarly, [WPS-PBC] is shown if PBC mode 18739beb93cSSam Leffleris in progress. GUI programs can use these as triggers for suggesting 18839beb93cSSam Lefflera guided WPS configuration to the user. In addition, control interface 18939beb93cSSam Lefflermonitor events WPS-AP-AVAILABLE{,-PBC,-PIN} can be used to find out if 19039beb93cSSam Lefflerthere are WPS enabled APs in scan results without having to go through 19139beb93cSSam Lefflerall the details in the GUI. These notification could be used, e.g., to 19239beb93cSSam Lefflersuggest possible WPS connection to the user. 19339beb93cSSam Leffler 19439beb93cSSam Leffler 19539beb93cSSam Lefflerwpa_gui 19639beb93cSSam Leffler------- 19739beb93cSSam Leffler 19839beb93cSSam Lefflerwpa_gui-qt4 directory contains a sample GUI that shows an example of 19939beb93cSSam Lefflerhow WPS support can be integrated into the GUI. Its main window has a 20039beb93cSSam LefflerWPS tab that guides user through WPS registration with automatic AP 20139beb93cSSam Lefflerselection. In addition, it shows how WPS can be started manually by 20239beb93cSSam Lefflerselecting an AP from scan results. 20339beb93cSSam Leffler 20439beb93cSSam Leffler 20539beb93cSSam LefflerCredential processing 20639beb93cSSam Leffler--------------------- 20739beb93cSSam Leffler 20839beb93cSSam LefflerBy default, wpa_supplicant processes received credentials and updates 20939beb93cSSam Lefflerits configuration internally. However, it is possible to 21039beb93cSSam Lefflercontrol these operations from external programs, if desired. 21139beb93cSSam Leffler 21239beb93cSSam LefflerThis internal processing can be disabled with wps_cred_processing=1 21339beb93cSSam Leffleroption. When this is used, an external program is responsible for 21439beb93cSSam Lefflerprocessing the credential attributes and updating wpa_supplicant 21539beb93cSSam Lefflerconfiguration based on them. 21639beb93cSSam Leffler 217*a90b9d01SCy SchubertThe following control interface messages are sent out for external 218*a90b9d01SCy Schubertprograms: 21939beb93cSSam Leffler 22039beb93cSSam LefflerWPS-CRED-RECEIVED <hexdump of Credential attribute(s)> 22139beb93cSSam LefflerFor example: 22239beb93cSSam Leffler<2>WPS-CRED-RECEIVED 100e006f10260001011045000c6a6b6d2d7770732d74657374100300020020100f000200081027004030653462303435366332363666653064333961643135353461316634626637313234333761636664623766333939653534663166316230323061643434386235102000060266a0ee1727 223f05cddf9SRui Paulo 224f05cddf9SRui Paulo 225f05cddf9SRui Paulowpa_supplicant as WPS External Registrar (ER) 226f05cddf9SRui Paulo--------------------------------------------- 227f05cddf9SRui Paulo 228f05cddf9SRui Paulowpa_supplicant can be used as a WPS ER to configure an AP or enroll 229f05cddf9SRui Paulonew Enrollee to join the network. This functionality uses UPnP and 230f05cddf9SRui Paulorequires that a working IP connectivity is available with the AP (this 231f05cddf9SRui Paulocan be either over a wired or wireless connection). 232f05cddf9SRui Paulo 233f05cddf9SRui PauloSeparate wpa_supplicant process can be started for WPS ER 234f05cddf9SRui Paulooperations. A special "none" driver can be used in such a case to 235f05cddf9SRui Pauloindicate that no local network interface is actually controlled. For 236*a90b9d01SCy Schubertexample, the following command could be used to start the ER: 237f05cddf9SRui Paulo 238f05cddf9SRui Paulowpa_supplicant -Dnone -c er.conf -ieth0 239f05cddf9SRui Paulo 240f05cddf9SRui PauloSample er.conf: 241f05cddf9SRui Paulo 242f05cddf9SRui Pauloctrl_interface=DIR=/var/run/wpa_supplicant GROUP=admin 243f05cddf9SRui Paulodevice_name=WPS External Registrar 244f05cddf9SRui Paulo 245f05cddf9SRui Paulowpa_cli commands for ER functionality: 246f05cddf9SRui Paulo 247f05cddf9SRui Paulowps_er_start [IP address] 248f05cddf9SRui Paulo- start WPS ER functionality 249f05cddf9SRui Paulo- the optional IP address parameter can be used to filter operations only 250f05cddf9SRui Paulo to include a single AP 251f05cddf9SRui Paulo- if run again while ER is active, the stored information (discovered APs 252f05cddf9SRui Paulo and Enrollees) are shown again 253f05cddf9SRui Paulo 254f05cddf9SRui Paulowps_er_stop 255f05cddf9SRui Paulo- stop WPS ER functionality 256f05cddf9SRui Paulo 2575b9c547cSRui Paulowps_er_learn <UUID|BSSID> <AP PIN> 258f05cddf9SRui Paulo- learn AP configuration 259f05cddf9SRui Paulo 2605b9c547cSRui Paulowps_er_set_config <UUID|BSSID> <network id> 261f05cddf9SRui Paulo- use AP configuration from a locally configured network (e.g., from 262f05cddf9SRui Paulo wps_reg command); this does not change the AP's configuration, but 263f05cddf9SRui Paulo only prepares a configuration to be used when enrolling a new device 264f05cddf9SRui Paulo to the AP 265f05cddf9SRui Paulo 2665b9c547cSRui Paulowps_er_config <UUID|BSSID> <AP PIN> <new SSID> <auth> <encr> <new key> 267f05cddf9SRui Paulo- examples: 268f05cddf9SRui Paulo wps_er_config 87654321-9abc-def0-1234-56789abc0002 12345670 testing WPA2PSK CCMP 12345678 269f05cddf9SRui Paulo wpa_er_config 87654321-9abc-def0-1234-56789abc0002 12345670 clear OPEN NONE "" 270f05cddf9SRui Paulo 271f05cddf9SRui Paulo<auth> must be one of the following: OPEN WPAPSK WPA2PSK 272f05cddf9SRui Paulo<encr> must be one of the following: NONE WEP TKIP CCMP 273f05cddf9SRui Paulo 2745b9c547cSRui Paulowps_er_pbc <Enrollee UUID|MAC address> 275f05cddf9SRui Paulo- accept an Enrollee PBC using External Registrar 276f05cddf9SRui Paulo 2775b9c547cSRui Paulowps_er_pin <Enrollee UUID|"any"|MAC address> <PIN> [Enrollee MAC address] 278f05cddf9SRui Paulo- add an Enrollee PIN to External Registrar 279f05cddf9SRui Paulo- if Enrollee UUID is not known, "any" can be used to add a wildcard PIN 280f05cddf9SRui Paulo- if the MAC address of the enrollee is known, it should be configured 281f05cddf9SRui Paulo to allow the AP to advertise list of authorized enrollees 282f05cddf9SRui Paulo 283f05cddf9SRui PauloWPS ER events: 284f05cddf9SRui Paulo 285f05cddf9SRui PauloWPS_EVENT_ER_AP_ADD 286f05cddf9SRui Paulo- WPS ER discovered an AP 287f05cddf9SRui Paulo 288f05cddf9SRui PauloWPS-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/ 289f05cddf9SRui Paulo 290f05cddf9SRui PauloWPS_EVENT_ER_AP_REMOVE 291f05cddf9SRui Paulo- WPS ER removed an AP entry 292f05cddf9SRui Paulo 293f05cddf9SRui PauloWPS-ER-AP-REMOVE 87654321-9abc-def0-1234-56789abc0002 294f05cddf9SRui Paulo 295f05cddf9SRui PauloWPS_EVENT_ER_ENROLLEE_ADD 296f05cddf9SRui Paulo- WPS ER discovered a new Enrollee 297f05cddf9SRui Paulo 298f05cddf9SRui PauloWPS-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| 299f05cddf9SRui Paulo 300f05cddf9SRui PauloWPS_EVENT_ER_ENROLLEE_REMOVE 301f05cddf9SRui Paulo- WPS ER removed an Enrollee entry 302f05cddf9SRui Paulo 303f05cddf9SRui PauloWPS-ER-ENROLLEE-REMOVE 2b7093f1-d6fb-5108-adbb-bea66bb87333 02:66:a0:ee:17:27 304f05cddf9SRui Paulo 305f05cddf9SRui PauloWPS-ER-AP-SETTINGS 306f05cddf9SRui Paulo- WPS ER learned AP settings 307f05cddf9SRui Paulo 308f05cddf9SRui PauloWPS-ER-AP-SETTINGS uuid=fd91b4ec-e3fa-5891-a57d-8c59efeed1d2 ssid=test-wps auth_type=0x0020 encr_type=0x0008 key=12345678 309f05cddf9SRui Paulo 310f05cddf9SRui Paulo 311f05cddf9SRui PauloWPS with NFC 312f05cddf9SRui Paulo------------ 313f05cddf9SRui Paulo 314f05cddf9SRui PauloWPS can be used with NFC-based configuration method. An NFC tag 315f05cddf9SRui Paulocontaining a password token from the Enrollee can be used to 316f05cddf9SRui Pauloauthenticate the connection instead of the PIN. In addition, an NFC tag 317f05cddf9SRui Paulowith a configuration token can be used to transfer AP settings without 318f05cddf9SRui Paulogoing through the WPS protocol. 319f05cddf9SRui Paulo 320f05cddf9SRui PauloWhen the station acts as an Enrollee, a local NFC tag with a password 321f05cddf9SRui Paulotoken can be used by touching the NFC interface of a Registrar. 322f05cddf9SRui Paulo 323f05cddf9SRui Paulo"wps_nfc [BSSID]" command starts WPS protocol run with the local end as 324f05cddf9SRui Paulothe Enrollee using the NFC password token that is either pre-configured 325f05cddf9SRui Pauloin the configuration file (wps_nfc_dev_pw_id, wps_nfc_dh_pubkey, 326f05cddf9SRui Paulowps_nfc_dh_privkey, wps_nfc_dev_pw) or generated dynamically with 327f05cddf9SRui Paulo"wps_nfc_token <WPS|NDEF>" command. The included nfc_pw_token tool 328f05cddf9SRui Paulo(build with "make nfc_pw_token") can be used to generate NFC password 329f05cddf9SRui Paulotokens during manufacturing (each station needs to have its own random 330f05cddf9SRui Paulokeys). 331f05cddf9SRui Paulo 3325b9c547cSRui PauloThe "wps_nfc_config_token <WPS/NDEF>" command can be used to build an 3335b9c547cSRui PauloNFC configuration token when wpa_supplicant is controlling an AP 3345b9c547cSRui Paulointerface (AP or P2P GO). The output value from this command is a 3355b9c547cSRui Paulohexdump of the current AP configuration (WPS parameter requests this to 3365b9c547cSRui Pauloinclude only the WPS attributes; NDEF parameter requests additional NDEF 3375b9c547cSRui Pauloencapsulation to be included). This data needs to be written to an NFC 3385b9c547cSRui Paulotag with an external program. Once written, the NFC configuration token 3395b9c547cSRui Paulocan be used to touch an NFC interface on a station to provision the 3405b9c547cSRui Paulocredentials needed to access the network. 3415b9c547cSRui Paulo 3425b9c547cSRui PauloThe "wps_nfc_config_token <WPS/NDEF> <network id>" command can be used 3435b9c547cSRui Pauloto build an NFC configuration token based on a locally configured 3445b9c547cSRui Paulonetwork. 3455b9c547cSRui Paulo 346f05cddf9SRui PauloIf the station includes NFC interface and reads an NFC tag with a MIME 347f05cddf9SRui Paulomedia type "application/vnd.wfa.wsc", the NDEF message payload (with or 348f05cddf9SRui Paulowithout NDEF encapsulation) can be delivered to wpa_supplicant using the 349f05cddf9SRui Paulofollowing wpa_cli command: 350f05cddf9SRui Paulo 351f05cddf9SRui Paulowps_nfc_tag_read <hexdump of payload> 352f05cddf9SRui Paulo 353f05cddf9SRui PauloIf the NFC tag contains a configuration token, the network is added to 354f05cddf9SRui Paulowpa_supplicant configuration. If the NFC tag contains a password token, 355f05cddf9SRui Paulothe token is added to the WPS Registrar component. This information can 356f05cddf9SRui Paulothen be used with wps_reg command (when the NFC password token was from 357f05cddf9SRui Pauloan AP) using a special value "nfc-pw" in place of the PIN parameter. If 358f05cddf9SRui Paulothe ER functionality has been started (wps_er_start), the NFC password 359f05cddf9SRui Paulotoken is used to enable enrollment of a new station (that was the source 360f05cddf9SRui Pauloof the NFC password token). 361f05cddf9SRui Paulo 3625b9c547cSRui Paulo"nfc_get_handover_req <NDEF> <WPS-CR>" command can be used to build the 3635b9c547cSRui PauloWPS carrier record for a Handover Request Message for connection 3645b9c547cSRui Paulohandover. The first argument selects the format of the output data and 3655b9c547cSRui Paulothe second argument selects which type of connection handover is 3665b9c547cSRui Paulorequested (WPS-CR = Wi-Fi handover as specified in WSC 2.0). 367f05cddf9SRui Paulo 3685b9c547cSRui Paulo"nfc_get_handover_sel <NDEF> <WPS> [UUID|BSSID]" command can be used to 3695b9c547cSRui Paulobuild the contents of a Handover Select Message for connection handover 3705b9c547cSRui Paulowhen this does not depend on the contents of the Handover Request 3715b9c547cSRui PauloMessage. The first argument selects the format of the output data and 3725b9c547cSRui Paulothe second argument selects which type of connection handover is 3735b9c547cSRui Paulorequested (WPS = Wi-Fi handover as specified in WSC 2.0). If the options 3745b9c547cSRui PauloUUID|BSSID argument is included, this is a request to build the handover 3755b9c547cSRui Paulomessage for the specified AP when wpa_supplicant is operating as a WPS 3765b9c547cSRui PauloER. 377f05cddf9SRui Paulo 3785b9c547cSRui Paulo"nfc_report_handover <INIT/RESP> WPS <carrier from handover request> 3795b9c547cSRui Paulo<carrier from handover select>" can be used as an alternative way for 3805b9c547cSRui Pauloreporting completed NFC connection handover. The first parameter 3815b9c547cSRui Pauloindicates whether the local device initiated or responded to the 3825b9c547cSRui Pauloconnection handover and the carrier records are the selected carrier 3835b9c547cSRui Paulofrom the handover request and select messages as a hexdump. 384f05cddf9SRui Paulo 3855b9c547cSRui PauloThe "wps_er_nfc_config_token <WPS/NDEF> <UUID|BSSID>" command can be 3865b9c547cSRui Pauloused to build an NFC configuration token for the specified AP when 3875b9c547cSRui Paulowpa_supplicant is operating as a WPS ER. The output value from this 3885b9c547cSRui Paulocommand is a hexdump of the selected AP configuration (WPS parameter 3895b9c547cSRui Paulorequests this to include only the WPS attributes; NDEF parameter 3905b9c547cSRui Paulorequests additional NDEF encapsulation to be included). This data needs 3915b9c547cSRui Pauloto be written to an NFC tag with an external program. Once written, the 3925b9c547cSRui PauloNFC configuration token can be used to touch an NFC interface on a 3935b9c547cSRui Paulostation to provision the credentials needed to access the network. 394