]> git.ipfire.org Git - thirdparty/hostap.git/log
thirdparty/hostap.git
4 years agohw_feature: Correctly select mode in case of the 6 GHz band
Ilan Peer [Thu, 22 Oct 2020 11:00:25 +0000 (14:00 +0300)] 
hw_feature: Correctly select mode in case of the 6 GHz band

There are 2 HW modes with IEEE80211_MODE_A: one for the 5 GHz channels
and one for 6 GHz channels. Since hw_get_chan() checks all the
compatible hw modes, eventually, an incorrect hw mode is selected.

To fix this, add a function that checks if a specific mode supports
the requested frequency and if so use it as the current mode.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
4 years agotests: New HE configuration parameters
Jouni Malinen [Sun, 7 Feb 2021 22:45:42 +0000 (00:45 +0200)] 
tests: New HE configuration parameters

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoAP: Extend Spatial Reuse Parameter Set
Rajkumar Manoharan [Sat, 3 Oct 2020 09:31:16 +0000 (02:31 -0700)] 
AP: Extend Spatial Reuse Parameter Set

Extend SPR element to support following fields and pass all
information to kernel for driver use.
 * Non-SRG OBSS PD Max Offset
 * SRG BSS Color Bitmap
 * SRG Partial BSSID Bitmap

Signed-off-by: Rajkumar Manoharan <rmanohar@codeaurora.org>
4 years agoAllow HE MCS rate selection for Beacon frames
Rajkumar Manoharan [Sat, 3 Oct 2020 09:31:15 +0000 (02:31 -0700)] 
Allow HE MCS rate selection for Beacon frames

Allow HE MCS rate to be used for beacon transmission when the driver
advertises the support. The rate is specified with a new beacon_rate
option "he:<HE MCS>" in hostapd configuration.

Signed-off-by: Rajkumar Manoharan <rmanohar@codeaurora.org>
4 years agonl80211: Support the 6 GHz band for beacon rate configuration
Rajkumar Manoharan [Sat, 3 Oct 2020 09:31:15 +0000 (02:31 -0700)] 
nl80211: Support the 6 GHz band for beacon rate configuration

Use the correct enum nl80211_band value when configuring the beacon rate
for the 6 GHz band.

Signed-off-by: Rajkumar Manoharan <rmanohar@codeaurora.org>
4 years agohostapd: Add HE 6 GHz band capability configuration
Rajkumar Manoharan [Sat, 3 Oct 2020 06:34:16 +0000 (23:34 -0700)] 
hostapd: Add HE 6 GHz band capability configuration

Enable user to configure Maximum MPDU Length, Maximum A-MPDU Length
Exponent, Rx Antenna Pattern Consistency, and Tx Antenna Pattern
Consistency of 6 GHz capability through config file.

Signed-off-by: Rajkumar Manoharan <rmanohar@codeaurora.org>
4 years agoEAP-AKA: Check that ID message storing succeeds
Jouni Malinen [Sun, 7 Feb 2021 17:29:23 +0000 (19:29 +0200)] 
EAP-AKA: Check that ID message storing succeeds

This could fail in theory if running out of memory, so better check for
this explicitly instead of allowing the exchange to continue and fail
later due to checkcode mismatch.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoFix compiler warning on CONFIG_AP without CONFIG_P2P builds
Jouni Malinen [Sun, 7 Feb 2021 17:12:24 +0000 (19:12 +0200)] 
Fix compiler warning on CONFIG_AP without CONFIG_P2P builds

The static function is_chanwidth160_supported() is called only within
CONFIG_P2P block so the function itself needs to have matching condition
for build.

Fixes: ed24bad1d98d ("AP: Check driver support while auto-selecting bandwidth for AP/P2P GO")
Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoUpdate Visual Studio projects to match file renaming
Jouni Malinen [Sun, 7 Feb 2021 16:21:04 +0000 (18:21 +0200)] 
Update Visual Studio projects to match file renaming

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: Fix fuzzing test build after file rename
Jouni Malinen [Sun, 7 Feb 2021 16:16:28 +0000 (18:16 +0200)] 
tests: Fix fuzzing test build after file rename

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoRename blacklist.[ch] to bssid_ignore.[ch]
Jouni Malinen [Sun, 7 Feb 2021 15:06:19 +0000 (17:06 +0200)] 
Rename blacklist.[ch] to bssid_ignore.[ch]

This completes renaming of this functionality for a list of temporarily
ignored BSSIDs.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoRename wpa_blacklist to wpa_bssid_ignore
Jouni Malinen [Sun, 7 Feb 2021 15:02:37 +0000 (17:02 +0200)] 
Rename wpa_blacklist to wpa_bssid_ignore

This is more accurate name for this functionality of temporarily
ignoring BSSIDs.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoRename INTERWORKING_BLACKLISTED define
Jouni Malinen [Sun, 7 Feb 2021 14:43:54 +0000 (16:43 +0200)] 
Rename INTERWORKING_BLACKLISTED define

Use more accurate INTERWORKING_EXCLUDED for this. The actual event
prefix is not changed to remains compatible with external components
using this control interface event message.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: Use the new BSSID_IGNORE name for the command
Jouni Malinen [Sun, 7 Feb 2021 14:41:10 +0000 (16:41 +0200)] 
tests: Use the new BSSID_IGNORE name for the command

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoRename the control interface BLACKLIST command to BSSID_IGNORE
Jouni Malinen [Sun, 7 Feb 2021 14:29:53 +0000 (16:29 +0200)] 
Rename the control interface BLACKLIST command to BSSID_IGNORE

Use a more specific name for the control interface command used for
managing the list of BSSIDs that are temporarily ignored.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: Use new names for network profile BSSID ignore/accept parameters
Jouni Malinen [Sun, 7 Feb 2021 14:19:09 +0000 (16:19 +0200)] 
tests: Use new names for network profile BSSID ignore/accept parameters

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoRename network profiles parameters for ignoring/accepted BSSIDs
Jouni Malinen [Sun, 7 Feb 2021 14:10:18 +0000 (16:10 +0200)] 
Rename network profiles parameters for ignoring/accepted BSSIDs

Rename the network profile parameters bssid_blacklist and
bssid_whitelist to bssid_ignore and bssid_accept to use more specific
names for the configuration of which BSSs are ignored/accepted during
BSS selection. The old parameter names are maintained as aliases for the
new names to avoid breaking compatibility with previously used
configurations.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agowlantest: Add new key_mgmt and rsn_capab values for BSS/STA debug prints
Jouni Malinen [Sun, 7 Feb 2021 11:52:59 +0000 (13:52 +0200)] 
wlantest: Add new key_mgmt and rsn_capab values for BSS/STA debug prints

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoradiotap: Update radiotap parser
Jouni Malinen [Sun, 7 Feb 2021 11:25:13 +0000 (13:25 +0200)] 
radiotap: Update radiotap parser

Update the radiotap parser to the latest version of the
http://git.sipsolutions.net/radiotap.git/ library.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agowlantest: Add more details about protected FTM frames
Jouni Malinen [Sun, 7 Feb 2021 11:11:34 +0000 (13:11 +0200)] 
wlantest: Add more details about protected FTM frames

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agowlantest: Recognize the FTM bit in the CCMP Key ID octet
Jouni Malinen [Sun, 7 Feb 2021 10:30:03 +0000 (12:30 +0200)] 
wlantest: Recognize the FTM bit in the CCMP Key ID octet

This previously reserved bit is now used in FTM to help select the
appropriate replay counter. Silence the warning about use of a reserved
bit for this. wlantest does not yet support the actual replay counter
processing for FTM.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agowlantest: Process Action No Ack frames like Action frames
Jouni Malinen [Sun, 7 Feb 2021 10:00:12 +0000 (12:00 +0200)] 
wlantest: Process Action No Ack frames like Action frames

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agowlantest: Support TK list for Management frame decryption
Jouni Malinen [Sun, 7 Feb 2021 09:37:58 +0000 (11:37 +0200)] 
wlantest: Support TK list for Management frame decryption

Use the TKs from the PTK file (-T command line argument) to try to
decrypt encrypted Management frames if no BSS/STA key can be found based
on addresses.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: DFS pre CAC tests
Janusz Dziedzic [Sun, 11 Oct 2020 19:01:53 +0000 (21:01 +0200)] 
tests: DFS pre CAC tests

Add test cases that check preCAC, which is available for EU regulatory
domain. Also confirm that preCAC is not used for US.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@gmail.com>
4 years agoDFS: Allow switch to an available channel
Janusz Dziedzic [Sun, 11 Oct 2020 19:01:52 +0000 (21:01 +0200)] 
DFS: Allow switch to an available channel

For EU, where preCAC is allowed, we should allow switch to DFS available
channels, instead of restarting BSS.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@gmail.com>
4 years agotests: MAC ACL accept list changes
Jouni Malinen [Sun, 7 Feb 2021 08:10:46 +0000 (10:10 +0200)] 
tests: MAC ACL accept list changes

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agohostapd: Report errors ACCEPT_ACL/DENY_ACL control interface commands
Masafumi Utsugi [Tue, 29 Sep 2020 06:12:01 +0000 (15:12 +0900)] 
hostapd: Report errors ACCEPT_ACL/DENY_ACL control interface commands

Return FAIL for couple of the operations that were previously ignoring
invalid addresses without reporting errors.

Signed-off-by: Masafumi Utsugi <mutsugi@allied-telesis.co.jp>
4 years agohostapd: Fix dynamic ACCEPT_ACL management over control interface
Masafumi Utsugi [Tue, 29 Sep 2020 06:12:01 +0000 (15:12 +0900)] 
hostapd: Fix dynamic ACCEPT_ACL management over control interface

hostapd_disassoc_accept_mac() was called after a new accept MAC address
was added (ACCEPT_ACL ADD_MAC), but this function should have been
called after an accept MAC address was removed and accept MAC list was
cleared to disconnect a STA which is not listed in the update accept MAC
address list. Fix this by moving the call to places where a connected
STA can actually end up losing its previously present accept entry.

Signed-off-by: Masafumi Utsugi <mutsugi@allied-telesis.co.jp>
4 years agotests: Extend Multi AP tests
Janusz Dziedzic [Tue, 13 Oct 2020 10:16:27 +0000 (12:16 +0200)] 
tests: Extend Multi AP tests

Add option to:
 - add a new AP on the same phy that the backhaul-sta uses
 - run CSA from the parent

Adding a new AP (backhaul/fronthaul) on the same phy we have for
backhaul-sta is closer to the real repeater implementation.

Add a test case for that and run CSA.

This is a common problem when we have on the same phy:
 - connected backhaul STA
 - we started fronthaul/backhaul AP
 - we receive (from parent) CSA on the STA interface

This is multi_ap_wps_shared_apdev_csa test case, which fails today with
both mac80211_hwsim and ath9k. To avoid always failing test cases,
ignore this failure for now. Full validation can be enabled once the
issue behind this is fixed.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@gmail.com>
4 years agotests: Pass ful params_backhaul in Multi AP test cases
Janusz Dziedzic [Tue, 13 Oct 2020 10:16:26 +0000 (12:16 +0200)] 
tests: Pass ful params_backhaul in Multi AP test cases

Pass the backhaul parameters as a parameter. This is in preparation for
channel switch test for Multi AP.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@gmail.com>
4 years agohostapd: Add multi_ap settings to get_config() output
Raphaël Mélotte [Wed, 2 Dec 2020 16:51:45 +0000 (17:51 +0100)] 
hostapd: Add multi_ap settings to get_config() output

Since a running hostapd is not necessarily using the settings that are
in the configuration file (if they were changed at runtime, or the file
was changed but not reloaded, etc.), being able to get their value at
runtime can be useful (to know if they have to be updated for example).

If multi_ap is set, also print the SSID and passphrase (or PSK).

Signed-off-by: Raphaël Mélotte <raphael.melotte@mind.be>
4 years agotests: Add WPS test with dynamic update
Raphaël Mélotte [Fri, 18 Dec 2020 10:50:28 +0000 (11:50 +0100)] 
tests: Add WPS test with dynamic update

This test first configure hostapd with an initial SSID
('test-wpa2-psk-start'). Then a new SSID is configured
('test-wpa2-psk-new') using SET and RELOAD. Next, a station is
associated using WPS, and the test verifies that the new SSID was served
to the station.

Signed-off-by: Raphaël Mélotte <raphael.melotte@mind.be>
4 years agoWPS: Reconfigure credentials on hostapd config reload
Raphaël Mélotte [Thu, 4 Feb 2021 15:36:13 +0000 (16:36 +0100)] 
WPS: Reconfigure credentials on hostapd config reload

When new credentials are configured and hostapd is reconfigured using
SIGHUP (or RELOAD on the ctrl_iface), also update the WPS credentials.

Before these changes, when WPS is triggered the Registar always serves
the credentials that were configured when hostapd started.

Signed-off-by: Raphaël Mélotte <raphael.melotte@mind.be>
4 years agoWPS: Use helper variables to clean up code
Raphaël Mélotte [Thu, 4 Feb 2021 15:36:13 +0000 (16:36 +0100)] 
WPS: Use helper variables to clean up code

This is in preparation of larger changes in hostapd_update_wps() to keep
the commits more readable.

Signed-off-by: Raphaël Mélotte <raphael.melotte@mind.be>
4 years agowpa_supplicant: Configurable fast-associate timer threshold
Mikael Kanstrup [Wed, 4 Nov 2020 09:30:27 +0000 (10:30 +0100)] 
wpa_supplicant: Configurable fast-associate timer threshold

For Android the default value of 5 seconds is usually too short for
scan results from last scan initiated from settings app to be
considered for fast-associate. Make the fast-associate timer value
configurable so that a suitable value can be set based on a systems
regular scan interval.

Signed-off-by: Mikael Kanstrup <mikael.kanstrup@sony.com>
4 years agowpa_supplicant: Notify freq change on CH_SWITCH
Arowa Suliman [Tue, 3 Nov 2020 19:20:01 +0000 (11:20 -0800)] 
wpa_supplicant: Notify freq change on CH_SWITCH

wpa_supplicant does not send a D-Bus notification of the BSS frequency
change when a CSA happens. Sending a PropertyChanged signal with the
updated frequency will notify the network manager quickly, instead of
waiting for the next scan results.

Signed-off-by: Arowa Suliman <arowa@chromium.org>
Reviewed-by: Brian Norris <briannorris@chromium.org>
4 years agotests: Fix regdom cleanup in some p2p_channel tests
Andrei Otcheretianski [Mon, 14 Dec 2020 12:42:06 +0000 (14:42 +0200)] 
tests: Fix regdom cleanup in some p2p_channel tests

cfg80211 may ignore user hints while there are active COUNTRY_IE hints,
thus at some timings it may ignore the country setting back to world
domain. Fix it by making sure the country is set only after all the
interfaces are stopped. In addition, call a more robust
clear_regdom_dev() function.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
4 years agohostapd: Fix dpp_listen in DPP responder scenario
Michal Kazior [Tue, 15 Dec 2020 09:34:54 +0000 (09:34 +0000)] 
hostapd: Fix dpp_listen in DPP responder scenario

Some time ago it was found some drivers are setting their hw/ucode RX
filters restrictively enough to prevent broadcast DPP Action frames from
being received at upper layers in the stack.

A set of patches was introduced to the kernel and
ath9k driver as well as wpa_supplicant, e.g.,

  a39e9af90 ("nl80211: DPP listen mode callback")
  4d2ec436e ("DPP: Add driver operation for enabling/disabling listen mode")

However, the hostapd code itself was not calling the new multicast
registration. As such the AP side of things wasn't working as expected
in some scenarios. I've found this while trying to get ath9k working as
an AP Responder/Configurator.

The problem wasn't seen on, e.g., mac80211 hwsim driver.

Extend the wpa_supplicant mechanism to work with hostapd as well.

Signed-off-by: Michal Kazior <michal@plume.com>
4 years agotests: Add ap_notify_mgmt_frames
Raphaël Mélotte [Mon, 30 Nov 2020 11:10:47 +0000 (12:10 +0100)] 
tests: Add ap_notify_mgmt_frames

Test that if notify_mgmt_frames is enabled and a station connects we do
get AP-MGMT-FRAME-RECEIVED, and that it includes an Authentication
frame.

Also test that if notify_mgmt_frames is disabled, no Management frame is
sent on ctrl_iface when a station connects.

Signed-off-by: Raphaël Mélotte <raphael.melotte@mind.be>
4 years agohostapd: Add an option to notify management frames on ctrl_iface
Raphaël Mélotte [Mon, 30 Nov 2020 11:10:46 +0000 (12:10 +0100)] 
hostapd: Add an option to notify management frames on ctrl_iface

In some contexts (e.g., Multi-AP) it can be useful to have access to
some of the management frames in upper layers (e.g., to be able to
process the content of association requests externally).

Add 'notify_mgmt_frames'. When enabled, it will notify the ctrl_iface
when a management frame arrives using the AP-MGMT-FRAME-RECEIVED event
message.

Note that to avoid completely flooding the ctrl_iface, not all
management frames are included (e.g., Beacon and Probe Request frames
are excluded).

Signed-off-by: Raphaël Mélotte <raphael.melotte@mind.be>
4 years agoP2P: Adding option to manage device drivers creating random MAC addresses
Ircama [Sun, 24 Jan 2021 15:33:58 +0000 (16:33 +0100)] 
P2P: Adding option to manage device drivers creating random MAC addresses

Add option 2 to the p2p_device_random_mac_addr configuration option to
support device drivers which use by default random MAC adresses when
creating a new P2P Device interface (for instance, the BCM2711 80211
wireless device driver included in Raspberry Pi 4 Model B). In such
case, this option allows to create the P2P Device interface correctly
when using P2P permanent groups, enabling wpa_supplicant to reuse the
same MAC address when re-invoking a P2P permanent group.

update_config=1 is required.

Signed-off-by: Ircama <amacri@tiscali.it>
4 years agoBSD: If route socket overflows, sync drivers to system interfaces
Roy Marples [Fri, 1 Jan 2021 14:16:43 +0000 (14:16 +0000)] 
BSD: If route socket overflows, sync drivers to system interfaces

Messages such as RTM_IFNFO or RTM_IFANNOUNCE could have been lost.
As such, sync the state of our internal driver to the state of the
system interfaces as reports by getifaddrs(2).

This change requires the routing socket be placed in non-blocking
mode. While here, set the routing and inet sockets to close on exec.

BSDs that support SO_RERROR include NetBSD and DragonFly.
There is a review underway to add this to FreeBSD.

Signed-off-by: Roy Marples <roy@marples.name>
4 years agotests: Add mixed SAE/WPA-PSK AP test
Andrei Otcheretianski [Thu, 21 Jan 2021 15:40:37 +0000 (17:40 +0200)] 
tests: Add mixed SAE/WPA-PSK AP test

Verify WPA-PSK/TKIP connection on SAE configured AP.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
4 years agoRSN+WPA: Fix RSNE removing in EAPOL-Key msg 3/4 when RSNXE is included
Andrei Otcheretianski [Thu, 21 Jan 2021 15:40:33 +0000 (17:40 +0200)] 
RSN+WPA: Fix RSNE removing in EAPOL-Key msg 3/4 when RSNXE is included

When the AP advertised RSNE, RSNXE, and WPA IE, hostapd incorrectly
removed the RSNE in the EAPOL-Key msg 3/4 if the STA associates with
WPA, leaving only RSNXE instead of WPA IE. WPA STA fails to connect to
such AP as the WPA IE is missing.

Since RSNXE is not really used in non-RSN connection, just remove it
here with RSNE.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
4 years agoRSN: Validate RSNXE match in EAPOL-Key msg 3/4 only when RSN is used
Jouni Malinen [Sat, 6 Feb 2021 09:19:55 +0000 (11:19 +0200)] 
RSN: Validate RSNXE match in EAPOL-Key msg 3/4 only when RSN is used

This is needed to avoid the corner case of local RSNXE aware station
being configured to behave as WPA(v1)-only STA when the AP might not
include RSNXE in EAPOL-Key msg 3/4.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: Fix sporadic failures in p2p_channel_avoid3
Andrei Otcheretianski [Thu, 21 Jan 2021 15:40:36 +0000 (17:40 +0200)] 
tests: Fix sporadic failures in p2p_channel_avoid3

The P2P group may be originally formed on UNII-3, so disabling UNII-1
and UNII-2 will not result in a channel switch failing the test.
Fix this by setting 44 as a preferred channel.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
4 years agotests: Fix ap_ft_r0_key_expiration test
Andrei Otcheretianski [Thu, 21 Jan 2021 15:40:35 +0000 (17:40 +0200)] 
tests: Fix ap_ft_r0_key_expiration test

The test configures ft_r0_key_lifetime parameter, however ft_params
already contain the r0_key_lifetime. Since both options are accepted by
hostapd and set the same field, one of them gets overwritten.
As the dictionary enumeration order is not guaranteed in python, the
test may sporadically fail.
Fix that by explicitely removing the unneeded parameter.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
4 years agoDPP: Silence compiler warning about signed/unsigned comparison
Andrei Otcheretianski [Thu, 21 Jan 2021 15:40:32 +0000 (17:40 +0200)] 
DPP: Silence compiler warning about signed/unsigned comparison

Old gcc versions complain about signed/unsigned comparison in
dpp_rx_gas_resp(). Hide it.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
4 years agoMake wpa_bss_ext_capab() handle NULL bss argument
Jouni Malinen [Sat, 6 Feb 2021 09:00:09 +0000 (11:00 +0200)] 
Make wpa_bss_ext_capab() handle NULL bss argument

This simplifies the callers that use wpa_s->current_bss (which could be
NULL).

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agorobust_av: Use wpa_bss_ext_capab() helper
Johannes Berg [Tue, 19 Jan 2021 19:07:36 +0000 (20:07 +0100)] 
robust_av: Use wpa_bss_ext_capab() helper

Use the helper instead of open-coding the check. Since the
helper doesn't handle a NULL BSS, keep that extra check.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
4 years agotests: he_tkip to match implementation change
Jouni Malinen [Sat, 6 Feb 2021 10:08:43 +0000 (12:08 +0200)] 
tests: he_tkip to match implementation change

HE is now getting disabled just like HT and VHT when only TKIP is
enabled.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoDisable HE capabilities when using unacceptable security config
Shay Bar [Wed, 27 Jan 2021 16:01:17 +0000 (18:01 +0200)] 
Disable HE capabilities when using unacceptable security config

Add HE configuration check similar to HT/VHT.

Signed-off-by: Shay Bar <shay.bar@celeno.com>
4 years agonl80211: Skip frame filter config for P2P-Device
Johannes Berg [Thu, 4 Feb 2021 20:26:40 +0000 (21:26 +0100)] 
nl80211: Skip frame filter config for P2P-Device

There's no point in attempting to configure frame filters on
a P2P-Devices that doesn't even have a netdev (nor passes any
data traffic), that just results in error messages. Skip it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
4 years agodbus: Fix IEs getter to use wpa_bss_ie_ptr()
Brad Kemp [Fri, 5 Feb 2021 20:46:49 +0000 (15:46 -0500)] 
dbus: Fix IEs getter to use wpa_bss_ie_ptr()

The wpa_bss structure's last element is an empty array. The forgotten
code here assumed that the array of IEs was contiguous to the wpa_bss
structure. This is not always the case anymore. Update this missed case
to use the new wpa_bss_ie_ptr() wrapper to send the correct array of IEs
over DBus.

Fixes: be7ee264f654 ("BSS: Use wrapper function for getting a pointer to the IE buffer")
Signed-off-by: Brad Kemp <brad at beechwoods.com>
4 years agoAdd HE in ieee80211_freq_to_channel_ext() documentation
Muna Sinada [Thu, 11 Jun 2020 11:18:43 +0000 (04:18 -0700)] 
Add HE in ieee80211_freq_to_channel_ext() documentation

This function covers HE cases, so include that in the comment.

Signed-off-by: Muna Sinada <msinada@codeaurora.org>
4 years agohostapd: Generalize channel switch methods to incorperated HE mode
Muna Sinada [Thu, 11 Jun 2020 11:18:43 +0000 (04:18 -0700)] 
hostapd: Generalize channel switch methods to incorperated HE mode

Remove the VHT specific naming on methods that are utilized in both VHT
and HE modes.

Signed-off-by: Muna Sinada <msinada@codeaurora.org>
4 years agohostapd: Enable HE for channel switch commmand
Muna Sinada [Thu, 11 Jun 2020 11:18:42 +0000 (04:18 -0700)] 
hostapd: Enable HE for channel switch commmand

Add HE as an accepted option ("he") in the CHAN_SWITCH command similarly
to the way VHT is addressed.

Signed-off-by: Muna Sinada <msinada@codeaurora.org>
4 years agoP2P: Add a maximum length limit for peer vendor IEs
Jouni Malinen [Thu, 4 Feb 2021 23:39:29 +0000 (01:39 +0200)] 
P2P: Add a maximum length limit for peer vendor IEs

This is mainly to help with fuzz testing that could generate overly long
test data that would not be possible in real use cases due to MMPDU size
limits. The implementation for storing vendor IEs with such
unrealisticly long IE buffers can result in huge number of memory
reallozations and analyzing those can be very heavy.

While the maximum length of the fuzzing test input could be limited, it
seems nicer to limit this IE storage limit instead to avoid timeouts
from fuzz test runs.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoP2P: Fix copying of secondary device types for P2P group client
Jouni Malinen [Mon, 9 Nov 2020 09:43:12 +0000 (11:43 +0200)] 
P2P: Fix copying of secondary device types for P2P group client

Parsing and copying of WPS secondary device types list was verifying
that the contents is not too long for the internal maximum in the case
of WPS messages, but similar validation was missing from the case of P2P
group information which encodes this information in a different
attribute. This could result in writing beyond the memory area assigned
for these entries and corrupting memory within an instance of struct
p2p_device. This could result in invalid operations and unexpected
behavior when trying to free pointers from that corrupted memory.

Credit to OSS-Fuzz: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=27269
Fixes: e57ae6e19edf ("P2P: Keep track of secondary device types for peers")
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoRemove pointless defines for ext capab bits
Jouni Malinen [Wed, 3 Feb 2021 22:23:14 +0000 (00:23 +0200)] 
Remove pointless defines for ext capab bits

These were copy-pasted templates that were forgotten to be removed when
defining the bits.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoReset external_scan_running on interface deletion
David Su [Tue, 26 Jan 2021 22:26:13 +0000 (14:26 -0800)] 
Reset external_scan_running on interface deletion

Currently, the external_scan_running flag is not reset when an interface
is removed. Thus, if a connection attempt is made on another iface, it
will fail due to wpa_supplicant incorrectly assuming the radio is still
busy due to the ongoing scan.

To fix this, convert external_scan_running to a pointer to the interface
that started the scan. If this interface is removed, also reset the
pointer to NULL so that other operations may continue on this radio.

Test:
  1. Start scan on wlan0
  2. Remove wlan0
  3. Can connect to a network on wlan1

Signed-off-by: David Su <dysu@google.com>
4 years agoAP: Add 6 GHz security constraints
Aloka Dixit [Tue, 12 Jan 2021 19:29:18 +0000 (11:29 -0800)] 
AP: Add 6 GHz security constraints

Add security constraints for the 6 GHz band as given in IEEE
P802.11ax/D8.0, 12.12.2.

Signed-off-by: Aloka Dixit <alokad@codeaurora.org>
4 years agomesh: Fix for leaving mesh
Abinaya Kalaiselvan [Mon, 1 Feb 2021 04:59:36 +0000 (10:29 +0530)] 
mesh: Fix for leaving mesh

Avoid multiple execution of wpa_drv_leave_mesh().

Fixes: 0896c442dcd5 ("mesh: Fix for mesh init/deinit")
Signed-off-by: Abinaya Kalaiselvan <akalaise@codeaurora.org>
4 years agoWPA: Support deriving KDK based on capabilities (Authenticator)
Ilan Peer [Wed, 16 Dec 2020 11:01:40 +0000 (13:01 +0200)] 
WPA: Support deriving KDK based on capabilities (Authenticator)

Derive the KDK as part of PMK to PTK derivation if forced by
configuration or in case both the local AP and the peer station declare
support for secure LTF.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
4 years agoWPA: Support deriving KDK based on capabilities
Ilan Peer [Wed, 16 Dec 2020 11:01:39 +0000 (13:01 +0200)] 
WPA: Support deriving KDK based on capabilities

Derive the KDK as part of PMK to PTK derivation if forced by
configuration or in case both the local station and the AP declare
support for secure LTF.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
4 years agoPASN: Include RSNXE in the PASN negotiation
Ilan Peer [Wed, 16 Dec 2020 11:01:38 +0000 (13:01 +0200)] 
PASN: Include RSNXE in the PASN negotiation

IEEE P802.11az/D2.6 added definitions to include RSNXE in the PASN
negotiation. Implement the new functionality in both wpa_supplicant and
hostapd.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
4 years agoRSN: Add RSNXE new definitions
Ilan Peer [Wed, 16 Dec 2020 11:01:37 +0000 (13:01 +0200)] 
RSN: Add RSNXE new definitions

IEEE P802.11az/D2.6 defines the following additional capabilities to
RSNXE:

- Secure LTF support
- Secure RTT support
- Protection of range negotiation and measurement management frames.

Add support for advertising the new capabilities.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
4 years agotests: Add PASN tests with FT key derivation
Ilan Peer [Wed, 16 Dec 2020 11:01:05 +0000 (13:01 +0200)] 
tests: Add PASN tests with FT key derivation

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
4 years agoAP: Support PASN with FT key derivation
Ilan Peer [Wed, 16 Dec 2020 11:01:04 +0000 (13:01 +0200)] 
AP: Support PASN with FT key derivation

Note that the implementation is not complete as it is missing support
for the FT wrapped data which is optional for the station, but must be
supported by the AP in case the station included it.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
4 years agoPASN: Support PASN with FT key derivation
Ilan Peer [Wed, 16 Dec 2020 11:01:03 +0000 (13:01 +0200)] 
PASN: Support PASN with FT key derivation

Add support for PASN authentication with FT key derivation:

- As IEEE P802.11az/D2.6 states that wrapped data is optional and
  is only needed for further validation of the FT security parameters,
  do not include them in the first PASN frame.

- PASN with FT key derivation requires knowledge of the PMK-R1 and
  PMK-R1-Name for the target AP. As the WPA state machine stores PMK-R1,
  etc. only for the currently associated AP, store the mapping of
  BSSID to R1KH-ID for each previous association, so the R1KH-ID
  could be used to derive PMK-R1 and PMK-R1-Name. Do so instead
  of storing the PMK-R1 to avoid maintaining keys that might not
  be used.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
4 years agotests: Add PASN with FILS tests
Ilan Peer [Wed, 16 Dec 2020 11:00:57 +0000 (13:00 +0200)] 
tests: Add PASN with FILS tests

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
4 years agoAP: Support PASN with FILS key derivation
Ilan Peer [Wed, 16 Dec 2020 11:00:56 +0000 (13:00 +0200)] 
AP: Support PASN with FILS key derivation

As the PASN FILS authentication is only defined for FILS SK without PFS,
and to support PASN authentication with FILS, implement the PASN with
FILS processing as part of the PASN handling and not as part of the WPA
Authenticator state machine.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
4 years agoPASN: Support PASN with FILS key derivation
Ilan Peer [Wed, 16 Dec 2020 11:00:55 +0000 (13:00 +0200)] 
PASN: Support PASN with FILS key derivation

As the PASN FILS authentication is only defined for FILS SK without PFS,
and to support PASN authentication with FILS, implement the PASN with
FILS processing as part of the PASN handling and not as part of the WPA
state machine.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
4 years agotests: Add PASN tests with SAE
Ilan Peer [Wed, 16 Dec 2020 11:00:54 +0000 (13:00 +0200)] 
tests: Add PASN tests with SAE

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
4 years agoAP: Support PASN with SAE key derivation
Ilan Peer [Wed, 16 Dec 2020 11:00:53 +0000 (13:00 +0200)] 
AP: Support PASN with SAE key derivation

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
4 years agoPASN: Support PASN with SAE key derivation
Ilan Peer [Wed, 16 Dec 2020 11:00:52 +0000 (13:00 +0200)] 
PASN: Support PASN with SAE key derivation

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
4 years agotests: Add PASN test coverage
Ilan Peer [Wed, 16 Dec 2020 11:00:33 +0000 (13:00 +0200)] 
tests: Add PASN test coverage

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
4 years agoAP: Add support for PASN processing to the SME
Ilan Peer [Wed, 16 Dec 2020 11:00:32 +0000 (13:00 +0200)] 
AP: Add support for PASN processing to the SME

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
4 years agoAdd PTKSA cache to hostapd
Ilan Peer [Wed, 16 Dec 2020 11:00:31 +0000 (13:00 +0200)] 
Add PTKSA cache to hostapd

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
4 years agoAP: Add support for configuring PASN
Ilan Peer [Wed, 16 Dec 2020 11:00:30 +0000 (13:00 +0200)] 
AP: Add support for configuring PASN

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
4 years agoctrl_iface: Add support for PASN authentication
Ilan Peer [Wed, 16 Dec 2020 11:00:29 +0000 (13:00 +0200)] 
ctrl_iface: Add support for PASN authentication

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
4 years agoPASN: Add support for PASN processing to wpa_supplicant
Ilan Peer [Wed, 16 Dec 2020 11:00:28 +0000 (13:00 +0200)] 
PASN: Add support for PASN processing to wpa_supplicant

Add PASN implementation to wpa_supplicant

1. Add functions to initialize and clear PASN data.
2. Add functions to construct PASN Authentication frames.
3. Add function to process PASN Authentication frame.
4. Add function to handle PASN frame TX status.
5. Implement the station side flow processing for PASN.

The implementation is missing support for wrapped data and PMKSA
establishment for base AKMs, and only supports PASN authentication or
base AKM with PMKSA caching.

The missing parts will be added in later patches.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
4 years agoWPA: Add PTKSA cache to wpa_supplicant for PASN
Ilan Peer [Wed, 16 Dec 2020 11:00:27 +0000 (13:00 +0200)] 
WPA: Add PTKSA cache to wpa_supplicant for PASN

PASN requires to store the PTK derived during PASN authentication
so it can later be used for secure LTF etc. This is also true
for a PTK derived during regular connection.

Add an instance of a PTKSA cache for each wpa_supplicant
interface when PASN is enabled in build configuration.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
4 years agoWPA: Add PTKSA cache implementation
Ilan Peer [Wed, 16 Dec 2020 11:00:26 +0000 (13:00 +0200)] 
WPA: Add PTKSA cache implementation

In order to be able to perform secure LTF measurements, both the
initiator and the responder need to first derive TK and KDK and store
them, so they would later be available for the secure LTF negotiation.

Add a basic implementation of a PTKSA cache that stores derived TK/KDK
which can later be used for secure LTF negotiation, and add it to the
build configuration.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
4 years agoWPA: Add a function to get PMKSA cache entry
Ilan Peer [Wed, 16 Dec 2020 11:00:25 +0000 (13:00 +0200)] 
WPA: Add a function to get PMKSA cache entry

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
4 years agocommon: Add PASN parsing to ieee802_11_parse_extension()
Ilan Peer [Wed, 16 Dec 2020 11:00:24 +0000 (13:00 +0200)] 
common: Add PASN parsing to ieee802_11_parse_extension()

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
4 years agotests: Add module tests for PASN PTK derivation
Ilan Peer [Wed, 16 Dec 2020 11:00:23 +0000 (13:00 +0200)] 
tests: Add module tests for PASN PTK derivation

Based on tests vectors taken from IEEE P802.11az/D2.6.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
4 years agoPASN: Add common Authentication frame build/validation functions
Ilan Peer [Wed, 16 Dec 2020 11:00:22 +0000 (13:00 +0200)] 
PASN: Add common Authentication frame build/validation functions

Add helper functions to construct a PASN Authentication frame and
validate its content, which are common to both wpa_supplicant and
hostapd.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
4 years agoPASN: Add functions to compute PTK, MIC and hash
Ilan Peer [Wed, 16 Dec 2020 11:00:21 +0000 (13:00 +0200)] 
PASN: Add functions to compute PTK, MIC and hash

1. Add a function to derive the PTK from a PMK and additional data.
2. Add a function to calculate the MIC for a PASN frames.
3. Add a function to compute the hash of an authentication frame body.

The above are built only in case that CONFIG_PASN is enabled at build
time.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
4 years agoFILS: Extend the fils_pmk_to_ptk() function to also derive KDK
Ilan Peer [Wed, 16 Dec 2020 11:00:19 +0000 (13:00 +0200)] 
FILS: Extend the fils_pmk_to_ptk() function to also derive KDK

Extend the fils_pmk_to_ptk() to also derive Key Derivation
Key (KDK) which can later be used for secure LTF measurements.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
4 years agoFT: Extend the wpa_pmk_r1_to_ptk() function to also derive KDK
Ilan Peer [Wed, 16 Dec 2020 11:00:18 +0000 (13:00 +0200)] 
FT: Extend the wpa_pmk_r1_to_ptk() function to also derive KDK

Extend the wpa_pmk_r1_to_ptk() to also derive Key Derivation
Key (KDK), which can later be used for secure LTF measurements.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
4 years agoWPA: Extend the wpa_pmk_to_ptk() function to also derive KDK
Ilan Peer [Wed, 16 Dec 2020 11:00:17 +0000 (13:00 +0200)] 
WPA: Extend the wpa_pmk_to_ptk() function to also derive KDK

Extend the wpa_pmk_to_ptk() to also derive Key Derivation
Key (KDK), which can later be used for secure LTF measurements.

Update the wpa_supplicant and hostapd configuration and the
corresponding WPA and WPA Auth state machine, to allow enabling of KDK
derivation. For now, use a testing parameter to control whether KDK is
derived.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
4 years agocommon: Allow WPA_CIPHER_GTK_NOT_USED as a valid group management cipher
Ilan Peer [Wed, 16 Dec 2020 11:00:16 +0000 (13:00 +0200)] 
common: Allow WPA_CIPHER_GTK_NOT_USED as a valid group management cipher

PASN authentication requires that group management cipher suite
would be set to 00-0F-AC:7 in the RSNE, so consider it as a valid
group management cipher and adjust the code accordingly.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
4 years agonl80211: Always register for RX authentication frames with PASN
Ilan Peer [Wed, 16 Dec 2020 11:00:15 +0000 (13:00 +0200)] 
nl80211: Always register for RX authentication frames with PASN

Register a filter that only requests PASN Authentication frames
to be passed to user space.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
4 years agonl80211: Allow off-channel of PASN authentication frames in send_mlme()
Ilan Peer [Wed, 16 Dec 2020 11:00:14 +0000 (13:00 +0200)] 
nl80211: Allow off-channel of PASN authentication frames in send_mlme()

As part of the support needed for PASN.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
4 years agowlantest: Include PASN into build
Ilan Peer [Wed, 16 Dec 2020 11:00:20 +0000 (13:00 +0200)] 
wlantest: Include PASN into build

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
4 years agoPASN: Add some specification definitions
Ilan Peer [Wed, 16 Dec 2020 11:00:20 +0000 (13:00 +0200)] 
PASN: Add some specification definitions

Based on IEEE P802.11az/D2.6.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
4 years agoAdd support for new 5 GHz channels 173 and 177
Sreeramya Soratkal [Mon, 23 Nov 2020 08:00:02 +0000 (13:30 +0530)] 
Add support for new 5 GHz channels 173 and 177

Add support for new channels 173 and 177 in the operating classes 125 to
130 as defined in draft IEEE P802.11ax/D8.0.

Signed-off-by: Sreeramya Soratkal <ssramya@codeaurora.org>
4 years agoP2P: Fix channel selection for operating class 129
Sreeramya Soratkal [Mon, 23 Nov 2020 07:51:53 +0000 (13:21 +0530)] 
P2P: Fix channel selection for operating class 129

The operating class 129 includes channels with a maximum bandwidth of
160 MHz with center frequency index 50 and 114. The previous definition
of operating class 129 considered the center frequency index as actual
channels resulting in incorrect channel setup for the operating class.

Fix the definition of operating class 129 to consider channels with the
center frequency index of 50 and 114.

Also update the comment that describes the channel selection for
operating 128, 129, and 130 which mentions wpas_p2p_allow_channel()
verifies the channels while wpas_p2p_verify_channel() takes care of it.

Signed-off-by: Sreeramya Soratkal <ssramya@codeaurora.org>
4 years agotests: DPP Responder behavior on missing Auth Confirm
Jouni Malinen [Fri, 22 Jan 2021 15:08:48 +0000 (17:08 +0200)] 
tests: DPP Responder behavior on missing Auth Confirm

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>