1*03f9172cSAndroid Build Coastguard WorkerDevice Provisioning Protocol (DPP) 2*03f9172cSAndroid Build Coastguard Worker================================== 3*03f9172cSAndroid Build Coastguard Worker 4*03f9172cSAndroid Build Coastguard WorkerThis document describes how the Device Provisioning Protocol (DPP) 5*03f9172cSAndroid Build Coastguard Workerimplementation in wpa_supplicant and hostapd can be configured and how 6*03f9172cSAndroid Build Coastguard Workerthe STA device and AP can be configured to connect each other using DPP 7*03f9172cSAndroid Build Coastguard WorkerConnector mechanism. 8*03f9172cSAndroid Build Coastguard Worker 9*03f9172cSAndroid Build Coastguard WorkerIntroduction to DPP 10*03f9172cSAndroid Build Coastguard Worker------------------- 11*03f9172cSAndroid Build Coastguard Worker 12*03f9172cSAndroid Build Coastguard WorkerDevice Provisioning Protocol (also known as Wi-Fi Easy Connect) allows 13*03f9172cSAndroid Build Coastguard Workerenrolling of interface-less devices in a secure Wi-Fi network using many 14*03f9172cSAndroid Build Coastguard Workermethods like QR code based authentication (detailed below), PKEX based 15*03f9172cSAndroid Build Coastguard Workerauthentication (password with in-band provisioning), etc. In DPP a 16*03f9172cSAndroid Build Coastguard WorkerConfigurator is used to provide network credentials to the devices. The 17*03f9172cSAndroid Build Coastguard Workerthree phases of DPP connection are authentication, configuration and 18*03f9172cSAndroid Build Coastguard Workernetwork introduction. 19*03f9172cSAndroid Build Coastguard Worker 20*03f9172cSAndroid Build Coastguard WorkerMore information about Wi-Fi Easy Connect is available from this Wi-Fi 21*03f9172cSAndroid Build Coastguard WorkerAlliance web page: 22*03f9172cSAndroid Build Coastguard Workerhttps://www.wi-fi.org/discover-wi-fi/wi-fi-easy-connect 23*03f9172cSAndroid Build Coastguard Worker 24*03f9172cSAndroid Build Coastguard WorkerBuild config setup 25*03f9172cSAndroid Build Coastguard Worker------------------ 26*03f9172cSAndroid Build Coastguard Worker 27*03f9172cSAndroid Build Coastguard WorkerThe following parameters must be included in the config file used to 28*03f9172cSAndroid Build Coastguard Workercompile hostapd and wpa_supplicant. 29*03f9172cSAndroid Build Coastguard Worker 30*03f9172cSAndroid Build Coastguard Workerwpa_supplicant build config 31*03f9172cSAndroid Build Coastguard Worker--------------------------- 32*03f9172cSAndroid Build Coastguard Worker 33*03f9172cSAndroid Build Coastguard WorkerEnable DPP in wpa_supplicant build config file 34*03f9172cSAndroid Build Coastguard Worker 35*03f9172cSAndroid Build Coastguard WorkerCONFIG_DPP=y 36*03f9172cSAndroid Build Coastguard Worker 37*03f9172cSAndroid Build Coastguard Workerhostapd build config 38*03f9172cSAndroid Build Coastguard Worker-------------------- 39*03f9172cSAndroid Build Coastguard Worker 40*03f9172cSAndroid Build Coastguard WorkerEnable DPP in hostapd build config file 41*03f9172cSAndroid Build Coastguard Worker 42*03f9172cSAndroid Build Coastguard WorkerCONFIG_DPP=y 43*03f9172cSAndroid Build Coastguard Worker 44*03f9172cSAndroid Build Coastguard WorkerConfigurator build config 45*03f9172cSAndroid Build Coastguard Worker------------------------- 46*03f9172cSAndroid Build Coastguard Worker 47*03f9172cSAndroid Build Coastguard WorkerAny STA or AP device can act as a Configurator. Enable DPP in build 48*03f9172cSAndroid Build Coastguard Workerconfig. For an AP to act as a Configurator, Interworking needs to be 49*03f9172cSAndroid Build Coastguard Workerenabled for GAS. For wpa_supplicant it is not required. 50*03f9172cSAndroid Build Coastguard Worker 51*03f9172cSAndroid Build Coastguard WorkerCONFIG_INTERWORKING=y 52*03f9172cSAndroid Build Coastguard Worker 53*03f9172cSAndroid Build Coastguard Worker 54*03f9172cSAndroid Build Coastguard WorkerSample supplicant config file before provisioning 55*03f9172cSAndroid Build Coastguard Worker------------------------------------------------- 56*03f9172cSAndroid Build Coastguard Worker 57*03f9172cSAndroid Build Coastguard Workerctrl_interface=DIR=/var/run/wpa_supplicant 58*03f9172cSAndroid Build Coastguard Workerctrl_interface_group=0 59*03f9172cSAndroid Build Coastguard Workerupdate_config=1 60*03f9172cSAndroid Build Coastguard Workerpmf=2 61*03f9172cSAndroid Build Coastguard Workerdpp_config_processing=2 62*03f9172cSAndroid Build Coastguard Worker 63*03f9172cSAndroid Build Coastguard WorkerSample hostapd config file before provisioning 64*03f9172cSAndroid Build Coastguard Worker---------------------------------------------- 65*03f9172cSAndroid Build Coastguard Worker 66*03f9172cSAndroid Build Coastguard Workerinterface=wlan0 67*03f9172cSAndroid Build Coastguard Workerdriver=nl80211 68*03f9172cSAndroid Build Coastguard Workerctrl_interface=/var/run/hostapd 69*03f9172cSAndroid Build Coastguard Workerssid=test 70*03f9172cSAndroid Build Coastguard Workerchannel=1 71*03f9172cSAndroid Build Coastguard Workerwpa=2 72*03f9172cSAndroid Build Coastguard Workerwpa_key_mgmt=DPP 73*03f9172cSAndroid Build Coastguard Workerieee80211w=1 74*03f9172cSAndroid Build Coastguard Workerwpa_pairwise=CCMP 75*03f9172cSAndroid Build Coastguard Workerrsn_pairwise=CCMP 76*03f9172cSAndroid Build Coastguard Worker 77*03f9172cSAndroid Build Coastguard Worker 78*03f9172cSAndroid Build Coastguard WorkerPre-requisites 79*03f9172cSAndroid Build Coastguard Worker-------------- 80*03f9172cSAndroid Build Coastguard Worker 81*03f9172cSAndroid Build Coastguard WorkerIt is assumed that an AP and client station are up by running hostapd 82*03f9172cSAndroid Build Coastguard Workerand wpa_supplicant using respective config files. 83*03f9172cSAndroid Build Coastguard Worker 84*03f9172cSAndroid Build Coastguard Worker 85*03f9172cSAndroid Build Coastguard WorkerCreating Configurator 86*03f9172cSAndroid Build Coastguard Worker--------------------- 87*03f9172cSAndroid Build Coastguard Worker 88*03f9172cSAndroid Build Coastguard WorkerAdd a Configurator over the control interface (wpa_cli/hostapd_cli) 89*03f9172cSAndroid Build Coastguard Worker 90*03f9172cSAndroid Build Coastguard Worker> dpp_configurator_add 91*03f9172cSAndroid Build Coastguard Worker(returns id) 92*03f9172cSAndroid Build Coastguard Worker 93*03f9172cSAndroid Build Coastguard WorkerTo get key of Configurator 94*03f9172cSAndroid Build Coastguard Worker> dpp_configurator_get_key <id> 95*03f9172cSAndroid Build Coastguard Worker 96*03f9172cSAndroid Build Coastguard Worker 97*03f9172cSAndroid Build Coastguard WorkerHow to configure an Enrollee using Configurator 98*03f9172cSAndroid Build Coastguard Worker----------------------------------------------- 99*03f9172cSAndroid Build Coastguard Worker 100*03f9172cSAndroid Build Coastguard WorkerOn Enrollee side: 101*03f9172cSAndroid Build Coastguard Worker 102*03f9172cSAndroid Build Coastguard WorkerGenerate QR code for the device. Store the QR code id returned by the 103*03f9172cSAndroid Build Coastguard Workercommand. 104*03f9172cSAndroid Build Coastguard Worker 105*03f9172cSAndroid Build Coastguard Worker> dpp_bootstrap_gen type=qrcode mac=<mac-address-of-device> chan=<operating-class/channel> key=<key of the device> 106*03f9172cSAndroid Build Coastguard Worker(Returns bootstrapping info id. If the key parameter is not included, a new key 107*03f9172cSAndroid Build Coastguard Workeris generated automatically. The MAC address is specified without octet 108*03f9172cSAndroid Build Coastguard Workerseparating colons. The channel list includes the possible channels on which the 109*03f9172cSAndroid Build Coastguard Workerdevice is waiting. This uses global operating classes; e.g., 81/1 is the 2.4 110*03f9172cSAndroid Build Coastguard WorkerGHz channel 1 on 2412 MHz.) 111*03f9172cSAndroid Build Coastguard Worker 112*03f9172cSAndroid Build Coastguard WorkerGet URI for the QR Code of device using the bootstrap info id. 113*03f9172cSAndroid Build Coastguard Worker> dpp_bootstrap_get_uri <bootstrap-id> 114*03f9172cSAndroid Build Coastguard Worker 115*03f9172cSAndroid Build Coastguard WorkerMake device listen to DPP request. The central frequency of the 2.4 GHz 116*03f9172cSAndroid Build Coastguard Workerband channel 1 is 2412 MHz) in case the Enrollee is a client device. An 117*03f9172cSAndroid Build Coastguard WorkerAP as an Enrollee is listening on its operating channel. 118*03f9172cSAndroid Build Coastguard Worker 119*03f9172cSAndroid Build Coastguard Worker> dpp_listen <frequency> 120*03f9172cSAndroid Build Coastguard Worker 121*03f9172cSAndroid Build Coastguard WorkerOn Configurator side: 122*03f9172cSAndroid Build Coastguard Worker 123*03f9172cSAndroid Build Coastguard WorkerEnter the QR Code in the Configurator. 124*03f9172cSAndroid Build Coastguard Worker> dpp_qr_code "<URI-from-QR-Code-read-from-enrollee>" 125*03f9172cSAndroid Build Coastguard Worker 126*03f9172cSAndroid Build Coastguard WorkerOn successfully adding QR Code, a bootstrapping info id is returned. 127*03f9172cSAndroid Build Coastguard Worker 128*03f9172cSAndroid Build Coastguard WorkerSend provisioning request to Enrollee. (conf is ap-dpp if Enrollee is an 129*03f9172cSAndroid Build Coastguard WorkerAP. conf is sta-dpp if Enrollee is a client) 130*03f9172cSAndroid Build Coastguard Worker> dpp_auth_init peer=<qr-code-id> conf=<ap-dpp|sta-dpp> ssid=<SSID hexdump> configurator=<configurator-id> 131*03f9172cSAndroid Build Coastguard Workeror for legacy (PSK/SAE) provisioning for a station Enrollee: 132*03f9172cSAndroid Build Coastguard Worker> dpp_auth_init peer=<qr-code-id> conf=sta-psk ssid=<SSID hexdump> pass=<passphrase hexdump> 133*03f9172cSAndroid Build Coastguard Worker 134*03f9172cSAndroid Build Coastguard WorkerThe DPP values will be printed in the console. Save these values into the 135*03f9172cSAndroid Build Coastguard Workerconfig file. If the Enrollee is an AP, we need to manually write these 136*03f9172cSAndroid Build Coastguard Workervalues to the hostapd config file. If the Enrollee is a client device, 137*03f9172cSAndroid Build Coastguard Workerthese details can be automatically saved to config file using the 138*03f9172cSAndroid Build Coastguard Workerfollowing command. 139*03f9172cSAndroid Build Coastguard Worker 140*03f9172cSAndroid Build Coastguard Worker> save_config 141*03f9172cSAndroid Build Coastguard Worker 142*03f9172cSAndroid Build Coastguard WorkerTo set values in runtime for AP enrollees 143*03f9172cSAndroid Build Coastguard Worker 144*03f9172cSAndroid Build Coastguard Worker> set dpp_connector <Connector-value-printed-on-console> 145*03f9172cSAndroid Build Coastguard Worker> set dpp_csign <csign-value-on-console> 146*03f9172cSAndroid Build Coastguard Worker> set dpp_netaccesskey <netaccess-value-on-console> 147*03f9172cSAndroid Build Coastguard Worker 148*03f9172cSAndroid Build Coastguard WorkerTo set values in runtime for client enrollees, set dpp_config_processing 149*03f9172cSAndroid Build Coastguard Workerto 2 in wpa_supplicant conf file. 150*03f9172cSAndroid Build Coastguard Worker 151*03f9172cSAndroid Build Coastguard WorkerOnce the values are set in run-time (if not set in run-time, but saved 152*03f9172cSAndroid Build Coastguard Workerin config files, they are taken up in next restart), the client device 153*03f9172cSAndroid Build Coastguard Workerwill automatically connect to the already provisioned AP and connection 154*03f9172cSAndroid Build Coastguard Workerwill be established. 155*03f9172cSAndroid Build Coastguard Worker 156*03f9172cSAndroid Build Coastguard Worker 157*03f9172cSAndroid Build Coastguard WorkerSelf-configuring a device 158*03f9172cSAndroid Build Coastguard Worker------------------------- 159*03f9172cSAndroid Build Coastguard Worker 160*03f9172cSAndroid Build Coastguard WorkerIt is possible for a device to configure itself if it is the 161*03f9172cSAndroid Build Coastguard WorkerConfigurator for the network. 162*03f9172cSAndroid Build Coastguard Worker 163*03f9172cSAndroid Build Coastguard WorkerCreate a Configurator in the device and use the dpp_configurator_sign 164*03f9172cSAndroid Build Coastguard Workercommand to get DPP credentials. 165*03f9172cSAndroid Build Coastguard Worker 166*03f9172cSAndroid Build Coastguard Worker> dpp_configurator_add 167*03f9172cSAndroid Build Coastguard Worker(returns configurator id) 168*03f9172cSAndroid Build Coastguard Worker> dpp_configurator_sign conf=<ap-dpp|sta-dpp> configurator=<configurator-id> ssid=<SSID hexdump> 169*03f9172cSAndroid Build Coastguard Worker 170*03f9172cSAndroid Build Coastguard Worker 171*03f9172cSAndroid Build Coastguard WorkerSample AP configuration files after provisioning 172*03f9172cSAndroid Build Coastguard Worker------------------------------------------------ 173*03f9172cSAndroid Build Coastguard Worker 174*03f9172cSAndroid Build Coastguard Workerinterface=wlan0 175*03f9172cSAndroid Build Coastguard Workerdriver=nl80211 176*03f9172cSAndroid Build Coastguard Workerctrl_interface=/var/run/hostapd 177*03f9172cSAndroid Build Coastguard Workerssid=test 178*03f9172cSAndroid Build Coastguard Workerchannel=1 179*03f9172cSAndroid Build Coastguard Workerwpa=2 180*03f9172cSAndroid Build Coastguard Workerwpa_key_mgmt=DPP 181*03f9172cSAndroid Build Coastguard Workerieee80211w=1 182*03f9172cSAndroid Build Coastguard Workerwpa_pairwise=CCMP 183*03f9172cSAndroid Build Coastguard Workerrsn_pairwise=CCMP 184*03f9172cSAndroid Build Coastguard Workerdpp_connector=<Connector value provided by Configurator> 185*03f9172cSAndroid Build Coastguard Workerdpp_csign=<C-Sign-Key value provided by Configurator> 186*03f9172cSAndroid Build Coastguard Workerdpp_netaccesskey=<Net access key provided by Configurator> 187*03f9172cSAndroid Build Coastguard Worker 188*03f9172cSAndroid Build Coastguard Worker 189*03f9172cSAndroid Build Coastguard WorkerSample station configuration file after provisioning 190*03f9172cSAndroid Build Coastguard Worker---------------------------------------------------- 191*03f9172cSAndroid Build Coastguard Worker 192*03f9172cSAndroid Build Coastguard Workerctrl_interface=DIR=/var/run/wpa_supplicant 193*03f9172cSAndroid Build Coastguard Workerctrl_interface_group=0 194*03f9172cSAndroid Build Coastguard Workerupdate_config=1 195*03f9172cSAndroid Build Coastguard Workerpmf=2 196*03f9172cSAndroid Build Coastguard Workerdpp_config_processing=2 197*03f9172cSAndroid Build Coastguard Workernetwork={ 198*03f9172cSAndroid Build Coastguard Worker ssid="test" 199*03f9172cSAndroid Build Coastguard Worker key_mgmt=DPP 200*03f9172cSAndroid Build Coastguard Worker ieee80211w=2 201*03f9172cSAndroid Build Coastguard Worker dpp_connector="<Connector value provided by Configurator>" 202*03f9172cSAndroid Build Coastguard Worker dpp_netaccesskey=<Net access key provided by Configurator> 203*03f9172cSAndroid Build Coastguard Worker dpp_csign=<C-sign-key value provided by Configurator> 204*03f9172cSAndroid Build Coastguard Worker} 205