]> git.ipfire.org Git - thirdparty/hostap.git/log
thirdparty/hostap.git
5 years agotests: FT with different BIP algorithms
Jouni Malinen [Tue, 5 Jun 2018 18:39:08 +0000 (21:39 +0300)] 
tests: FT with different BIP algorithms

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoFT: Support BIP-CMAC-256, BIP-GMAC-128, BIP-GMAC-256 in STA case
Jouni Malinen [Tue, 5 Jun 2018 18:38:01 +0000 (21:38 +0300)] 
FT: Support BIP-CMAC-256, BIP-GMAC-128, BIP-GMAC-256 in STA case

wpa_supplicant was hardcoded to use BIP-CMAC-128 in FT protocol if PMF
was enabled. Extend that to allow the other BIP algorithms to be used as
well.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoFT: Support 256-bit IGTK in AP case
Jouni Malinen [Tue, 5 Jun 2018 18:36:56 +0000 (21:36 +0300)] 
FT: Support 256-bit IGTK in AP case

hostapd was hardcoded to use 128-bit IGTK in FT protocol (IGTK
subelement in FTE). Extend that to allow 256-bit IGTK (i.e.,
BIP-CMAC-256 and BIP-GMAC-256) to be used as well.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: FILS+FT with SHA384
Jouni Malinen [Tue, 5 Jun 2018 17:15:53 +0000 (20:15 +0300)] 
tests: FILS+FT with SHA384

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoFT: Handle AssocResp generation failures as fatal errors
Jouni Malinen [Tue, 5 Jun 2018 18:09:43 +0000 (21:09 +0300)] 
FT: Handle AssocResp generation failures as fatal errors

Instead of sending out a partially completed frame, abort the
association process if something unexpected happens and remove the STA
entry.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: Split ap_ft_ap_oom7 into separate test cases
Jouni Malinen [Tue, 5 Jun 2018 18:48:27 +0000 (21:48 +0300)] 
tests: Split ap_ft_ap_oom7 into separate test cases

The implementation changes in hostapd FT error path handling in the
follow commit would result in ap_ft_ap_oom7 test case failing. This is
triggered partially by PMF protections and SA Query attempts, so it
looks like it is easier to split each failure case into a separate test
case.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoFILS: Fix KEK2 use in FT-FILS use cases
Jouni Malinen [Tue, 5 Jun 2018 17:13:34 +0000 (20:13 +0300)] 
FILS: Fix KEK2 use in FT-FILS use cases

When support for KCK2 and KEK2 was added, both keys were derived for
FT-FILS cases, but only KCK2 was actually used. Add similar changes to
use KEK2 to protect GTK/IGTK in FTE with using FT-FILS AKMs.

This fixes AES key wrapping to use the correct key. The change is not
backwards compatible.

Fixes: 2f37387812a5 ("FILS: Add more complete support for FT-FILS use cases")
Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoFT: Fix potential NULL pointer dereference in MDE addition
Jouni Malinen [Tue, 5 Jun 2018 11:40:18 +0000 (14:40 +0300)] 
FT: Fix potential NULL pointer dereference in MDE addition

The bss variable in this function might be NULL, so make the FT MDE
addition case conditional on a BSS entry being available.

Fixes: 3dc3afe298f0 ("FT: Add MDE to assoc request IEs in connect params")
Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoFT: Fix RRB error path handling
Jouni Malinen [Tue, 5 Jun 2018 11:18:41 +0000 (14:18 +0300)] 
FT: Fix RRB error path handling

When building an RRB message, a failure in wpa_ft_rrb_lin() calls could
have resulted in trying to free an uninitialized pointer. Fix this by
initializing *packet to NULL before going through the initial steps.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoFT: Debug print of IE parsing element details
Jouni Malinen [Tue, 5 Jun 2018 10:21:27 +0000 (13:21 +0300)] 
FT: Debug print of IE parsing element details

This makes it easier to debug issues in processing FT frames.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: FT-EAP-SHA384
Jouni Malinen [Mon, 4 Jun 2018 12:16:54 +0000 (15:16 +0300)] 
tests: FT-EAP-SHA384

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoFT: Add key management value FT-EAP-SHA384 for wpa_supplicant
Jouni Malinen [Mon, 4 Jun 2018 12:16:54 +0000 (15:16 +0300)] 
FT: Add key management value FT-EAP-SHA384 for wpa_supplicant

This allows wpa_supplicant to be configuted to use the SHA384-based FT
AKM.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoFT: Add key management value FT-EAP-SHA384 for hostapd
Jouni Malinen [Mon, 4 Jun 2018 12:16:54 +0000 (15:16 +0300)] 
FT: Add key management value FT-EAP-SHA384 for hostapd

This allows hostapd to be configuted to use the SHA384-based FT AKM.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoFT: Add support for variable length PMK-R1 receiving in RRB
Jouni Malinen [Mon, 4 Jun 2018 12:16:54 +0000 (15:16 +0300)] 
FT: Add support for variable length PMK-R1 receiving in RRB

SHA384-based FT AKM uses longer keys, so the RRB receive processing for
push and pull response messages needs to be able to accept variable
length PMK-R1.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoFT: FTE generation for SHA384-based AKM on AP
Jouni Malinen [Mon, 4 Jun 2018 22:31:43 +0000 (01:31 +0300)] 
FT: FTE generation for SHA384-based AKM on AP

The MIC field is now a variable length field, so make FTE generation in
hostapd aware of the two different field lengths.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoFT: FTE generation for SHA384-based AKM on STA
Jouni Malinen [Mon, 4 Jun 2018 12:16:54 +0000 (15:16 +0300)] 
FT: FTE generation for SHA384-based AKM on STA

The MIC field is now a variable length field, so make FTE generation in
wpa_supplicant aware of the two different field lengths.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoFT: FTE parsing for SHA384-based AKM
Jouni Malinen [Mon, 4 Jun 2018 12:16:54 +0000 (15:16 +0300)] 
FT: FTE parsing for SHA384-based AKM

The MIC field is now a variable length field, so make the FTE parser
aware of the two different field lengths.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoFT: Connection settings for SHA384-based AKM
Jouni Malinen [Mon, 4 Jun 2018 12:16:54 +0000 (15:16 +0300)] 
FT: Connection settings for SHA384-based AKM

Extend wpa_supplicant to allow SHA384-based FT AKM to be selected for a
connection.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoFT: PMK-R0 derivation using SHA384-based AKM
Jouni Malinen [Mon, 4 Jun 2018 12:16:54 +0000 (15:16 +0300)] 
FT: PMK-R0 derivation using SHA384-based AKM

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoFT: PMKID derivation using SHA384-based AKM
Jouni Malinen [Mon, 4 Jun 2018 12:16:54 +0000 (15:16 +0300)] 
FT: PMKID derivation using SHA384-based AKM

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoFT: PTK derivation using SHA384-based AKM
Jouni Malinen [Mon, 4 Jun 2018 12:16:54 +0000 (15:16 +0300)] 
FT: PTK derivation using SHA384-based AKM

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoFT: PMK-R1 derivation using SHA384-based AKM
Jouni Malinen [Mon, 4 Jun 2018 12:16:54 +0000 (15:16 +0300)] 
FT: PMK-R1 derivation using SHA384-based AKM

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoFT: FTE MIC calculation using SHA384-based AKM
Jouni Malinen [Mon, 4 Jun 2018 12:16:54 +0000 (15:16 +0300)] 
FT: FTE MIC calculation using SHA384-based AKM

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoFT: EAPOL-Key MIC calculation using SHA384-based AKM
Jouni Malinen [Mon, 4 Jun 2018 12:16:54 +0000 (15:16 +0300)] 
FT: EAPOL-Key MIC calculation using SHA384-based AKM

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoFT: XXKey derivation for SHA384-based AKM
Jouni Malinen [Mon, 4 Jun 2018 12:16:54 +0000 (15:16 +0300)] 
FT: XXKey derivation for SHA384-based AKM

XXKey is the first 384 bits of MSK when using the SHA384-based FT AKM.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoFT: Support variable length keys
Jouni Malinen [Mon, 4 Jun 2018 12:16:54 +0000 (15:16 +0300)] 
FT: Support variable length keys

This is a step in adding support for SHA384-based FT AKM.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoFT: SHA384-based AKM in RSNE processing
Jouni Malinen [Mon, 4 Jun 2018 12:16:54 +0000 (15:16 +0300)] 
FT: SHA384-based AKM in RSNE processing

This defines key lengths for SHA384-based FT AKM and handles writing and
parsing for RSNE AKMs with the new value.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoEAP-TLS: Derive Session-Id using TLS-Exporter when TLS v1.3 is used
Jouni Malinen [Fri, 1 Jun 2018 14:58:56 +0000 (17:58 +0300)] 
EAP-TLS: Derive Session-Id using TLS-Exporter when TLS v1.3 is used

This updates Session-Id derivation with TLS v1.3 per
draft-ietf-emu-eap-tls13-00.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: ERP enabled on RADIUS server and peer using EAP-TLS v1.3
Jouni Malinen [Fri, 1 Jun 2018 14:53:10 +0000 (17:53 +0300)] 
tests: ERP enabled on RADIUS server and peer using EAP-TLS v1.3

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoEAP-TLS server: Fix EMSK derivation with TLS v1.3
Jouni Malinen [Fri, 1 Jun 2018 14:52:18 +0000 (17:52 +0300)] 
EAP-TLS server: Fix EMSK derivation with TLS v1.3

The new label string for TLS-Exporter was taken into use for MSK
derivation, but it was missed from EMSK deriation in the server side
implementation.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoEAP-TLS: Update key derivation label per draft-ietf-emu-eap-tls13-00
Jouni Malinen [Fri, 1 Jun 2018 14:41:59 +0000 (17:41 +0300)] 
EAP-TLS: Update key derivation label per draft-ietf-emu-eap-tls13-00

The label strings used for deriving Key_Material with TLS v1.3 were
changed, so update the implementation to match the new values.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agowpa_supplicant: Fix parsing of max_oper_chwidth
Sven Eckelmann [Mon, 7 May 2018 13:24:29 +0000 (15:24 +0200)] 
wpa_supplicant: Fix parsing of max_oper_chwidth

The max_oper_chwidth is parsed in wpa_config_set as INT_RANGE (see
ssid_fields). The actual parsing for INT_RANGE is done by
wpa_config_parse_int which can only store the result as full integer.

max_oper_chwidth is stored as u8 (a single byte) in wpa_ssid. This means
that on little endian systems, the least significant byte of the parsed
value are really stored in the max_oper_chwidth. But on big endian
system, the only most significant byte is stored as max_oper_chwidth.
This means that 0 is always stored because the provided range doesn't
allow any other value for systems with multi-byte-wide integers.

This also means that for common systems with 4-byte-wide integers, the
remaining 3 bytes were written after the actual member of the struct.
This should not have influenced the behavior of succeeding members
because these bytes would have been part of the padding between the
members on most systems.

Increasing its size to a full int fixes the write operations outside of
the member and allows to use the max_oper_chwidth setting on big endian
systems.

Fixes: 0f29bc68d18e ("IBSS/mesh: Add support for VHT80P80 configuration")
Signed-off-by: Sven Eckelmann <sven.eckelmann@openmesh.com>
5 years agotests: Update mesh_oom to match implementation change
Jouni Malinen [Thu, 31 May 2018 13:13:58 +0000 (16:13 +0300)] 
tests: Update mesh_oom to match implementation change

The initial direct allocation within wpa_supplicant_mesh_init() was
removed.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agomesh: Fix crash with CONFIG_TAXONOMY enabled
Felix Fietkau [Thu, 3 May 2018 10:36:15 +0000 (12:36 +0200)] 
mesh: Fix crash with CONFIG_TAXONOMY enabled

wpa_s->ifmsh needs to be allocated using hostapd_alloc_iface() instead
of a direct call to os_zalloc(), otherwise the linked list for station
taxonomy items remains uninitialized, leading to a crash on the first
attempt to traverse that list

Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>