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