]> git.ipfire.org Git - thirdparty/hostap.git/log
thirdparty/hostap.git
7 years agoEAP-TLS: Extend TLS version config to allow TLS v1.3 to be disabled
Jouni Malinen [Tue, 1 May 2018 18:52:45 +0000 (21:52 +0300)] 
EAP-TLS: Extend TLS version config to allow TLS v1.3 to be disabled

This may be needed to avoid interoperability issues with the new
protocol version and significant changes for EAP use cases in both key
derivation and handshake termination.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agotests: Ignore openssl_cipher_suite_config_hapd failure (OpenSSL 1.1.1)
Jouni Malinen [Tue, 1 May 2018 19:02:19 +0000 (22:02 +0300)] 
tests: Ignore openssl_cipher_suite_config_hapd failure (OpenSSL 1.1.1)

It looks like OpenSSL 1.1.1 accepted the openssl_ciphers=FOO test
configuration or well, at least does not reject it like previous
versions did. For now, ignore this failure.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoOpenSSL: Move server vs. client information into connection data
Jouni Malinen [Tue, 1 May 2018 18:45:29 +0000 (21:45 +0300)] 
OpenSSL: Move server vs. client information into connection data

This makes this more easily available throughout the handshake
processing, if needed, compared to having to pass through the function
argument through the full path from
tls_connection{,_server}_handshake().

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoEAP-TLS peer: MSK/EMSK derivation with TLS v1.3
Jouni Malinen [Tue, 1 May 2018 14:53:07 +0000 (17:53 +0300)] 
EAP-TLS peer: MSK/EMSK derivation with TLS v1.3

Use new MSK/EMSK derivation mechanism if TLS v1.3 or newer is used per
draft-mattsson-eap-tls13-02.txt.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoEAP-TLS peer: Allow NewSessionTicket after Client Finished with TLS v1.3
Jouni Malinen [Tue, 1 May 2018 14:51:34 +0000 (17:51 +0300)] 
EAP-TLS peer: Allow NewSessionTicket after Client Finished with TLS v1.3

The EAP session cannot be marked fully completed on sending Client
Finished with TLS v1.3 since the server may still send NewSessionTicket
before EAP-Success.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoEAP-TLS peer: Support fragmentation of last message
Jouni Malinen [Tue, 1 May 2018 14:49:19 +0000 (17:49 +0300)] 
EAP-TLS peer: Support fragmentation of last message

With TLS v1.3, the Finished message from the client can require
fragmentation. Postpone key derivation and marking of the EAP session
fully completed until all the fragments of that last message are sent to
avoid losing all the subsequent fragments.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoEAP-TLS server: MSK/EMSK derivation with TLS v1.3
Jouni Malinen [Tue, 1 May 2018 14:47:22 +0000 (17:47 +0300)] 
EAP-TLS server: MSK/EMSK derivation with TLS v1.3

Use new MSK/EMSK derivation mechanism if TLS v1.3 or newer is used per
draft-mattsson-eap-tls13-02.txt.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoEAP-TLS peer: Determine whether TLS v1.3 or newer is used
Jouni Malinen [Tue, 1 May 2018 14:45:37 +0000 (17:45 +0300)] 
EAP-TLS peer: Determine whether TLS v1.3 or newer is used

This is needed to be able to handle different key derivation and message
handshakes in EAP implementation.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoEAP-TLS server: Determine whether TLS v1.3 or newer is used
Jouni Malinen [Tue, 1 May 2018 14:44:22 +0000 (17:44 +0300)] 
EAP-TLS server: Determine whether TLS v1.3 or newer is used

This is needed to be able to handle different key derivation and message
handshakes in EAP implementation.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoMark eap_server_tls_derive_key() label argument const
Jouni Malinen [Tue, 1 May 2018 14:42:33 +0000 (17:42 +0300)] 
Mark eap_server_tls_derive_key() label argument const

This value is going to be used only with a helper function that takes it
in as a const value, so use the same style here to simplify callers in
upcoming TLS v1.3 changes.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoEAP-TLS server: Remove trailing whitespace
Jouni Malinen [Tue, 1 May 2018 14:40:58 +0000 (17:40 +0300)] 
EAP-TLS server: Remove trailing whitespace

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoOpenSSL: Terminate TLS handshake if ClientHello cannot be generated
Jouni Malinen [Tue, 1 May 2018 09:41:28 +0000 (12:41 +0300)] 
OpenSSL: Terminate TLS handshake if ClientHello cannot be generated

OpenSSL 1.1.1 added cases where ClientHello generation may fail due to
"no ciphers available". There is no point in sending out the resulting
TLS Alert message to the server since the server does not know what to
do with it before ClientHello. Instead, simply terminate the TLS
handshake locally and report EAP failure to avoid getting stuck waiting
for a timeout.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agotests: Fix ap_wpa2_eap_fast_cipher_suites with OpenSSL 1.1.1
Jouni Malinen [Tue, 1 May 2018 09:10:07 +0000 (12:10 +0300)] 
tests: Fix ap_wpa2_eap_fast_cipher_suites with OpenSSL 1.1.1

RC4-SHA cipher case ended up allowing the handshake to be started just
to fail with "no ciphers available" when trying to generate ClientHello.
Fix this by handling an EAP failure case for the RC4-SHA test step with
OpenSSL 1.1.*.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoDPP: Fix testing code for invalid keys with OpenSSL 1.1.1
Jouni Malinen [Tue, 1 May 2018 09:02:57 +0000 (12:02 +0300)] 
DPP: Fix testing code for invalid keys with OpenSSL 1.1.1

OpenSSL started reporting failures from
EC_POINT_set_affine_coordinates_GFp() similarly to BoringSSL, so use the
same workaround to enable this protocol testing case.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoHS 2.0: Terms and Conditions server and management
Jouni Malinen [Mon, 30 Apr 2018 14:58:34 +0000 (17:58 +0300)] 
HS 2.0: Terms and Conditions server and management

Add minimal Terms and Conditions server for testing purposes. This can
be used to test user interaction for Terms and Conditions acceptance.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoHS 2.0: Update server SQL DB initialization to cover new fields
Jouni Malinen [Mon, 30 Apr 2018 14:45:13 +0000 (17:45 +0300)] 
HS 2.0: Update server SQL DB initialization to cover new fields

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoHS 2.0: Update server instructions for Ubuntu 16.04
Jouni Malinen [Mon, 30 Apr 2018 14:44:28 +0000 (17:44 +0300)] 
HS 2.0: Update server instructions for Ubuntu 16.04

Some of the Ubuntu package names have changed for PHP.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agotests: pending_tc table check for HS 2.0 Terms and Conditions
Jouni Malinen [Mon, 30 Apr 2018 17:19:01 +0000 (20:19 +0300)] 
tests: pending_tc table check for HS 2.0 Terms and Conditions

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoHS 2.0: Maintain a database of pending T&C acceptance sessions
Jouni Malinen [Mon, 30 Apr 2018 17:07:55 +0000 (20:07 +0300)] 
HS 2.0: Maintain a database of pending T&C acceptance sessions

The new SQLite table pending_tc is used to maintain a list of sessions
that need to accept Terms and Conditions. This information can be used
on an external Terms and Conditions server to map the incoming MAC
address information into user identity.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agowpa_cli: Indicate HS20-T-C-ACCEPTANCE to action scripts
Jouni Malinen [Sun, 29 Apr 2018 17:02:13 +0000 (20:02 +0300)] 
wpa_cli: Indicate HS20-T-C-ACCEPTANCE to action scripts

This can be used to start a web browser to go through Terms and
Conditions acknowledgment.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoAdd QCA vendor command/attr to filter frames from other BSSs
Karthikeyan Periyasamy [Tue, 24 Apr 2018 02:47:30 +0000 (08:17 +0530)] 
Add QCA vendor command/attr to filter frames from other BSSs

Add commands to allow an AP to configure filtering rules to capture
frames from stations that are active on the operating channel, but
not associated to this AP. Operations include add/delete the filter
and get the statistics information of the unassociated stations.

Signed-off-by: Karthikeyan Periyasamy <periyasa@codeaurora.org>
7 years agotests: Hotspot 2.0 Terms and Conditions using SQLite for user DB
Jouni Malinen [Wed, 25 Apr 2018 21:57:23 +0000 (00:57 +0300)] 
tests: Hotspot 2.0 Terms and Conditions using SQLite for user DB

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoHS 2.0: Terms and Conditions testing feature in authentication server
Jouni Malinen [Wed, 25 Apr 2018 21:57:44 +0000 (00:57 +0300)] 
HS 2.0: Terms and Conditions testing feature in authentication server

Allow hostapd RADIUS authentication server with SQLite EAP user DB to be
used for testing Terms and Conditions functionality. This could be used
for the HO AAA part of functionality (merging HO AAA and SP AAA into a
single component to avoid separate RADIUS proxy in testing setup).

A T&C server with HTTPS processing is needed to allow this to be used
for full over-the-air testing. This commit adds sufficient functionality
to allow hwsim test cases to cover the RADIUS server part.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agotests: Hotspot 2.0 Terms and Conditions signaling - CoA
Jouni Malinen [Tue, 24 Apr 2018 22:23:01 +0000 (01:23 +0300)] 
tests: Hotspot 2.0 Terms and Conditions signaling - CoA

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoHS 2.0: CoA-Request processing for Terms and Conditions filtering
Jouni Malinen [Tue, 24 Apr 2018 22:23:30 +0000 (01:23 +0300)] 
HS 2.0: CoA-Request processing for Terms and Conditions filtering

Extend RADIUS DAS to support CoA-Request packets for the case where the
HS 2.0 Terms And Conditions filtering VSA is used to remove filtering.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoDFS: Mark channels required DFS based on reg-domain info from the driver
mazumdar [Fri, 13 Apr 2018 09:55:40 +0000 (15:25 +0530)] 
DFS: Mark channels required DFS based on reg-domain info from the driver

Mark a channel as required DFS based on regulatory information received
from the driver/kernel rather than deciding based on hardcoded
boundaries on the frequency. Previously few channels were being marked
as requiring DFS even though they were non-DFS in a particular country.

If the driver does not provide channel list information, fall back to
the previously used frequency-based determination.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agotests: Hotspot 2.0 Terms and Conditions signaling
Jouni Malinen [Mon, 23 Apr 2018 18:10:30 +0000 (21:10 +0300)] 
tests: Hotspot 2.0 Terms and Conditions signaling

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoHS 2.0: Process received Terms and Conditions Acceptance notification
Jouni Malinen [Mon, 23 Apr 2018 21:17:47 +0000 (00:17 +0300)] 
HS 2.0: Process received Terms and Conditions Acceptance notification

Extend wpa_supplicant WNM-Notification RX handling to parse and process
received Terms and Conditions Acceptance notifications. If PMF is
enabled for the association, this frame results in control interface
indication (HS20-T-C-ACCEPTANCE <URL>) to get upper layers to guide the
user through the required acceptance steps.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoHS 2.0: Send Terms and Conditions Acceptance notification
Jouni Malinen [Mon, 23 Apr 2018 21:05:44 +0000 (00:05 +0300)] 
HS 2.0: Send Terms and Conditions Acceptance notification

This extends hostapd Access-Accept processing to check if the RADIUS
server indicated that Terms and Conditions Acceptance is required. The
new hs20_t_c_server_url parameter is used to specify the server URL
template that the STA is requested to visit.

This commit does not enable any kind of filtering, i.e., only the part
of forwarding a request from Access-Accept to the STA using
WNM-Notification is covered.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoHS 2.0: Terms and Conditions attributes in Access-Request messages
Jouni Malinen [Mon, 23 Apr 2018 18:10:52 +0000 (21:10 +0300)] 
HS 2.0: Terms and Conditions attributes in Access-Request messages

This extends hostapd with two new configuration parameters
(hs20_t_c_filename and hs20_t_c_timestamp) that can be used to specify
that the Terms and Conditions attributes are to be added into all
Access-Request messages for Hotspot 2.0 STAs.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agotests: WDS STA interface events and STA command output
Jouni Malinen [Mon, 23 Apr 2018 17:38:40 +0000 (20:38 +0300)] 
tests: WDS STA interface events and STA command output

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agohostapd: Add ctrl iface indications for WDS STA interface
Bhagavathi Perumal S [Fri, 20 Apr 2018 09:05:36 +0000 (14:35 +0530)] 
hostapd: Add ctrl iface indications for WDS STA interface

This allows user to get event indication when a new interface is
added/removed for 4addr WDS STA and also WDS STA ifname is informed
through the STA command.

Signed-off-by: Bhagavathi Perumal S <bperumal@codeaurora.org>
7 years agoFILS: Enable SHA256 KDF even without PMF/SAE in the build
Jouni Malinen [Mon, 23 Apr 2018 15:25:59 +0000 (18:25 +0300)] 
FILS: Enable SHA256 KDF even without PMF/SAE in the build

While it is unlikely that FILS would be used without PMF or SAE in the
build, it is possible to generate such a build and as such, it would be
good for the KDF selection to work properly. Add CONFIG_FILS as an
independent condition for the SHA256-based KDF. Previously, this
combination would have resulted in failure to derive keys and terminated
key management exchange.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agonl80211: Print NL80211_CMD_SET_POWER_SAVE errors in debug log
Jouni Malinen [Mon, 23 Apr 2018 10:44:06 +0000 (13:44 +0300)] 
nl80211: Print NL80211_CMD_SET_POWER_SAVE errors in debug log

This makes it easier to understand what happened with PS configuration.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agotests: WPA2-PSK/GCMP/CCMP ciphers
Jouni Malinen [Mon, 23 Apr 2018 10:43:52 +0000 (13:43 +0300)] 
tests: WPA2-PSK/GCMP/CCMP ciphers

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoDo not remove CCMP group cipher if any CCMP/GCMP cipher is enabled
Jouni Malinen [Mon, 23 Apr 2018 10:40:39 +0000 (13:40 +0300)] 
Do not remove CCMP group cipher if any CCMP/GCMP cipher is enabled

CCMP group cipher was removed if CCMP was not allowed as a pairwise
cipher when loading a configuration file (but not actually when changing
configuration during runtime). This is needed to avoid issues with
configurations that use the default group cipher (TKIP CCMP) while
modifying pairwise cipher from the default CCMP TKIP) to TKIP. However,
there is not really a need to remove the CCMP group cipher if any GCMP
or CCMP cipher is enabled as a pairwise cipher.

Change the network profile validation routine to not remove CCMP as
group cipher if CCMP-256, GCMP, or GCMP-256 is enabled as a pairwise
cipher even if CCMP is not.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agotests: Async. AP setup failure with wpa_supplicant
Andrei Otcheretianski [Mon, 21 Aug 2017 16:42:20 +0000 (19:42 +0300)] 
tests: Async. AP setup failure with wpa_supplicant

Verify that the AP initialization failure is reported back to
wpa_supplicant also when the initialization is complete in a callback.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
7 years agoAP: Handle AP initalization failure in async flow
Tova Mussai [Mon, 21 Aug 2017 16:42:19 +0000 (19:42 +0300)] 
AP: Handle AP initalization failure in async flow

When AP initialization is completed in a callback (e.g., OBSS scan),
wpa_supplicant_deinit_ap() is not called in case of failure. Fix this by
calling setup_complete_cb in case of failure, too, which in turn calls
wpa_supplicant_deinit_ap() if needed.

Signed-off-by: Tova Mussai <tova.mussai@intel.com>
7 years agoFT: Add FT auth algorithm to connect params when roaming
Ahmad Masri [Mon, 16 Apr 2018 10:30:42 +0000 (13:30 +0300)] 
FT: Add FT auth algorithm to connect params when roaming

Add WPA FT auth to connect params in case of a re-connection to ESS
supporting FT when FT was used in the first connect.

Signed-off-by: Ahmad Masri <amasri@codeaurora.org>
7 years agoFT: Add MDE to assoc request IEs in connect params
Ahmad Masri [Mon, 16 Apr 2018 10:52:27 +0000 (13:52 +0300)] 
FT: Add MDE to assoc request IEs in connect params

Add MDE (mobility domain element) to Association Request frame IEs in
the driver assoc params. wpa_supplicant will add MDE only if the network
profile allows FT, the selected AP supports FT, and the mobility domain
ID matches.

Signed-off-by: Ahmad Masri <amasri@codeaurora.org>
7 years agoMake CENTER_FRQ1 available independently in SIGNAL_POLL
Bhagavathi Perumal S [Thu, 19 Apr 2018 11:55:49 +0000 (17:25 +0530)] 
Make CENTER_FRQ1 available independently in SIGNAL_POLL

This allows user to get center frequency and find secondary channel
offset.

Signed-off-by: Bhagavathi Perumal S <bperumal@codeaurora.org>
7 years agoHS 2.0: Add Roaming Consortium Selection element into AssocReq
Jouni Malinen [Tue, 17 Apr 2018 14:22:56 +0000 (17:22 +0300)] 
HS 2.0: Add Roaming Consortium Selection element into AssocReq

This makes wpa_supplicant add Hotspot 2.0 Roaming Consortium Selection
element into (Re)Association Request frames if the network profile
includes roaming_consortium_selection parameter.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agotests: roaming_consortium_selection
Jouni Malinen [Tue, 17 Apr 2018 14:14:47 +0000 (17:14 +0300)] 
tests: roaming_consortium_selection

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoHS 2.0: Add Roaming Consortium Selection network profile parameter
Jouni Malinen [Tue, 17 Apr 2018 14:12:22 +0000 (17:12 +0300)] 
HS 2.0: Add Roaming Consortium Selection network profile parameter

This adds new roaming_consortium_selection network profile parameter
into wpa_supplicant. This is used to store the OI that was used for
network selection (INTERWORKING_SELECT) based on matching against the
Roaming Consortium OIs advertised by the AP. This can also be used when
using an external component to perform selection.

This commit adds the network profile parameter, but does not yet include
it in (Re)Association Request frames.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agotests: Hotspot 2.0 connection based on roaming_consortiums match
Jouni Malinen [Tue, 17 Apr 2018 13:40:14 +0000 (16:40 +0300)] 
tests: Hotspot 2.0 connection based on roaming_consortiums match

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoHS 2.0: Use roaming_consortiums list to match OIs for access
Jouni Malinen [Tue, 17 Apr 2018 13:39:10 +0000 (16:39 +0300)] 
HS 2.0: Use roaming_consortiums list to match OIs for access

This extends Hotspot 2.0 credential matching to consider the
roaming_consortiums parameter when determining whether the cred block
matches the information advertised by an AP.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoHS 2.0: OSU client to send HomeSP/RoamingConsortiumOI to wpa_supplicant
Jouni Malinen [Tue, 17 Apr 2018 13:21:36 +0000 (16:21 +0300)] 
HS 2.0: OSU client to send HomeSP/RoamingConsortiumOI to wpa_supplicant

This adds mapping of the PPS MO HomeSP/RoamingConsortiumOI leaf node
value into the wpa_supplicant cred block parameter roaming_consortiums.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agotests: wpa_supplicant cred roaming_consortiums parsing/writing
Jouni Malinen [Tue, 17 Apr 2018 13:21:00 +0000 (16:21 +0300)] 
tests: wpa_supplicant cred roaming_consortiums parsing/writing

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoHS 2.0: Add a new cred block parameter roaming_consortiums
Jouni Malinen [Tue, 17 Apr 2018 13:19:00 +0000 (16:19 +0300)] 
HS 2.0: Add a new cred block parameter roaming_consortiums

This new string parameter contains a comma delimited list of OIs
(hexdump) in a string. This is used to store Hotspot 2.0
PerProviderSubscription/<X+>/HomeSP/RoamingConsortiumOI. This commit
includes the configuration changes to parse and write the parameter. The
actual values are not yet used in Interworking network selection.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoHS 2.0: Document credential parameter required_roaming_consortium
Jouni Malinen [Tue, 17 Apr 2018 10:22:47 +0000 (13:22 +0300)] 
HS 2.0: Document credential parameter required_roaming_consortium

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoHS 2.0: Copy Roaming Consortium OI from (Re)AssocReq to Access-Request
Jouni Malinen [Tue, 17 Apr 2018 10:08:31 +0000 (13:08 +0300)] 
HS 2.0: Copy Roaming Consortium OI from (Re)AssocReq to Access-Request

This extends hostapd processing of (Re)Association Request frames to
store a local copy of the Consortium OI within the Roaming Consortium
Selection element, if present, and then add that in HS 2.0 Roaming
Consortium attribute into RADIUS Access-Request messages.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agotests: Hotspot 2.0 operator icons
Jouni Malinen [Mon, 16 Apr 2018 10:21:44 +0000 (13:21 +0300)] 
tests: Hotspot 2.0 operator icons

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoHS 2.0: Allow configuration of operator icons
Jouni Malinen [Mon, 16 Apr 2018 10:18:57 +0000 (13:18 +0300)] 
HS 2.0: Allow configuration of operator icons

This extends hostapd Hotspot 2.0 implementation to allow operator icons
to be made available. The existing hs20_icon parameter is used to define
the icons and the new operator_icon parameter (zero or more entries) is
used to specify which of the available icons are operator icons. The
operator icons are advertised in the Operator Icon Metadata ANQP-element
while the icon data can be fetched using the same mechanism (icon
request/binary file) that was added for the OSU Providers icons.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoHS 2.0: Add fetching of Operator Icon Metadata ANQP-element
Jouni Malinen [Mon, 16 Apr 2018 10:16:39 +0000 (13:16 +0300)] 
HS 2.0: Add fetching of Operator Icon Metadata ANQP-element

This extends wpa_supplicant Hotspot 2.0 ANQP routines to allow the
Operator Icon Metadata ANQP-element to be fetched with "ANQP_GET <bssid>
hs20:12". The result is available in the new hs20_operator_icon_metadata
entry in the "BSS <bssid>" output.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agowpa_supplicant: Increase authentication timeout if CAC is started
Dmitry Lebed [Wed, 4 Apr 2018 20:44:08 +0000 (23:44 +0300)] 
wpa_supplicant: Increase authentication timeout if CAC is started

Timeout is increased by dfs_cac_ms from channel data, or by max CAC time
(10 minutes) if dfs_cac_ms is not defined. This is needed for some more
complex cases, e.g., when STA is acting as an active slave with DFS
offload enabled and decided to start CAC after receiving CONNECT
command, in such a case the 10 second timeout is too small and
wpa_supplicant need to wait for CAC completion or CAC timeout (up to 10
minutes).

Without such timeout modification wpa_supplicant will be unable to
connect to an AP on DFS channel, since the default authentication
timeout (10 s) is smaller than the minimum CAC time (60 s).

Tested with nl80211 DFS offload implementation.

Signed-off-by: Dmitry Lebed <dlebed@quantenna.com>
7 years agowpa_supplicant: Rename wpas_event_*() to wpas_ap_event_*()
Dmitry Lebed [Wed, 4 Apr 2018 20:44:07 +0000 (23:44 +0300)] 
wpa_supplicant: Rename wpas_event_*() to wpas_ap_event_*()

Rename DFS event handling functions, since they are located in ap.c and
refer to AP-mode only. Needed to add some STA-mode DFS event handling.

Signed-off-by: Dmitry Lebed <dlebed@quantenna.com>
7 years agonl80211: Add MLME auth work-around for -EEXIST errno
Ben Greear [Fri, 16 Mar 2018 21:31:55 +0000 (14:31 -0700)] 
nl80211: Add MLME auth work-around for -EEXIST errno

The Linux 4.9 kernel, at least, can return EEXIST when trying to auth a
station that already exists.

We have seen this bug in multiple places, but it is difficult to
reproduce. Here is a link to someone else that appears to have hit this
issue: https://github.com/greearb/ath10k-ct/issues/18

Signed-off-by: Ben Greear <greearb@candelatech.com>
7 years agoFix building nt_password_hash with gnutls
Andrey Utkin [Sat, 14 Apr 2018 23:34:35 +0000 (00:34 +0100)] 
Fix building nt_password_hash with gnutls

Even with

    CONFIG_TLS=gnutls
    CONFIG_CRYPTO=gnutls

in .config, nt_password_hash was linked with libcrypto instead of
libgcrypt, which caused linkage failure.

Signed-off-by: Andrey Utkin <andrey_utkin@gentoo.org>
7 years agoDPP: Fix build with LibreSSL v2.5
Jouni Malinen [Sat, 14 Apr 2018 20:56:38 +0000 (23:56 +0300)] 
DPP: Fix build with LibreSSL v2.5

The ECDSA_SIG_{set,get}0() wrappers are needed with LibreSSL v2.5 (but
not v2.7.2).

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoDPP: Fix X509_ALGOR_get0() use with LibreSSL
Jouni Malinen [Sat, 14 Apr 2018 20:53:35 +0000 (23:53 +0300)] 
DPP: Fix X509_ALGOR_get0() use with LibreSSL

At least LibreSSL v2.7.2 indicates support for OpenSSL API 1.1.0, but it
does not apparently use const ASN1_OBJECT * with X509_ALGOR_get0(). Use
the older non-const version here with LibreSSL to fix compilation.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoOpenSSL: Skip SSL_OP_NO_TLSv1_3 if not defined to fix LibreSSL build
Jouni Malinen [Sat, 14 Apr 2018 20:48:42 +0000 (23:48 +0300)] 
OpenSSL: Skip SSL_OP_NO_TLSv1_3 if not defined to fix LibreSSL build

LibreSSL v2.7 claims an OPENSSL_VERSION_NUMBER value that would indicate
that SSL_OP_NO_TLSv1_3 is available, but that does not seem to be the
case with LibreSSL. As such, skip this step based on whether
SSL_OP_NO_TLSv1_3 is defined to avoid build issues.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoFix build with LibreSSL 2.7
Bernard Spil [Sun, 1 Apr 2018 19:58:06 +0000 (21:58 +0200)] 
Fix build with LibreSSL 2.7

LibreSSL 2.7 adds (most of) the OpenSSL 1.1 API.

Signed-off-by: Bernard Spil <brnrd@FreeBSD.org>
7 years agoFix sae_password documentation in wpa_supplicant to refer correct field
Jouni Malinen [Fri, 13 Apr 2018 09:08:47 +0000 (12:08 +0300)] 
Fix sae_password documentation in wpa_supplicant to refer correct field

sae_password replaces psk, not passphrase, parameter in wpa_supplicant.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agotests: wpa_supplicant secure mesh using sae_password
Jouni Malinen [Fri, 13 Apr 2018 09:03:40 +0000 (12:03 +0300)] 
tests: wpa_supplicant secure mesh using sae_password

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agomesh: Properly handle sae_password
Daniel Golle [Thu, 12 Apr 2018 22:42:10 +0000 (00:42 +0200)] 
mesh: Properly handle sae_password

The recently introduced sae_password parameter was only handled properly
in wpa_supplicant/sme.c while wpa_supplicant/mesh.c assumed that
ssid->passphrase exclusively holds the secret.

Import the logic from sme.c to mesh.c to allow having only sae_password
set which otherwise throws this error:
AP-ENABLED
mesh: Passphrase for SAE not configured

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
7 years agoFix wpa_supplicant build with CONFIG_NO_WPA
Daniel Golle [Fri, 13 Apr 2018 04:14:21 +0000 (06:14 +0200)] 
Fix wpa_supplicant build with CONFIG_NO_WPA

pmksa_cache stubs have not been updated when function prototypes have
been modified in commit 852b2f2738 (SAE: Only allow SAE AKMP for PMKSA
caching attempts). Add new function parameter int akmp to stubs of
pmksa_cache_get() and pmksa_cache_set_current() as well to fix build.

Fixes: 852b2f2738 ("SAE: Only allow SAE AKMP for PMKSA caching attempts")
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
7 years agotests: DPP and SAE AKMs
Jouni Malinen [Thu, 12 Apr 2018 18:14:33 +0000 (21:14 +0300)] 
tests: DPP and SAE AKMs

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agotests: sigma_dut DPP/QR initiator as Enrollee (SAE)
Jouni Malinen [Tue, 10 Apr 2018 18:41:58 +0000 (21:41 +0300)] 
tests: sigma_dut DPP/QR initiator as Enrollee (SAE)

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agotests: SAE and PSK enabled in wpa_supplicant network profile
Jouni Malinen [Mon, 9 Apr 2018 10:09:49 +0000 (13:09 +0300)] 
tests: SAE and PSK enabled in wpa_supplicant network profile

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoSAE: Only allow SAE AKMP for PMKSA caching attempts
Jouni Malinen [Sun, 8 Apr 2018 17:06:40 +0000 (20:06 +0300)] 
SAE: Only allow SAE AKMP for PMKSA caching attempts

Explicitly check the PMKSA cache entry to have matching SAE AKMP for the
case where determining whether to use PMKSA caching instead of new SAE
authentication. Previously, only the network context was checked, but a
single network configuration profile could be used with both WPA2-PSK
and SAE, so should check the AKMP as well.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoSAE: Fix default PMK configuration for PMKSA caching case
Jouni Malinen [Sun, 8 Apr 2018 16:55:52 +0000 (19:55 +0300)] 
SAE: Fix default PMK configuration for PMKSA caching case

The RSN supplicant state machine PMK was set based on WPA PSK even for
the cases where SAE would be used. If the AP allows PMKSA caching to be
used with SAE, but does not indicate the selected PMKID explicitly in
EAPOL-Key msg 1/4, this could result in trying to use the PSK instead of
SAE PMK. Fix this by not setting the WPA-PSK as default PMK for SAE
network profiles and instead, configuring the PMK explicitly from the
found PMKSA cache entry.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoWPA: Fix a typo in a debug message
Jouni Malinen [Sun, 8 Apr 2018 16:44:53 +0000 (19:44 +0300)] 
WPA: Fix a typo in a debug message

"PT derivation" was supposed to be saying "PTK derivation".

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoClear pmk_len more consistently for extra protection
Jouni Malinen [Sun, 8 Apr 2018 16:42:52 +0000 (19:42 +0300)] 
Clear pmk_len more consistently for extra protection

This gives more protection against unexpected behavior if RSN supplicant
code ends up trying to use sm->pmk[] with a stale value. Couple of the
code paths did not clear sm->pmk_len explicitly in cases where the old
PMK is being removed, so cover those cases as well to make sure these
will result in PMK-to-PTK derivation failures rather than use of
incorrect PMK value if such a code path could be reached somehow.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoAdd more debug prints for wpa_sm_set_pmk() calls
Jouni Malinen [Sun, 8 Apr 2018 16:11:07 +0000 (19:11 +0300)] 
Add more debug prints for wpa_sm_set_pmk() calls

Couple of these were not preceded by wpa_hexdump_key(PSK) which made it
more difficult to interpret the debug log.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoDefine new test config attribute for HE LTF configuration
Kiran Kumar Lokere [Thu, 5 Apr 2018 00:51:36 +0000 (17:51 -0700)] 
Define new test config attribute for HE LTF configuration

Add a new wifi test config attribute to configure HE LTF in the
driver. This is used for testbed configuration.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agotests: Extend hostapd reload config test to cover wmm_enabled behavior
Jouni Malinen [Fri, 6 Apr 2018 20:32:31 +0000 (23:32 +0300)] 
tests: Extend hostapd reload config test to cover wmm_enabled behavior

This is a regression test for default behavior for wmm_enabled on the
config reload path.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoFix hostapd wmm_enabled setup on config reload path
Jouni Malinen [Fri, 6 Apr 2018 20:29:11 +0000 (23:29 +0300)] 
Fix hostapd wmm_enabled setup on config reload path

If there is no explicit wmm_enabled parameter in the configuration
(i.e., conf->wmm_enabled == -1), the configuration reload path needs to
initialize conf->wmm_enabled based on iconf->ieee80211n in
hostapd_reload_bss() similarly to what is done in the initial startup
case in hostapd_setup_bss().

This fixes issues with RSN capabilities being set incorrectly when WMM
is supposed to get enabled and unexpectedly enabling WMM when it is not
supposed to be enabled (HT disabled). Either of these issues could show
up when asking hostapd to reload the configuration file (and when that
file does not set wmm_enabled explicitly).

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoFT: Add session_timeout to push/resp
Michael Braun [Thu, 18 May 2017 13:21:56 +0000 (15:21 +0200)] 
FT: Add session_timeout to push/resp

This ensures a session timeout configured on R0KH either using
RADIUS-based ACL or 802.1X authentication is copied over to the new
R1KH.

Signed-off-by: Michael Braun <michael-dev@fami-braun.de>
7 years agoFT: Add set/get session_timeout callback functions
Michael Braun [Thu, 18 May 2017 13:21:56 +0000 (15:21 +0200)] 
FT: Add set/get session_timeout callback functions

These are needed to allow wpa_auth_ft.c to control session_timeout
values for STAs.

Signed-off-by: Michael Braun <michael-dev@fami-braun.de>
7 years agoConvert STA session_timeout to os_reltime
Michael Braun [Thu, 18 May 2017 13:21:56 +0000 (15:21 +0200)] 
Convert STA session_timeout to os_reltime

This is needed to allow the remaining session time to be computed for FT
(when sending PMK-R1 to another AP).

Signed-off-by: Michael Braun <michael-dev@fami-braun.de>
7 years agotests: FT with CUI
Michael Braun [Thu, 18 May 2017 13:21:55 +0000 (15:21 +0200)] 
tests: FT with CUI

Signed-off-by: Michael Braun <michael-dev@fami-braun.de>
7 years agoFT: Include identity and radius_cui in pull/resp frames
Michael Braun [Thu, 18 May 2017 13:21:54 +0000 (15:21 +0200)] 
FT: Include identity and radius_cui in pull/resp frames

This allows APs using FT to get the EAP session information from R0KH to
R1KHs.

Signed-off-by: Michael Braun <michael-dev@fami-braun.de>
7 years agoFT: Move wpa_ft_rrb_build_r0() special case to caller
Michael Braun [Thu, 18 May 2017 13:21:54 +0000 (15:21 +0200)] 
FT: Move wpa_ft_rrb_build_r0() special case to caller

Handle the special case of no PMK-R0 entry in the caller instead of
having to have wpa_ft_rrb_build_r0() aware of the possibility of pmk_r0
being NULL.

Signed-off-by: Michael Braun <michael-dev@fami-braun.de>
7 years agoFT: Add set/get identity/radius_cui callback functions
Michael Braun [Thu, 18 May 2017 13:21:54 +0000 (15:21 +0200)] 
FT: Add set/get identity/radius_cui callback functions

These are needed to allow wpa_auth_ft.c to control identity/radius_cui
values for STAs.

Signed-off-by: Michael Braun <michael-dev@fami-braun.de>
7 years agoFix potential memory leak with identity/radius_cui
Michael Braun [Thu, 18 May 2017 13:21:54 +0000 (15:21 +0200)] 
Fix potential memory leak with identity/radius_cui

ieee802_11_set_radius_info() might be called with a STA entry that has
already stored identity and/or radius_cui information, so make sure the
old values get freed before being replaced by the new ones.

Signed-off-by: Michael Braun <michael-dev@fami-braun.de>
7 years agotests: FT-PSK with VLAN
Michael Braun [Thu, 18 May 2017 13:21:53 +0000 (15:21 +0200)] 
tests: FT-PSK with VLAN

Signed-off-by: Michael Braun <michael-dev@fami-braun.de>
7 years agotests: Add a small sleep in FT run_roams()
Michael Braun [Thu, 18 May 2017 13:21:52 +0000 (15:21 +0200)] 
tests: Add a small sleep in FT run_roams()

time.sleep() in run_roams() is required because the target AP sets the
key once the station was associated. There are races, when the station
processes the (Re)Association Response frame AND the test suite starts
FT_DS before the AP processes its local confirmation and thus
wpa_auth_sm_event(ASSOC_FT). Therefore, the ActionFrame will be lost, as
the AP driver is missing the key.

Since this is this speed is highly synthetic, wait a few milliseconds
before roaming back.

Signed-off-by: Michael Braun <michael-dev@fami-braun.de>
7 years agotests: FT-EAP with VLAN
Michael Braun [Thu, 18 May 2017 13:21:52 +0000 (15:21 +0200)] 
tests: FT-EAP with VLAN

Signed-off-by: Michael Braun <michael-dev@fami-braun.de>
7 years agoFT: Add IEEE VLAN support (including tagged VLANs)
Michael Braun [Thu, 18 May 2017 13:21:51 +0000 (15:21 +0200)] 
FT: Add IEEE VLAN support (including tagged VLANs)

This uses set_vlan()/get_vlan() callbacks to fetch and configure the
VLAN of STA. Transmission of VLAN information between APs uses new TLVs.

Signed-off-by: Michael Braun <michael-dev@fami-braun.de>
7 years agoFT: Add set_vlan()/get_vlan() callback functions
Michael Braun [Thu, 18 May 2017 13:21:51 +0000 (15:21 +0200)] 
FT: Add set_vlan()/get_vlan() callback functions

These are needed to allow wpa_auth_ft.c to control VLAN assignment for
STAs.

Signed-off-by: Michael Braun <michael-dev@fami-braun.de>
7 years agoFT: Add expiration to PMK-R0 and PMK-R1 cache
Michael Braun [Thu, 18 May 2017 13:21:50 +0000 (15:21 +0200)] 
FT: Add expiration to PMK-R0 and PMK-R1 cache

IEEE Std 802.11-2016, 12.7.1.7.1 indicates that the lifetime of the
PMK-R0 (and PMK-R1) is bound to the lifetime of PSK or MSK from which
the key was derived. This is currently stored in r0_key_lifetime, but
cache entries are not actually removed.

This commit uses the r0_key_lifetime configuration parameter when
wpa_auth_derive_ptk_ft() is called. This may need to be extended to use
the MSK lifetime, if provided by an external authentication server, with
some future changes. For PSK, there is no such lifetime, but it also
matters less as FT-PSK can be achieved without inter-AP communication.

The expiration timeout is then passed from R0KH to R1KH. The R1KH verifies
that the given timeout for sanity, it may not exceed the locally configured
r1_max_key_lifetime.

Signed-off-by: Michael Braun <michael-dev@fami-braun.de>
7 years agoFT: Use dl_list for PMK-R0/R1 cache
Michael Braun [Thu, 18 May 2017 13:21:50 +0000 (15:21 +0200)] 
FT: Use dl_list for PMK-R0/R1 cache

This makes it easier to remove expired entries from the list.

Signed-off-by: Michael Braun <michael-dev@fami-braun.de>
7 years agoFT: Add helper function for FILS key storing
Michael Braun [Thu, 18 May 2017 13:21:50 +0000 (15:21 +0200)] 
FT: Add helper function for FILS key storing

FILS calls wpa_ft_store_pmk_r0() from wpa_auth.c. This is moved into a
new function wpa_ft_store_pmk_fils() in preparation of additional
information being needed.

Signed-off-by: Michael Braun <michael-dev@fami-braun.de>
7 years agoFT: Convert r0_key_lifetime to seconds
Michael Braun [Thu, 18 May 2017 13:21:50 +0000 (15:21 +0200)] 
FT: Convert r0_key_lifetime to seconds

Add a new configuration option ft_r0_key_lifetime that deprecates
r0_key_lifetime. Though, the old configuration is still accepted for
backwards compatibility.

This simplifies testing. All other items are in seconds as well. In
addition, this makes dot11FTR0KeyLifetime comment match with what got
standardized in the end in IEEE Std 802.11r-2008.

Signed-off-by: Michael Braun <michael-dev@fami-braun.de>
7 years agoRemove CONFIG_IEEE80211R_AP=y build option from wpa_supplicant
Jouni Malinen [Mon, 2 Apr 2018 14:00:45 +0000 (17:00 +0300)] 
Remove CONFIG_IEEE80211R_AP=y build option from wpa_supplicant

There is no existing mechanism for setting up AP mode functionality with
FT enabled, so there is not really much point in having a build option
for trying to include the AP-to-AP FT functionality into wpa_supplicant
either. Since this build option results in failures to complete the
build, simply remove it completely. This can be restored if there is
ever desire to enable FT functionality in wpa_supplicant controlled AP
mode.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agohostapd: Add more authentication error case debugging
Ben Greear [Thu, 7 Dec 2017 17:14:49 +0000 (09:14 -0800)] 
hostapd: Add more authentication error case debugging

This can help one understand better why stations are failing
to authenticate.

Signed-off-by: Ben Greear <greearb@candelatech.com>
7 years agohostapd: Add logging around Michael MIC related failures
Ben Greear [Thu, 7 Dec 2017 17:14:49 +0000 (09:14 -0800)] 
hostapd: Add logging around Michael MIC related failures

This can help one understand better why stations are failing
to authentication/associate.

Signed-off-by: Ben Greear <greearb@candelatech.com>
7 years agohostapd: Add send_auth_reply() caller info in debug logging
Ben Greear [Thu, 7 Dec 2017 17:14:49 +0000 (09:14 -0800)] 
hostapd: Add send_auth_reply() caller info in debug logging

This can help one understand better what happens during the
authentication exchange.

Signed-off-by: Ben Greear <greearb@candelatech.com>
7 years agowpa_supplicant: Don't reply to EAPOL if pkt_type is PACKET_OTHERHOST
Davide Caratti [Wed, 28 Mar 2018 14:34:56 +0000 (16:34 +0200)] 
wpa_supplicant: Don't reply to EAPOL if pkt_type is PACKET_OTHERHOST

When wpa_supplicant is running on a Linux interface that is configured in
promiscuous mode, and it is not a member of a bridge, incoming EAPOL
packets are processed regardless of the Destination Address in the frame.
As a consequence, there are situations where wpa_supplicant replies to
EAPOL packets that are not destined for it.

This behavior seems undesired (see IEEE Std 802.1X-2010, 11.4.a), and can
be avoided by attaching a BPF filter that lets the kernel discard packets
having pkt_type equal to PACKET_OTHERHOST.

Signed-off-by: Davide Caratti <davide.caratti@gmail.com>
7 years agoClean up setting of iface->p2p_mgmt flag
Vasyl Vavrychuk [Mon, 12 Feb 2018 19:29:06 +0000 (21:29 +0200)] 
Clean up setting of iface->p2p_mgmt flag

Previously we set this flag to one in wpa_supplicant_init_iface() if
Wi-Fi controller does not have a dedicated P2P-interface.

This setting had effect only in scope of wpa_supplicant_init_iface() and
it contradicts with comment to struct wpa_interface::p2p_mgmt field.
This comment says that this flag is used only if Wi-Fi controller has
dedicated P2P-device interface.

Also it contradicts with usage of similiar p2p_mgmt field in struct
wpa_supplicant. Again struct wpa_supplicant::p2p_mgmt is set only for
dedicated P2P-device interface.

After this change wpa_interface become input argument to
wpa_supplicant_init_iface() that we are not modifying.

Signed-off-by: Vasyl Vavrychuk <vvavrychuk@gmail.com>