]> git.ipfire.org Git - thirdparty/hostap.git/log
thirdparty/hostap.git
7 years agoAdd some missing driver flags strings
Mikael Kanstrup [Fri, 18 May 2018 08:19:03 +0000 (10:19 +0200)] 
Add some missing driver flags strings

New WPA_DRIVER_FLAGS have been added but corresponding lookup
strings for driver_flags command were never added. Add the
missing strings.

Signed-off-by: Mikael Kanstrup <mikael.kanstrup@sony.com>
7 years agotests: WNM Time Advertisement without time zone configuration
Jouni Malinen [Thu, 31 May 2018 09:55:49 +0000 (12:55 +0300)] 
tests: WNM Time Advertisement without time zone configuration

This is a regression test for a segfault in hostapd.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoWNM: Fix time_zone advertisement without time_zone configuration
Markus Theil [Mon, 28 May 2018 20:26:46 +0000 (22:26 +0200)] 
WNM: Fix time_zone advertisement without time_zone configuration

If time_advertisement=2 is included in hostapd configuration, but
time_zone is unset, the previous implementation tried to write the Time
Zone element into management frames. This resulted in segmentation fault
when trying to dereference a NULL pointer. Fix that by skipping addition
of this element when time_zone parameter is not set.

Signed-off-by: Markus Theil <markus.theil@tu-ilmenau.de>
7 years agonl80211: Allow mesh interface to send channel switch request
Peter Oh [Tue, 29 May 2018 21:39:16 +0000 (14:39 -0700)] 
nl80211: Allow mesh interface to send channel switch request

Add mesh type to nl80211 channel switch request, so mesh is able to send
the request to kernel drivers.

Signed-off-by: Peter Oh <peter.oh@bowerswilkins.com>
7 years agotests: Hotspot 2.0 OSEN-single-SSID connection
Jouni Malinen [Tue, 29 May 2018 17:12:14 +0000 (20:12 +0300)] 
tests: Hotspot 2.0 OSEN-single-SSID connection

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoHS 2.0: Allow OSEN connection to be used in an RSN BSS
Jouni Malinen [Tue, 29 May 2018 17:09:53 +0000 (20:09 +0300)] 
HS 2.0: Allow OSEN connection to be used in an RSN BSS

This allows a single BSS/SSID to be used for both data connection and
OSU. In wpa_supplicant configuration, the current proto=OSEN
key_mgmt=OSEN combination is now allowing both the old separate OSEN
BSS/IE and the new RSN-OSEN to be used.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoHS 2.0: Allow OSEN connection to be enabled in an RSN BSS
Jouni Malinen [Tue, 29 May 2018 17:09:53 +0000 (20:09 +0300)] 
HS 2.0: Allow OSEN connection to be enabled in an RSN BSS

This allows a single BSS/SSID to be used for both data connection and
OSU. Instead of hostapd configuration osen=1, wpa_key_mgmt=OSEN (or more
likely, wpa_key_mgmt=WPA-EAP OSEN) is used to enable this new option.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agomacsec_qca: Fix byte order of TX SCI port
xiaofeis [Fri, 25 May 2018 02:41:01 +0000 (10:41 +0800)] 
macsec_qca: Fix byte order of TX SCI port

Before calling HW macsec driver API, be_to_host16() should be used to
reverse the SCI port byte order. This was broken as part of the mka API
changes.

Fixes: 8ebfc7c2ba77 ("mka: Pass full structures down to macsec drivers' transmit SC ops")
Signed-off-by: xiaofeis <xiaofeis@codeaurora.org>
7 years agotests: EAP-pwd with salted passwords
Jouni Malinen [Mon, 28 May 2018 14:14:37 +0000 (17:14 +0300)] 
tests: EAP-pwd with salted passwords

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoEAP-pwd: Mask timing of PWE derivation
Dan Harkins [Fri, 25 May 2018 18:40:04 +0000 (21:40 +0300)] 
EAP-pwd: Mask timing of PWE derivation

Run through the hunting-and-pecking loop 40 times to mask the time
necessary to find PWE. The odds of PWE not being found in 40 loops is
roughly 1 in 1 trillion.

Signed-off-by: Dan Harkins <dharkins@lounge.org>
7 years agoEAP-pwd peer: Add SHA512 hash based salt mechanism
Dan Harkins [Fri, 25 May 2018 18:40:04 +0000 (21:40 +0300)] 
EAP-pwd peer: Add SHA512 hash based salt mechanism

Signed-off-by: Dan Harkins <dharkins@lounge.org>
7 years agoEAP-pwd peer: Add SHA256 hash based salt mechanism
Dan Harkins [Fri, 25 May 2018 18:40:04 +0000 (21:40 +0300)] 
EAP-pwd peer: Add SHA256 hash based salt mechanism

Signed-off-by: Dan Harkins <dharkins@lounge.org>
7 years agoEAP-pwd peer: Add SHA-1 hash based salt mechanism
Dan Harkins [Fri, 25 May 2018 18:40:04 +0000 (21:40 +0300)] 
EAP-pwd peer: Add SHA-1 hash based salt mechanism

Signed-off-by: Dan Harkins <dharkins@lounge.org>
7 years agoEAP-pwd peer: Check for unexpected state for ID exchange
Jouni Malinen [Mon, 28 May 2018 13:17:20 +0000 (16:17 +0300)] 
EAP-pwd peer: Check for unexpected state for ID exchange

Aborty processing if ID exchange processing is entered twice
unexpectedly. This avoids memory leaks in the function.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoEAP-pwd peer: Add support for salted password databases
Dan Harkins [Fri, 25 May 2018 18:40:04 +0000 (21:40 +0300)] 
EAP-pwd peer: Add support for salted password databases

These changes add support for salted password databases to EAP-pwd per
RFC 8146. This commits introduces the framework for enabling this and
the actual salting mechanisms are introduced in the following commits.

Signed-off-by: Dan Harkins <dharkins@lounge.org>
7 years agotests: Adjust eap_proto_pwd_errors to match implementation changes
Jouni Malinen [Mon, 28 May 2018 14:00:52 +0000 (17:00 +0300)] 
tests: Adjust eap_proto_pwd_errors to match implementation changes

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoEAP-pwd peer: Move PWE derivation to commit exchange
Dan Harkins [Fri, 25 May 2018 18:40:04 +0000 (21:40 +0300)] 
EAP-pwd peer: Move PWE derivation to commit exchange

There is no need to do this during the ID exchange, so move PWE
deriation into the following commit exchange in preparation for adding
support for salted passwords.

Signed-off-by: Dan Harkins <dharkins@lounge.org>
7 years agoEAP-pwd server: Add support for salted password databases
Dan Harkins [Fri, 25 May 2018 18:40:04 +0000 (21:40 +0300)] 
EAP-pwd server: Add support for salted password databases

These changes add support for salted password databases to EAP-pwd per
RFC 8146. This commits introduces the framework for enabling this and
the salting mechanisms based on SHA-1, SHA256, and SHA512 hash
algorithms.

Signed-off-by: Dan Harkins <dharkins@lounge.org>
7 years agoEAP-pwd: Pre-processing method definitions from RFC 8146
Dan Harkins [Fri, 25 May 2018 18:40:04 +0000 (21:40 +0300)] 
EAP-pwd: Pre-processing method definitions from RFC 8146

Add new password pre-processing method definitions in preparation for
salted passwords with EAP-pwd.

Signed-off-by: Dan Harkins <dharkins@lounge.org>
7 years agoEAP-pwd: Move EC group initialization to earlier step
Dan Harkins [Fri, 25 May 2018 18:40:04 +0000 (21:40 +0300)] 
EAP-pwd: Move EC group initialization to earlier step

This is needed for adding support for salted passwords.

Signed-off-by: Dan Harkins <dharkins@lounge.org>
7 years agoAdd a QCA vendor command attribute to enable/disable GTX
Sachin Ahuja [Mon, 21 May 2018 11:47:27 +0000 (17:17 +0530)] 
Add a QCA vendor command attribute to enable/disable GTX

This commit adds a new vendor command attribute
QCA_WLAN_VENDOR_ATTR_CONFIG_GTX in
QCA_NL80211_VENDOR_SUBCMD_SET_WIFI_CONFIGURATION to enable/disable green
Tx power saving feature.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agotests: WPA2-EAP-FT AP changing from 802.1X-only to FT-only
Jouni Malinen [Mon, 21 May 2018 19:24:36 +0000 (22:24 +0300)] 
tests: WPA2-EAP-FT AP changing from 802.1X-only to FT-only

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoFT: Disable PMKSA caching with FT
Jouni Malinen [Mon, 21 May 2018 19:18:50 +0000 (22:18 +0300)] 
FT: Disable PMKSA caching with FT

PMKSA caching with FT is not fully functional, so disable the case for
now, so that wpa_supplicant does not end up trying to connect with a
PMKSA cache entry from another AKM. FT-EAP was already modified long
time ago to not add PMKSA cache entries itself.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agofst: Fix compile error in fst_ctrl_aux.h with C++ compilers
Lior David [Mon, 7 May 2018 14:59:51 +0000 (17:59 +0300)] 
fst: Fix compile error in fst_ctrl_aux.h with C++ compilers

Move enum fst_reason to be a top level type, since it is used as
argument in the function fst_reason_name() and having it as nested
type caused a compile error when fst_ctrl_aux.h was included from
a C++ source file.

Signed-off-by: Lior David <liord@codeaurora.org>
7 years agotests: SAE with Password Identifier
Jouni Malinen [Sat, 19 May 2018 14:24:42 +0000 (17:24 +0300)] 
tests: SAE with Password Identifier

This verifies SAE Password Identifier functionality in both the
infrastructure and mesh BSS cases.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoSAE: Add support for using the optional Password Identifier
Jouni Malinen [Sat, 19 May 2018 14:28:01 +0000 (17:28 +0300)] 
SAE: Add support for using the optional Password Identifier

This extends the SAE implementation in both infrastructure and mesh BSS
cases to allow an optional Password Identifier to be used. This uses the
mechanism added in P802.11REVmd/D1.0. The Password Identifier is
configured in a wpa_supplicant network profile as a new string parameter
sae_password_id. In hostapd configuration, the existing sae_password
parameter has been extended to allow the password identifier (and also a
peer MAC address) to be set. In addition, multiple sae_password entries
can now be provided to hostapd to allow multiple per-peer and
per-identifier passwords to be set.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agomesh: Register msg_ctx for hostapd/AP code
Jouni Malinen [Sat, 19 May 2018 14:22:48 +0000 (17:22 +0300)] 
mesh: Register msg_ctx for hostapd/AP code

The use of hostapd code for a mesh interface did not register
hapd->msg_ctx. This needs to be done similarly to the existing cases in
wpa_supplicant AP and IBSS mode uses so that wpa_msg() calls from the
hostapd/AP code get delivered properly.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoAdd QCA NAN vendor attributes to provide IPv6 information
Naveen Rawat [Mon, 14 May 2018 17:25:01 +0000 (10:25 -0700)] 
Add QCA NAN vendor attributes to provide IPv6 information

Add NAN attributes to communicate IPv6 address, port, and protocol
between wifihal and host driver.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agotests: Brainpool curves in ap_wpa2_eap_pwd_groups with OpenSSL 1.1.x
Jouni Malinen [Thu, 17 May 2018 19:03:25 +0000 (22:03 +0300)] 
tests: Brainpool curves in ap_wpa2_eap_pwd_groups with OpenSSL 1.1.x

The OpenSSL version check should not have been limited to 1.0.2 only.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agowolfSSL: Fix crypto_bignum_rshift() wrapper
Jouni Malinen [Thu, 17 May 2018 19:02:02 +0000 (22:02 +0300)] 
wolfSSL: Fix crypto_bignum_rshift() wrapper

The n argument to this function is number of bits, not bytes, to shift.
As such, need to use mp_rshb() instead of mp_rshd(). This fixes EAP-pwd
with P-521 curve.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agowolfSSL: DH initialization to call TEST_FAIL() for error tests
Sean Parkinson [Mon, 7 May 2018 23:26:45 +0000 (09:26 +1000)] 
wolfSSL: DH initialization to call TEST_FAIL() for error tests

Signed-off-by: Sean Parkinson <sean@wolfssl.com>
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>