xref: /freebsd/contrib/wpa/wpa_supplicant/README-DPP (revision c1d255d3ffdbe447de3ab875bf4e7d7accc5bfc5)
14bc52338SCy SchubertDevice Provisioning Protocol (DPP)
24bc52338SCy Schubert==================================
34bc52338SCy Schubert
44bc52338SCy SchubertThis document describes how the Device Provisioning Protocol (DPP)
54bc52338SCy Schubertimplementation in wpa_supplicant and hostapd can be configured and how
64bc52338SCy Schubertthe STA device and AP can be configured to connect each other using DPP
74bc52338SCy SchubertConnector mechanism.
84bc52338SCy Schubert
94bc52338SCy SchubertIntroduction to DPP
104bc52338SCy Schubert-------------------
114bc52338SCy Schubert
12*c1d255d3SCy SchubertDevice Provisioning Protocol (also known as Wi-Fi Easy Connect) allows
13*c1d255d3SCy Schubertenrolling of interface-less devices in a secure Wi-Fi network using many
14*c1d255d3SCy Schubertmethods like QR code based authentication (detailed below), PKEX based
15*c1d255d3SCy Schubertauthentication (password with in-band provisioning), etc. In DPP a
16*c1d255d3SCy SchubertConfigurator is used to provide network credentials to the devices. The
17*c1d255d3SCy Schubertthree phases of DPP connection are authentication, configuration and
184bc52338SCy Schubertnetwork introduction.
194bc52338SCy Schubert
20*c1d255d3SCy SchubertMore information about Wi-Fi Easy Connect is available from this Wi-Fi
21*c1d255d3SCy SchubertAlliance web page:
22*c1d255d3SCy Schuberthttps://www.wi-fi.org/discover-wi-fi/wi-fi-easy-connect
23*c1d255d3SCy Schubert
244bc52338SCy SchubertBuild config setup
254bc52338SCy Schubert------------------
264bc52338SCy Schubert
27*c1d255d3SCy SchubertThe following parameters must be included in the config file used to
28*c1d255d3SCy Schubertcompile hostapd and wpa_supplicant.
294bc52338SCy Schubert
304bc52338SCy Schubertwpa_supplicant build config
314bc52338SCy Schubert---------------------------
324bc52338SCy Schubert
33*c1d255d3SCy SchubertEnable DPP in wpa_supplicant build config file
344bc52338SCy Schubert
354bc52338SCy SchubertCONFIG_DPP=y
364bc52338SCy Schubert
374bc52338SCy Schuberthostapd build config
384bc52338SCy Schubert--------------------
394bc52338SCy Schubert
40*c1d255d3SCy SchubertEnable DPP in hostapd build config file
414bc52338SCy Schubert
424bc52338SCy SchubertCONFIG_DPP=y
434bc52338SCy Schubert
444bc52338SCy SchubertConfigurator build config
454bc52338SCy Schubert-------------------------
464bc52338SCy Schubert
47*c1d255d3SCy SchubertAny STA or AP device can act as a Configurator. Enable DPP in build
48*c1d255d3SCy Schubertconfig. For an AP to act as a Configurator, Interworking needs to be
49*c1d255d3SCy Schubertenabled for GAS. For wpa_supplicant it is not required.
504bc52338SCy Schubert
514bc52338SCy SchubertCONFIG_INTERWORKING=y
524bc52338SCy Schubert
534bc52338SCy Schubert
544bc52338SCy SchubertSample supplicant config file before provisioning
554bc52338SCy Schubert-------------------------------------------------
564bc52338SCy Schubert
574bc52338SCy Schubertctrl_interface=DIR=/var/run/wpa_supplicant
584bc52338SCy Schubertctrl_interface_group=0
594bc52338SCy Schubertupdate_config=1
604bc52338SCy Schubertpmf=2
614bc52338SCy Schubertdpp_config_processing=2
624bc52338SCy Schubert
634bc52338SCy SchubertSample hostapd config file before provisioning
644bc52338SCy Schubert----------------------------------------------
654bc52338SCy Schubert
664bc52338SCy Schubertinterface=wlan0
674bc52338SCy Schubertdriver=nl80211
684bc52338SCy Schubertctrl_interface=/var/run/hostapd
694bc52338SCy Schubertssid=test
704bc52338SCy Schubertchannel=1
714bc52338SCy Schubertwpa=2
724bc52338SCy Schubertwpa_key_mgmt=DPP
734bc52338SCy Schubertieee80211w=1
744bc52338SCy Schubertwpa_pairwise=CCMP
754bc52338SCy Schubertrsn_pairwise=CCMP
764bc52338SCy Schubert
774bc52338SCy Schubert
784bc52338SCy SchubertPre-requisites
794bc52338SCy Schubert--------------
804bc52338SCy Schubert
814bc52338SCy SchubertIt is assumed that an AP and client station are up by running hostapd
824bc52338SCy Schubertand wpa_supplicant using respective config files.
834bc52338SCy Schubert
844bc52338SCy Schubert
854bc52338SCy SchubertCreating Configurator
864bc52338SCy Schubert---------------------
874bc52338SCy Schubert
884bc52338SCy SchubertAdd a Configurator over the control interface (wpa_cli/hostapd_cli)
894bc52338SCy Schubert
904bc52338SCy Schubert> dpp_configurator_add
914bc52338SCy Schubert(returns id)
924bc52338SCy Schubert
934bc52338SCy SchubertTo get key of Configurator
944bc52338SCy Schubert> dpp_configurator_get_key <id>
954bc52338SCy Schubert
964bc52338SCy Schubert
97*c1d255d3SCy SchubertHow to configure an Enrollee using Configurator
984bc52338SCy Schubert-----------------------------------------------
994bc52338SCy Schubert
100*c1d255d3SCy SchubertOn Enrollee side:
1014bc52338SCy Schubert
102*c1d255d3SCy SchubertGenerate QR code for the device. Store the QR code id returned by the
1034bc52338SCy Schubertcommand.
1044bc52338SCy Schubert
105*c1d255d3SCy Schubert> dpp_bootstrap_gen type=qrcode mac=<mac-address-of-device> chan=<operating-class/channel> key=<key of the device>
106*c1d255d3SCy Schubert(Returns bootstrapping info id. If the key parameter is not included, a new key
107*c1d255d3SCy Schubertis generated automatically. The MAC address is specified without octet
108*c1d255d3SCy Schubertseparating colons. The channel list includes the possible channels on which the
109*c1d255d3SCy Schubertdevice is waiting. This uses global operating classes; e.g., 81/1 is the 2.4
110*c1d255d3SCy SchubertGHz channel 1 on 2412 MHz.)
1114bc52338SCy Schubert
112*c1d255d3SCy SchubertGet URI for the QR Code of device using the bootstrap info id.
1134bc52338SCy Schubert> dpp_bootstrap_get_uri <bootstrap-id>
1144bc52338SCy Schubert
115*c1d255d3SCy SchubertMake device listen to DPP request. The central frequency of the 2.4 GHz
116*c1d255d3SCy Schubertband channel 1 is 2412 MHz) in case the Enrollee is a client device. An
117*c1d255d3SCy SchubertAP as an Enrollee is listening on its operating channel.
1184bc52338SCy Schubert
1194bc52338SCy Schubert> dpp_listen <frequency>
1204bc52338SCy Schubert
1214bc52338SCy SchubertOn Configurator side:
1224bc52338SCy Schubert
1234bc52338SCy SchubertEnter the QR Code in the Configurator.
124*c1d255d3SCy Schubert> dpp_qr_code "<URI-from-QR-Code-read-from-enrollee>"
1254bc52338SCy Schubert
1264bc52338SCy SchubertOn successfully adding QR Code, a bootstrapping info id is returned.
1274bc52338SCy Schubert
128*c1d255d3SCy SchubertSend provisioning request to Enrollee. (conf is ap-dpp if Enrollee is an
129*c1d255d3SCy SchubertAP. conf is sta-dpp if Enrollee is a client)
130*c1d255d3SCy Schubert> dpp_auth_init peer=<qr-code-id> conf=<ap-dpp|sta-dpp> ssid=<SSID hexdump> configurator=<configurator-id>
131*c1d255d3SCy Schubertor for legacy (PSK/SAE) provisioning for a station Enrollee:
132*c1d255d3SCy Schubert> dpp_auth_init peer=<qr-code-id> conf=sta-psk ssid=<SSID hexdump> pass=<passphrase hexdump>
1334bc52338SCy Schubert
134*c1d255d3SCy SchubertThe DPP values will be printed in the console. Save these values into the
135*c1d255d3SCy Schubertconfig file. If the Enrollee is an AP, we need to manually write these
136*c1d255d3SCy Schubertvalues to the hostapd config file. If the Enrollee is a client device,
1374bc52338SCy Schubertthese details can be automatically saved to config file using the
1384bc52338SCy Schubertfollowing command.
1394bc52338SCy Schubert
1404bc52338SCy Schubert> save_config
1414bc52338SCy Schubert
1424bc52338SCy SchubertTo set values in runtime for AP enrollees
1434bc52338SCy Schubert
1444bc52338SCy Schubert> set dpp_connector <Connector-value-printed-on-console>
1454bc52338SCy Schubert> set dpp_csign <csign-value-on-console>
1464bc52338SCy Schubert> set dpp_netaccesskey <netaccess-value-on-console>
1474bc52338SCy Schubert
1484bc52338SCy SchubertTo set values in runtime for client enrollees, set dpp_config_processing
1494bc52338SCy Schubertto 2 in wpa_supplicant conf file.
1504bc52338SCy Schubert
1514bc52338SCy SchubertOnce the values are set in run-time (if not set in run-time, but saved
1524bc52338SCy Schubertin config files, they are taken up in next restart), the client device
1534bc52338SCy Schubertwill automatically connect to the already provisioned AP and connection
1544bc52338SCy Schubertwill be established.
1554bc52338SCy Schubert
1564bc52338SCy Schubert
1574bc52338SCy SchubertSelf-configuring a device
1584bc52338SCy Schubert-------------------------
1594bc52338SCy Schubert
1604bc52338SCy SchubertIt is possible for a device to configure itself if it is the
1614bc52338SCy SchubertConfigurator for the network.
1624bc52338SCy Schubert
1634bc52338SCy SchubertCreate a Configurator in the device and use the dpp_configurator_sign
1644bc52338SCy Schubertcommand to get DPP credentials.
1654bc52338SCy Schubert
1664bc52338SCy Schubert> dpp_configurator_add
1674bc52338SCy Schubert(returns configurator id)
168*c1d255d3SCy Schubert> dpp_configurator_sign conf=<ap-dpp|sta-dpp> configurator=<configurator-id> ssid=<SSID hexdump>
1694bc52338SCy Schubert
1704bc52338SCy Schubert
1714bc52338SCy SchubertSample AP configuration files after provisioning
1724bc52338SCy Schubert------------------------------------------------
1734bc52338SCy Schubert
1744bc52338SCy Schubertinterface=wlan0
1754bc52338SCy Schubertdriver=nl80211
1764bc52338SCy Schubertctrl_interface=/var/run/hostapd
1774bc52338SCy Schubertssid=test
1784bc52338SCy Schubertchannel=1
1794bc52338SCy Schubertwpa=2
1804bc52338SCy Schubertwpa_key_mgmt=DPP
1814bc52338SCy Schubertieee80211w=1
1824bc52338SCy Schubertwpa_pairwise=CCMP
1834bc52338SCy Schubertrsn_pairwise=CCMP
1844bc52338SCy Schubertdpp_connector=<Connector value provided by Configurator>
1854bc52338SCy Schubertdpp_csign=<C-Sign-Key value provided by Configurator>
1864bc52338SCy Schubertdpp_netaccesskey=<Net access key provided by Configurator>
1874bc52338SCy Schubert
1884bc52338SCy Schubert
1894bc52338SCy SchubertSample station configuration file after provisioning
1904bc52338SCy Schubert----------------------------------------------------
1914bc52338SCy Schubert
1924bc52338SCy Schubertctrl_interface=DIR=/var/run/wpa_supplicant
1934bc52338SCy Schubertctrl_interface_group=0
1944bc52338SCy Schubertupdate_config=1
1954bc52338SCy Schubertpmf=2
1964bc52338SCy Schubertdpp_config_processing=2
1974bc52338SCy Schubertnetwork={
1984bc52338SCy Schubert	ssid="test"
1994bc52338SCy Schubert	key_mgmt=DPP
2004bc52338SCy Schubert	ieee80211w=2
2014bc52338SCy Schubert	dpp_connector="<Connector value provided by Configurator>"
2024bc52338SCy Schubert	dpp_netaccesskey=<Net access key provided by Configurator>
2034bc52338SCy Schubert	dpp_csign=<C-sign-key value provided by Configurator>
2044bc52338SCy Schubert}
205