README-HS20 13 KB

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