]> git.ipfire.org Git - thirdparty/hostap.git/log
thirdparty/hostap.git
5 years agotests: OSEN with two group ciphers allowed on client side
Jouni Malinen [Mon, 30 Jul 2018 21:33:08 +0000 (00:33 +0300)] 
tests: OSEN with two group ciphers allowed on client side

This verifies the new default behavior for OSEN in Single SSID capable
devices.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoHS 2.0: Allow CCMP as group cipher for OSEN single SSID case
Jouni Malinen [Mon, 30 Jul 2018 21:31:16 +0000 (00:31 +0300)] 
HS 2.0: Allow CCMP as group cipher for OSEN single SSID case

When OSEN is used in the BSS that is shared both for production data and
OSU uses, the group cipher might be either GTK_NOT_USED (like in Rel 2
OSEN) or CCMP. Modify hs20-osu-client to allow both these group ciphers
to be used when requesting OSEN connection.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: Verify T&C Server URL generation result
Jouni Malinen [Mon, 30 Jul 2018 21:21:59 +0000 (00:21 +0300)] 
tests: Verify T&C Server URL generation result

Check that the @1@ macro gets replaced correctly both when in the middle
and when in the end of the URL template.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoHS 2.0: Fix Terms and Conditions Server URL macro replacement
Jouni Malinen [Mon, 30 Jul 2018 21:07:36 +0000 (00:07 +0300)] 
HS 2.0: Fix Terms and Conditions Server URL macro replacement

The last character of the STA MAC address got replaced with 0x00 due to
truncation if the @1@ macro was used at the end of the URL. Fix this
case by allocating larger buffer for the URL.

Fixes: d4e39c51f8bb ("HS 2.0: Move Terms and Conditions Server URL generation from AP to AS")
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDefine test config QCA vendor attribute for HE MAC padding duration
Kiran Kumar Lokere [Thu, 5 Jul 2018 22:28:11 +0000 (15:28 -0700)] 
Define test config QCA vendor attribute for HE MAC padding duration

Add a new wifi test config QCA vendor attribute to configure HE
trigger frame MAC padding duration value in the driver.
This is used for testbed configuration.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agonl80211: Indicate interface up only for the main netdev
Hu Wang [Tue, 26 Jun 2018 02:56:29 +0000 (10:56 +0800)] 
nl80211: Indicate interface up only for the main netdev

ifname is checked for interface down event in commit
106fa1e97e29e7514ae324020802c280f993ee48 ("nl80211: Indicate
interface-down event only for the main netdev"). Do the same for
interface up event to avoid unexpected notifications when the master
interface (e.g., a bridge interface) is set up while then WLAN interface
remains down.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agonl80211: Allocate nl_sock for NETLINK_ROUTE when already_in_bridge
Sathishkumar Muruganandam [Wed, 4 Jul 2018 09:31:02 +0000 (15:01 +0530)] 
nl80211: Allocate nl_sock for NETLINK_ROUTE when already_in_bridge

When we start hostapd having Hotspot 2.0 configuration with interface
already added to bridge interface, addition and deletion of new neighbor
to bridge ip neighbor table fails.

This is since 'bss->added_if_into_bridge' is not set which only allows
'drv->rtnl_sk' (nl_sock for NETLINK_ROUTE) allocation needed for bridge
ip neighbor table.

Add a new bit 'already_in_bridge' and set it when interface is already
added to bridge by some external component. Check this bit in addition
to 'bss->added_if_into_bridge' for 'drv->rtnl_sk' allocation done in
i802_init().

Now 'drv->rtnl_sk' is closed in wpa_driver_nl80211_deinit() regardless of
'bss->added_if_into_bridge' since when we have 'bss->already_in_bridge'
case too, this need to be removed.

brctl show

bridge name     bridge id               STP enabled     interfaces
br0             8000.8efdf006b050       no              ap

hostapd_cli raw STATUS-DRIVER

Selected interface 'ap'
ifindex=15
ifname=ap
brname=br0
addr=8e:fd:f0:06:b0:50
freq=5180
beacon_set=1
already_in_bridge=1
..

Signed-off-by: Sathishkumar Muruganandam <murugana@codeaurora.org>
5 years agonl80211: Skip vendor specific DFS offload if upstream mechanism is used
Peng Xu [Fri, 15 Jun 2018 21:39:32 +0000 (14:39 -0700)] 
nl80211: Skip vendor specific DFS offload if upstream mechanism is used

Since the generic DFS offload support flag is added as
NL80211_EXT_FEATURE_DFS_OFFLOAD, only use the vendor command to check
DFS capablity if the flag is not already set.

Signed-off-by: Peng Xu <pxu@codeaurora.org>
5 years agoDefine test config QCA vendor attribute for HE MU EDCA params
Kiran Kumar Lokere [Thu, 28 Jun 2018 23:50:19 +0000 (16:50 -0700)] 
Define test config QCA vendor attribute for HE MU EDCA params

Add a new wifi test config QCA vendor attributes to configure
HE MU EDCA parameters value in the driver.
This is used for testbed configuration.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDefine test config QCA vendor attribute for Tx beamformee NSTS
Kiran Kumar Lokere [Sat, 23 Jun 2018 00:31:45 +0000 (17:31 -0700)] 
Define test config QCA vendor attribute for Tx beamformee NSTS

Add a new wifi test config QCA vendor attribute to configure Tx
beamformee number of space-time streams value in the driver.
This is used for testbed configuration.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoHS 2.0: CoA-Request from Terms and Conditions server
Jouni Malinen [Fri, 22 Jun 2018 17:22:40 +0000 (20:22 +0300)] 
HS 2.0: CoA-Request from Terms and Conditions server

This extends the terms.php implementation of Hotspot 2.0 Terms and
Conditions server to allow it to interact with hostapd(AS) to clear the
filtering rules from the AP. After requesting hostapd to send out the
CoA-Request, terms.php waits for up to 10 seconds to see whether the
current_sessions table gets an update to indicate that filtering has
been successfully disabled.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: ap_hs20_terms_and_conditions_sql to test DAC_REQUEST
Jouni Malinen [Fri, 22 Jun 2018 16:34:37 +0000 (19:34 +0300)] 
tests: ap_hs20_terms_and_conditions_sql to test DAC_REQUEST

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoRADIUS: Add DAC implementation in hostapd(AS)
Jouni Malinen [Fri, 22 Jun 2018 16:32:46 +0000 (19:32 +0300)] 
RADIUS: Add DAC implementation in hostapd(AS)

The new DAC_REQUEST control interface command can now be used to request
hostapd to send out Disconnect-Request and CoA-Request packets for an
existing session.

DAC_REQUEST <disconnect|coa> <MAC Address> [t_c_clear]

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoRADIUS: Allow 0.0.0.0 to be used as wildard radius_das_client
Jouni Malinen [Fri, 22 Jun 2018 08:47:19 +0000 (11:47 +0300)] 
RADIUS: Allow 0.0.0.0 to be used as wildard radius_das_client

This allows hostapd DAS to be configured to allow any DAC (with the
matching shared secret) to send Disconnect-Request and CoA-Request
packets.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: Check current_sessions in ap_hs20_terms_and_conditions_sql
Jouni Malinen [Thu, 21 Jun 2018 21:13:15 +0000 (00:13 +0300)] 
tests: Check current_sessions in ap_hs20_terms_and_conditions_sql

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoRADIUS server: Add current_sessions SQLite table
Jouni Malinen [Thu, 21 Jun 2018 21:12:07 +0000 (00:12 +0300)] 
RADIUS server: Add current_sessions SQLite table

This can be used to track active sessions, e.g., for the purpose of
issuing RADIUS DAS commands (Disconnect-Request or CoA-Request).

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: Move hs20_t_c_server_url parameter from AP to AS
Jouni Malinen [Thu, 21 Jun 2018 17:52:54 +0000 (20:52 +0300)] 
tests: Move hs20_t_c_server_url parameter from AP to AS

This is needed with the modified hostapd implementation to fix the
ap_hs20_terms_and_conditions* test cases.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoHS 2.0: Move Terms and Conditions Server URL generation from AP to AS
Jouni Malinen [Thu, 21 Jun 2018 17:50:54 +0000 (20:50 +0300)] 
HS 2.0: Move Terms and Conditions Server URL generation from AP to AS

This makes it more convenient to generate the URL in a way that
interoperates between different vendors. The AP is simply copying the
already constructed URL as-is from Access-Accept to WNM-Notification.
This means that the HO AAA can generate the URL in a manner that works
for the associated T&C Server without having to coordinate with each AP.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: hs20-osu-client testing for PPS MO parsing
Jouni Malinen [Thu, 21 Jun 2018 16:18:54 +0000 (19:18 +0300)] 
tests: hs20-osu-client testing for PPS MO parsing

This adds a mechanism to allow hs20-osu-client set_pps command to be
tested with PPS MO files.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoHS 2.0: Process Credential/UsernamePassword/EAPMethod nodes in PPS MO
Jouni Malinen [Thu, 21 Jun 2018 16:16:26 +0000 (19:16 +0300)] 
HS 2.0: Process Credential/UsernamePassword/EAPMethod nodes in PPS MO

This allows hs20-osu-client to configure wpa_supplicant credential with
a specific EAP method so that roaming consortium OI -based matching can
be used.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: Fix mbo_supp_oper_classes with new regdb
Jouni Malinen [Wed, 20 Jun 2018 12:23:50 +0000 (15:23 +0300)] 
tests: Fix mbo_supp_oper_classes with new regdb

Change country code KZ to SY for the 2.4 GHz only case since 5 GHz rules
were added for KZ.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: Add more details on sae_bignum_failure logs
Jouni Malinen [Wed, 20 Jun 2018 10:07:38 +0000 (13:07 +0300)] 
tests: Add more details on sae_bignum_failure logs

It is easier to understand the hostapd debug log here if each step is
noted there before starting the wpa_supplicant operation. In addition,
it looks safer to process all pending event messages between each step
to avoid running out of any buffer limits.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoSAE: Allow authentication restart on AP
Jouni Malinen [Wed, 20 Jun 2018 10:04:31 +0000 (13:04 +0300)] 
SAE: Allow authentication restart on AP

In the infrastructure BSS case, the AP needs to clear pending SAE state
if a new Commit message is received when already in Committed state.
This allows the non-AP STA to negotiate a new group if it ends up trying
to go through SAE authentication again before the AP side has removed
the previous STA entry.

This fixes an issue where a kernel update changed something in SAE
timing or authentication sequence and started failing the
sae_bignum_failure hwsim test case.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: sigma_dut controlled AP with EAP+OSEN
Jouni Malinen [Mon, 18 Jun 2018 21:39:42 +0000 (00:39 +0300)] 
tests: sigma_dut controlled AP with EAP+OSEN

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoHS 2.0: Allow Hotspot 2.0 version number to be overridden for build
Jouni Malinen [Mon, 18 Jun 2018 16:42:38 +0000 (19:42 +0300)] 
HS 2.0: Allow Hotspot 2.0 version number to be overridden for build

This can be used for testing and development purposes.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: P2P and avoid frequencies driver event on 5 GHz
Jouni Malinen [Fri, 15 Jun 2018 18:56:21 +0000 (21:56 +0300)] 
tests: P2P and avoid frequencies driver event on 5 GHz

This test case verifies that wpa_supplicant is able to perform CSA to a
VHT80 channel when having to move the GO due to an avoid-frequencies
driver event.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoP2P: Use more compact debug print of common group frequencies
Jouni Malinen [Fri, 15 Jun 2018 18:55:26 +0000 (21:55 +0300)] 
P2P: Use more compact debug print of common group frequencies

Print the list of frequencies on a single line instead of one line per
frequency.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoP2P: Improve common group channel selection if GO needs to be moved
Jouni Malinen [Fri, 15 Jun 2018 18:47:29 +0000 (21:47 +0300)] 
P2P: Improve common group channel selection if GO needs to be moved

Prefer channels that support VHT80 (and secondarily, HT40 on the same
band) over other common group channels. If no such channel is found,
prefer any channel that uses the same band so that CSA can be used. This
improves the case where a P2P GO needs to move to another channel and
there is no other reason (e.g., preferred channel from the driver or an
already used channel from a virtual interface sharing the same radio) to
pick a specific channel.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoP2P/AP: More detailed debug prints on HT/VHT parameter selection
Jouni Malinen [Fri, 15 Jun 2018 18:40:43 +0000 (21:40 +0300)] 
P2P/AP: More detailed debug prints on HT/VHT parameter selection

This makes it easier to debug why wpa_supplicant selects particular
HT/VHT parameters for AP/P2P GO mode.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agonl80211: Add more command/event names to debug prints
Jouni Malinen [Fri, 15 Jun 2018 18:40:08 +0000 (21:40 +0300)] 
nl80211: Add more command/event names to debug prints

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agotests: Associated STA indicating 40 MHz intolerant and hostapd deinit
Jouni Malinen [Tue, 12 Jun 2018 18:47:43 +0000 (21:47 +0300)] 
tests: Associated STA indicating 40 MHz intolerant and hostapd deinit

This is a regression test for a forgotten ap_ht2040_timeout() eloop
timer callback on AP interface removal.

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agoAP: Fix HT 20/40 co-ex transition timer cancellation on iface removal
Martin Willi [Thu, 26 Apr 2018 12:27:05 +0000 (14:27 +0200)] 
AP: Fix HT 20/40 co-ex transition timer cancellation on iface removal

When removing an interface, hostapd_bss_deinit() frees all associated
STAs. If any of the stations is 40MHz intolerant, the cleanup invokes
ht40_intolerant_remove(), that in turn registers a 20->40MHz transition
timer for the last station (ap_ht2040_timeout() function). That timer is
never canceled; once it executes, the interface is gone, most likely
resulting in a segfault when referencing it.

While hostapd_interface_deinit() cancels the transition timer, it does
so before cleaning up STAs. Move the cancellation after STA cleanup to
cancel any timer that was registered during that operation.

Signed-off-by: Martin Willi <martin@strongswan.org>
6 years agonl80211: Handle NL80211_CMD_WIPHY_REG_CHANGE event
Peng Xu [Wed, 14 Mar 2018 22:10:19 +0000 (15:10 -0700)] 
nl80211: Handle NL80211_CMD_WIPHY_REG_CHANGE event

Handle NL80211_CMD_WIPHY_REG_CHANGE the same way as the
NL80211_CMD_REG_CHANGE event. The wiphy-specific event is generated by
the cfg80211 reg_process_self_managed_hints() function, e.g., when going
through regulatory_set_wiphy_regd_sync_rtnl(). Previously, such events
were ignored completely in hostapd/wpa_supplicant.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoFT: Derive PMKR0Name/PMKR1Name using SHA-384 with AKM 00-0F-AC:13
Jouni Malinen [Wed, 6 Jun 2018 18:57:58 +0000 (21:57 +0300)] 
FT: Derive PMKR0Name/PMKR1Name using SHA-384 with AKM 00-0F-AC:13

The AKM 00-0F-AC:13 is supposed to use cryptographic algorithms
consistently, but the current IEEE 802.11 standard is not doing so for
the key names: PMKID (uses SHA-1), PMKR0Name/PMKR1Name (uses SHA-256).
The PMKID case was already implemented with SHA-384 and this commit
replaces use of SHA-256 with SHA-384 for PMKR0Name/PMKR1Name derivation
to be consistent in SHA-384. While this is not compliant with the
current IEEE 802.11 standard, this is clearly needed to meet CNSA Suite
requirements. Matching change is being proposed in REVmd to get the IEEE
802.11 standard to meet the use case requirements.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agotests: SAE reauthentication
Jouni Malinen [Tue, 5 Jun 2018 22:27:00 +0000 (01:27 +0300)] 
tests: SAE reauthentication

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoSAE: Do not drop STA entry on reauthentication in infrastructure BSS
Jouni Malinen [Tue, 5 Jun 2018 22:22:01 +0000 (01:22 +0300)] 
SAE: Do not drop STA entry on reauthentication in infrastructure BSS

A new SAE Commit message should not be allowed to drop an existing STA
entry since the sender of that Commit message cannot be authenticated
before receiving the Confirm message. This is important in particular
when PMF is used since this would provide a potential new path for
forcing a connection to be dropped.

Fix this by allowing a new SAE Authentication instance to be started
when the old instance is in Accepted state and the new Commit message
does not use the same peer-scalar value (checked in
sae_parse_commit_scalar()). When PMF is used, the AP will use SA Query
procedure when receiving the (Re)Association Request frame. In theory,
that step could be skipped in case of SAE Authentication since the
non-AP STA is demonstrating knowledge of the password. Anyway, there is
no allowance for that exception in the IEEE 802.11 standard, so at least
for now, leave this using SA Query procedure just like any other PMF
case.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>