xref: /freebsd/contrib/wpa/wpa_supplicant/README-HS20 (revision a90b9d0159070121c221b966469c3e36d912bf82)
1f05cddf9SRui Paulowpa_supplicant and Hotspot 2.0
2f05cddf9SRui Paulo==============================
3f05cddf9SRui Paulo
4f05cddf9SRui PauloThis document describe how the IEEE 802.11u Interworking and Wi-Fi
5f05cddf9SRui PauloHotspot 2.0 (Release 1) implementation in wpa_supplicant can be
6f05cddf9SRui Pauloconfigured and how an external component on the client e.g., management
7f05cddf9SRui PauloGUI or Wi-Fi framework) is used to manage this functionality.
8f05cddf9SRui Paulo
9f05cddf9SRui Paulo
10f05cddf9SRui PauloIntroduction to Wi-Fi Hotspot 2.0
11f05cddf9SRui Paulo---------------------------------
12f05cddf9SRui Paulo
13f05cddf9SRui PauloHotspot 2.0 is the name of the Wi-Fi Alliance specification that is used
14f05cddf9SRui Pauloin the Wi-Fi CERTIFIED Passpoint<TM> program. More information about
15f05cddf9SRui Paulothis is available in this white paper:
16f05cddf9SRui Paulo
17f05cddf9SRui Paulohttp://www.wi-fi.org/knowledge-center/white-papers/wi-fi-certified-passpoint%E2%84%A2-new-program-wi-fi-alliance%C2%AE-enable-seamless
18f05cddf9SRui Paulo
19f05cddf9SRui PauloThe Hotspot 2.0 specification is also available from WFA:
20f05cddf9SRui Paulohttps://www.wi-fi.org/knowledge-center/published-specifications
21f05cddf9SRui Paulo
22f05cddf9SRui PauloThe core Interworking functionality (network selection, GAS/ANQP) were
23f05cddf9SRui Paulostandardized in IEEE Std 802.11u-2011 which is now part of the IEEE Std
24f05cddf9SRui Paulo802.11-2012.
25f05cddf9SRui Paulo
26f05cddf9SRui Paulo
27f05cddf9SRui Paulowpa_supplicant network selection
28f05cddf9SRui Paulo--------------------------------
29f05cddf9SRui Paulo
30f05cddf9SRui PauloInterworking support added option for configuring credentials that can
31f05cddf9SRui Paulowork with multiple networks as an alternative to configuration of
32f05cddf9SRui Paulonetwork blocks (e.g., per-SSID parameters). When requested to perform
33f05cddf9SRui Paulonetwork selection, wpa_supplicant picks the highest priority enabled
34f05cddf9SRui Paulonetwork block or credential. If a credential is picked (based on ANQP
35f05cddf9SRui Pauloinformation from APs), a temporary network block is created
36f05cddf9SRui Pauloautomatically for the matching network. This temporary network block is
37f05cddf9SRui Pauloused similarly to the network blocks that can be configured by the user,
38f05cddf9SRui Paulobut it is not stored into the configuration file and is meant to be used
39f05cddf9SRui Pauloonly for temporary period of time since a new one can be created
40f05cddf9SRui Paulowhenever needed based on ANQP information and the credential.
41f05cddf9SRui Paulo
42f05cddf9SRui PauloBy default, wpa_supplicant is not using automatic network selection
43f05cddf9SRui Paulounless requested explicitly with the interworking_select command. This
44f05cddf9SRui Paulocan be changed with the auto_interworking=1 parameter to perform network
45f05cddf9SRui Pauloselection automatically whenever trying to find a network for connection
46f05cddf9SRui Pauloand none of the enabled network blocks match with the scan results. This
47f05cddf9SRui Paulocase works similarly to "interworking_select auto", i.e., wpa_supplicant
48f05cddf9SRui Paulowill internally determine which network or credential is going to be
49f05cddf9SRui Pauloused based on configured priorities, scan results, and ANQP information.
50f05cddf9SRui Paulo
51f05cddf9SRui Paulo
52f05cddf9SRui Paulowpa_supplicant configuration
53f05cddf9SRui Paulo----------------------------
54f05cddf9SRui Paulo
55f05cddf9SRui PauloInterworking and Hotspot 2.0 functionality are optional components that
56f05cddf9SRui Pauloneed to be enabled in the wpa_supplicant build configuration
57f05cddf9SRui Paulo(.config). This is done by adding following parameters into that file:
58f05cddf9SRui Paulo
59f05cddf9SRui PauloCONFIG_INTERWORKING=y
60f05cddf9SRui PauloCONFIG_HS20=y
61f05cddf9SRui Paulo
62f05cddf9SRui PauloIt should be noted that this functionality requires a driver that
63f05cddf9SRui Paulosupports GAS/ANQP operations. This uses the same design as P2P, i.e.,
64f05cddf9SRui PauloAction frame processing and building in user space within
65f05cddf9SRui Paulowpa_supplicant. The Linux nl80211 driver interface provides the needed
66f05cddf9SRui Paulofunctionality for this.
67f05cddf9SRui Paulo
68f05cddf9SRui Paulo
69f05cddf9SRui PauloThere are number of run-time configuration parameters (e.g., in
70f05cddf9SRui Paulowpa_supplicant.conf when using the configuration file) that can be used
71f05cddf9SRui Pauloto control Hotspot 2.0 operations.
72f05cddf9SRui Paulo
73f05cddf9SRui Paulo# Enable Interworking
74f05cddf9SRui Paulointerworking=1
75f05cddf9SRui Paulo
76f05cddf9SRui Paulo# Enable Hotspot 2.0
77f05cddf9SRui Paulohs20=1
78f05cddf9SRui Paulo
79f05cddf9SRui Paulo# Parameters for controlling scanning
80f05cddf9SRui Paulo
81c1d255d3SCy Schubert# Homogeneous ESS identifier
82f05cddf9SRui Paulo# If this is set, scans will be used to request response only from BSSes
83f05cddf9SRui Paulo# belonging to the specified Homogeneous ESS. This is used only if interworking
84f05cddf9SRui Paulo# is enabled.
85f05cddf9SRui Paulo#hessid=00:11:22:33:44:55
86f05cddf9SRui Paulo
87f05cddf9SRui Paulo# Access Network Type
88f05cddf9SRui Paulo# When Interworking is enabled, scans can be limited to APs that advertise the
89f05cddf9SRui Paulo# specified Access Network Type (0..15; with 15 indicating wildcard match).
90f05cddf9SRui Paulo# This value controls the Access Network Type value in Probe Request frames.
91f05cddf9SRui Paulo#access_network_type=15
92f05cddf9SRui Paulo
93f05cddf9SRui Paulo# Automatic network selection behavior
94f05cddf9SRui Paulo# 0 = do not automatically go through Interworking network selection
95f05cddf9SRui Paulo#     (i.e., require explicit interworking_select command for this; default)
96f05cddf9SRui Paulo# 1 = perform Interworking network selection if one or more
97f05cddf9SRui Paulo#     credentials have been configured and scan did not find a
98f05cddf9SRui Paulo#     matching network block
99f05cddf9SRui Paulo#auto_interworking=0
100f05cddf9SRui Paulo
101f05cddf9SRui Paulo
102f05cddf9SRui PauloCredentials can be pre-configured for automatic network selection:
103f05cddf9SRui Paulo
104f05cddf9SRui Paulo# credential block
105f05cddf9SRui Paulo#
106f05cddf9SRui Paulo# Each credential used for automatic network selection is configured as a set
107f05cddf9SRui Paulo# of parameters that are compared to the information advertised by the APs when
108f05cddf9SRui Paulo# interworking_select and interworking_connect commands are used.
109f05cddf9SRui Paulo#
110f05cddf9SRui Paulo# credential fields:
111f05cddf9SRui Paulo#
1125b9c547cSRui Paulo# temporary: Whether this credential is temporary and not to be saved
1135b9c547cSRui Paulo#
114f05cddf9SRui Paulo# priority: Priority group
115f05cddf9SRui Paulo#	By default, all networks and credentials get the same priority group
116f05cddf9SRui Paulo#	(0). This field can be used to give higher priority for credentials
117f05cddf9SRui Paulo#	(and similarly in struct wpa_ssid for network blocks) to change the
118f05cddf9SRui Paulo#	Interworking automatic networking selection behavior. The matching
119f05cddf9SRui Paulo#	network (based on either an enabled network block or a credential)
120f05cddf9SRui Paulo#	with the highest priority value will be selected.
121f05cddf9SRui Paulo#
122f05cddf9SRui Paulo# pcsc: Use PC/SC and SIM/USIM card
123f05cddf9SRui Paulo#
124f05cddf9SRui Paulo# realm: Home Realm for Interworking
125f05cddf9SRui Paulo#
126f05cddf9SRui Paulo# username: Username for Interworking network selection
127f05cddf9SRui Paulo#
128f05cddf9SRui Paulo# password: Password for Interworking network selection
129f05cddf9SRui Paulo#
130f05cddf9SRui Paulo# ca_cert: CA certificate for Interworking network selection
131f05cddf9SRui Paulo#
132f05cddf9SRui Paulo# client_cert: File path to client certificate file (PEM/DER)
133f05cddf9SRui Paulo#	This field is used with Interworking networking selection for a case
134f05cddf9SRui Paulo#	where client certificate/private key is used for authentication
135f05cddf9SRui Paulo#	(EAP-TLS). Full path to the file should be used since working
136f05cddf9SRui Paulo#	directory may change when wpa_supplicant is run in the background.
137f05cddf9SRui Paulo#
138f05cddf9SRui Paulo#	Alternatively, a named configuration blob can be used by setting
139f05cddf9SRui Paulo#	this to blob://blob_name.
140f05cddf9SRui Paulo#
141f05cddf9SRui Paulo# private_key: File path to client private key file (PEM/DER/PFX)
142f05cddf9SRui Paulo#	When PKCS#12/PFX file (.p12/.pfx) is used, client_cert should be
143f05cddf9SRui Paulo#	commented out. Both the private key and certificate will be read
144f05cddf9SRui Paulo#	from the PKCS#12 file in this case. Full path to the file should be
145f05cddf9SRui Paulo#	used since working directory may change when wpa_supplicant is run
146f05cddf9SRui Paulo#	in the background.
147f05cddf9SRui Paulo#
148f05cddf9SRui Paulo#	Windows certificate store can be used by leaving client_cert out and
149f05cddf9SRui Paulo#	configuring private_key in one of the following formats:
150f05cddf9SRui Paulo#
151f05cddf9SRui Paulo#	cert://substring_to_match
152f05cddf9SRui Paulo#
153f05cddf9SRui Paulo#	hash://certificate_thumbprint_in_hex
154f05cddf9SRui Paulo#
155f05cddf9SRui Paulo#	For example: private_key="hash://63093aa9c47f56ae88334c7b65a4"
156f05cddf9SRui Paulo#
157f05cddf9SRui Paulo#	Note that when running wpa_supplicant as an application, the user
158f05cddf9SRui Paulo#	certificate store (My user account) is used, whereas computer store
159f05cddf9SRui Paulo#	(Computer account) is used when running wpasvc as a service.
160f05cddf9SRui Paulo#
161f05cddf9SRui Paulo#	Alternatively, a named configuration blob can be used by setting
162f05cddf9SRui Paulo#	this to blob://blob_name.
163f05cddf9SRui Paulo#
164f05cddf9SRui Paulo# private_key_passwd: Password for private key file
165f05cddf9SRui Paulo#
166f05cddf9SRui Paulo# imsi: IMSI in <MCC> | <MNC> | '-' | <MSIN> format
167f05cddf9SRui Paulo#
168f05cddf9SRui Paulo# milenage: Milenage parameters for SIM/USIM simulator in <Ki>:<OPc>:<SQN>
169f05cddf9SRui Paulo#	format
170f05cddf9SRui Paulo#
171*a90b9d01SCy Schubert# imsi_privacy_cert: IMSI privacy certificate (PEM encoded X.509v3 certificate)
172*a90b9d01SCy Schubert#	This field is used with EAP-SIM/AKA/AKA' to encrypt the permanent
173*a90b9d01SCy Schubert#	identity (IMSI) to improve privacy. The X.509v3 certificate needs to
174*a90b9d01SCy Schubert#	include a 2048-bit RSA public key and this is from the operator who
175*a90b9d01SCy Schubert#	authenticates the SIM/USIM.
176*a90b9d01SCy Schubert# imsi_privacy_attr: IMSI privacy attribute
177*a90b9d01SCy Schubert#	This field is used to help the EAP-SIM/AKA/AKA' server to identify
178*a90b9d01SCy Schubert#	the used certificate (and as such, the matching private key). This
179*a90b9d01SCy Schubert#	is set to an attribute in name=value format if the operator needs
180*a90b9d01SCy Schubert#	this information.
181*a90b9d01SCy Schubert#
1825b9c547cSRui Paulo# domain_suffix_match: Constraint for server domain name
1835b9c547cSRui Paulo#	If set, this FQDN is used as a suffix match requirement for the AAA
1845b9c547cSRui Paulo#	server certificate in SubjectAltName dNSName element(s). If a
1855b9c547cSRui Paulo#	matching dNSName is found, this constraint is met. If no dNSName
1865b9c547cSRui Paulo#	values are present, this constraint is matched against SubjectName CN
1875b9c547cSRui Paulo#	using same suffix match comparison. Suffix match here means that the
1885b9c547cSRui Paulo#	host/domain name is compared one label at a time starting from the
1895b9c547cSRui Paulo#	top-level domain and all the labels in @domain_suffix_match shall be
1905b9c547cSRui Paulo#	included in the certificate. The certificate may include additional
1915b9c547cSRui Paulo#	sub-level labels in addition to the required labels.
1925b9c547cSRui Paulo#
1935b9c547cSRui Paulo#	For example, domain_suffix_match=example.com would match
1945b9c547cSRui Paulo#	test.example.com but would not match test-example.com.
1955b9c547cSRui Paulo#
1965b9c547cSRui Paulo# domain: Home service provider FQDN(s)
197f05cddf9SRui Paulo#	This is used to compare against the Domain Name List to figure out
1985b9c547cSRui Paulo#	whether the AP is operated by the Home SP. Multiple domain entries can
1995b9c547cSRui Paulo#	be used to configure alternative FQDNs that will be considered home
2005b9c547cSRui Paulo#	networks.
201f05cddf9SRui Paulo#
202*a90b9d01SCy Schubert# home_ois: Home OI(s)
203*a90b9d01SCy Schubert#	This string field contains one or more comma delimited OIs (hexdump)
204*a90b9d01SCy Schubert#	identifying the access the access points that support authentication
205*a90b9d01SCy Schubert#	with this credential. There are an alternative to the use of the realm
206*a90b9d01SCy Schubert#	parameter. When using Home OIs to match the network, the EAP parameters
207*a90b9d01SCy Schubert#	need to be pre-configured with the credentials since the NAI Realm
208*a90b9d01SCy Schubert#	information may not be available or fetched.
209*a90b9d01SCy Schubert#	A successful authentication with the access point is possible as soon
210*a90b9d01SCy Schubert#	as at least one Home OI from the list matches an OI in the Roaming
211*a90b9d01SCy Schubert#	Consortium advertised by the access point.
212*a90b9d01SCy Schubert#	(Hotspot 2.0 PerProviderSubscription/<X+>/HomeSP/HomeOIList/<X+>/HomeOI)
213*a90b9d01SCy Schubert#
214*a90b9d01SCy Schubert# required_home_ois: Required Home OI(s)
215*a90b9d01SCy Schubert#	This string field contains the set of Home OI(s) (hexdump) that are
216*a90b9d01SCy Schubert#	required to be advertised by the AP for the credential to be considered
217*a90b9d01SCy Schubert#	matching.
218*a90b9d01SCy Schubert#	(Hotspot 2.0 PerProviderSubscription/<X+>/HomeSP/HomeOIList/<X+>/HomeOIRequired)
219*a90b9d01SCy Schubert#
220f05cddf9SRui Paulo# roaming_consortium: Roaming Consortium OI
221*a90b9d01SCy Schubert#	Deprecated: use home_ois instead.
222f05cddf9SRui Paulo#	If roaming_consortium_len is non-zero, this field contains the
223f05cddf9SRui Paulo#	Roaming Consortium OI that can be used to determine which access
224f05cddf9SRui Paulo#	points support authentication with this credential. This is an
225f05cddf9SRui Paulo#	alternative to the use of the realm parameter. When using Roaming
226f05cddf9SRui Paulo#	Consortium to match the network, the EAP parameters need to be
227f05cddf9SRui Paulo#	pre-configured with the credential since the NAI Realm information
228f05cddf9SRui Paulo#	may not be available or fetched.
229f05cddf9SRui Paulo#
23085732ac8SCy Schubert# required_roaming_consortium: Required Roaming Consortium OI
231*a90b9d01SCy Schubert#	Deprecated: use required_home_ois instead.
23285732ac8SCy Schubert#	If required_roaming_consortium_len is non-zero, this field contains the
23385732ac8SCy Schubert#	Roaming Consortium OI that is required to be advertised by the AP for
23485732ac8SCy Schubert#	the credential to be considered matching.
23585732ac8SCy Schubert#
23685732ac8SCy Schubert# roaming_consortiums: Roaming Consortium OI(s) memberships
23785732ac8SCy Schubert#	This string field contains one or more comma delimited OIs (hexdump)
23885732ac8SCy Schubert#	identifying the roaming consortiums of which the provider is a member.
23985732ac8SCy Schubert#	The list is sorted from the most preferred one to the least preferred
24085732ac8SCy Schubert#	one. A match between the Roaming Consortium OIs advertised by an AP and
24185732ac8SCy Schubert#	the OIs in this list indicates that successful authentication is
24285732ac8SCy Schubert#	possible.
24385732ac8SCy Schubert#	(Hotspot 2.0 PerProviderSubscription/<X+>/HomeSP/RoamingConsortiumOI)
24485732ac8SCy Schubert#
245f05cddf9SRui Paulo# eap: Pre-configured EAP method
246f05cddf9SRui Paulo#	This optional field can be used to specify which EAP method will be
247f05cddf9SRui Paulo#	used with this credential. If not set, the EAP method is selected
248f05cddf9SRui Paulo#	automatically based on ANQP information (e.g., NAI Realm).
249f05cddf9SRui Paulo#
250f05cddf9SRui Paulo# phase1: Pre-configure Phase 1 (outer authentication) parameters
251f05cddf9SRui Paulo#	This optional field is used with like the 'eap' parameter.
252f05cddf9SRui Paulo#
253f05cddf9SRui Paulo# phase2: Pre-configure Phase 2 (inner authentication) parameters
254f05cddf9SRui Paulo#	This optional field is used with like the 'eap' parameter.
255f05cddf9SRui Paulo#
256f05cddf9SRui Paulo# excluded_ssid: Excluded SSID
257f05cddf9SRui Paulo#	This optional field can be used to excluded specific SSID(s) from
258f05cddf9SRui Paulo#	matching with the network. Multiple entries can be used to specify more
259f05cddf9SRui Paulo#	than one SSID.
260f05cddf9SRui Paulo#
2615b9c547cSRui Paulo# roaming_partner: Roaming partner information
2625b9c547cSRui Paulo#	This optional field can be used to configure preferences between roaming
2635b9c547cSRui Paulo#	partners. The field is a string in following format:
2645b9c547cSRui Paulo#	<FQDN>,<0/1 exact match>,<priority>,<* or country code>
2655b9c547cSRui Paulo#	(non-exact match means any subdomain matches the entry; priority is in
2665b9c547cSRui Paulo#	0..255 range with 0 being the highest priority)
2675b9c547cSRui Paulo#
2685b9c547cSRui Paulo# update_identifier: PPS MO ID
2695b9c547cSRui Paulo#	(Hotspot 2.0 PerProviderSubscription/UpdateIdentifier)
2705b9c547cSRui Paulo#
2715b9c547cSRui Paulo# provisioning_sp: FQDN of the SP that provisioned the credential
2725b9c547cSRui Paulo#	This optional field can be used to keep track of the SP that provisioned
2735b9c547cSRui Paulo#	the credential to find the PPS MO (./Wi-Fi/<provisioning_sp>).
2745b9c547cSRui Paulo#
2755b9c547cSRui Paulo# sp_priority: Credential priority within a provisioning SP
2765b9c547cSRui Paulo#	This is the priority of the credential among all credentials
277780fb4a2SCy Schubert#	provisioned by the same SP (i.e., for entries that have identical
2785b9c547cSRui Paulo#	provisioning_sp value). The range of this priority is 0-255 with 0
2795b9c547cSRui Paulo#	being the highest and 255 the lower priority.
2805b9c547cSRui Paulo#
2815b9c547cSRui Paulo# Minimum backhaul threshold (PPS/<X+>/Policy/MinBackhauldThreshold/*)
2825b9c547cSRui Paulo#	These fields can be used to specify minimum download/upload backhaul
2835b9c547cSRui Paulo#	bandwidth that is preferred for the credential. This constraint is
2845b9c547cSRui Paulo#	ignored if the AP does not advertise WAN Metrics information or if the
2855b9c547cSRui Paulo#	limit would prevent any connection. Values are in kilobits per second.
2865b9c547cSRui Paulo# min_dl_bandwidth_home
2875b9c547cSRui Paulo# min_ul_bandwidth_home
2885b9c547cSRui Paulo# min_dl_bandwidth_roaming
2895b9c547cSRui Paulo# min_ul_bandwidth_roaming
2905b9c547cSRui Paulo#
2915b9c547cSRui Paulo# max_bss_load: Maximum BSS Load Channel Utilization (1..255)
2925b9c547cSRui Paulo#	(PPS/<X+>/Policy/MaximumBSSLoadValue)
2935b9c547cSRui Paulo#	This value is used as the maximum channel utilization for network
2945b9c547cSRui Paulo#	selection purposes for home networks. If the AP does not advertise
2955b9c547cSRui Paulo#	BSS Load or if the limit would prevent any connection, this constraint
2965b9c547cSRui Paulo#	will be ignored.
2975b9c547cSRui Paulo#
2985b9c547cSRui Paulo# req_conn_capab: Required connection capability
2995b9c547cSRui Paulo#	(PPS/<X+>/Policy/RequiredProtoPortTuple)
3005b9c547cSRui Paulo#	This value is used to configure set of required protocol/port pairs that
3015b9c547cSRui Paulo#	a roaming network shall support (include explicitly in Connection
3025b9c547cSRui Paulo#	Capability ANQP element). This constraint is ignored if the AP does not
3035b9c547cSRui Paulo#	advertise Connection Capability or if this constraint would prevent any
3045b9c547cSRui Paulo#	network connection. This policy is not used in home networks.
3055b9c547cSRui Paulo#	Format: <protocol>[:<comma-separated list of ports]
3065b9c547cSRui Paulo#	Multiple entries can be used to list multiple requirements.
3075b9c547cSRui Paulo#	For example, number of common TCP protocols:
3085b9c547cSRui Paulo#	req_conn_capab=6:22,80,443
3095b9c547cSRui Paulo#	For example, IPSec/IKE:
3105b9c547cSRui Paulo#	req_conn_capab=17:500
3115b9c547cSRui Paulo#	req_conn_capab=50
3125b9c547cSRui Paulo#
3135b9c547cSRui Paulo# ocsp: Whether to use/require OCSP to check server certificate
3145b9c547cSRui Paulo#	0 = do not use OCSP stapling (TLS certificate status extension)
3155b9c547cSRui Paulo#	1 = try to use OCSP stapling, but not require response
3165b9c547cSRui Paulo#	2 = require valid OCSP stapling response
3175b9c547cSRui Paulo#
3185b9c547cSRui Paulo# sim_num: Identifier for which SIM to use in multi-SIM devices
3195b9c547cSRui Paulo#
32032a95656SCy Schubert# engine: Whether to use an engine for private key operations (0/1)
32132a95656SCy Schubert# engine_id: String identifying the engine to use
32232a95656SCy Schubert# ca_cert_id: The CA certificate identifier when using an engine
32332a95656SCy Schubert# cert_id: The certificate identifier when using an engine
32432a95656SCy Schubert# key_id: The private key identifier when using an engine
32532a95656SCy Schubert#
326f05cddf9SRui Paulo# for example:
327f05cddf9SRui Paulo#
328f05cddf9SRui Paulo#cred={
329f05cddf9SRui Paulo#	realm="example.com"
330f05cddf9SRui Paulo#	username="user@example.com"
331f05cddf9SRui Paulo#	password="password"
332f05cddf9SRui Paulo#	ca_cert="/etc/wpa_supplicant/ca.pem"
333f05cddf9SRui Paulo#	domain="example.com"
3345b9c547cSRui Paulo#	domain_suffix_match="example.com"
335f05cddf9SRui Paulo#}
336f05cddf9SRui Paulo#
337f05cddf9SRui Paulo#cred={
338f05cddf9SRui Paulo#	imsi="310026-000000000"
339f05cddf9SRui Paulo#	milenage="90dca4eda45b53cf0f12d7c9c3bc6a89:cb9cccc4b9258e6dca4760379fb82"
340f05cddf9SRui Paulo#}
341f05cddf9SRui Paulo#
342f05cddf9SRui Paulo#cred={
343f05cddf9SRui Paulo#	realm="example.com"
344f05cddf9SRui Paulo#	username="user"
345f05cddf9SRui Paulo#	password="password"
346f05cddf9SRui Paulo#	ca_cert="/etc/wpa_supplicant/ca.pem"
347f05cddf9SRui Paulo#	domain="example.com"
348*a90b9d01SCy Schubert#	home_ois="223344"
34985732ac8SCy Schubert#	roaming_consortiums="112233,4455667788,aabbcc"
350f05cddf9SRui Paulo#	eap=TTLS
351f05cddf9SRui Paulo#	phase2="auth=MSCHAPV2"
352f05cddf9SRui Paulo#}
353f05cddf9SRui Paulo
354f05cddf9SRui Paulo
355f05cddf9SRui PauloControl interface
356f05cddf9SRui Paulo-----------------
357f05cddf9SRui Paulo
358f05cddf9SRui Paulowpa_supplicant provides a control interface that can be used from
359f05cddf9SRui Pauloexternal programs to manage various operations. The included command
360f05cddf9SRui Pauloline tool, wpa_cli, can be used for manual testing with this interface.
361f05cddf9SRui Paulo
362f05cddf9SRui PauloFollowing wpa_cli interactive mode commands show some examples of manual
363f05cddf9SRui Paulooperations related to Hotspot 2.0:
364f05cddf9SRui Paulo
365f05cddf9SRui PauloRemove configured networks and credentials:
366f05cddf9SRui Paulo
367f05cddf9SRui Paulo> remove_network all
368f05cddf9SRui PauloOK
369f05cddf9SRui Paulo> remove_cred all
370f05cddf9SRui PauloOK
371f05cddf9SRui Paulo
372f05cddf9SRui Paulo
373f05cddf9SRui PauloAdd a username/password credential:
374f05cddf9SRui Paulo
375f05cddf9SRui Paulo> add_cred
376f05cddf9SRui Paulo0
377f05cddf9SRui Paulo> set_cred 0 realm "mail.example.com"
378f05cddf9SRui PauloOK
379f05cddf9SRui Paulo> set_cred 0 username "username"
380f05cddf9SRui PauloOK
381f05cddf9SRui Paulo> set_cred 0 password "password"
382f05cddf9SRui PauloOK
383f05cddf9SRui Paulo> set_cred 0 priority 1
384f05cddf9SRui PauloOK
3855b9c547cSRui Paulo> set_cred 0 temporary 1
3865b9c547cSRui PauloOK
387f05cddf9SRui Paulo
388f05cddf9SRui PauloAdd a SIM credential using a simulated SIM/USIM card for testing:
389f05cddf9SRui Paulo
390f05cddf9SRui Paulo> add_cred
391f05cddf9SRui Paulo1
392f05cddf9SRui Paulo> set_cred 1 imsi "23456-0000000000"
393f05cddf9SRui PauloOK
394f05cddf9SRui Paulo> set_cred 1 milenage "90dca4eda45b53cf0f12d7c9c3bc6a89:cb9cccc4b9258e6dca4760379fb82581:000000000123"
395f05cddf9SRui PauloOK
396f05cddf9SRui Paulo> set_cred 1 priority 1
397f05cddf9SRui PauloOK
398f05cddf9SRui Paulo
399f05cddf9SRui PauloNote: the return value of add_cred is used as the first argument to
400f05cddf9SRui Paulothe following set_cred commands.
401f05cddf9SRui Paulo
4025b9c547cSRui PauloAdd a SIM credential using a external SIM/USIM processing:
4035b9c547cSRui Paulo
4045b9c547cSRui Paulo> set external_sim 1
4055b9c547cSRui PauloOK
4065b9c547cSRui Paulo> add_cred
4075b9c547cSRui Paulo1
4085b9c547cSRui Paulo> set_cred 1 imsi "23456-0000000000"
4095b9c547cSRui PauloOK
4105b9c547cSRui Paulo> set_cred 1 eap SIM
4115b9c547cSRui PauloOK
4125b9c547cSRui Paulo
413f05cddf9SRui Paulo
414f05cddf9SRui PauloAdd a WPA2-Enterprise network:
415f05cddf9SRui Paulo
416f05cddf9SRui Paulo> add_network
417f05cddf9SRui Paulo0
418f05cddf9SRui Paulo> set_network 0 key_mgmt WPA-EAP
419f05cddf9SRui PauloOK
420f05cddf9SRui Paulo> set_network 0 ssid "enterprise"
421f05cddf9SRui PauloOK
422f05cddf9SRui Paulo> set_network 0 eap TTLS
423f05cddf9SRui PauloOK
424f05cddf9SRui Paulo> set_network 0 anonymous_identity "anonymous"
425f05cddf9SRui PauloOK
426f05cddf9SRui Paulo> set_network 0 identity "user"
427f05cddf9SRui PauloOK
428f05cddf9SRui Paulo> set_network 0 password "password"
429f05cddf9SRui PauloOK
430f05cddf9SRui Paulo> set_network 0 priority 0
431f05cddf9SRui PauloOK
432f05cddf9SRui Paulo> enable_network 0 no-connect
433f05cddf9SRui PauloOK
434f05cddf9SRui Paulo
435f05cddf9SRui Paulo
436f05cddf9SRui PauloAdd an open network:
437f05cddf9SRui Paulo
438f05cddf9SRui Paulo> add_network
439f05cddf9SRui Paulo3
440f05cddf9SRui Paulo> set_network 3 key_mgmt NONE
441f05cddf9SRui PauloOK
442f05cddf9SRui Paulo> set_network 3 ssid "coffee-shop"
443f05cddf9SRui PauloOK
444f05cddf9SRui Paulo> select_network 3
445f05cddf9SRui PauloOK
446f05cddf9SRui Paulo
447f05cddf9SRui PauloNote: the return value of add_network is used as the first argument to
448f05cddf9SRui Paulothe following set_network commands.
449f05cddf9SRui Paulo
450f05cddf9SRui PauloThe preferred credentials/networks can be indicated with the priority
451f05cddf9SRui Pauloparameter (1 is higher priority than 0).
452f05cddf9SRui Paulo
453f05cddf9SRui Paulo
454f05cddf9SRui PauloInterworking network selection can be started with interworking_select
455f05cddf9SRui Paulocommand. This instructs wpa_supplicant to run a network scan and iterate
456f05cddf9SRui Paulothrough the discovered APs to request ANQP information from the APs that
457f05cddf9SRui Pauloadvertise support for Interworking/Hotspot 2.0:
458f05cddf9SRui Paulo
459f05cddf9SRui Paulo> interworking_select
460f05cddf9SRui PauloOK
461f05cddf9SRui Paulo<3>Starting ANQP fetch for 02:00:00:00:01:00
462f05cddf9SRui Paulo<3>RX-ANQP 02:00:00:00:01:00 ANQP Capability list
463f05cddf9SRui Paulo<3>RX-ANQP 02:00:00:00:01:00 Roaming Consortium list
464f05cddf9SRui Paulo<3>RX-HS20-ANQP 02:00:00:00:01:00 HS Capability List
465f05cddf9SRui Paulo<3>ANQP fetch completed
466f05cddf9SRui Paulo<3>INTERWORKING-AP 02:00:00:00:01:00 type=unknown
467f05cddf9SRui Paulo
468f05cddf9SRui Paulo
469f05cddf9SRui PauloINTERWORKING-AP event messages indicate the APs that support network
470f05cddf9SRui Pauloselection and for which there is a matching
471f05cddf9SRui Paulocredential. interworking_connect command can be used to select a network
472f05cddf9SRui Pauloto connect with:
473f05cddf9SRui Paulo
474f05cddf9SRui Paulo
475f05cddf9SRui Paulo> interworking_connect 02:00:00:00:01:00
476f05cddf9SRui PauloOK
477f05cddf9SRui Paulo<3>CTRL-EVENT-SCAN-RESULTS
478f05cddf9SRui Paulo<3>SME: Trying to authenticate with 02:00:00:00:01:00 (SSID='Example Network' freq=2412 MHz)
479f05cddf9SRui Paulo<3>Trying to associate with 02:00:00:00:01:00 (SSID='Example Network' freq=2412 MHz)
480f05cddf9SRui Paulo<3>Associated with 02:00:00:00:01:00
481f05cddf9SRui Paulo<3>CTRL-EVENT-EAP-STARTED EAP authentication started
482f05cddf9SRui Paulo<3>CTRL-EVENT-EAP-PROPOSED-METHOD vendor=0 method=21
483f05cddf9SRui Paulo<3>CTRL-EVENT-EAP-METHOD EAP vendor 0 method 21 (TTLS) selected
484f05cddf9SRui Paulo<3>CTRL-EVENT-EAP-SUCCESS EAP authentication completed successfully
485f05cddf9SRui Paulo<3>WPA: Key negotiation completed with 02:00:00:00:01:00 [PTK=CCMP GTK=CCMP]
486f05cddf9SRui Paulo<3>CTRL-EVENT-CONNECTED - Connection to 02:00:00:00:01:00 completed (auth) [id=0 id_str=]
487f05cddf9SRui Paulo
488f05cddf9SRui Paulo
489f05cddf9SRui Paulowpa_supplicant creates a temporary network block for the selected
490f05cddf9SRui Paulonetwork based on the configured credential and ANQP information from the
491f05cddf9SRui PauloAP:
492f05cddf9SRui Paulo
493f05cddf9SRui Paulo> list_networks
494f05cddf9SRui Paulonetwork id / ssid / bssid / flags
495f05cddf9SRui Paulo0	Example Network	any	[CURRENT]
496f05cddf9SRui Paulo> get_network 0 key_mgmt
497f05cddf9SRui PauloWPA-EAP
498f05cddf9SRui Paulo> get_network 0 eap
499f05cddf9SRui PauloTTLS
500f05cddf9SRui Paulo
501f05cddf9SRui Paulo
502f05cddf9SRui PauloAlternatively to using an external program to select the network,
503f05cddf9SRui Paulo"interworking_select auto" command can be used to request wpa_supplicant
504f05cddf9SRui Pauloto select which network to use based on configured priorities:
505f05cddf9SRui Paulo
506f05cddf9SRui Paulo
507f05cddf9SRui Paulo> remove_network all
508f05cddf9SRui PauloOK
509f05cddf9SRui Paulo<3>CTRL-EVENT-DISCONNECTED bssid=02:00:00:00:01:00 reason=1 locally_generated=1
510f05cddf9SRui Paulo> interworking_select auto
511f05cddf9SRui PauloOK
512f05cddf9SRui Paulo<3>Starting ANQP fetch for 02:00:00:00:01:00
513f05cddf9SRui Paulo<3>RX-ANQP 02:00:00:00:01:00 ANQP Capability list
514f05cddf9SRui Paulo<3>RX-ANQP 02:00:00:00:01:00 Roaming Consortium list
515f05cddf9SRui Paulo<3>RX-HS20-ANQP 02:00:00:00:01:00 HS Capability List
516f05cddf9SRui Paulo<3>ANQP fetch completed
517f05cddf9SRui Paulo<3>INTERWORKING-AP 02:00:00:00:01:00 type=unknown
518f05cddf9SRui Paulo<3>CTRL-EVENT-SCAN-RESULTS
519f05cddf9SRui Paulo<3>SME: Trying to authenticate with 02:00:00:00:01:00 (SSID='Example Network' freq=2412 MHz)
520f05cddf9SRui Paulo<3>Trying to associate with 02:00:00:00:01:00 (SSID='Example Network' freq=2412 MHz)
521f05cddf9SRui Paulo<3>Associated with 02:00:00:00:01:00
522f05cddf9SRui Paulo<3>CTRL-EVENT-EAP-STARTED EAP authentication started
523f05cddf9SRui Paulo<3>CTRL-EVENT-EAP-PROPOSED-METHOD vendor=0 method=21
524f05cddf9SRui Paulo<3>CTRL-EVENT-EAP-METHOD EAP vendor 0 method 21 (TTLS) selected
525f05cddf9SRui Paulo<3>CTRL-EVENT-EAP-SUCCESS EAP authentication completed successfully
526f05cddf9SRui Paulo<3>WPA: Key negotiation completed with 02:00:00:00:01:00 [PTK=CCMP GTK=CCMP]
527f05cddf9SRui Paulo<3>CTRL-EVENT-CONNECTED - Connection to 02:00:00:00:01:00 completed (reauth) [id=0 id_str=]
528f05cddf9SRui Paulo
529f05cddf9SRui Paulo
530f05cddf9SRui PauloThe connection status can be shown with the status command:
531f05cddf9SRui Paulo
532f05cddf9SRui Paulo> status
533f05cddf9SRui Paulobssid=02:00:00:00:01:00
534f05cddf9SRui Paulossid=Example Network
535f05cddf9SRui Pauloid=0
536f05cddf9SRui Paulomode=station
537f05cddf9SRui Paulopairwise_cipher=CCMP       <--- link layer security indication
538f05cddf9SRui Paulogroup_cipher=CCMP
539f05cddf9SRui Paulokey_mgmt=WPA2/IEEE 802.1X/EAP
540f05cddf9SRui Paulowpa_state=COMPLETED
541f05cddf9SRui Paulop2p_device_address=02:00:00:00:00:00
542f05cddf9SRui Pauloaddress=02:00:00:00:00:00
543f05cddf9SRui Paulohs20=1      <--- HS 2.0 indication
544f05cddf9SRui PauloSupplicant PAE state=AUTHENTICATED
545f05cddf9SRui PaulosuppPortStatus=Authorized
546f05cddf9SRui PauloEAP state=SUCCESS
547f05cddf9SRui PauloselectedMethod=21 (EAP-TTLS)
548f05cddf9SRui PauloEAP TLS cipher=AES-128-SHA
549f05cddf9SRui PauloEAP-TTLSv0 Phase2 method=PAP
550f05cddf9SRui Paulo
551f05cddf9SRui Paulo
552f05cddf9SRui Paulo> status
553f05cddf9SRui Paulobssid=02:00:00:00:02:00
554f05cddf9SRui Paulossid=coffee-shop
555f05cddf9SRui Pauloid=3
556f05cddf9SRui Paulomode=station
557f05cddf9SRui Paulopairwise_cipher=NONE
558f05cddf9SRui Paulogroup_cipher=NONE
559f05cddf9SRui Paulokey_mgmt=NONE
560f05cddf9SRui Paulowpa_state=COMPLETED
561f05cddf9SRui Paulop2p_device_address=02:00:00:00:00:00
562f05cddf9SRui Pauloaddress=02:00:00:00:00:00
563f05cddf9SRui Paulo
564f05cddf9SRui Paulo
565f05cddf9SRui PauloNote: The Hotspot 2.0 indication is shown as "hs20=1" in the status
566f05cddf9SRui Paulocommand output. Link layer security is indicated with the
567f05cddf9SRui Paulopairwise_cipher (CCMP = secure, NONE = no encryption used).
568f05cddf9SRui Paulo
569f05cddf9SRui Paulo
570f05cddf9SRui PauloAlso the scan results include the Hotspot 2.0 indication:
571f05cddf9SRui Paulo
572f05cddf9SRui Paulo> scan_results
573f05cddf9SRui Paulobssid / frequency / signal level / flags / ssid
574f05cddf9SRui Paulo02:00:00:00:01:00	2412	-30	[WPA2-EAP-CCMP][ESS][HS20]	Example Network
575f05cddf9SRui Paulo
576f05cddf9SRui Paulo
577f05cddf9SRui PauloANQP information for the BSS can be fetched using the BSS command:
578f05cddf9SRui Paulo
579f05cddf9SRui Paulo> bss 02:00:00:00:01:00
580f05cddf9SRui Pauloid=1
581f05cddf9SRui Paulobssid=02:00:00:00:01:00
582f05cddf9SRui Paulofreq=2412
583f05cddf9SRui Paulobeacon_int=100
584f05cddf9SRui Paulocapabilities=0x0411
585f05cddf9SRui Pauloqual=0
586f05cddf9SRui Paulonoise=-92
587f05cddf9SRui Paulolevel=-30
588f05cddf9SRui Paulotsf=1345573286517276
589f05cddf9SRui Pauloage=105
590f05cddf9SRui Pauloie=000f4578616d706c65204e6574776f726b010882848b960c1218240301012a010432043048606c30140100000fac040100000fac040100000fac0100007f04000000806b091e07010203040506076c027f006f1001531122331020304050010203040506dd05506f9a1000
591f05cddf9SRui Pauloflags=[WPA2-EAP-CCMP][ESS][HS20]
592f05cddf9SRui Paulossid=Example Network
593f05cddf9SRui Pauloanqp_roaming_consortium=031122330510203040500601020304050603fedcba
594f05cddf9SRui Paulo
595f05cddf9SRui Paulo
596f05cddf9SRui PauloANQP queries can also be requested with the anqp_get and hs20_anqp_get
597f05cddf9SRui Paulocommands:
598f05cddf9SRui Paulo
599f05cddf9SRui Paulo> anqp_get 02:00:00:00:01:00 261
600f05cddf9SRui PauloOK
601f05cddf9SRui Paulo<3>RX-ANQP 02:00:00:00:01:00 Roaming Consortium list
602f05cddf9SRui Paulo> hs20_anqp_get 02:00:00:00:01:00 2
603f05cddf9SRui PauloOK
604f05cddf9SRui Paulo<3>RX-HS20-ANQP 02:00:00:00:01:00 HS Capability List
605f05cddf9SRui Paulo
606f05cddf9SRui PauloIn addition, fetch_anqp command can be used to request similar set of
607f05cddf9SRui PauloANQP queries to be done as is run as part of interworking_select:
608f05cddf9SRui Paulo
609f05cddf9SRui Paulo> scan
610f05cddf9SRui PauloOK
611f05cddf9SRui Paulo<3>CTRL-EVENT-SCAN-RESULTS
612f05cddf9SRui Paulo> fetch_anqp
613f05cddf9SRui PauloOK
614f05cddf9SRui Paulo<3>Starting ANQP fetch for 02:00:00:00:01:00
615f05cddf9SRui Paulo<3>RX-ANQP 02:00:00:00:01:00 ANQP Capability list
616f05cddf9SRui Paulo<3>RX-ANQP 02:00:00:00:01:00 Roaming Consortium list
617f05cddf9SRui Paulo<3>RX-HS20-ANQP 02:00:00:00:01:00 HS Capability List
618f05cddf9SRui Paulo<3>ANQP fetch completed
619780fb4a2SCy Schubert
620780fb4a2SCy Schubert
621780fb4a2SCy SchubertHotspot 2.0 Rel 2 online signup and OSEN
622780fb4a2SCy Schubert----------------------------------------
623780fb4a2SCy Schubert
624780fb4a2SCy SchubertFollowing parameters can be used to create a network profile for
625780fb4a2SCy Schubertlink-layer protected Hotspot 2.0 online signup connection with
626780fb4a2SCy SchubertOSEN. Note that ssid and identify (NAI) values need to be set based on
627780fb4a2SCy Schubertthe information for the selected provider in the OSU Providers list
628780fb4a2SCy SchubertANQP-element.
629780fb4a2SCy Schubert
630780fb4a2SCy Schubertnetwork={
631780fb4a2SCy Schubert    ssid="HS 2.0 OSU"
632780fb4a2SCy Schubert    proto=OSEN
633780fb4a2SCy Schubert    key_mgmt=OSEN
634780fb4a2SCy Schubert    pairwise=CCMP
635780fb4a2SCy Schubert    group=GTK_NOT_USED
636780fb4a2SCy Schubert    eap=WFA-UNAUTH-TLS
637780fb4a2SCy Schubert    identity="anonymous@example.com"
638780fb4a2SCy Schubert    ca_cert="osu-ca.pem"
639780fb4a2SCy Schubert    ocsp=2
640780fb4a2SCy Schubert}
641780fb4a2SCy Schubert
642780fb4a2SCy Schubert
643780fb4a2SCy SchubertHotspot 2.0 connection with external network selection
644780fb4a2SCy Schubert------------------------------------------------------
645780fb4a2SCy Schubert
64685732ac8SCy SchubertWhen a component controlling wpa_supplicant takes care of Interworking
647780fb4a2SCy Schubertnetwork selection, following configuration and network profile
648780fb4a2SCy Schubertparameters can be used to configure a temporary network profile for a
649780fb4a2SCy SchubertHotspot 2.0 connection (e.g., with SET, ADD_NETWORK, SET_NETWORK, and
650780fb4a2SCy SchubertSELECT_NETWORK control interface commands):
651780fb4a2SCy Schubert
652780fb4a2SCy Schubertinterworking=1
653780fb4a2SCy Schuberths20=1
654780fb4a2SCy Schubertauto_interworking=0
655780fb4a2SCy Schubert
656780fb4a2SCy Schubertnetwork={
657780fb4a2SCy Schubert    ssid="test-hs20"
658780fb4a2SCy Schubert    proto=RSN
659780fb4a2SCy Schubert    key_mgmt=WPA-EAP
660780fb4a2SCy Schubert    pairwise=CCMP
661780fb4a2SCy Schubert    anonymous_identity="anonymous@example.com"
662780fb4a2SCy Schubert    identity="hs20-test@example.com"
663780fb4a2SCy Schubert    password="password"
664780fb4a2SCy Schubert    ca_cert="ca.pem"
665780fb4a2SCy Schubert    eap=TTLS
666780fb4a2SCy Schubert    phase2="auth=MSCHAPV2"
667780fb4a2SCy Schubert    update_identifier=54321
66885732ac8SCy Schubert    roaming_consortium_selection=112233
669780fb4a2SCy Schubert    #ocsp=2
670780fb4a2SCy Schubert}
671780fb4a2SCy Schubert
672780fb4a2SCy Schubert
673780fb4a2SCy SchubertThese parameters are set based on the PPS MO credential and/or NAI Realm
674780fb4a2SCy Schubertlist ANQP-element:
675780fb4a2SCy Schubert
676780fb4a2SCy Schubertanonymous_identity: Credential/UsernamePassword/Username with username part
677780fb4a2SCy Schubert		    replaced with "anonymous"
678780fb4a2SCy Schubertidentity: Credential/UsernamePassword/Username
679780fb4a2SCy Schubertpassword: Credential/UsernamePassword/Password
680780fb4a2SCy Schubertupdate_identifier: PPS/UpdateIdentifier
681780fb4a2SCy Schubertca_cert: from the downloaded trust root based on PPS information
682780fb4a2SCy Schuberteap: Credential/UsernamePassword/EAPMethod or NAI Realm list
683780fb4a2SCy Schubertphase2: Credential/UsernamePassword/EAPMethod or NAI Realm list
68485732ac8SCy Schubertroaming_consortium_selection: Matching OI from HomeSP/RoamingConsortiumOI
685780fb4a2SCy Schubertocsp: Credential/CheckAAAServerCertStatus
686