]> git.ipfire.org Git - thirdparty/hostap.git/log
thirdparty/hostap.git
4 years agoOpenSSL: Add support for TPM2-wrapped keys
Daniel Kobras [Tue, 2 Jul 2019 14:19:38 +0000 (16:19 +0200)] 
OpenSSL: Add support for TPM2-wrapped keys

If the header of a PEM-formatted certificate or key in private_key file
indicates that it is wrapped with a TPM2 key, try to autoload the
appropriate OpenSSL engine that can transparently unwrap the key. This
enables systems to use TPM2-wrapped keys as drop-in replacements to
ordinary SSL keys.

This functionality needs
https://git.kernel.org/pub/scm/linux/kernel/git/jejb/openssl_tpm2_engine.git
to be installed as an OpenSSL engine.

Signed-off-by: Daniel Kobras <kobras@puzzle-itc.de>
4 years agotests: Make ap_hs20_gas_while_associated_with_pmf more robust
Jouni Malinen [Sat, 28 Dec 2019 21:38:36 +0000 (23:38 +0200)] 
tests: Make ap_hs20_gas_while_associated_with_pmf more robust

Explicitly clear cfg80211 scan cache to avoid issues with old BSS
entries from previous test cases.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: ignore_broadcast_ssid and SSID List or Short SSID List mismatch
Jouni Malinen [Sat, 28 Dec 2019 21:21:14 +0000 (23:21 +0200)] 
tests: ignore_broadcast_ssid and SSID List or Short SSID List mismatch

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoFix ignore_broadcast_ssid behavior with SSID List and Short SSID List
Jouni Malinen [Sat, 28 Dec 2019 21:19:44 +0000 (23:19 +0200)] 
Fix ignore_broadcast_ssid behavior with SSID List and Short SSID List

ignore_broadcast_ssid=1 (or 2) were practically ignored if the Probe
Request frame included the SSID List or Short SSID List elements. Fix
this by requiring exact SSID match whenever ignore_broadcast_ssid is in
use regardless how SSID parameters are set in the Probe Request frame.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: Scan using SSID List and Short SSID List elements
Jouni Malinen [Sat, 28 Dec 2019 21:14:47 +0000 (23:14 +0200)] 
tests: Scan using SSID List and Short SSID List elements

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoAP: Support Short SSID List element in Probe Request frames
Andrei Otcheretianski [Wed, 19 Jun 2019 12:49:16 +0000 (15:49 +0300)] 
AP: Support Short SSID List element in Probe Request frames

According to IEEE P802.11ax/D6.0, 11.1.4.3.4 (Criteria for sending a
response), AP should answer Probe Request frames if either SSID or Short
SSID matches. Implement this part of the Short SSID use for the BSS (the
collocated 6 GHz BSS case is not covered in this commit).

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
4 years agoAP: Determine Short SSID value for the BSS
Andrei Otcheretianski [Wed, 19 Jun 2019 12:49:15 +0000 (15:49 +0300)] 
AP: Determine Short SSID value for the BSS

This can be used in the future to implement support for RNR and scanning
extensions using a shorter field for the SSID.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
4 years agomesh: Fix race condition in mesh mpm new peer handling
Felix Fietkau [Sun, 17 Feb 2019 15:02:56 +0000 (16:02 +0100)] 
mesh: Fix race condition in mesh mpm new peer handling

When wpa_supplicant receives another new peer event before the first one
has been processed, it tries to add a station to the driver a second
time (which fails) and then tears down the station entry until another
event comes in.

Fix this by only adding a station to the driver if it didn't exist
already.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
4 years agoEnsure authenticator session timer is applied with wired driver
Zefir Kurtisi [Mon, 29 Apr 2019 09:00:02 +0000 (11:00 +0200)] 
Ensure authenticator session timer is applied with wired driver

We use the wired driver for wired port authentication with a slight
extension to add the port into a bridge upon successful authentication
and to remove it from the bridge when the session terminates.

Our expectation was that the Session-Timeout configuration at the RADIUS
server is respected, i.e. the session is terminated and would need
re-authentication - like it is working for WLAN sessions over the
nl80211 driver. Alas, it turned out the session is not terminated with
the wired driver.

It turned out that when ap_handle_session_timer() is executed, the
sta->flags of the wired port has only the WLAN_STA_AUTHORIZED bit set.
The WLAN_STA_AUTH bit, which is used to check whether the STA needs to
be de-authenticated, is missing.

Extend the check for any of the WLAN_STA_(AUTH | ASSOC | AUTHORIZED)
bits to solve this issue with the wired driver. That should not have any
side-effect for the WLAN cases since WLAN_STA_AUTH is expected to always
be set for those when there is an ongoing session and separate checks
for ASSOC and AUTHORIZED don't change this.

Signed-off-by: Zefir Kurtisi <zefir.kurtisi@neratec.com>
4 years agotests: Fix he_supported() check with python3
Jouni Malinen [Sat, 28 Dec 2019 17:52:17 +0000 (19:52 +0200)] 
tests: Fix he_supported() check with python3

This was making error paths on HE test cases fail with:
TypeError: a bytes-like object is required, not 'str'

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: Make ap_hs20_roaming_consortium more robust
Jouni Malinen [Sat, 28 Dec 2019 17:05:50 +0000 (19:05 +0200)] 
tests: Make ap_hs20_roaming_consortium more robust

Explicitly clear cfg80211 scan cache to avoid issues with old BSS
entries from previous test cases.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: Make ap_cipher_mixed_wpa_wpa2 more robust
Jouni Malinen [Sat, 28 Dec 2019 17:03:22 +0000 (19:03 +0200)] 
tests: Make ap_cipher_mixed_wpa_wpa2 more robust

Explicitly clear cfg80211 scan cache to avoid issues with old BSS
entries from previous test cases.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agodefconfig: Enable MACsec
Lubomir Rintel [Tue, 19 Feb 2019 13:44:13 +0000 (14:44 +0100)] 
defconfig: Enable MACsec

Debian and Fedora enable it, NetworkManager uses it.

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
4 years agoAllow debug log to be written to both syslog and file
Jouni Malinen [Sat, 28 Dec 2019 16:17:44 +0000 (18:17 +0200)] 
Allow debug log to be written to both syslog and file

If hostapd or wpa_supplicant is started with both -s and -f command line
arguments, debug log ended up being written only into syslog and the log
file was left empty. Change this so that the log entries will be written
to both places. Either -s or -f (or both) results in debug log to stdout
being disabled which was already the case.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: Ignore fe80::ff:fe00:300 NS from AP for now in proxyarp tests
Jouni Malinen [Sat, 28 Dec 2019 15:17:05 +0000 (17:17 +0200)] 
tests: Ignore fe80::ff:fe00:300 NS from AP for now in proxyarp tests

This NS seems to go out from the AP interface every now and then and it
makes proxyarp_open_ebtables_ipv6 fails inconveniently often. That frame
should not really be there, but it's not clear what exactly is needed to
stop it going through. It does not come from the test operations
themselves, so ignore it for now to keep test results cleaner.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: Make ap_hs20_nai_realms more robust
Jouni Malinen [Fri, 27 Dec 2019 22:34:25 +0000 (00:34 +0200)] 
tests: Make ap_hs20_nai_realms more robust

Explicitly clear cfg80211 scan cache to avoid issues from scan results
from previous test cases interfering with INTERWORKING_CONNECT
operation.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agowpa_gui: Silence a compiler warning
Jouni Malinen [Fri, 27 Dec 2019 22:17:55 +0000 (00:17 +0200)] 
wpa_gui: Silence a compiler warning

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agowpa_gui: Show entire list of networks
Victor Ananyev [Wed, 18 Sep 2019 22:12:23 +0000 (00:12 +0200)] 
wpa_gui: Show entire list of networks

Use LAST_ID of LIST_NETWORKS to load all the network entries iteratively
if there is large enough number of networks to not fit in a single
response.

Signed-off-by: Victor Ananyev <vindex10@gmail.com>
4 years agowpa_cli: Let LAST_ID argument to be used for LIST_NETWORKS
Victor Ananyev [Tue, 17 Sep 2019 19:38:52 +0000 (21:38 +0200)] 
wpa_cli: Let LAST_ID argument to be used for LIST_NETWORKS

This allows starting point of the network list to be specified so that
the potentially long response can be fragmented into multiple fetch
operations.

Signed-off-by: Victor Ananyev <vindex10@gmail.com>
4 years agotests: Replace tcpdump with wlantest
Jouni Malinen [Fri, 27 Dec 2019 21:17:43 +0000 (23:17 +0200)] 
tests: Replace tcpdump with wlantest

This removes dependency on tcpdump by using an already included test
tool for capturing frames with Ethernet headers. There were some issues
in getting tcpdump working on Ubuntu 19.10, so this seems to be a clean
way of addressing that.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agowlantest: Ethernet interface capture
Jouni Malinen [Fri, 27 Dec 2019 21:15:14 +0000 (23:15 +0200)] 
wlantest: Ethernet interface capture

Allow option (command line argument -e) to capture Ethernet headers
instead of IEEE 802.11 so that wlantest can be used as a replacement for
tcpdump/dumpcap for capturing.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: Make rrm_reassociation more robust
Jouni Malinen [Fri, 27 Dec 2019 20:41:36 +0000 (22:41 +0200)] 
tests: Make rrm_reassociation more robust

Flush cfg80211 scan cache explicitly when running this test case to
avoid issues with the ROAM command not working due to a scan result from
an earlier test case. This was causing failures in the following test
case sequence:
rrm_beacon_req_active_ap_channels rrm_reassociation

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoSTA OBSS: Update secondary channel info after CSA
Sergey Matyukevich [Fri, 27 Dec 2019 12:22:24 +0000 (15:22 +0300)] 
STA OBSS: Update secondary channel info after CSA

Field wpa_s->sme.ht_sec_chan keeps secondary channel for the 40 MHz
band. This field is used to prepare a list of channels for the STA OBSS
scan. Initially, the secondary channel is set to HT_SEC_CHAN_UNKNOWN.
Later on, in function wpa_obss_scan_freq_list() it is obtained from the
current BSS HT operation IE. However, the secondary channel information
is not updated after channel switch, which may lead to an incorrect list
of channels prepared for the STA OBSS scan.

Update ht_sec_chan according to the channel switch event data to fix
this.

Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com>
4 years agotests: Allow more VMs to be started in parallel
Jouni Malinen [Fri, 27 Dec 2019 18:31:33 +0000 (20:31 +0200)] 
tests: Allow more VMs to be started in parallel

Check the number of CPUs to determine how many VMs can be started in
parallel.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: Move ocsp-resp-*-signed*.der generation into test case
Jouni Malinen [Fri, 27 Dec 2019 18:01:38 +0000 (20:01 +0200)] 
tests: Move ocsp-resp-*-signed*.der generation into test case

There is no need to generate these OCSP responses for every single test
session. Generate these more dynamically if a test case that uses these
files is executed.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: Move ocsp-server-cache-{revoked,unknown}.der generation into test case
Jouni Malinen [Fri, 27 Dec 2019 17:44:35 +0000 (19:44 +0200)] 
tests: Move ocsp-server-cache-{revoked,unknown}.der generation into test case

There is no need to generate these OCSP responses for every single test
session. Generate these more dynamically if a test case that uses these
files is executed.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: Use the run_openssl() helper for running openssl
Jouni Malinen [Fri, 27 Dec 2019 17:38:44 +0000 (19:38 +0200)] 
tests: Use the run_openssl() helper for running openssl

This avoids unnecessary duplication of the same functionality to run
openssl and check result.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: Move ocsp-server-cache-key-id.der generation into test case
Jouni Malinen [Fri, 27 Dec 2019 17:37:06 +0000 (19:37 +0200)] 
tests: Move ocsp-server-cache-key-id.der generation into test case

There is no need to generate this OCSP response for every single test
session. Generate this more dynamically if the test case that uses the
particular file is executed.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: Remove unnecessary copying of ocsp-multi-server-cache.der
Jouni Malinen [Fri, 27 Dec 2019 17:10:20 +0000 (19:10 +0200)] 
tests: Remove unnecessary copying of ocsp-multi-server-cache.der

This file is not being modified, so the original one from the auth_serv
directory can be used directly.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: Fix thread handling in P2P GO Negotiation test cases
Jouni Malinen [Fri, 27 Dec 2019 16:14:09 +0000 (18:14 +0200)] 
tests: Fix thread handling in P2P GO Negotiation test cases

Some of the error paths in go_neg_pbc() and go_neg_pin() did not wait
for the helper thread to complete processing. This could result in
unexpected behavior when the test case could have exited while the
thread was still performing tasks for the GO Negotiation. This could
result in getting stuck in one of the following test cases with
"go_neg_init_pbc thread caught an exception from p2p_go_neg_init: Group
formation timed out" showing up in the log.

This was hit, e.g., with the following test sequence:
no_go_freq p2p_channel_drv_pref_autogo

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: Use python selector in the parallel-vm.py main loop
Jouni Malinen [Fri, 27 Dec 2019 15:12:34 +0000 (17:12 +0200)] 
tests: Use python selector in the parallel-vm.py main loop

This gets rid of the loop that was polling for things to do every 0.25
seconds and instead, reacts to any data from VMs as soon as it becomes
available. This avoids unnecessary operations when no new data is
available and avoids unnecessary waits when new data becomes available
more quickly.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: Make pmksa_cache_expiration more robust
Jouni Malinen [Fri, 27 Dec 2019 13:58:32 +0000 (15:58 +0200)] 
tests: Make pmksa_cache_expiration more robust

Wait for hostapd to enter the PTKINITDONE state before checking
connectivity. This is needed to avoid a race condition with UML
time-travel.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: Print a summary of SKIP reasons
Jouni Malinen [Fri, 27 Dec 2019 08:46:13 +0000 (10:46 +0200)] 
tests: Print a summary of SKIP reasons

This makes it easier to determine reasons for test cases being skipped.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: Move VM starting delay control into parallel-vm.py
Jouni Malinen [Fri, 27 Dec 2019 08:09:43 +0000 (10:09 +0200)] 
tests: Move VM starting delay control into parallel-vm.py

This is more efficient since we can now start only the necessary number
of VMs instead of always forcing all VMs to start with one second delay.
This can also control the starting delay by keeping at most two VMs
starting at a time instead of using the hardcoded one second wait for
each consecutive VM.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: Move HwsimSkip processing into start_wnm_ap()
Jouni Malinen [Fri, 27 Dec 2019 07:38:25 +0000 (09:38 +0200)] 
tests: Move HwsimSkip processing into start_wnm_ap()

There is no need to handle this separately in each OCV test case.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: Speed up wpas_mesh_gate_forwarding tshark operations
Jouni Malinen [Thu, 26 Dec 2019 22:03:24 +0000 (00:03 +0200)] 
tests: Speed up wpas_mesh_gate_forwarding tshark operations

For some reason, running tshark in the test cases can take significant
time especially with UML time-travel. Optimize this by reducing the
number of times tshark needs to be executed in the loop.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: Optimize tshark operations for new versions
Jouni Malinen [Thu, 26 Dec 2019 22:02:05 +0000 (00:02 +0200)] 
tests: Optimize tshark operations for new versions

The wlan_mgt to wlan renaming is already included in most recent tshark
versions, so replace the backwards compatibility option to prefer the
new version so that current versions do not need to take the performance
hit.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: Check operating channel parameter in obss_scan*
Jouni Malinen [Thu, 26 Dec 2019 21:13:57 +0000 (23:13 +0200)] 
tests: Check operating channel parameter in obss_scan*

It looks like these test cases can fail with the new "Undefined
secondary channel: drop OBSS scan results" case. Add more checks to
determine if something is wrong with the connection.

In addition, force clearing of the cfg80211 scan cache on the main AP
interface so that a scan result from a previous test case cannot prevent
40 MHz channel bandwidth from being used. This could apparently happen
in the following test case sequence:
ap_ht40_scan_conflict obss_scan

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: Replace hapd_connected() with hapd.wait_sta()
Jouni Malinen [Thu, 26 Dec 2019 17:36:31 +0000 (19:36 +0200)] 
tests: Replace hapd_connected() with hapd.wait_sta()

These were doing practically the same thing, so get rid of the external
helper function and standardize on using hapd.wait_sta().

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: Make wpa2_ocv_ap_group_hs more robust
Jouni Malinen [Thu, 26 Dec 2019 17:33:22 +0000 (19:33 +0200)] 
tests: Make wpa2_ocv_ap_group_hs more robust

Wait for hostapd to indicate connection before disconnecting from the
station side. This avoids a race condition especially with UML
time-travel.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: SHOW_NEIGHBOR
Jouni Malinen [Thu, 26 Dec 2019 15:59:16 +0000 (17:59 +0200)] 
tests: SHOW_NEIGHBOR

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agohostapd: Support showing neighbor list through hostapd_cli
Ben Greear [Tue, 19 Mar 2019 17:09:50 +0000 (10:09 -0700)] 
hostapd: Support showing neighbor list through hostapd_cli

This lets one know the current neighbor list, and could be used
to populate the neighbor list of other hostapd processes.

For instance:

$ hostapd_cli -i vap0001 show_neighbor
04:f0:21:1e:ae:b0 ssid=04f0211eaeb0af190000802809 nr=04f0211eaeb0af1900008028090603022a00
$ hostapd_cli -i vap0000 set_neighbor 04:f0:21:1e:ae:b0 ssid=04f0211eaeb0af190000802809 nr=04f0211eaeb0af1900008028090603022a00
OK
$ hostapd_cli -i vap0000 show_neighbor
04:f0:21:1e:ae:b0 ssid=04f0211eaeb0af190000802809 nr=04f0211eaeb0af1900008028090603022a00
04:f0:21:c3:b2:b0 ssid=04f021c3b2b0af190000802809 nr=04f021c3b2b0af1900008028090603022a00

Signed-off-by: Ben Greear <greearb@candelatech.com>
4 years agotests: Make ap_wpa2_disable_eapol_retry_group more robust
Jouni Malinen [Thu, 26 Dec 2019 15:01:02 +0000 (17:01 +0200)] 
tests: Make ap_wpa2_disable_eapol_retry_group more robust

Wait for hostapd to report completion of the connection before going
through the disconnection and reconnection steps to avoid a race
condition especially with UML time-travel.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: Make TDLS tests more robust
Jouni Malinen [Thu, 26 Dec 2019 09:39:12 +0000 (11:39 +0200)] 
tests: Make TDLS tests more robust

Wait for hostapd to report connection completion before performing
connectivity test to avoid race conditions especially with UML
time-travel.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoSTA OBSS: Add check for overlapping BSSs
Sergey Matyukevich [Tue, 19 Mar 2019 12:35:56 +0000 (12:35 +0000)] 
STA OBSS: Add check for overlapping BSSs

In the previous implementation connected STA performs OBSS scan
according to requests from its 20/40 MHz AP. However STA checks only 40
MHz intolerance subfield from HT Capabilities element in scan results.
Meanwhile, as per IEEE Std 802.11-2016, 11.16.12, STA should check
overlapping BSSs as well.

Note that all the required code to check overlapping BSSs did already
exist for AP mode since AP does those checks properly before operating
as 20/40 MHz BSS in the 2.4 GHz band. Use that existing code by replace
existing 40 MHz intolerance check in sme_proc_obss_scan() with the new
shared helper function check_bss_coex_40mhz().

Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com>
4 years agoExtract BSS coex 40 MHz check into a separate function
Sergey Matyukevich [Tue, 19 Mar 2019 12:35:56 +0000 (12:35 +0000)] 
Extract BSS coex 40 MHz check into a separate function

Move this implementation from check_40mhz_2g4() into a new helper
function check_bss_coex_40mhz function() so that it can be used in the
station mode case as well as the previously used AP mode case.

Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com>
4 years agotests: rrm_neighbor_db and neighbor removal without specifying SSID
Jouni Malinen [Thu, 26 Dec 2019 09:04:23 +0000 (11:04 +0200)] 
tests: rrm_neighbor_db and neighbor removal without specifying SSID

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoAllow removing neighbor DB entries by BSSID alone
Ben Greear [Mon, 18 Mar 2019 20:46:34 +0000 (13:46 -0700)] 
Allow removing neighbor DB entries by BSSID alone

Let users delete a neighbor by BSSID alone if they prefer. The
underlying code already properly handled a NULL SSID, so just relax the
control interface command calling restrictions.

Signed-off-by: Ben Greear <greearb@candelatech.com>
4 years agoChange some RRM debug messages from wpa_printf() to wpa_dbg()
Ben Greear [Fri, 15 Mar 2019 15:46:33 +0000 (08:46 -0700)] 
Change some RRM debug messages from wpa_printf() to wpa_dbg()

This gives us the network device name in logging messages, which can be
helpful when having one wpa_supplicant process handle multiple devices.

Signed-off-by: Ben Greear <greearb@candelatech.com>
4 years agodrivers: Support of dynamic VLAN requires Linux ioctls
Sergey Matyukevich [Mon, 7 Oct 2019 21:08:32 +0000 (00:08 +0300)] 
drivers: Support of dynamic VLAN requires Linux ioctls

Support for dynamic VLANs depends on the Linux bridge ioctls.
Add this dependency explicitely to drivers make files.

This fixes build for minimal hostapd configs such as:
CONFIG_DRIVER_WIRED=y
CONFIG_FULL_DYNAMIC_VLAN=y

Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com>
4 years agotests: Secure mesh with BIP-GMAC-128, BIP-GMAC-256, and BIP-CMAC-256
Jouni Malinen [Wed, 25 Dec 2019 21:56:16 +0000 (23:56 +0200)] 
tests: Secure mesh with BIP-GMAC-128, BIP-GMAC-256, and BIP-CMAC-256

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agomesh: Allow group management cipher to be configured
Jouni Malinen [Wed, 25 Dec 2019 21:43:35 +0000 (23:43 +0200)] 
mesh: Allow group management cipher to be configured

This allows BIP-GMAC-128, BIP-GMAC-256, or BIP-CMAC-256 to be used
instead of the previously hardcoded AES-128-CMAC as the group management
cipher when using mesh with PMF. For now, this can be configured by
setting a single group_mgmt value in the network block and doing that
consistently through all the STAs in the mesh.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agomesh: Increase plink action frame AMPY buffer length for max GTK/IGTK
Jouni Malinen [Wed, 25 Dec 2019 21:35:40 +0000 (23:35 +0200)] 
mesh: Increase plink action frame AMPY buffer length for max GTK/IGTK

The previous calculation of the buffer length did not take into account
the possibility of 32-octet GTK and IGTK values and it was also missing
something to cover the 16 octet keys that are supported now. Other
buffer elements were likely sufficient to cover all these cases, but
anyway, it is better to allocate sufficient size specifically for AMPE
to avoid issues in the future.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoWPS: Add WPS-PIN-ACTIVE and WPS-CANCEL events
Bilal Hatipoglu [Thu, 5 Sep 2019 09:33:44 +0000 (12:33 +0300)] 
WPS: Add WPS-PIN-ACTIVE and WPS-CANCEL events

WPS_EVENT_CANCEL is added to indicate cancellation of a WPS operation
for any reason in hostapd/wpa_supplicant.

WPS_EVENT_PIN_ACTIVE is added to indicate when a PIN operation is
triggered in wpa_supplicant.

Signed-off-by: Veli Demirel <veli.demirel@airties.com>
Signed-off-by: Bilal Hatipoglu <bilal.hatipoglu@airties.com>
4 years agoAdd "reconnect" cmdline argument to hostapd_cli/wpa_cli
Bilal Hatipoglu [Thu, 5 Sep 2019 09:31:00 +0000 (12:31 +0300)] 
Add "reconnect" cmdline argument to hostapd_cli/wpa_cli

When the newly added "-r" parameter is used, both clis will try to
reconnect forever on connection lost until signalled (ctrl+c) or
terminated. This is useful only when used with -a to take action to
retrieve events or get status and the cli process stays even if
hostapd/wpa_supplicant daemons restart for some reason (e.g.,
configuration change).

Signed-off-by: Veli Demirel <veli.demirel@airties.com>
Signed-off-by: Bilal Hatipoglu <bilal.hatipoglu@airties.com>
4 years agoDBus: Update dont_quote[] with new network profile parameters
Jouni Malinen [Wed, 25 Dec 2019 10:39:17 +0000 (12:39 +0200)] 
DBus: Update dont_quote[] with new network profile parameters

This array had not been updated for years (since it was initially added)
and it was missing new network profile parameters that were not quoted
strings (but also not integers that could be set as integer types). Add
those missing non-quoted-strings to allow them to be set through the
DBus interface.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoDBus: Remove not existing network profile params from dont_quote[]
Jouni Malinen [Wed, 25 Dec 2019 10:26:33 +0000 (12:26 +0200)] 
DBus: Remove not existing network profile params from dont_quote[]

These parameters are global parameters, not network profile parameters,
and as such, do not below in dont_quote[] which is used to determine
whether a network profile parameter needs to be quoted.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agodbus: Move roam metrics to the correct interface
Matthew Wang [Fri, 11 Oct 2019 20:49:25 +0000 (13:49 -0700)] 
dbus: Move roam metrics to the correct interface

These properties were in the wpas_dbus_bss_properties array when they
should have been in the wpas_dbus_interface_properties array. Move them
to the right place. This is the logical location for these properties
and it matches both the other parts of the implementation (e.g., being
in enum wpas_dbus_prop, not in enum wpas_dbus_bss_prop) and what
was originally documented for the interface in dbus.doxygen.

Fixes: 2bbad1c7c9cb ("dbus: Export roam time, roam complete, and session length")
Fixes: 80d06d0ca9f3 ("dbus: Export BSS Transition Management status")
Signed-off-by: Matthew Wang <matthewmwang@chromium.org>
4 years agonl80211: Relax bridge setup
Michal Kazior [Mon, 28 Oct 2019 12:49:29 +0000 (13:49 +0100)] 
nl80211: Relax bridge setup

Normally nl80211 driver will attempt to strictly control what bridge
given interface is put in. It'll attempt to remove it from an existing
bridge if it doesn't match the configured one. If it's not in a bridge
it'll try to put it into one. If any of this fails then hostapd will
bail out and not set up the BSS at all.

Arguably that's reasonable since it allows to set the BSS up coherently
with regard to EAPOL handling as well as allows extra interactions with
things like FDB. However, not all hostapd drivers interact with bridge=
the same way. One example is atheros. Therefore it's not clear what the
desired behavior should be if consistency across drivers is considered.

There's a case where one might want to use a non-native Linux bridge,
e.g., openvswitch, in which case regular ioctls won't work to put an
interface into a bridge, or figure out what bridge an interface is in.
The underlying wireless driver can still be an ordinary nl80211 driver.

This change relaxes the bridge setup failure so that hostapd still
starts even if it fails to add an interface into a configured bridge
name. It still sets up all the necessary sockets (including the
configured bridge=) so EAPOL handling should work fine. This then leaves
it to the system integrator to manage wireless interface as bridge ports
and possibly fdb hints too.

Signed-off-by: Michal Kazior <michal@plume.com>
4 years agol2_packet: Fix bridge workaround for repeater configuration
Sergey Matyukevich [Wed, 16 Oct 2019 10:44:49 +0000 (10:44 +0000)] 
l2_packet: Fix bridge workaround for repeater configuration

In repeater configuration, both AP and STA wireless interfaces may be
included into the same bridge. In this case the following race condition
may occur: wpa_supplicant and hostapd are started, then hostapd clients
are connected before wpa_supplicant connects to remote AP. EAPOL packets
between hostapd and its clients are detected by wpa_supplicant on bridge
interface, prematurely disabling the workaround.

One possible option to fix this issue is to check EAPOL destination MAC
in wpa_supplicant and disable workaround only if EAPOL packet on bridge
interface is indeed intended for wpa_supplicant.

Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com>
4 years agotests: Make FT PMKSA caching test cases more robust
Jouni Malinen [Tue, 24 Dec 2019 17:04:36 +0000 (19:04 +0200)] 
tests: Make FT PMKSA caching test cases more robust

The RECONNECT command on the station was issued immediately after
wpa_supplicant had processed EAPOL-Key msg 3/4. This could happen before
hostapd has processed EAPOL-Key msg 4/4 and especially with UML
time-travel, this could result in the following FT protocol exchange
going through in a manner that makes the hostapd process EAPOL-Key msg
4/4 from the first association as a postponed EAPOL RX at the beginning
of the second association. Avoid this by waiting hostapd to report
completion of the connection before issuing RECONNECT.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: FT-SAE with PWE default and with H2E
Jouni Malinen [Tue, 24 Dec 2019 16:58:38 +0000 (18:58 +0200)] 
tests: FT-SAE with PWE default and with H2E

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoFT: More debug prints for RSNE modification for EAPOL-Key msg 2/4
Jouni Malinen [Tue, 24 Dec 2019 16:57:33 +0000 (18:57 +0200)] 
FT: More debug prints for RSNE modification for EAPOL-Key msg 2/4

This buffer was getting corrupted, so add more details to make it
clearer what causes the corruption should this type of regression show
up again.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoFix wpa_insert_pmkid() when buffer includes extra IEs
Jouni Malinen [Tue, 24 Dec 2019 16:54:38 +0000 (18:54 +0200)] 
Fix wpa_insert_pmkid() when buffer includes extra IEs

The case where the old RSNE included one or more PMKIDs and that RSNE
was followed by another IE was handled incorrectly since the
os_memmove() to move the end of the buffer when removing old PMKIDs was
stopping copying at the end of the RSNE, not the end of the IE buffer.
This could result in corrupting the IE that followed the RSNE. In
practice, this broke FT-SAE with H2E by corrupting the RSNXE that is in
the buffer after the RSNE.

Fix this by copying the full end of the buffer (i.e., including the
following RSNXE in the visible error case) when removing the old PMKIDs.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: Prepare rsn_ie_proto_ft_psk_sta for implementation change
Jouni Malinen [Tue, 24 Dec 2019 19:15:41 +0000 (21:15 +0200)] 
tests: Prepare rsn_ie_proto_ft_psk_sta for implementation change

This PMKID replacement case is not going to prevent connection after a
change in wpa_insert_pmkid() so remove it.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agowpa_passphrase: Output errors to stderr
Sam Tygier [Mon, 23 Dec 2019 15:20:20 +0000 (15:20 +0000)] 
wpa_passphrase: Output errors to stderr

The stdout of wpa_passphrase is often piped directly into the
wpa_supplicant config file. In case of errors these will be written to
the file and possibly not noticed by the user.

Use fprintf to print errors to stderr.

Signed-off-by: Sam Tygier <samtygier@yahoo.co.uk>
4 years agotests: New style fuzzing tool for EAP-MSCHAPv2 peer processing
Jouni Malinen [Tue, 24 Dec 2019 08:59:22 +0000 (10:59 +0200)] 
tests: New style fuzzing tool for EAP-MSCHAPv2 peer processing

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoEAP-SIM peer: Do not accept SIM/Challenge without SIM/Start
Jouni Malinen [Mon, 23 Dec 2019 21:59:16 +0000 (23:59 +0200)] 
EAP-SIM peer: Do not accept SIM/Challenge without SIM/Start

EAP-SIM full authentication starts with one or more SIM/Start rounds, so
reject an unexpected SIM/Challenge round without any preceeding
SIM/Start rounds to avoid unexpected behavior. In practice, an attempt
to start with SIM/Challenge would have resulted in different MK being
derived and the Challenge message getting rejected due to mismatching
AT_MAC unless the misbehaving server has access to valid Kc, so the end
result is identical, but it is cleaner to reject the unexpected message
explicitly to avoid any risk of trying to proceed without NONCE_MT.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: Make nfc_wps_handover_init more robust
Jouni Malinen [Mon, 23 Dec 2019 18:19:03 +0000 (20:19 +0200)] 
tests: Make nfc_wps_handover_init more robust

Data connectivity test could have been started in the middle of 4-way
handshake. This test case needs to wait for two STA connections before
starting the connectivity test since the first one is only for the
provisioning step.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoOpenSSL: Extend key_block size determination to support GCM/CCM ciphers
Jouni Malinen [Mon, 23 Dec 2019 16:58:43 +0000 (18:58 +0200)] 
OpenSSL: Extend key_block size determination to support GCM/CCM ciphers

These ciphers do not use a separate MAC algorithm, so digest nid will be
NID_undef. In addition, the fixed_iv_length needs to be set to 4 which
is the implicit part of the IV from PRF. This is needed to fix EAP-FAST
key derivation for cases where GCM/CCM ciphers are used for TLS.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: DPP exchange when driver uses a separate P2P Device interface
Jouni Malinen [Mon, 23 Dec 2019 09:20:17 +0000 (11:20 +0200)] 
tests: DPP exchange when driver uses a separate P2P Device interface

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoMore detailed documentation on ieee80211w configuration parameter
Jouni Malinen [Mon, 23 Dec 2019 08:48:09 +0000 (10:48 +0200)] 
More detailed documentation on ieee80211w configuration parameter

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agonl80211: Fix couple of typos in a comment
Jouni Malinen [Mon, 23 Dec 2019 08:24:49 +0000 (10:24 +0200)] 
nl80211: Fix couple of typos in a comment

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoStrip trailing zero data in EAPOL-Key msg 1/4 when no PMKID to send
Mikael Kanstrup [Tue, 19 Nov 2019 09:51:05 +0000 (10:51 +0100)] 
Strip trailing zero data in EAPOL-Key msg 1/4 when no PMKID to send

EAPOL-Key message 1/4 without PMKID KDE was sent with 22 bytes of stray
data following a zero length key data field. These 22 bytes happens to
be the exact size of an PMKID KDE. Strip these trailing bytes by
checking whether a PMKID is available and adjust pmkid_len to 0 if not.

This was seen for example in capture files created by hwsim test case
suite_b_192 but code modified to handle also the other cases without
PMKID (Suite B no-KCK, FILS without PMKID available, SAE without PMKID
available).

Signed-off-by: Mikael Kanstrup <mikael.kanstrup@sony.com>
4 years agonl80211: Initialize full channel info struct even if channel is not known
Jouni Malinen [Sun, 22 Dec 2019 22:01:02 +0000 (00:01 +0200)] 
nl80211: Initialize full channel info struct even if channel is not known

It was possible for the driver to advertise support for channels that
are not found from wpa_supplicant frequency-to-channel mapping (e.g.,
channel 182 at 5910 MHz) and that resulted in not initializing the
channel number information. Fix this by explicitly clearing the full
struct hostapd_channel_data buffer before parsing the information into
it from the driver.

This avoids some conditional jumps that could have dependent on
uninitialized values.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: Make DPP text cases more robust for DPP-TX event processing
Jouni Malinen [Sun, 22 Dec 2019 21:33:21 +0000 (23:33 +0200)] 
tests: Make DPP text cases more robust for DPP-TX event processing

The previous waits were matching both DPP-TX and DPP-TX-STATUS and if
the latter event was received, the test cases would either report
failure or would not really test what was supposed to be verified. Fix
this by waiting explicitly for "DPP-TX " to avoid matching
"DPP-TX-STATUS" prefix.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: FILS SK/ERP and roaming with different AKM
Jouni Malinen [Sun, 22 Dec 2019 15:41:48 +0000 (17:41 +0200)] 
tests: FILS SK/ERP and roaming with different AKM

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: Make fils_sk_auth_mismatch more robust
Jouni Malinen [Sun, 22 Dec 2019 15:20:33 +0000 (17:20 +0200)] 
tests: Make fils_sk_auth_mismatch more robust

Wait STA connection to be completed in hostapd before testing
connectivity. This avoids a possible race condition that could be hit
especially when testing with UML time-travel.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoWPS: Add prefixes to public event_* functions
Brian Norris [Mon, 2 Dec 2019 20:14:47 +0000 (12:14 -0800)] 
WPS: Add prefixes to public event_* functions

openssl engines may dynamically load external libraries. Our event_*()
functions happen to be named very generically, such that event_add()
collides with the libevent library (https://libevent.org/). This can
have disastrous effects (esp. when using CONFIG_WPA_TRACE, which enables
partial linking) when our SSL engines call into the WPS event_add()
instead of their intended libevent event_add().

Resolve this by providing a more unique prefix to these functions.

Rename performed via:

  sed -i -E \
    's:\<event_(add|delete_all|send_all_later|send_stop_all)\>:wps_upnp_event_\1:g' \
     $(git grep -l event_)

Tested via (among other things) hwsim '-f ap_wps' module.

Signed-off-by: Brian Norris <briannorris@chromium.org>
4 years agotests: OWE: allow hex integers from tshark
Brian Norris [Tue, 5 Nov 2019 23:58:10 +0000 (15:58 -0800)] 
tests: OWE: allow hex integers from tshark

Old versions of tshark would dump these values as hex. Allow parsing as
either decimal or hex.

Signed-off-by: Brian Norris <briannorris@chromium.org>
4 years agoFix memory leak in case allocation of token fails during JSON parsing
Davide Caratti [Sun, 24 Nov 2019 17:32:20 +0000 (18:32 +0100)] 
Fix memory leak in case allocation of token fails during JSON parsing

On failure of json_alloc_token(), json_parse() can return without
freeing 'str' previously allocated by json_parse_string(). Fix this
adding proper call to os_free().

Signed-off-by: Davide Caratti <davide.caratti@gmail.com>
4 years agowpa_supplicant: Do not try to detect PSK mismatch during PTK rekeying
Alexander Wetzel [Fri, 20 Dec 2019 19:21:26 +0000 (20:21 +0100)] 
wpa_supplicant: Do not try to detect PSK mismatch during PTK rekeying

When a PTK rekey fails it can't be caused by a PSK mismatch. Report a
possible PSK mismatch only during the initial 4-way handshake to avoid
incorrect reports.

Signed-off-by: Alexander Wetzel <alexander@wetzel-home.de>
4 years agoDPP: Fix a memory leak on an error path
Alexander Wetzel [Fri, 20 Dec 2019 19:21:25 +0000 (20:21 +0100)] 
DPP: Fix a memory leak on an error path

Fix a memory leak exposed by the dpp_own_config_sign_fail test.

Fixes: 52d469de1112 ("DPP2: Support multiple Config Objects in Enrollee")
Signed-off-by: Alexander Wetzel <alexander@wetzel-home.de>
4 years agotests: DPP connection status - association rejection
Jouni Malinen [Fri, 20 Dec 2019 14:53:26 +0000 (16:53 +0200)] 
tests: DPP connection status - association rejection

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoDPP: Abort ongoing scan if connection status needs to be sent
Jouni Malinen [Fri, 20 Dec 2019 14:51:59 +0000 (16:51 +0200)] 
DPP: Abort ongoing scan if connection status needs to be sent

Ongoing scan could prevent the station Enrollee from sending out DPP
connection status after the 15 second timeout and that would result in
the Configurator timing out on the wait for the status report. Abort any
ongoing scan, if needed, to avoid this.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoSAE: Enable NEED_DH_GROUPS_ALL for CONFIG_TESTING_OPTIONS=y builds
Vamsi Krishna [Fri, 20 Dec 2019 10:36:46 +0000 (16:06 +0530)] 
SAE: Enable NEED_DH_GROUPS_ALL for CONFIG_TESTING_OPTIONS=y builds

Enable all DH FFC groups for SAE in wpa_supplicant testing builds. These
are needed to allow more testing coverage for AP functionality.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoQCA vendor command for getting STA information
Min Liu [Thu, 17 Oct 2019 08:03:03 +0000 (16:03 +0800)] 
QCA vendor command for getting STA information

Add a QCA vendor subcommand QCA_NL80211_VENDOR_SUBCMD_GET_STA_INFO with
attributes defined in enum qca_wlan_vendor_attr_get_sta to get
information for a BSS in STA mode or for a peer STA in AP mode. This
vendor sub command can be used to get STA information from the driver to
userspace. The attributes defined in enum
qca_wlan_vendor_attr_get_sta_info are used to encapsulate required
information.

Signed-off-by: Min Liu <minliu@codeaurora.org>
4 years agotests: Automatic channel selection with freqlist set
Jouni Malinen [Fri, 20 Dec 2019 11:41:57 +0000 (13:41 +0200)] 
tests: Automatic channel selection with freqlist set

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago6 GHz: Select channel width using configured op_class
Vamsi Krishna [Fri, 6 Dec 2019 13:47:29 +0000 (19:17 +0530)] 
6 GHz: Select channel width using configured op_class

Use op_class to derive channel width for the operating channel when
op_class is configured by the user in both fixed channel and ACS cases.
We can avoid using ht_capab field to derive channel width especially in
the 6 GHz band in which only HE is supported.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoDo not enable HT/VHT when operating in 6 GHz band
Vamsi Krishna [Fri, 13 Dec 2019 09:01:00 +0000 (14:31 +0530)] 
Do not enable HT/VHT when operating in 6 GHz band

Only HE mode is allowed in the 6 GHz band hence do not enable HT/VHT
even if they are configured by the user.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoAllow non-PCS 6 GHz channels to be excluded from ACS
Ankita Bajaj [Tue, 26 Nov 2019 05:49:32 +0000 (11:19 +0530)] 
Allow non-PCS 6 GHz channels to be excluded from ACS

Add support to exclude non-PSC 6 GHz channels from the input frequency
list to ACS. The new acs_exclude_6ghz_non_psc=1 parameter can be used by
6 GHz only APs.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoAllow ACS channel list to be configured as frequencies (in MHz)
Ankita Bajaj [Tue, 26 Nov 2019 05:49:32 +0000 (11:19 +0530)] 
Allow ACS channel list to be configured as frequencies (in MHz)

The channel numbers are duplicated between 2.4 GHz / 5 GHz bands and 6
GHz band. Hence, add support to configure a list of frequencies to ACS
(freqlist) instead of a list of channel numbers (chanlist). Also, both 5
GHz and 6 GHz channels are referred by HOSTAPD_MODE_IEEE80211A. The 6
GHz channels alone can be configured by using both mode and frequency
list.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoUse frequency in HT/VHT validation steps done before starting AP
Ankita Bajaj [Tue, 19 Nov 2019 10:24:44 +0000 (15:54 +0530)] 
Use frequency in HT/VHT validation steps done before starting AP

Using the channel parameter for validating allowed channel combinations
is not scalable to add 6 GHz support in the future since channel numbers
are duplicated between 2.4 GHz / 5 GHz bands and 6 GHz band. Hence use
frequency field for all channel combination validation steps done before
starting AP.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoACS: Select current hw_mode based on the selected frequency
Ankita Bajaj [Wed, 27 Nov 2019 14:25:49 +0000 (19:55 +0530)] 
ACS: Select current hw_mode based on the selected frequency

After receiving ACS offload results, select the current hw_mode based on
the frequency selected by the ACS algorithm. The current hw_mode will be
further used during other validation steps such as HT capability
validations, DFS validation, etc.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoAP: Populate iface->freq before starting AP
Ankita Bajaj [Mon, 18 Nov 2019 09:09:04 +0000 (14:39 +0530)] 
AP: Populate iface->freq before starting AP

Using channel field while starting AP will cause issues with the new
6GHz band as the channel numbers are duplicated between the different
bands. Populate iface->freq before starting AP so that it can be used
instead of the channel number for all validations that need to be done
while starting AP.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoACS: Use frequency params in ACS (offload) completed event interface
Ankita Bajaj [Mon, 18 Nov 2019 09:09:04 +0000 (14:39 +0530)] 
ACS: Use frequency params in ACS (offload) completed event interface

Replace channel fields with frequency fields in ACS completed event
interface from the driver layer. Use
QCA_WLAN_VENDOR_ATTR_ACS_PRIMARY_FREQUENCY and
QCA_WLAN_VENDOR_ATTR_ACS_SECONDARY_FREQUENCY attributes if the driver
includes them in the QCA_NL80211_VENDOR_SUBCMD_DO_ACS event, otherwise
use QCA_WLAN_VENDOR_ATTR_ACS_PRIMARY_CHANNEL and
QCA_WLAN_VENDOR_ATTR_ACS_SECONDARY_CHANNEL attributes to maintain
backwards compatibility with old drivers.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoSearch through all hw_features sets in hw_get_channel_freq()
Ankita Bajaj [Mon, 18 Nov 2019 06:30:06 +0000 (12:00 +0530)] 
Search through all hw_features sets in hw_get_channel_freq()

The 5 GHz channels are stored in one hw_features set with mode
HOSTAPD_MODE_IEEE80211A while the 6 GHz channels will need to stored in
a separate hw_features set (but with same mode HOSTAPD_MODE_IEEE80211A)
due to possibility of different HE capabilities being available between
the 5 GHz and 6 GHz bands.

Search through all hw_features sets whose mode is same as the input mode
while finding channel corresponding to the input frequency in
hw_get_channel_freq().

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoACS: Add channels from all modes matching with configured hw mode
Ankita Bajaj [Mon, 18 Nov 2019 06:06:51 +0000 (11:36 +0530)] 
ACS: Add channels from all modes matching with configured hw mode

The 5 GHz channels are stored in one hw_features set with mode
HOSTAPD_MODE_IEEE80211A while the 6 GHz channels will need to stored in
a separate hw_features set (but with same mode HOSTAPD_MODE_IEEE80211A)
due to possibility of different HE capabilities being available between
the 5 GHz and 6 GHz bands.

Iterate through all hw_features sets and populate channels from all
hw_features sets whose hardware mode is matching the configured hardware
mode while preparing the channel list for ACS.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoP2P: Add support for EDMG channels
Ahmad Masri [Thu, 17 Oct 2019 17:44:14 +0000 (20:44 +0300)] 
P2P: Add support for EDMG channels

This allows a P2P connection over P802.11ay EDMG channels to achieve the
highest link speed that the standard allows for channel bonding (CB) up
to CB4.

Let each P2P peer add its EDMG channels to the Supported Channels IE
advertised in P2P GO negotiation. Give EDMG channels priority when peers
negotiate for operating channel.

User may add 'edmg' parameter to p2p_connect, p2p_add_group, and
p2p_invite commands to prefer an EDMG channel for the P2P link. User may
also set p2p_go_edmg=1 in wpa_supplicant configuration file to prefer
EDMG.

When EDMG is used, P2P will try to find the highest channel bonding
supported channel that matches the frequency parameter, if the devices
do not support EDMG, the P2P connection will use a legacy (1-6) 60 GHz
channel.

Signed-off-by: Ahmad Masri <amasri@codeaurora.org>
4 years agoUpdate operating classes and channels for the 60 GHz band
Ahmad Masri [Wed, 4 Dec 2019 14:40:22 +0000 (16:40 +0200)] 
Update operating classes and channels for the 60 GHz band

Update new channels in Channel Bonding (CB2 ... CB4) in the 60 GHz band
for different regulatory regions according to the latest draft amendment
IEEE P802.11ay/D5.0.

Signed-off-by: Ahmad Masri <amasri@codeaurora.org>