README-HS20 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475
  1. wpa_supplicant and Hotspot 2.0
  2. ==============================
  3. This document describe how the IEEE 802.11u Interworking and Wi-Fi
  4. Hotspot 2.0 (Release 1) implementation in wpa_supplicant can be
  5. configured and how an external component on the client e.g., management
  6. GUI or Wi-Fi framework) is used to manage this functionality.
  7. Introduction to Wi-Fi Hotspot 2.0
  8. ---------------------------------
  9. Hotspot 2.0 is the name of the Wi-Fi Alliance specification that is used
  10. in the Wi-Fi CERTIFIED Passpoint<TM> program. More information about
  11. this is available in this white paper:
  12. http://www.wi-fi.org/knowledge-center/white-papers/wi-fi-certified-passpoint%E2%84%A2-new-program-wi-fi-alliance%C2%AE-enable-seamless
  13. The Hotspot 2.0 specification is also available from WFA:
  14. https://www.wi-fi.org/knowledge-center/published-specifications
  15. The core Interworking functionality (network selection, GAS/ANQP) were
  16. standardized in IEEE Std 802.11u-2011 which is now part of the IEEE Std
  17. 802.11-2012.
  18. wpa_supplicant network selection
  19. --------------------------------
  20. Interworking support added option for configuring credentials that can
  21. work with multiple networks as an alternative to configuration of
  22. network blocks (e.g., per-SSID parameters). When requested to perform
  23. network selection, wpa_supplicant picks the highest priority enabled
  24. network block or credential. If a credential is picked (based on ANQP
  25. information from APs), a temporary network block is created
  26. automatically for the matching network. This temporary network block is
  27. used similarly to the network blocks that can be configured by the user,
  28. but it is not stored into the configuration file and is meant to be used
  29. only for temporary period of time since a new one can be created
  30. whenever needed based on ANQP information and the credential.
  31. By default, wpa_supplicant is not using automatic network selection
  32. unless requested explicitly with the interworking_select command. This
  33. can be changed with the auto_interworking=1 parameter to perform network
  34. selection automatically whenever trying to find a network for connection
  35. and none of the enabled network blocks match with the scan results. This
  36. case works similarly to "interworking_select auto", i.e., wpa_supplicant
  37. will internally determine which network or credential is going to be
  38. used based on configured priorities, scan results, and ANQP information.
  39. wpa_supplicant configuration
  40. ----------------------------
  41. Interworking and Hotspot 2.0 functionality are optional components that
  42. need to be enabled in the wpa_supplicant build configuration
  43. (.config). This is done by adding following parameters into that file:
  44. CONFIG_INTERWORKING=y
  45. CONFIG_HS20=y
  46. It should be noted that this functionality requires a driver that
  47. supports GAS/ANQP operations. This uses the same design as P2P, i.e.,
  48. Action frame processing and building in user space within
  49. wpa_supplicant. The Linux nl80211 driver interface provides the needed
  50. functionality for this.
  51. There are number of run-time configuration parameters (e.g., in
  52. wpa_supplicant.conf when using the configuration file) that can be used
  53. to control Hotspot 2.0 operations.
  54. # Enable Interworking
  55. interworking=1
  56. # Enable Hotspot 2.0
  57. hs20=1
  58. # Parameters for controlling scanning
  59. # Homogenous ESS identifier
  60. # If this is set, scans will be used to request response only from BSSes
  61. # belonging to the specified Homogeneous ESS. This is used only if interworking
  62. # is enabled.
  63. #hessid=00:11:22:33:44:55
  64. # Access Network Type
  65. # When Interworking is enabled, scans can be limited to APs that advertise the
  66. # specified Access Network Type (0..15; with 15 indicating wildcard match).
  67. # This value controls the Access Network Type value in Probe Request frames.
  68. #access_network_type=15
  69. # Automatic network selection behavior
  70. # 0 = do not automatically go through Interworking network selection
  71. # (i.e., require explicit interworking_select command for this; default)
  72. # 1 = perform Interworking network selection if one or more
  73. # credentials have been configured and scan did not find a
  74. # matching network block
  75. #auto_interworking=0
  76. Credentials can be pre-configured for automatic network selection:
  77. # credential block
  78. #
  79. # Each credential used for automatic network selection is configured as a set
  80. # of parameters that are compared to the information advertised by the APs when
  81. # interworking_select and interworking_connect commands are used.
  82. #
  83. # credential fields:
  84. #
  85. # priority: Priority group
  86. # By default, all networks and credentials get the same priority group
  87. # (0). This field can be used to give higher priority for credentials
  88. # (and similarly in struct wpa_ssid for network blocks) to change the
  89. # Interworking automatic networking selection behavior. The matching
  90. # network (based on either an enabled network block or a credential)
  91. # with the highest priority value will be selected.
  92. #
  93. # pcsc: Use PC/SC and SIM/USIM card
  94. #
  95. # realm: Home Realm for Interworking
  96. #
  97. # username: Username for Interworking network selection
  98. #
  99. # password: Password for Interworking network selection
  100. #
  101. # ca_cert: CA certificate for Interworking network selection
  102. #
  103. # client_cert: File path to client certificate file (PEM/DER)
  104. # This field is used with Interworking networking selection for a case
  105. # where client certificate/private key is used for authentication
  106. # (EAP-TLS). Full path to the file should be used since working
  107. # directory may change when wpa_supplicant is run in the background.
  108. #
  109. # Alternatively, a named configuration blob can be used by setting
  110. # this to blob://blob_name.
  111. #
  112. # private_key: File path to client private key file (PEM/DER/PFX)
  113. # When PKCS#12/PFX file (.p12/.pfx) is used, client_cert should be
  114. # commented out. Both the private key and certificate will be read
  115. # from the PKCS#12 file in this case. Full path to the file should be
  116. # used since working directory may change when wpa_supplicant is run
  117. # in the background.
  118. #
  119. # Windows certificate store can be used by leaving client_cert out and
  120. # configuring private_key in one of the following formats:
  121. #
  122. # cert://substring_to_match
  123. #
  124. # hash://certificate_thumbprint_in_hex
  125. #
  126. # For example: private_key="hash://63093aa9c47f56ae88334c7b65a4"
  127. #
  128. # Note that when running wpa_supplicant as an application, the user
  129. # certificate store (My user account) is used, whereas computer store
  130. # (Computer account) is used when running wpasvc as a service.
  131. #
  132. # Alternatively, a named configuration blob can be used by setting
  133. # this to blob://blob_name.
  134. #
  135. # private_key_passwd: Password for private key file
  136. #
  137. # imsi: IMSI in <MCC> | <MNC> | '-' | <MSIN> format
  138. #
  139. # milenage: Milenage parameters for SIM/USIM simulator in <Ki>:<OPc>:<SQN>
  140. # format
  141. #
  142. # domain: Home service provider FQDN
  143. # This is used to compare against the Domain Name List to figure out
  144. # whether the AP is operated by the Home SP.
  145. #
  146. # roaming_consortium: Roaming Consortium OI
  147. # If roaming_consortium_len is non-zero, this field contains the
  148. # Roaming Consortium OI that can be used to determine which access
  149. # points support authentication with this credential. This is an
  150. # alternative to the use of the realm parameter. When using Roaming
  151. # Consortium to match the network, the EAP parameters need to be
  152. # pre-configured with the credential since the NAI Realm information
  153. # may not be available or fetched.
  154. #
  155. # eap: Pre-configured EAP method
  156. # This optional field can be used to specify which EAP method will be
  157. # used with this credential. If not set, the EAP method is selected
  158. # automatically based on ANQP information (e.g., NAI Realm).
  159. #
  160. # phase1: Pre-configure Phase 1 (outer authentication) parameters
  161. # This optional field is used with like the 'eap' parameter.
  162. #
  163. # phase2: Pre-configure Phase 2 (inner authentication) parameters
  164. # This optional field is used with like the 'eap' parameter.
  165. #
  166. # excluded_ssid: Excluded SSID
  167. # This optional field can be used to excluded specific SSID(s) from
  168. # matching with the network. Multiple entries can be used to specify more
  169. # than one SSID.
  170. #
  171. # for example:
  172. #
  173. #cred={
  174. # realm="example.com"
  175. # username="user@example.com"
  176. # password="password"
  177. # ca_cert="/etc/wpa_supplicant/ca.pem"
  178. # domain="example.com"
  179. #}
  180. #
  181. #cred={
  182. # imsi="310026-000000000"
  183. # milenage="90dca4eda45b53cf0f12d7c9c3bc6a89:cb9cccc4b9258e6dca4760379fb82"
  184. #}
  185. #
  186. #cred={
  187. # realm="example.com"
  188. # username="user"
  189. # password="password"
  190. # ca_cert="/etc/wpa_supplicant/ca.pem"
  191. # domain="example.com"
  192. # roaming_consortium=223344
  193. # eap=TTLS
  194. # phase2="auth=MSCHAPV2"
  195. #}
  196. Control interface
  197. -----------------
  198. wpa_supplicant provides a control interface that can be used from
  199. external programs to manage various operations. The included command
  200. line tool, wpa_cli, can be used for manual testing with this interface.
  201. Following wpa_cli interactive mode commands show some examples of manual
  202. operations related to Hotspot 2.0:
  203. Remove configured networks and credentials:
  204. > remove_network all
  205. OK
  206. > remove_cred all
  207. OK
  208. Add a username/password credential:
  209. > add_cred
  210. 0
  211. > set_cred 0 realm "mail.example.com"
  212. OK
  213. > set_cred 0 username "username"
  214. OK
  215. > set_cred 0 password "password"
  216. OK
  217. > set_cred 0 priority 1
  218. OK
  219. Add a SIM credential using a simulated SIM/USIM card for testing:
  220. > add_cred
  221. 1
  222. > set_cred 1 imsi "23456-0000000000"
  223. OK
  224. > set_cred 1 milenage "90dca4eda45b53cf0f12d7c9c3bc6a89:cb9cccc4b9258e6dca4760379fb82581:000000000123"
  225. OK
  226. > set_cred 1 priority 1
  227. OK
  228. Note: the return value of add_cred is used as the first argument to
  229. the following set_cred commands.
  230. Add a WPA2-Enterprise network:
  231. > add_network
  232. 0
  233. > set_network 0 key_mgmt WPA-EAP
  234. OK
  235. > set_network 0 ssid "enterprise"
  236. OK
  237. > set_network 0 eap TTLS
  238. OK
  239. > set_network 0 anonymous_identity "anonymous"
  240. OK
  241. > set_network 0 identity "user"
  242. OK
  243. > set_network 0 password "password"
  244. OK
  245. > set_network 0 priority 0
  246. OK
  247. > enable_network 0 no-connect
  248. OK
  249. Add an open network:
  250. > add_network
  251. 3
  252. > set_network 3 key_mgmt NONE
  253. OK
  254. > set_network 3 ssid "coffee-shop"
  255. OK
  256. > select_network 3
  257. OK
  258. Note: the return value of add_network is used as the first argument to
  259. the following set_network commands.
  260. The preferred credentials/networks can be indicated with the priority
  261. parameter (1 is higher priority than 0).
  262. Interworking network selection can be started with interworking_select
  263. command. This instructs wpa_supplicant to run a network scan and iterate
  264. through the discovered APs to request ANQP information from the APs that
  265. advertise support for Interworking/Hotspot 2.0:
  266. > interworking_select
  267. OK
  268. <3>Starting ANQP fetch for 02:00:00:00:01:00
  269. <3>RX-ANQP 02:00:00:00:01:00 ANQP Capability list
  270. <3>RX-ANQP 02:00:00:00:01:00 Roaming Consortium list
  271. <3>RX-HS20-ANQP 02:00:00:00:01:00 HS Capability List
  272. <3>ANQP fetch completed
  273. <3>INTERWORKING-AP 02:00:00:00:01:00 type=unknown
  274. INTERWORKING-AP event messages indicate the APs that support network
  275. selection and for which there is a matching
  276. credential. interworking_connect command can be used to select a network
  277. to connect with:
  278. > interworking_connect 02:00:00:00:01:00
  279. OK
  280. <3>CTRL-EVENT-SCAN-RESULTS
  281. <3>SME: Trying to authenticate with 02:00:00:00:01:00 (SSID='Example Network' freq=2412 MHz)
  282. <3>Trying to associate with 02:00:00:00:01:00 (SSID='Example Network' freq=2412 MHz)
  283. <3>Associated with 02:00:00:00:01:00
  284. <3>CTRL-EVENT-EAP-STARTED EAP authentication started
  285. <3>CTRL-EVENT-EAP-PROPOSED-METHOD vendor=0 method=21
  286. <3>CTRL-EVENT-EAP-METHOD EAP vendor 0 method 21 (TTLS) selected
  287. <3>CTRL-EVENT-EAP-SUCCESS EAP authentication completed successfully
  288. <3>WPA: Key negotiation completed with 02:00:00:00:01:00 [PTK=CCMP GTK=CCMP]
  289. <3>CTRL-EVENT-CONNECTED - Connection to 02:00:00:00:01:00 completed (auth) [id=0 id_str=]
  290. wpa_supplicant creates a temporary network block for the selected
  291. network based on the configured credential and ANQP information from the
  292. AP:
  293. > list_networks
  294. network id / ssid / bssid / flags
  295. 0 Example Network any [CURRENT]
  296. > get_network 0 key_mgmt
  297. WPA-EAP
  298. > get_network 0 eap
  299. TTLS
  300. Alternatively to using an external program to select the network,
  301. "interworking_select auto" command can be used to request wpa_supplicant
  302. to select which network to use based on configured priorities:
  303. > remove_network all
  304. OK
  305. <3>CTRL-EVENT-DISCONNECTED bssid=02:00:00:00:01:00 reason=1 locally_generated=1
  306. > interworking_select auto
  307. OK
  308. <3>Starting ANQP fetch for 02:00:00:00:01:00
  309. <3>RX-ANQP 02:00:00:00:01:00 ANQP Capability list
  310. <3>RX-ANQP 02:00:00:00:01:00 Roaming Consortium list
  311. <3>RX-HS20-ANQP 02:00:00:00:01:00 HS Capability List
  312. <3>ANQP fetch completed
  313. <3>INTERWORKING-AP 02:00:00:00:01:00 type=unknown
  314. <3>CTRL-EVENT-SCAN-RESULTS
  315. <3>SME: Trying to authenticate with 02:00:00:00:01:00 (SSID='Example Network' freq=2412 MHz)
  316. <3>Trying to associate with 02:00:00:00:01:00 (SSID='Example Network' freq=2412 MHz)
  317. <3>Associated with 02:00:00:00:01:00
  318. <3>CTRL-EVENT-EAP-STARTED EAP authentication started
  319. <3>CTRL-EVENT-EAP-PROPOSED-METHOD vendor=0 method=21
  320. <3>CTRL-EVENT-EAP-METHOD EAP vendor 0 method 21 (TTLS) selected
  321. <3>CTRL-EVENT-EAP-SUCCESS EAP authentication completed successfully
  322. <3>WPA: Key negotiation completed with 02:00:00:00:01:00 [PTK=CCMP GTK=CCMP]
  323. <3>CTRL-EVENT-CONNECTED - Connection to 02:00:00:00:01:00 completed (reauth) [id=0 id_str=]
  324. The connection status can be shown with the status command:
  325. > status
  326. bssid=02:00:00:00:01:00
  327. ssid=Example Network
  328. id=0
  329. mode=station
  330. pairwise_cipher=CCMP <--- link layer security indication
  331. group_cipher=CCMP
  332. key_mgmt=WPA2/IEEE 802.1X/EAP
  333. wpa_state=COMPLETED
  334. p2p_device_address=02:00:00:00:00:00
  335. address=02:00:00:00:00:00
  336. hs20=1 <--- HS 2.0 indication
  337. Supplicant PAE state=AUTHENTICATED
  338. suppPortStatus=Authorized
  339. EAP state=SUCCESS
  340. selectedMethod=21 (EAP-TTLS)
  341. EAP TLS cipher=AES-128-SHA
  342. EAP-TTLSv0 Phase2 method=PAP
  343. > status
  344. bssid=02:00:00:00:02:00
  345. ssid=coffee-shop
  346. id=3
  347. mode=station
  348. pairwise_cipher=NONE
  349. group_cipher=NONE
  350. key_mgmt=NONE
  351. wpa_state=COMPLETED
  352. p2p_device_address=02:00:00:00:00:00
  353. address=02:00:00:00:00:00
  354. Note: The Hotspot 2.0 indication is shown as "hs20=1" in the status
  355. command output. Link layer security is indicated with the
  356. pairwise_cipher (CCMP = secure, NONE = no encryption used).
  357. Also the scan results include the Hotspot 2.0 indication:
  358. > scan_results
  359. bssid / frequency / signal level / flags / ssid
  360. 02:00:00:00:01:00 2412 -30 [WPA2-EAP-CCMP][ESS][HS20] Example Network
  361. ANQP information for the BSS can be fetched using the BSS command:
  362. > bss 02:00:00:00:01:00
  363. id=1
  364. bssid=02:00:00:00:01:00
  365. freq=2412
  366. beacon_int=100
  367. capabilities=0x0411
  368. qual=0
  369. noise=-92
  370. level=-30
  371. tsf=1345573286517276
  372. age=105
  373. ie=000f4578616d706c65204e6574776f726b010882848b960c1218240301012a010432043048606c30140100000fac040100000fac040100000fac0100007f04000000806b091e07010203040506076c027f006f1001531122331020304050010203040506dd05506f9a1000
  374. flags=[WPA2-EAP-CCMP][ESS][HS20]
  375. ssid=Example Network
  376. anqp_roaming_consortium=031122330510203040500601020304050603fedcba
  377. ANQP queries can also be requested with the anqp_get and hs20_anqp_get
  378. commands:
  379. > anqp_get 02:00:00:00:01:00 261
  380. OK
  381. <3>RX-ANQP 02:00:00:00:01:00 Roaming Consortium list
  382. > hs20_anqp_get 02:00:00:00:01:00 2
  383. OK
  384. <3>RX-HS20-ANQP 02:00:00:00:01:00 HS Capability List
  385. In addition, fetch_anqp command can be used to request similar set of
  386. ANQP queries to be done as is run as part of interworking_select:
  387. > scan
  388. OK
  389. <3>CTRL-EVENT-SCAN-RESULTS
  390. > fetch_anqp
  391. OK
  392. <3>Starting ANQP fetch for 02:00:00:00:01:00
  393. <3>RX-ANQP 02:00:00:00:01:00 ANQP Capability list
  394. <3>RX-ANQP 02:00:00:00:01:00 Roaming Consortium list
  395. <3>RX-HS20-ANQP 02:00:00:00:01:00 HS Capability List
  396. <3>ANQP fetch completed