README-HS20 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503
  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_suffix_match: Constraint for server domain name
  143. # If set, this FQDN is used as a suffix match requirement for the AAA
  144. # server certificate in SubjectAltName dNSName element(s). If a
  145. # matching dNSName is found, this constraint is met. If no dNSName
  146. # values are present, this constraint is matched against SubjetName CN
  147. # using same suffix match comparison. Suffix match here means that the
  148. # host/domain name is compared one label at a time starting from the
  149. # top-level domain and all the labels in @domain_suffix_match shall be
  150. # included in the certificate. The certificate may include additional
  151. # sub-level labels in addition to the required labels.
  152. #
  153. # For example, domain_suffix_match=example.com would match
  154. # test.example.com but would not match test-example.com.
  155. #
  156. # domain: Home service provider FQDN(s)
  157. # This is used to compare against the Domain Name List to figure out
  158. # whether the AP is operated by the Home SP. Multiple domain entries can
  159. # be used to configure alternative FQDNs that will be considered home
  160. # networks.
  161. #
  162. # roaming_consortium: Roaming Consortium OI
  163. # If roaming_consortium_len is non-zero, this field contains the
  164. # Roaming Consortium OI that can be used to determine which access
  165. # points support authentication with this credential. This is an
  166. # alternative to the use of the realm parameter. When using Roaming
  167. # Consortium to match the network, the EAP parameters need to be
  168. # pre-configured with the credential since the NAI Realm information
  169. # may not be available or fetched.
  170. #
  171. # eap: Pre-configured EAP method
  172. # This optional field can be used to specify which EAP method will be
  173. # used with this credential. If not set, the EAP method is selected
  174. # automatically based on ANQP information (e.g., NAI Realm).
  175. #
  176. # phase1: Pre-configure Phase 1 (outer authentication) parameters
  177. # This optional field is used with like the 'eap' parameter.
  178. #
  179. # phase2: Pre-configure Phase 2 (inner authentication) parameters
  180. # This optional field is used with like the 'eap' parameter.
  181. #
  182. # excluded_ssid: Excluded SSID
  183. # This optional field can be used to excluded specific SSID(s) from
  184. # matching with the network. Multiple entries can be used to specify more
  185. # than one SSID.
  186. #
  187. # for example:
  188. #
  189. #cred={
  190. # realm="example.com"
  191. # username="user@example.com"
  192. # password="password"
  193. # ca_cert="/etc/wpa_supplicant/ca.pem"
  194. # domain="example.com"
  195. # domain_suffix_match="example.com"
  196. #}
  197. #
  198. #cred={
  199. # imsi="310026-000000000"
  200. # milenage="90dca4eda45b53cf0f12d7c9c3bc6a89:cb9cccc4b9258e6dca4760379fb82"
  201. #}
  202. #
  203. #cred={
  204. # realm="example.com"
  205. # username="user"
  206. # password="password"
  207. # ca_cert="/etc/wpa_supplicant/ca.pem"
  208. # domain="example.com"
  209. # roaming_consortium=223344
  210. # eap=TTLS
  211. # phase2="auth=MSCHAPV2"
  212. #}
  213. Control interface
  214. -----------------
  215. wpa_supplicant provides a control interface that can be used from
  216. external programs to manage various operations. The included command
  217. line tool, wpa_cli, can be used for manual testing with this interface.
  218. Following wpa_cli interactive mode commands show some examples of manual
  219. operations related to Hotspot 2.0:
  220. Remove configured networks and credentials:
  221. > remove_network all
  222. OK
  223. > remove_cred all
  224. OK
  225. Add a username/password credential:
  226. > add_cred
  227. 0
  228. > set_cred 0 realm "mail.example.com"
  229. OK
  230. > set_cred 0 username "username"
  231. OK
  232. > set_cred 0 password "password"
  233. OK
  234. > set_cred 0 priority 1
  235. OK
  236. Add a SIM credential using a simulated SIM/USIM card for testing:
  237. > add_cred
  238. 1
  239. > set_cred 1 imsi "23456-0000000000"
  240. OK
  241. > set_cred 1 milenage "90dca4eda45b53cf0f12d7c9c3bc6a89:cb9cccc4b9258e6dca4760379fb82581:000000000123"
  242. OK
  243. > set_cred 1 priority 1
  244. OK
  245. Note: the return value of add_cred is used as the first argument to
  246. the following set_cred commands.
  247. Add a SIM credential using a external SIM/USIM processing:
  248. > set external_sim 1
  249. OK
  250. > add_cred
  251. 1
  252. > set_cred 1 imsi "23456-0000000000"
  253. OK
  254. > set_cred 1 eap SIM
  255. OK
  256. Add a WPA2-Enterprise network:
  257. > add_network
  258. 0
  259. > set_network 0 key_mgmt WPA-EAP
  260. OK
  261. > set_network 0 ssid "enterprise"
  262. OK
  263. > set_network 0 eap TTLS
  264. OK
  265. > set_network 0 anonymous_identity "anonymous"
  266. OK
  267. > set_network 0 identity "user"
  268. OK
  269. > set_network 0 password "password"
  270. OK
  271. > set_network 0 priority 0
  272. OK
  273. > enable_network 0 no-connect
  274. OK
  275. Add an open network:
  276. > add_network
  277. 3
  278. > set_network 3 key_mgmt NONE
  279. OK
  280. > set_network 3 ssid "coffee-shop"
  281. OK
  282. > select_network 3
  283. OK
  284. Note: the return value of add_network is used as the first argument to
  285. the following set_network commands.
  286. The preferred credentials/networks can be indicated with the priority
  287. parameter (1 is higher priority than 0).
  288. Interworking network selection can be started with interworking_select
  289. command. This instructs wpa_supplicant to run a network scan and iterate
  290. through the discovered APs to request ANQP information from the APs that
  291. advertise support for Interworking/Hotspot 2.0:
  292. > interworking_select
  293. OK
  294. <3>Starting ANQP fetch for 02:00:00:00:01:00
  295. <3>RX-ANQP 02:00:00:00:01:00 ANQP Capability list
  296. <3>RX-ANQP 02:00:00:00:01:00 Roaming Consortium list
  297. <3>RX-HS20-ANQP 02:00:00:00:01:00 HS Capability List
  298. <3>ANQP fetch completed
  299. <3>INTERWORKING-AP 02:00:00:00:01:00 type=unknown
  300. INTERWORKING-AP event messages indicate the APs that support network
  301. selection and for which there is a matching
  302. credential. interworking_connect command can be used to select a network
  303. to connect with:
  304. > interworking_connect 02:00:00:00:01:00
  305. OK
  306. <3>CTRL-EVENT-SCAN-RESULTS
  307. <3>SME: Trying to authenticate with 02:00:00:00:01:00 (SSID='Example Network' freq=2412 MHz)
  308. <3>Trying to associate with 02:00:00:00:01:00 (SSID='Example Network' freq=2412 MHz)
  309. <3>Associated with 02:00:00:00:01:00
  310. <3>CTRL-EVENT-EAP-STARTED EAP authentication started
  311. <3>CTRL-EVENT-EAP-PROPOSED-METHOD vendor=0 method=21
  312. <3>CTRL-EVENT-EAP-METHOD EAP vendor 0 method 21 (TTLS) selected
  313. <3>CTRL-EVENT-EAP-SUCCESS EAP authentication completed successfully
  314. <3>WPA: Key negotiation completed with 02:00:00:00:01:00 [PTK=CCMP GTK=CCMP]
  315. <3>CTRL-EVENT-CONNECTED - Connection to 02:00:00:00:01:00 completed (auth) [id=0 id_str=]
  316. wpa_supplicant creates a temporary network block for the selected
  317. network based on the configured credential and ANQP information from the
  318. AP:
  319. > list_networks
  320. network id / ssid / bssid / flags
  321. 0 Example Network any [CURRENT]
  322. > get_network 0 key_mgmt
  323. WPA-EAP
  324. > get_network 0 eap
  325. TTLS
  326. Alternatively to using an external program to select the network,
  327. "interworking_select auto" command can be used to request wpa_supplicant
  328. to select which network to use based on configured priorities:
  329. > remove_network all
  330. OK
  331. <3>CTRL-EVENT-DISCONNECTED bssid=02:00:00:00:01:00 reason=1 locally_generated=1
  332. > interworking_select auto
  333. OK
  334. <3>Starting ANQP fetch for 02:00:00:00:01:00
  335. <3>RX-ANQP 02:00:00:00:01:00 ANQP Capability list
  336. <3>RX-ANQP 02:00:00:00:01:00 Roaming Consortium list
  337. <3>RX-HS20-ANQP 02:00:00:00:01:00 HS Capability List
  338. <3>ANQP fetch completed
  339. <3>INTERWORKING-AP 02:00:00:00:01:00 type=unknown
  340. <3>CTRL-EVENT-SCAN-RESULTS
  341. <3>SME: Trying to authenticate with 02:00:00:00:01:00 (SSID='Example Network' freq=2412 MHz)
  342. <3>Trying to associate with 02:00:00:00:01:00 (SSID='Example Network' freq=2412 MHz)
  343. <3>Associated with 02:00:00:00:01:00
  344. <3>CTRL-EVENT-EAP-STARTED EAP authentication started
  345. <3>CTRL-EVENT-EAP-PROPOSED-METHOD vendor=0 method=21
  346. <3>CTRL-EVENT-EAP-METHOD EAP vendor 0 method 21 (TTLS) selected
  347. <3>CTRL-EVENT-EAP-SUCCESS EAP authentication completed successfully
  348. <3>WPA: Key negotiation completed with 02:00:00:00:01:00 [PTK=CCMP GTK=CCMP]
  349. <3>CTRL-EVENT-CONNECTED - Connection to 02:00:00:00:01:00 completed (reauth) [id=0 id_str=]
  350. The connection status can be shown with the status command:
  351. > status
  352. bssid=02:00:00:00:01:00
  353. ssid=Example Network
  354. id=0
  355. mode=station
  356. pairwise_cipher=CCMP <--- link layer security indication
  357. group_cipher=CCMP
  358. key_mgmt=WPA2/IEEE 802.1X/EAP
  359. wpa_state=COMPLETED
  360. p2p_device_address=02:00:00:00:00:00
  361. address=02:00:00:00:00:00
  362. hs20=1 <--- HS 2.0 indication
  363. Supplicant PAE state=AUTHENTICATED
  364. suppPortStatus=Authorized
  365. EAP state=SUCCESS
  366. selectedMethod=21 (EAP-TTLS)
  367. EAP TLS cipher=AES-128-SHA
  368. EAP-TTLSv0 Phase2 method=PAP
  369. > status
  370. bssid=02:00:00:00:02:00
  371. ssid=coffee-shop
  372. id=3
  373. mode=station
  374. pairwise_cipher=NONE
  375. group_cipher=NONE
  376. key_mgmt=NONE
  377. wpa_state=COMPLETED
  378. p2p_device_address=02:00:00:00:00:00
  379. address=02:00:00:00:00:00
  380. Note: The Hotspot 2.0 indication is shown as "hs20=1" in the status
  381. command output. Link layer security is indicated with the
  382. pairwise_cipher (CCMP = secure, NONE = no encryption used).
  383. Also the scan results include the Hotspot 2.0 indication:
  384. > scan_results
  385. bssid / frequency / signal level / flags / ssid
  386. 02:00:00:00:01:00 2412 -30 [WPA2-EAP-CCMP][ESS][HS20] Example Network
  387. ANQP information for the BSS can be fetched using the BSS command:
  388. > bss 02:00:00:00:01:00
  389. id=1
  390. bssid=02:00:00:00:01:00
  391. freq=2412
  392. beacon_int=100
  393. capabilities=0x0411
  394. qual=0
  395. noise=-92
  396. level=-30
  397. tsf=1345573286517276
  398. age=105
  399. ie=000f4578616d706c65204e6574776f726b010882848b960c1218240301012a010432043048606c30140100000fac040100000fac040100000fac0100007f04000000806b091e07010203040506076c027f006f1001531122331020304050010203040506dd05506f9a1000
  400. flags=[WPA2-EAP-CCMP][ESS][HS20]
  401. ssid=Example Network
  402. anqp_roaming_consortium=031122330510203040500601020304050603fedcba
  403. ANQP queries can also be requested with the anqp_get and hs20_anqp_get
  404. commands:
  405. > anqp_get 02:00:00:00:01:00 261
  406. OK
  407. <3>RX-ANQP 02:00:00:00:01:00 Roaming Consortium list
  408. > hs20_anqp_get 02:00:00:00:01:00 2
  409. OK
  410. <3>RX-HS20-ANQP 02:00:00:00:01:00 HS Capability List
  411. In addition, fetch_anqp command can be used to request similar set of
  412. ANQP queries to be done as is run as part of interworking_select:
  413. > scan
  414. OK
  415. <3>CTRL-EVENT-SCAN-RESULTS
  416. > fetch_anqp
  417. OK
  418. <3>Starting ANQP fetch for 02:00:00:00:01:00
  419. <3>RX-ANQP 02:00:00:00:01:00 ANQP Capability list
  420. <3>RX-ANQP 02:00:00:00:01:00 Roaming Consortium list
  421. <3>RX-HS20-ANQP 02:00:00:00:01:00 HS Capability List
  422. <3>ANQP fetch completed