1wpa_supplicant and Hotspot 2.0 2============================== 3 4This document describe how the IEEE 802.11u Interworking and Wi-Fi 5Hotspot 2.0 (Release 1) implementation in wpa_supplicant can be 6configured and how an external component on the client e.g., management 7GUI or Wi-Fi framework) is used to manage this functionality. 8 9 10Introduction to Wi-Fi Hotspot 2.0 11--------------------------------- 12 13Hotspot 2.0 is the name of the Wi-Fi Alliance specification that is used 14in the Wi-Fi CERTIFIED Passpoint<TM> program. More information about 15this is available in this white paper: 16 17http://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 19The Hotspot 2.0 specification is also available from WFA: 20https://www.wi-fi.org/knowledge-center/published-specifications 21 22The core Interworking functionality (network selection, GAS/ANQP) were 23standardized in IEEE Std 802.11u-2011 which is now part of the IEEE Std 24802.11-2012. 25 26 27wpa_supplicant network selection 28-------------------------------- 29 30Interworking support added option for configuring credentials that can 31work with multiple networks as an alternative to configuration of 32network blocks (e.g., per-SSID parameters). When requested to perform 33network selection, wpa_supplicant picks the highest priority enabled 34network block or credential. If a credential is picked (based on ANQP 35information from APs), a temporary network block is created 36automatically for the matching network. This temporary network block is 37used similarly to the network blocks that can be configured by the user, 38but it is not stored into the configuration file and is meant to be used 39only for temporary period of time since a new one can be created 40whenever needed based on ANQP information and the credential. 41 42By default, wpa_supplicant is not using automatic network selection 43unless requested explicitly with the interworking_select command. This 44can be changed with the auto_interworking=1 parameter to perform network 45selection automatically whenever trying to find a network for connection 46and none of the enabled network blocks match with the scan results. This 47case works similarly to "interworking_select auto", i.e., wpa_supplicant 48will internally determine which network or credential is going to be 49used based on configured priorities, scan results, and ANQP information. 50 51 52wpa_supplicant configuration 53---------------------------- 54 55Interworking and Hotspot 2.0 functionality are optional components that 56need to be enabled in the wpa_supplicant build configuration 57(.config). This is done by adding following parameters into that file: 58 59CONFIG_INTERWORKING=y 60CONFIG_HS20=y 61 62It should be noted that this functionality requires a driver that 63supports GAS/ANQP operations. This uses the same design as P2P, i.e., 64Action frame processing and building in user space within 65wpa_supplicant. The Linux nl80211 driver interface provides the needed 66functionality for this. 67 68 69There are number of run-time configuration parameters (e.g., in 70wpa_supplicant.conf when using the configuration file) that can be used 71to control Hotspot 2.0 operations. 72 73# Enable Interworking 74interworking=1 75 76# Enable Hotspot 2.0 77hs20=1 78 79# Parameters for controlling scanning 80 81# Homogeneous 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 102Credentials 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# temporary: Whether this credential is temporary and not to be saved 113# 114# priority: Priority group 115# By default, all networks and credentials get the same priority group 116# (0). This field can be used to give higher priority for credentials 117# (and similarly in struct wpa_ssid for network blocks) to change the 118# Interworking automatic networking selection behavior. The matching 119# network (based on either an enabled network block or a credential) 120# with the highest priority value will be selected. 121# 122# pcsc: Use PC/SC and SIM/USIM card 123# 124# realm: Home Realm for Interworking 125# 126# username: Username for Interworking network selection 127# 128# password: Password for Interworking network selection 129# 130# ca_cert: CA certificate for Interworking network selection 131# 132# client_cert: File path to client certificate file (PEM/DER) 133# This field is used with Interworking networking selection for a case 134# where client certificate/private key is used for authentication 135# (EAP-TLS). Full path to the file should be used since working 136# directory may change when wpa_supplicant is run in the background. 137# 138# Alternatively, a named configuration blob can be used by setting 139# this to blob://blob_name. 140# 141# private_key: File path to client private key file (PEM/DER/PFX) 142# When PKCS#12/PFX file (.p12/.pfx) is used, client_cert should be 143# commented out. Both the private key and certificate will be read 144# from the PKCS#12 file in this case. Full path to the file should be 145# used since working directory may change when wpa_supplicant is run 146# in the background. 147# 148# Windows certificate store can be used by leaving client_cert out and 149# configuring private_key in one of the following formats: 150# 151# cert://substring_to_match 152# 153# hash://certificate_thumbprint_in_hex 154# 155# For example: private_key="hash://63093aa9c47f56ae88334c7b65a4" 156# 157# Note that when running wpa_supplicant as an application, the user 158# certificate store (My user account) is used, whereas computer store 159# (Computer account) is used when running wpasvc as a service. 160# 161# Alternatively, a named configuration blob can be used by setting 162# this to blob://blob_name. 163# 164# private_key_passwd: Password for private key file 165# 166# imsi: IMSI in <MCC> | <MNC> | '-' | <MSIN> format 167# 168# milenage: Milenage parameters for SIM/USIM simulator in <Ki>:<OPc>:<SQN> 169# format 170# 171# imsi_privacy_key: IMSI privacy key (PEM encoded X.509v3 certificate) 172# This field is used with EAP-SIM/AKA/AKA' to encrypt the permanent 173# identity (IMSI) to improve privacy. The X.509v3 certificate needs to 174# include a 2048-bit RSA public key and this is from the operator who 175# authenticates the SIM/USIM. 176# 177# domain_suffix_match: Constraint for server domain name 178# If set, this FQDN is used as a suffix match requirement for the AAA 179# server certificate in SubjectAltName dNSName element(s). If a 180# matching dNSName is found, this constraint is met. If no dNSName 181# values are present, this constraint is matched against SubjectName CN 182# using same suffix match comparison. Suffix match here means that the 183# host/domain name is compared one label at a time starting from the 184# top-level domain and all the labels in @domain_suffix_match shall be 185# included in the certificate. The certificate may include additional 186# sub-level labels in addition to the required labels. 187# 188# For example, domain_suffix_match=example.com would match 189# test.example.com but would not match test-example.com. 190# 191# domain: Home service provider FQDN(s) 192# This is used to compare against the Domain Name List to figure out 193# whether the AP is operated by the Home SP. Multiple domain entries can 194# be used to configure alternative FQDNs that will be considered home 195# networks. 196# 197# roaming_consortium: Roaming Consortium OI 198# If roaming_consortium_len is non-zero, this field contains the 199# Roaming Consortium OI that can be used to determine which access 200# points support authentication with this credential. This is an 201# alternative to the use of the realm parameter. When using Roaming 202# Consortium to match the network, the EAP parameters need to be 203# pre-configured with the credential since the NAI Realm information 204# may not be available or fetched. 205# 206# required_roaming_consortium: Required Roaming Consortium OI 207# If required_roaming_consortium_len is non-zero, this field contains the 208# Roaming Consortium OI that is required to be advertised by the AP for 209# the credential to be considered matching. 210# 211# roaming_consortiums: Roaming Consortium OI(s) memberships 212# This string field contains one or more comma delimited OIs (hexdump) 213# identifying the roaming consortiums of which the provider is a member. 214# The list is sorted from the most preferred one to the least preferred 215# one. A match between the Roaming Consortium OIs advertised by an AP and 216# the OIs in this list indicates that successful authentication is 217# possible. 218# (Hotspot 2.0 PerProviderSubscription/<X+>/HomeSP/RoamingConsortiumOI) 219# 220# eap: Pre-configured EAP method 221# This optional field can be used to specify which EAP method will be 222# used with this credential. If not set, the EAP method is selected 223# automatically based on ANQP information (e.g., NAI Realm). 224# 225# phase1: Pre-configure Phase 1 (outer authentication) parameters 226# This optional field is used with like the 'eap' parameter. 227# 228# phase2: Pre-configure Phase 2 (inner authentication) parameters 229# This optional field is used with like the 'eap' parameter. 230# 231# excluded_ssid: Excluded SSID 232# This optional field can be used to excluded specific SSID(s) from 233# matching with the network. Multiple entries can be used to specify more 234# than one SSID. 235# 236# roaming_partner: Roaming partner information 237# This optional field can be used to configure preferences between roaming 238# partners. The field is a string in following format: 239# <FQDN>,<0/1 exact match>,<priority>,<* or country code> 240# (non-exact match means any subdomain matches the entry; priority is in 241# 0..255 range with 0 being the highest priority) 242# 243# update_identifier: PPS MO ID 244# (Hotspot 2.0 PerProviderSubscription/UpdateIdentifier) 245# 246# provisioning_sp: FQDN of the SP that provisioned the credential 247# This optional field can be used to keep track of the SP that provisioned 248# the credential to find the PPS MO (./Wi-Fi/<provisioning_sp>). 249# 250# sp_priority: Credential priority within a provisioning SP 251# This is the priority of the credential among all credentials 252# provisioned by the same SP (i.e., for entries that have identical 253# provisioning_sp value). The range of this priority is 0-255 with 0 254# being the highest and 255 the lower priority. 255# 256# Minimum backhaul threshold (PPS/<X+>/Policy/MinBackhauldThreshold/*) 257# These fields can be used to specify minimum download/upload backhaul 258# bandwidth that is preferred for the credential. This constraint is 259# ignored if the AP does not advertise WAN Metrics information or if the 260# limit would prevent any connection. Values are in kilobits per second. 261# min_dl_bandwidth_home 262# min_ul_bandwidth_home 263# min_dl_bandwidth_roaming 264# min_ul_bandwidth_roaming 265# 266# max_bss_load: Maximum BSS Load Channel Utilization (1..255) 267# (PPS/<X+>/Policy/MaximumBSSLoadValue) 268# This value is used as the maximum channel utilization for network 269# selection purposes for home networks. If the AP does not advertise 270# BSS Load or if the limit would prevent any connection, this constraint 271# will be ignored. 272# 273# req_conn_capab: Required connection capability 274# (PPS/<X+>/Policy/RequiredProtoPortTuple) 275# This value is used to configure set of required protocol/port pairs that 276# a roaming network shall support (include explicitly in Connection 277# Capability ANQP element). This constraint is ignored if the AP does not 278# advertise Connection Capability or if this constraint would prevent any 279# network connection. This policy is not used in home networks. 280# Format: <protocol>[:<comma-separated list of ports] 281# Multiple entries can be used to list multiple requirements. 282# For example, number of common TCP protocols: 283# req_conn_capab=6:22,80,443 284# For example, IPSec/IKE: 285# req_conn_capab=17:500 286# req_conn_capab=50 287# 288# ocsp: Whether to use/require OCSP to check server certificate 289# 0 = do not use OCSP stapling (TLS certificate status extension) 290# 1 = try to use OCSP stapling, but not require response 291# 2 = require valid OCSP stapling response 292# 293# sim_num: Identifier for which SIM to use in multi-SIM devices 294# 295# engine: Whether to use an engine for private key operations (0/1) 296# engine_id: String identifying the engine to use 297# ca_cert_id: The CA certificate identifier when using an engine 298# cert_id: The certificate identifier when using an engine 299# key_id: The private key identifier when using an engine 300# 301# for example: 302# 303#cred={ 304# realm="example.com" 305# username="user@example.com" 306# password="password" 307# ca_cert="/etc/wpa_supplicant/ca.pem" 308# domain="example.com" 309# domain_suffix_match="example.com" 310#} 311# 312#cred={ 313# imsi="310026-000000000" 314# milenage="90dca4eda45b53cf0f12d7c9c3bc6a89:cb9cccc4b9258e6dca4760379fb82" 315#} 316# 317#cred={ 318# realm="example.com" 319# username="user" 320# password="password" 321# ca_cert="/etc/wpa_supplicant/ca.pem" 322# domain="example.com" 323# roaming_consortium=223344 324# roaming_consortiums="112233,4455667788,aabbcc" 325# eap=TTLS 326# phase2="auth=MSCHAPV2" 327#} 328 329 330Control interface 331----------------- 332 333wpa_supplicant provides a control interface that can be used from 334external programs to manage various operations. The included command 335line tool, wpa_cli, can be used for manual testing with this interface. 336 337Following wpa_cli interactive mode commands show some examples of manual 338operations related to Hotspot 2.0: 339 340Remove configured networks and credentials: 341 342> remove_network all 343OK 344> remove_cred all 345OK 346 347 348Add a username/password credential: 349 350> add_cred 3510 352> set_cred 0 realm "mail.example.com" 353OK 354> set_cred 0 username "username" 355OK 356> set_cred 0 password "password" 357OK 358> set_cred 0 priority 1 359OK 360> set_cred 0 temporary 1 361OK 362 363Add a SIM credential using a simulated SIM/USIM card for testing: 364 365> add_cred 3661 367> set_cred 1 imsi "23456-0000000000" 368OK 369> set_cred 1 milenage "90dca4eda45b53cf0f12d7c9c3bc6a89:cb9cccc4b9258e6dca4760379fb82581:000000000123" 370OK 371> set_cred 1 priority 1 372OK 373 374Note: the return value of add_cred is used as the first argument to 375the following set_cred commands. 376 377Add a SIM credential using a external SIM/USIM processing: 378 379> set external_sim 1 380OK 381> add_cred 3821 383> set_cred 1 imsi "23456-0000000000" 384OK 385> set_cred 1 eap SIM 386OK 387 388 389Add a WPA2-Enterprise network: 390 391> add_network 3920 393> set_network 0 key_mgmt WPA-EAP 394OK 395> set_network 0 ssid "enterprise" 396OK 397> set_network 0 eap TTLS 398OK 399> set_network 0 anonymous_identity "anonymous" 400OK 401> set_network 0 identity "user" 402OK 403> set_network 0 password "password" 404OK 405> set_network 0 priority 0 406OK 407> enable_network 0 no-connect 408OK 409 410 411Add an open network: 412 413> add_network 4143 415> set_network 3 key_mgmt NONE 416OK 417> set_network 3 ssid "coffee-shop" 418OK 419> select_network 3 420OK 421 422Note: the return value of add_network is used as the first argument to 423the following set_network commands. 424 425The preferred credentials/networks can be indicated with the priority 426parameter (1 is higher priority than 0). 427 428 429Interworking network selection can be started with interworking_select 430command. This instructs wpa_supplicant to run a network scan and iterate 431through the discovered APs to request ANQP information from the APs that 432advertise support for Interworking/Hotspot 2.0: 433 434> interworking_select 435OK 436<3>Starting ANQP fetch for 02:00:00:00:01:00 437<3>RX-ANQP 02:00:00:00:01:00 ANQP Capability list 438<3>RX-ANQP 02:00:00:00:01:00 Roaming Consortium list 439<3>RX-HS20-ANQP 02:00:00:00:01:00 HS Capability List 440<3>ANQP fetch completed 441<3>INTERWORKING-AP 02:00:00:00:01:00 type=unknown 442 443 444INTERWORKING-AP event messages indicate the APs that support network 445selection and for which there is a matching 446credential. interworking_connect command can be used to select a network 447to connect with: 448 449 450> interworking_connect 02:00:00:00:01:00 451OK 452<3>CTRL-EVENT-SCAN-RESULTS 453<3>SME: Trying to authenticate with 02:00:00:00:01:00 (SSID='Example Network' freq=2412 MHz) 454<3>Trying to associate with 02:00:00:00:01:00 (SSID='Example Network' freq=2412 MHz) 455<3>Associated with 02:00:00:00:01:00 456<3>CTRL-EVENT-EAP-STARTED EAP authentication started 457<3>CTRL-EVENT-EAP-PROPOSED-METHOD vendor=0 method=21 458<3>CTRL-EVENT-EAP-METHOD EAP vendor 0 method 21 (TTLS) selected 459<3>CTRL-EVENT-EAP-SUCCESS EAP authentication completed successfully 460<3>WPA: Key negotiation completed with 02:00:00:00:01:00 [PTK=CCMP GTK=CCMP] 461<3>CTRL-EVENT-CONNECTED - Connection to 02:00:00:00:01:00 completed (auth) [id=0 id_str=] 462 463 464wpa_supplicant creates a temporary network block for the selected 465network based on the configured credential and ANQP information from the 466AP: 467 468> list_networks 469network id / ssid / bssid / flags 4700 Example Network any [CURRENT] 471> get_network 0 key_mgmt 472WPA-EAP 473> get_network 0 eap 474TTLS 475 476 477Alternatively to using an external program to select the network, 478"interworking_select auto" command can be used to request wpa_supplicant 479to select which network to use based on configured priorities: 480 481 482> remove_network all 483OK 484<3>CTRL-EVENT-DISCONNECTED bssid=02:00:00:00:01:00 reason=1 locally_generated=1 485> interworking_select auto 486OK 487<3>Starting ANQP fetch for 02:00:00:00:01:00 488<3>RX-ANQP 02:00:00:00:01:00 ANQP Capability list 489<3>RX-ANQP 02:00:00:00:01:00 Roaming Consortium list 490<3>RX-HS20-ANQP 02:00:00:00:01:00 HS Capability List 491<3>ANQP fetch completed 492<3>INTERWORKING-AP 02:00:00:00:01:00 type=unknown 493<3>CTRL-EVENT-SCAN-RESULTS 494<3>SME: Trying to authenticate with 02:00:00:00:01:00 (SSID='Example Network' freq=2412 MHz) 495<3>Trying to associate with 02:00:00:00:01:00 (SSID='Example Network' freq=2412 MHz) 496<3>Associated with 02:00:00:00:01:00 497<3>CTRL-EVENT-EAP-STARTED EAP authentication started 498<3>CTRL-EVENT-EAP-PROPOSED-METHOD vendor=0 method=21 499<3>CTRL-EVENT-EAP-METHOD EAP vendor 0 method 21 (TTLS) selected 500<3>CTRL-EVENT-EAP-SUCCESS EAP authentication completed successfully 501<3>WPA: Key negotiation completed with 02:00:00:00:01:00 [PTK=CCMP GTK=CCMP] 502<3>CTRL-EVENT-CONNECTED - Connection to 02:00:00:00:01:00 completed (reauth) [id=0 id_str=] 503 504 505The connection status can be shown with the status command: 506 507> status 508bssid=02:00:00:00:01:00 509ssid=Example Network 510id=0 511mode=station 512pairwise_cipher=CCMP <--- link layer security indication 513group_cipher=CCMP 514key_mgmt=WPA2/IEEE 802.1X/EAP 515wpa_state=COMPLETED 516p2p_device_address=02:00:00:00:00:00 517address=02:00:00:00:00:00 518hs20=1 <--- HS 2.0 indication 519Supplicant PAE state=AUTHENTICATED 520suppPortStatus=Authorized 521EAP state=SUCCESS 522selectedMethod=21 (EAP-TTLS) 523EAP TLS cipher=AES-128-SHA 524EAP-TTLSv0 Phase2 method=PAP 525 526 527> status 528bssid=02:00:00:00:02:00 529ssid=coffee-shop 530id=3 531mode=station 532pairwise_cipher=NONE 533group_cipher=NONE 534key_mgmt=NONE 535wpa_state=COMPLETED 536p2p_device_address=02:00:00:00:00:00 537address=02:00:00:00:00:00 538 539 540Note: The Hotspot 2.0 indication is shown as "hs20=1" in the status 541command output. Link layer security is indicated with the 542pairwise_cipher (CCMP = secure, NONE = no encryption used). 543 544 545Also the scan results include the Hotspot 2.0 indication: 546 547> scan_results 548bssid / frequency / signal level / flags / ssid 54902:00:00:00:01:00 2412 -30 [WPA2-EAP-CCMP][ESS][HS20] Example Network 550 551 552ANQP information for the BSS can be fetched using the BSS command: 553 554> bss 02:00:00:00:01:00 555id=1 556bssid=02:00:00:00:01:00 557freq=2412 558beacon_int=100 559capabilities=0x0411 560qual=0 561noise=-92 562level=-30 563tsf=1345573286517276 564age=105 565ie=000f4578616d706c65204e6574776f726b010882848b960c1218240301012a010432043048606c30140100000fac040100000fac040100000fac0100007f04000000806b091e07010203040506076c027f006f1001531122331020304050010203040506dd05506f9a1000 566flags=[WPA2-EAP-CCMP][ESS][HS20] 567ssid=Example Network 568anqp_roaming_consortium=031122330510203040500601020304050603fedcba 569 570 571ANQP queries can also be requested with the anqp_get and hs20_anqp_get 572commands: 573 574> anqp_get 02:00:00:00:01:00 261 575OK 576<3>RX-ANQP 02:00:00:00:01:00 Roaming Consortium list 577> hs20_anqp_get 02:00:00:00:01:00 2 578OK 579<3>RX-HS20-ANQP 02:00:00:00:01:00 HS Capability List 580 581In addition, fetch_anqp command can be used to request similar set of 582ANQP queries to be done as is run as part of interworking_select: 583 584> scan 585OK 586<3>CTRL-EVENT-SCAN-RESULTS 587> fetch_anqp 588OK 589<3>Starting ANQP fetch for 02:00:00:00:01:00 590<3>RX-ANQP 02:00:00:00:01:00 ANQP Capability list 591<3>RX-ANQP 02:00:00:00:01:00 Roaming Consortium list 592<3>RX-HS20-ANQP 02:00:00:00:01:00 HS Capability List 593<3>ANQP fetch completed 594 595 596Hotspot 2.0 Rel 2 online signup and OSEN 597---------------------------------------- 598 599Following parameters can be used to create a network profile for 600link-layer protected Hotspot 2.0 online signup connection with 601OSEN. Note that ssid and identify (NAI) values need to be set based on 602the information for the selected provider in the OSU Providers list 603ANQP-element. 604 605network={ 606 ssid="HS 2.0 OSU" 607 proto=OSEN 608 key_mgmt=OSEN 609 pairwise=CCMP 610 group=GTK_NOT_USED 611 eap=WFA-UNAUTH-TLS 612 identity="anonymous@example.com" 613 ca_cert="osu-ca.pem" 614 ocsp=2 615} 616 617 618Hotspot 2.0 connection with external network selection 619------------------------------------------------------ 620 621When a component controlling wpa_supplicant takes care of Interworking 622network selection, following configuration and network profile 623parameters can be used to configure a temporary network profile for a 624Hotspot 2.0 connection (e.g., with SET, ADD_NETWORK, SET_NETWORK, and 625SELECT_NETWORK control interface commands): 626 627interworking=1 628hs20=1 629auto_interworking=0 630 631network={ 632 ssid="test-hs20" 633 proto=RSN 634 key_mgmt=WPA-EAP 635 pairwise=CCMP 636 anonymous_identity="anonymous@example.com" 637 identity="hs20-test@example.com" 638 password="password" 639 ca_cert="ca.pem" 640 eap=TTLS 641 phase2="auth=MSCHAPV2" 642 update_identifier=54321 643 roaming_consortium_selection=112233 644 #ocsp=2 645} 646 647 648These parameters are set based on the PPS MO credential and/or NAI Realm 649list ANQP-element: 650 651anonymous_identity: Credential/UsernamePassword/Username with username part 652 replaced with "anonymous" 653identity: Credential/UsernamePassword/Username 654password: Credential/UsernamePassword/Password 655update_identifier: PPS/UpdateIdentifier 656ca_cert: from the downloaded trust root based on PPS information 657eap: Credential/UsernamePassword/EAPMethod or NAI Realm list 658phase2: Credential/UsernamePassword/EAPMethod or NAI Realm list 659roaming_consortium_selection: Matching OI from HomeSP/RoamingConsortiumOI 660ocsp: Credential/CheckAAAServerCertStatus 661