]> git.ipfire.org Git - thirdparty/hostap.git/log
thirdparty/hostap.git
7 years agowolfSSL: Fix ECDH set peer to use the index when importing point
Sean Parkinson [Mon, 7 May 2018 23:26:45 +0000 (09:26 +1000)] 
wolfSSL: Fix ECDH set peer to use the index when importing point

Signed-off-by: Sean Parkinson <sean@wolfssl.com>
7 years agoOWE: Mark connection failed in the unlikely no-bss-entry case
Jouni Malinen [Wed, 16 May 2018 16:01:23 +0000 (19:01 +0300)] 
OWE: Mark connection failed in the unlikely no-bss-entry case

If no BSS entry can be found when processing association rejected event
from the driver for the special OWE case of unsupported
finite-cyclic-group, process the event as a connection failure instead
of just skipping the the OWE retry with another DH group.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoMove wpa_supplicant_event() EVENT_ASSOC_REJECT handling into a function
Jouni Malinen [Wed, 16 May 2018 15:47:34 +0000 (18:47 +0300)] 
Move wpa_supplicant_event() EVENT_ASSOC_REJECT handling into a function

This cleans up the implementation a bit by making this functionality
easier to understand.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agotests: Additional VHT channel switch testing
Jouni Malinen [Tue, 15 May 2018 21:16:30 +0000 (00:16 +0300)] 
tests: Additional VHT channel switch testing

Enable/disable VHT with CHAN_SWITCH.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agohostapd: Fix CHAN_SWITCH command for VHT20 and VHT40
Sathishkumar Muruganandam [Mon, 7 May 2018 10:27:18 +0000 (15:57 +0530)] 
hostapd: Fix CHAN_SWITCH command for VHT20 and VHT40

Previously, hostapd CHAN_SWITCH command did not effect VHT configuration
for the following:

When VHT is currently disabled (ieee80211ac=0),

1. hostapd_cli -p /var/run/hostapd chan_switch 10 5180 \
                sec_channel_offset=1 center_freq1=5190 bandwidth=40 ht

====> Comes up in HT40

2. hostapd_cli -p /var/run/hostapd chan_switch 10 5765 \
                sec_channel_offset=-1 center_freq1=5775 bandwidth=40 vht

====> Comes up in HT40

3. hostapd_cli -p /var/run/hostapd chan_switch 10 5200 center_freq1=5200 \
                                                  bandwidth=20 vht

====> Comes up in HT20

When VHT is currently enabled (ieee80211ac=1),

1. hostapd_cli -p /var/run/hostapd chan_switch 10 5180 \
                sec_channel_offset=1 center_freq1=5190 bandwidth=40 ht

====> Comes up in VHT40

2. hostapd_cli -p /var/run/hostapd chan_switch 10 5200 center_freq1=5200 \
                                                  bandwidth=20 ht

====> Comes up in VHT20

This is since VHT config from chan_switch is processed only for
bandwidths 80 and above (80P80, 160) and for VHT20, VHT40 cases, only
NLA chan type and chan width are updated.

There is no NL attribute for determining if it is HT or VHT for
bandwidths 20 & 40 and currently they are updated as HT20, HT40 (+ or -
depending on offset). Same is notified back via
NL80211_CMD_CH_SWITCH_NOTIFY.

Instead of adding new NL attribute for tracking HT/VHT enabled config,
we are adding new hostapd VHT config parameter to save the chan_switch
config and use only for chan_switch case of VHT20 and VHT40.

Tested with all combinations of chan_switch (noHT->20->40->80->) HT/VHT
and confirmed to be working.

Signed-off-by: Sathishkumar Muruganandam <murugana@codeaurora.org>
7 years agoOWE: Get the bss from bssid of assoc_reject to try for next group
Srinivas Dasari [Mon, 7 May 2018 14:07:08 +0000 (19:37 +0530)] 
OWE: Get the bss from bssid of assoc_reject to try for next group

On an assoc_reject from the BSS with the status=77, a connection attempt
with the next supported group happens. The BSS considered here is from
current_bss which may be NULL at this point of time with SME-in-driver
case. Address this by getting the BSS from the bssid obtained in
association reject indication and skip the step if no BSS entry can be
found.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoACS: Avoid invalid interference factor when survey channel time is zero
Karthikeyan Periyasamy [Sat, 5 May 2018 05:14:41 +0000 (10:44 +0530)] 
ACS: Avoid invalid interference factor when survey channel time is zero

When the channel time is zero the interference factor calculation falls
under divide by zero operation which results in invalid (NaN =
not-a-number) interference factor value. This leads to wrong ideal
channel selection in ACS during the scenario described below.

Scenario:

In VHT80 mode, the channel 36 (first channel) gets the channel time as
zero which causes the interfactor factor to be an invalid number (NaN).
Any operations (like addition, mulitplication, divide, etc.) with NaN
value results in a NaN value, so that average factor for the primary
channel 36 got the invalid value (NaN). Since channel 36 is the first
channel, ideal factor is assigned as NaN in the first iteration. The
following iteration condition check (factor < ideal_factor) with a NaN
value fail for all other primary channels. This results in channel 36
being chosen as the ideal channel in ACS which holds a NaN value.

Logs:

ACS: Survey analysis for channel 36 (5180 MHz)
ACS: 1: min_nf=-103 interference_factor=nan nf=0 time=0 busy=0 rx=0
ACS: 2: min_nf=-103 interference_factor=0.615385 nf=-102 time=13 busy=8 rx=0
ACS: 3: min_nf=-103 interference_factor=2.45455 nf=0 time=22 busy=16 rx=0
ACS: 4: min_nf=-103 interference_factor=0.785714 nf=-103 time=42 busy=33 rx=0
ACS: 5: min_nf=-103 interference_factor=nan nf=0 time=0 busy=0 rx=0
ACS:  * interference factor average: nan
...
ACS:  * channel 36: total interference = nan
..
ACS:  * channel 149: total interference = 5.93174e-21
..
ACS: Ideal channel is 36 (5180 MHz) with total interference factor of nan

Signed-off-by: Karthikeyan Periyasamy <periyasa@codeaurora.org>
7 years agoFix style issues in qca-vendor.h
Jeff Johnson [Mon, 14 May 2018 19:00:19 +0000 (12:00 -0700)] 
Fix style issues in qca-vendor.h

Over time a number of style issues have crept into qca-vendor.h,
so fix most of them. There are some identifiers and comments which
exceed 80 columns, but these are left as-is for readability.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoDefine new QCA feature flag for self managed regulatory support
Kiran Kumar Lokere [Thu, 10 May 2018 21:30:27 +0000 (14:30 -0700)] 
Define new QCA feature flag for self managed regulatory support

This can be used to determine which mechanism to use for configuring
country code from trusted sources.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoDefine test config vendor attribute for Tx beamformee configuration
Kiran Kumar Lokere [Mon, 14 May 2018 20:01:41 +0000 (13:01 -0700)] 
Define test config vendor attribute for Tx beamformee configuration

Add a new wifi test config QCA vendor attribute to configure Tx
beamformee in the driver. This is used for testbed configuration.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoSAE: Flush PMKSA if an assoc reject without timeout is received
Srinivas Dasari [Thu, 10 May 2018 10:13:28 +0000 (15:43 +0530)] 
SAE: Flush PMKSA if an assoc reject without timeout is received

Flush the PMKSA upon receiving association reject event without timeout
in the event data in SME-in-driver case to avoid trying to use the old
PMKSA entry in subsequent connection attempts. Do not flush PMKSA if
association reject is received with timeout as it is generated
internally from the driver without reaching the AP. This is similar to
the SME-in-wpa_supplicant case that was already addressed within
sme_event_assoc_reject().

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agowext: Avoid gcc warnings on restricted pointer aliasing
Jouni Malinen [Tue, 15 May 2018 17:40:24 +0000 (20:40 +0300)] 
wext: Avoid gcc warnings on restricted pointer aliasing

The first two parameters to readlink() are marked restricted and at
least gcc 8.2 warns about used the same pointer for then, so avoid this
by using separate buffers for the pathname and response buffer.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoSilence a gcc warning on switch statement fallthrough
Jouni Malinen [Tue, 15 May 2018 17:29:00 +0000 (20:29 +0300)] 
Silence a gcc warning on switch statement fallthrough

Add an explicit comment noting a previously undocumented fallthrough to
not trigger an implicit-fallthrough warning.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoSilence new gcc warnings on switch statement fallthroughs
Jouni Malinen [Tue, 15 May 2018 17:27:17 +0000 (20:27 +0300)] 
Silence new gcc warnings on switch statement fallthroughs

Reword the comments to make gcc 8.1 recognize these as designed cases
and not trigger implicit-fallthrough warnings.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agotests: Fix dbus_tdls_channel_switch with missing kernel support
Jouni Malinen [Mon, 14 May 2018 21:38:13 +0000 (00:38 +0300)] 
tests: Fix dbus_tdls_channel_switch with missing kernel support

Check driver capabilities in the D-Bus TDLS case similarly to the
non-D-Bus cases.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agotests: Do not fail if driver supports power saving
Jouni Malinen [Fri, 4 May 2018 20:56:32 +0000 (23:56 +0300)] 
tests: Do not fail if driver supports power saving

Couple of "invalid value" tests started to fail now that mac80211_hwsim
actually accepts power save configuration. Fix these by running the same
command for more code coverage, but in a way that ignores the result of
the operation (succeeds with older kernel versions and fails with
newer).

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoFT: Clear SME FT data on disassoc
Ahmad Masri [Mon, 30 Apr 2018 10:42:04 +0000 (13:42 +0300)] 
FT: Clear SME FT data on disassoc

SME ft_used flag is sometimes not cleared on disassoc. For example,
after initial FT connection, ft_used is set while ft_ies stays NULL.
Later on, upon disassoc, sme_update_ft_ies() is not invoked and ft_used
is not cleared. Fix this by invoking sme_update_ft_ies() also in case
ft_used is set.

This is needed to fix an issue with drivers that use nl80211 Connect API
with FT and expect to the NL80211_AUTHTYPE_OPEN specified in the Connect
command for the initial mobility domain association.

Signed-off-by: Ahmad Masri <amasri@codeaurora.org>
7 years agoAdd QCA vendor attribute for spectral hardware generation
Edayilliam Jayadev [Fri, 27 Apr 2018 02:31:57 +0000 (08:01 +0530)] 
Add QCA vendor attribute for spectral hardware generation

Add spectral hardware generation attribute to
QCA_NL80211_VENDOR_SUBCMD_SPECTRAL_SCAN_GET_CAP_INFO vendor command.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agowpa_supplicant: Make channel switch event available for non-AP builds
Bhagavathi Perumal S [Wed, 25 Apr 2018 09:39:57 +0000 (15:09 +0530)] 
wpa_supplicant: Make channel switch event available for non-AP builds

This allows user to get channel switch indication in station mode even
if wpa_supplicant is built without CONFIG_AP=y.

Signed-off-by: Bhagavathi Perumal S <bperumal@codeaurora.org>
7 years agotests: wpa_supplicant STATUS output and ieee80211ac=1
Jouni Malinen [Fri, 4 May 2018 17:19:17 +0000 (20:19 +0300)] 
tests: wpa_supplicant STATUS output and ieee80211ac=1

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agowpa_supplicant: Add ieee80211ac information in STATUS
Bhagavathi Perumal S [Tue, 24 Apr 2018 07:54:20 +0000 (13:24 +0530)] 
wpa_supplicant: Add ieee80211ac information in STATUS

This allows user to get current operating mode of station.

Signed-off-by: Bhagavathi Perumal S <bperumal@codeaurora.org>
7 years agotests: Skip OCSP tests with wolfSSL
Jouni Malinen [Wed, 2 May 2018 09:41:12 +0000 (12:41 +0300)] 
tests: Skip OCSP tests with wolfSSL

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agowolfSSL: Fix EAP-FAST key derivation
Sean Parkinson [Thu, 29 Mar 2018 04:55:55 +0000 (14:55 +1000)] 
wolfSSL: Fix EAP-FAST key derivation

Implement tls_connection_get_eap_fast_key() using cryptographic
primitives as wolfSSL implements different spec.

Signed-off-by: Sean Parkinson <sean@wolfssl.com>
7 years agowolfSSL: Do not free cert store after setting it
Sean Parkinson [Thu, 29 Mar 2018 04:55:55 +0000 (14:55 +1000)] 
wolfSSL: Do not free cert store after setting it

Signed-off-by: Sean Parkinson <sean@wolfssl.com>
7 years agowolfSSL: Fix OCSP ifdefs
Sean Parkinson [Thu, 29 Mar 2018 04:55:55 +0000 (14:55 +1000)] 
wolfSSL: Fix OCSP ifdefs

Signed-off-by: Sean Parkinson <sean@wolfssl.com>
7 years agowolfSSL: Fix altSubjectName handling
Sean Parkinson [Thu, 29 Mar 2018 04:55:55 +0000 (14:55 +1000)] 
wolfSSL: Fix altSubjectName handling

Signed-off-by: Sean Parkinson <sean@wolfssl.com>
7 years agowolfSSL: Use defines from wolfssl/options.h
Sean Parkinson [Thu, 29 Mar 2018 04:55:55 +0000 (14:55 +1000)] 
wolfSSL: Use defines from wolfssl/options.h

Depend on proper wolfSSL configuration instead of trying to define these
build configuration values externally.

Signed-off-by: Sean Parkinson <sean@wolfssl.com>
7 years agowolfSSL: Remove aes-omac1.o from hostapd build
Sean Parkinson [Thu, 29 Mar 2018 04:55:55 +0000 (14:55 +1000)] 
wolfSSL: Remove aes-omac1.o from hostapd build

Avoid duplicated omac1_*() functions when building hostapd with wolfSSL.

Signed-off-by: Sean Parkinson <sean@wolfssl.com>
7 years agowolfSSL: Use wolfSSL memory allocation in dh5_init()
Sean Parkinson [Thu, 29 Mar 2018 04:55:55 +0000 (14:55 +1000)] 
wolfSSL: Use wolfSSL memory allocation in dh5_init()

Signed-off-by: Sean Parkinson <sean@wolfssl.com>
7 years agowolfSSL: Load certificates using 'chain' APIs
Sean Parkinson [Thu, 29 Mar 2018 04:55:55 +0000 (14:55 +1000)] 
wolfSSL: Load certificates using 'chain' APIs

This allows the full chain to be loaded.

Signed-off-by: Sean Parkinson <sean@wolfssl.com>
7 years agowolfSSL: Changes for memory allocation failure testing
Sean Parkinson [Thu, 29 Mar 2018 04:55:55 +0000 (14:55 +1000)] 
wolfSSL: Changes for memory allocation failure testing

Signed-off-by: Sean Parkinson <sean@wolfssl.com>
7 years agowolfSSL: Fix crypto_hash_init() memory clearing
Sean Parkinson [Thu, 29 Mar 2018 04:55:55 +0000 (14:55 +1000)] 
wolfSSL: Fix crypto_hash_init() memory clearing

Explicitly clear the allocated memory to avoid uninitialized data in
struct crypto_hash.

Signed-off-by: Sean Parkinson <sean@wolfssl.com>
7 years agowolfSSL: Fix crypto_ec_point_y_sqr()
Sean Parkinson [Thu, 29 Mar 2018 04:55:55 +0000 (14:55 +1000)] 
wolfSSL: Fix crypto_ec_point_y_sqr()

Use the correct intermediate result from mp_sqrmod() in the following
mp_mulmod() call (t is not initialized here; it is used only after this
step).

Signed-off-by: Sean Parkinson <sean@wolfssl.com>
7 years agowolfSSL: Fix crypto_ec_point_solve_y_coord()
Sean Parkinson [Thu, 29 Mar 2018 04:55:55 +0000 (14:55 +1000)] 
wolfSSL: Fix crypto_ec_point_solve_y_coord()

Provide full uncompressed DER data length to wc_ecc_import_point_der()
even though a compressed form is used here. In addition, use
ECC_POINT_COMP_* defined values to make this more readable.

Signed-off-by: Sean Parkinson <sean@wolfssl.com>
7 years agowolfSSL: Add crypto_ecdh_*()
Sean Parkinson [Thu, 29 Mar 2018 04:55:55 +0000 (14:55 +1000)] 
wolfSSL: Add crypto_ecdh_*()

Implement the wrapper functions for ECDH operations.

Signed-off-by: Sean Parkinson <sean@wolfssl.com>
7 years agowolfSSL: Use new digest namespace
Sean Parkinson [Thu, 29 Mar 2018 04:55:55 +0000 (14:55 +1000)] 
wolfSSL: Use new digest namespace

Signed-off-by: Sean Parkinson <sean@wolfssl.com>
7 years agowolfSSL: Fix conditional EAP-FAST compilation issue
Sean Parkinson [Thu, 29 Mar 2018 04:55:55 +0000 (14:55 +1000)] 
wolfSSL: Fix conditional EAP-FAST compilation issue

Variable name was partially renamed during earlier cleanup.

Signed-off-by: Sean Parkinson <sean@wolfssl.com>
7 years agotests: Use same certificates as used for GnuTLS with wolfSSL
Sean Parkinson [Thu, 29 Mar 2018 04:55:55 +0000 (14:55 +1000)] 
tests: Use same certificates as used for GnuTLS with wolfSSL

Signed-off-by: Sean Parkinson <sean@wolfssl.com>
7 years agotests: Use a valid key exchange value in eap_proto_ikev2
Sean Parkinson [Thu, 29 Mar 2018 04:55:55 +0000 (14:55 +1000)] 
tests: Use a valid key exchange value in eap_proto_ikev2

Signed-off-by: Sean Parkinson <sean@wolfssl.com>
7 years agotests: Add TLS v1.3 into ap_wpa2_eap_tls_versions
Jouni Malinen [Tue, 1 May 2018 19:06:43 +0000 (22:06 +0300)] 
tests: Add TLS v1.3 into ap_wpa2_eap_tls_versions

When running with OpenSSL 1.1.1, verify that EAP-TLS can be used with
TLS v1.3.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agotests: Enable TLS v1.3 explicitly in the authentication server
Jouni Malinen [Tue, 1 May 2018 19:11:48 +0000 (22:11 +0300)] 
tests: Enable TLS v1.3 explicitly in the authentication server

For testing purposes, enable TLS v1.3 in the authentication server so
that the protocol version can be controlled from wpa_supplicant side
more easily.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoEAP-TLS server: Disable TLS v1.3 by default
Jouni Malinen [Tue, 1 May 2018 19:12:37 +0000 (22:12 +0300)] 
EAP-TLS server: Disable TLS v1.3 by default

The current EAP peer implementation is not yet ready for the TLS v1.3
changes with EAP-TTLS, EAP-PEAP, and EAP-FAST, so disable TLS v1.3 for
this EAP method for now.

While the current EAP-TLS implementation is more or less complete for
TLS v1.3, there has been no interoperability testing with other
implementations, so disable for by default for now until there has been
chance to confirm that no significant interoperability issues show up
with TLS version update. tls_flags=[ENABLE-TLSv1.3] configuration
parameter can be used to enable TLS v1.3 (assuming the TLS library
supports it; e.g., when using OpenSSL 1.1.1).

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoEAP-TLS peer: Disable TLS v1.3 by default
Jouni Malinen [Tue, 1 May 2018 18:58:35 +0000 (21:58 +0300)] 
EAP-TLS peer: Disable TLS v1.3 by default

The current EAP peer implementation is not yet ready for the TLS v1.3
changes with EAP-TTLS, EAP-PEAP, and EAP-FAST, so disable TLS v1.3 for
this EAP method for now.

While the current EAP-TLS implementation is more or less complete for
TLS v1.3, there has been no interoperability testing with other
implementations, so disable for by default for now until there has been
chance to confirm that no significant interoperability issues show up
with TLS version update. phase1="tls_disable_tlsv1_3=0" configuration
parameter can be used to enable TLS v1.3 (assuming the TLS library
supports it; e.g., when using OpenSSL 1.1.1).

Signed-off-by: Jouni Malinen <j@w1.fi>
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>