]> git.ipfire.org Git - thirdparty/hostap.git/log
thirdparty/hostap.git
4 years agoASN.1: Add a helper for parsing SEQUENCE
Jouni Malinen [Thu, 30 Jan 2020 10:11:51 +0000 (12:11 +0200)] 
ASN.1: Add a helper for parsing SEQUENCE

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoASN.1: Add a helper for parsing INTEGER
Jouni Malinen [Thu, 12 Dec 2019 00:28:39 +0000 (02:28 +0200)] 
ASN.1: Add a helper for parsing INTEGER

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoDPP2: Add Protocol Version attr to Auth Resp only if peer is R2 or newer
Jouni Malinen [Tue, 28 Jan 2020 22:58:33 +0000 (00:58 +0200)] 
DPP2: Add Protocol Version attr to Auth Resp only if peer is R2 or newer

There is no need for the Protocol Version attribute in Authentication
Response if the peer is a DPP R1 device since such device would not know
how to use this attribute. To reduce risk for interoperability issues,
add this new attribute only if the peer included it in Authentication
Request.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoAdd a vendor attribute for RTPL instance primary frequency
Krishna Rao [Tue, 14 Jan 2020 12:46:55 +0000 (18:16 +0530)] 
Add a vendor attribute for RTPL instance primary frequency

Add an attribute QCA_WLAN_VENDOR_ATTR_RTPLINST_PRIMARY_FREQUENCY for
primary channel center frequency in the definition for Representative
Tx Power List (RTPL) list entry instance. This is required for 6 GHz
support, since the 6 GHz channel numbers overlap with existing 2.4 GHz
and 5 GHz channel numbers thus requiring frequency values to uniquely
identify channels.

Mark QCA_WLAN_VENDOR_ATTR_RTPLINST_PRIMARY as deprecated if both the
driver and user space application support 6 GHz. For backward
compatibility, QCA_WLAN_VENDOR_ATTR_RTPLINST_PRIMARY is still used if
either the driver or user space application or both do not support the
6 GHz band.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoTLS: Fix bounds checking in certificate policy parser
Jouni Malinen [Tue, 28 Jan 2020 12:17:52 +0000 (14:17 +0200)] 
TLS: Fix bounds checking in certificate policy parser

The recent addition of the X.509v3 certificatePolicies parser had a
copy-paste issue on the inner SEQUENCE parser that ended up using
incorrect length for the remaining buffer. Fix that to calculate the
remaining length properly to avoid reading beyond the end of the buffer
in case of corrupted input data.

Credit to OSS-Fuzz: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=20363
Fixes: d165b32f3887 ("TLS: TOD-STRICT and TOD-TOFU certificate policies")
Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoDPP: Example script for NFC bootstrapping method
Jouni Malinen [Mon, 27 Jan 2020 19:39:54 +0000 (21:39 +0200)] 
DPP: Example script for NFC bootstrapping method

This Python script is an example on how nfcpy can be used to drive an
NFC Device to perform DPP bootstrapping operations over DPP (tag with
NFC URI and negotiated connection handover).

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agotests: DPP bootstrapping via NFC negotiated handover
Jouni Malinen [Mon, 27 Jan 2020 15:04:12 +0000 (17:04 +0200)] 
tests: DPP bootstrapping via NFC negotiated handover

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoDPP: Show selected negotiation channel in DPP_BOOTSTRAP_INFO
Jouni Malinen [Mon, 27 Jan 2020 15:31:10 +0000 (17:31 +0200)] 
DPP: Show selected negotiation channel in DPP_BOOTSTRAP_INFO

Make the selected channel available for upper layer software to use,
e.g., when starting DPP listen operation during NFC negotiated
connection handover.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoDPP: NFC negotiated connection handover
Jouni Malinen [Mon, 27 Jan 2020 15:04:26 +0000 (17:04 +0200)] 
DPP: NFC negotiated connection handover

Add new control interface commands "DPP_NFC_HANDOVER_REQ own=<id>
uri=<URI>" and "DPP_NFC_HANDOVER_SEL own=<id> uri=<URI>" to support NFC
negotiated connection handover. These commands are used to report a DPP
URI received from a peer NFC Device in Handover Request and Handover
Select messages. The commands return peer bootstrapping information ID
or FAIL on failure. The returned ID is used similarly to any other
bootstrapping information to initiate DPP authentication.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoDPP: Helper function for bootstrapping URI generation
Jouni Malinen [Mon, 27 Jan 2020 15:04:26 +0000 (17:04 +0200)] 
DPP: Helper function for bootstrapping URI generation

The new dpp_gen_uri() helper function can be used to build the
bootstrapping URI from locally stored information. This can be used to
make it easier to update the URI, e.g., for NFC negotiated connection
handover cases.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agotests: Fix eap_proto_ttls_errors with CONFIG_TLS=internal
Jouni Malinen [Sun, 26 Jan 2020 15:09:50 +0000 (17:09 +0200)] 
tests: Fix eap_proto_ttls_errors with CONFIG_TLS=internal

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agocrypto: Allow up to 10 fragments for hmac_sha*_vector()
Jouni Malinen [Sun, 26 Jan 2020 15:04:54 +0000 (17:04 +0200)] 
crypto: Allow up to 10 fragments for hmac_sha*_vector()

This increases the limit of how many data fragments can be supported
with the internal HMAC implementation. The previous limit was hit with
some FT use cases.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: Check for domain_suffix_match in HS 2.0 PPS MO testing
Jouni Malinen [Sun, 26 Jan 2020 14:56:06 +0000 (16:56 +0200)] 
tests: Check for domain_suffix_match in HS 2.0 PPS MO testing

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: Check for TLS EC support in build
Jouni Malinen [Sun, 26 Jan 2020 14:54:07 +0000 (16:54 +0200)] 
tests: Check for TLS EC support in build

These test cases need to be skipped with CONFIG_TLS=internal.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: Check for TLS library capabilities in sigma_dut test cases
Jouni Malinen [Sun, 26 Jan 2020 14:50:20 +0000 (16:50 +0200)] 
tests: Check for TLS library capabilities in sigma_dut test cases

These test cases cannot be run with CONFIG_TLS=internal.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoTLS: TOD-STRICT and TOD-TOFU certificate policies
Jouni Malinen [Sun, 26 Jan 2020 14:44:49 +0000 (16:44 +0200)] 
TLS: TOD-STRICT and TOD-TOFU certificate policies

Add parsing of certificate policies for TOD-STRICT and TOD-TOFU when
using CONFIG_TLS=internal.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: Recognize more test SKIP reasons
Jouni Malinen [Sun, 26 Jan 2020 14:03:31 +0000 (16:03 +0200)] 
tests: Recognize more test SKIP reasons

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: Fix DPP capability checking to avoid failures in non-DPP build
Jouni Malinen [Sun, 26 Jan 2020 11:28:43 +0000 (13:28 +0200)] 
tests: Fix DPP capability checking to avoid failures in non-DPP build

"finally" handler should not trigger a new exception when trying to
clear state for non-DPP builds. In addition, couple of checks for DPP
capability in the build were missing.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: Check SAE capability in build more consistently
Jouni Malinen [Sun, 26 Jan 2020 11:19:09 +0000 (13:19 +0200)] 
tests: Check SAE capability in build more consistently

Use a helper function for this and add checks for number of test cases
that were missing this. This gets rid of undesired FAIL results
(converts them to SKIP) for test runs where the station do not support
SAE.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoTLS: Fix a typo in a debug message
Jouni Malinen [Sun, 26 Jan 2020 10:50:44 +0000 (12:50 +0200)] 
TLS: Fix a typo in a debug message

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoAdd vendor interface QCA_NL80211_VENDOR_SUBCMD_REQUEST_SAR_LIMITS_EVENT
Ashish Kumar Dhanotiya [Fri, 24 Jan 2020 12:29:39 +0000 (17:59 +0530)] 
Add vendor interface QCA_NL80211_VENDOR_SUBCMD_REQUEST_SAR_LIMITS_EVENT

This commit introduces the vendor event
QCA_NL80211_VENDOR_SUBCMD_REQUEST_SAR_LIMITS_EVENT.
Host drivers can request user space application to set SAR power
limits with this event.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoAdd new QCA vendor attribute to set thermal level
Vamsi Krishna [Mon, 13 Jan 2020 12:37:13 +0000 (18:07 +0530)] 
Add new QCA vendor attribute to set thermal level

Add a new QCA vendor attribute to set thermal level to the driver from
userspace. The driver/firmware takes actions requested by userspace to
mitigate high temperature such as throttling TX etc. The driver may
choose the level of throttling and other actions for various thermal
levels set by userspace.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agotests: OWE PTK derivation workarounds
Jouni Malinen [Thu, 23 Jan 2020 21:04:47 +0000 (23:04 +0200)] 
tests: OWE PTK derivation workarounds

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoOWE: PTK derivation workaround in STA mode
Jouni Malinen [Thu, 23 Jan 2020 20:46:51 +0000 (22:46 +0200)] 
OWE: PTK derivation workaround in STA mode

Initial OWE implementation used SHA256 when deriving the PTK for all OWE
groups. This was supposed to change to SHA384 for group 20 and SHA512
for group 21. The new owe_ptk_workaround=1 network parameter can be used
to enable older behavior mainly for testing purposes. There is no impact
to group 19 behavior, but if enabled, this will make group 20 and 21
cases use SHA256-based PTK derivation which will not work with the
updated OWE implementation on the AP side.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoOWE: PTK derivation workaround in AP mode
Jouni Malinen [Thu, 23 Jan 2020 18:56:51 +0000 (20:56 +0200)] 
OWE: PTK derivation workaround in AP mode

Initial OWE implementation used SHA256 when deriving the PTK for all OWE
groups. This was supposed to change to SHA384 for group 20 and SHA512
for group 21. The new owe_ptk_workaround parameter can be used to enable
workaround for interoperability with stations that use SHA256 with
groups 20 and 21. By default, only the appropriate hash function is
accepted. When workaround is enabled (owe_ptk_workaround=1), the
appropriate hash function is tried first and if that fails, SHA256-based
PTK derivation is attempted. This workaround can result in reduced
security for groups 20 and 21, but is required for interoperability with
older implementations. There is no impact to group 19 behavior.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoOWE: Select KDF hash algorithm based on the length of the prime
Jouni Malinen [Thu, 23 Jan 2020 18:04:40 +0000 (20:04 +0200)] 
OWE: Select KDF hash algorithm based on the length of the prime

Previous implementation was hardcoding use of SHA256 PMK-to-PTK
derivation for all groups. Replace that with hash algorithm selection
based on the length of the prime similarly to the way this was done for
other derivation steps in OWE.

This breaks backwards compatibility when using group 20 or 21; group 19
behavior remains same.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoFix a typo in an example configuration file comment
Jouni Malinen [Thu, 23 Jan 2020 21:06:27 +0000 (23:06 +0200)] 
Fix a typo in an example configuration file comment

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoFix a typo in a comment
Jouni Malinen [Thu, 23 Jan 2020 21:05:24 +0000 (23:05 +0200)] 
Fix a typo in a comment

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoFix coloc_intf_reporting config param in hostapd in non-OWE builds
Jouni Malinen [Thu, 23 Jan 2020 18:48:46 +0000 (20:48 +0200)] 
Fix coloc_intf_reporting config param in hostapd in non-OWE builds

This has nothing to do with OWE and parsing of this value was not
supposed to be within an ifdef CONFIG_OWE block.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agotests: Make ap_hs20_connect_no_full_match more robust
Jouni Malinen [Thu, 23 Jan 2020 14:54:45 +0000 (16:54 +0200)] 
tests: Make ap_hs20_connect_no_full_match more robust

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

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoDo not enable HT/VHT for 6 GHz band 20 MHz width channels also
Vamsi Krishna [Mon, 13 Jan 2020 09:29:06 +0000 (14:59 +0530)] 
Do not enable HT/VHT for 6 GHz band 20 MHz width channels also

The previous commit had a rebasing issue that ended up covering only the
center_segment0 != 0 case. These were supposed to apply for all 6 GHz
band cases.

Fixes: 0bfc04b8d0f8 ("Do not enable HT/VHT when operating in 6 GHz band")
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoEnhance get_mode() to return correct hw_mode with 6 GHz support
Vamsi Krishna [Mon, 30 Dec 2019 09:42:12 +0000 (15:12 +0530)] 
Enhance get_mode() to return correct hw_mode with 6 GHz support

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

Iterate through all hw_features sets and check and match the band of
channel supported by the hw_features set while getting the hw_features
set in get_mode(). This allows both the 5 GHz and 6 GHz channels to be
found and correct capabilities to be used in cases where the driver
reports different capability values between 5 and 6 GHz channels.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoRemove deprecated text for ap_scan=0
Chaitanya Tata [Mon, 20 Jan 2020 18:36:44 +0000 (00:06 +0530)] 
Remove deprecated text for ap_scan=0

Users might be tempted to try ap_scan=0 for offloading scan,
ap_selection and, WPA to driver. Update the text to reflect that this is
deprecated.

Jouni confirmed deprecation in
https://www.spinics.net/lists/hostap/msg06482.html

Signed-off-by: Chaitanya Tata <chaitanya.tata@bluwireless.com>
4 years agotests: Allow more time for sigma_dut sta_associate commands
Jouni Malinen [Tue, 21 Jan 2020 11:22:57 +0000 (13:22 +0200)] 
tests: Allow more time for sigma_dut sta_associate commands

The previously used timeout of two seconds did not allow more than a
single scan attempt and that could fail every now and then. Make these
more robust by increasing the timeout to 10 seconds which allows another
scan attempt to be completed similarly to the most non-sigma_dut test
cases.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoSAE: Use Anti-Clogging Token Container element with H2E
Jouni Malinen [Mon, 20 Jan 2020 18:27:06 +0000 (20:27 +0200)] 
SAE: Use Anti-Clogging Token Container element with H2E

IEEE P802.11-REVmd was modified to use a container IE for anti-clogging
token whenver H2E is used so that parsing of the SAE Authentication
frames can be simplified.

See this document for more details of the approved changes:
https://mentor.ieee.org/802.11/dcn/19/11-19-2154-02-000m-sae-anti-clogging-token.docx

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoSAE: Use H2E whenever Password Identifier is used
Jouni Malinen [Mon, 20 Jan 2020 19:15:04 +0000 (21:15 +0200)] 
SAE: Use H2E whenever Password Identifier is used

IEEE P802.11-REVmd was modified to require H2E to be used whenever
Password Identifier is used with SAE.

See this document for more details of the approved changes:
https://mentor.ieee.org/802.11/dcn/19/11-19-2154-02-000m-sae-anti-clogging-token.docx

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agotests: Remove mesh SAE Password Identifier test cases for now
Jouni Malinen [Tue, 21 Jan 2020 10:57:07 +0000 (12:57 +0200)] 
tests: Remove mesh SAE Password Identifier test cases for now

IEEE P802.11-REVmd was modified to require H2E to be used whenever
Password Identifier is used with SAE. Since wpa_supplicant and mac80211
do not yet support SAE H2E in mesh, Password Identifier cannot be used
in mesh cases. Remove the test cases that verified this behavior for now
to allow H2E to be required per updated REVmd definition. These test
cases will be restored once H2E is fully functionality in mesh cases.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoSAE: Mark sae_derive_pt_ecc() static
Jouni Malinen [Mon, 20 Jan 2020 22:34:53 +0000 (00:34 +0200)] 
SAE: Mark sae_derive_pt_ecc() static

This function is not used outside sae.c.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agotests: SAE anti clogging (forced, H2E)
Jouni Malinen [Mon, 20 Jan 2020 18:25:29 +0000 (20:25 +0200)] 
tests: SAE anti clogging (forced, H2E)

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoSAE H2E: Check H2E-only BSS membership selector only if SAE is enabled
Jouni Malinen [Mon, 20 Jan 2020 18:23:48 +0000 (20:23 +0200)] 
SAE H2E: Check H2E-only BSS membership selector only if SAE is enabled

This BSS membership selector has impact only for SAE functionality, so
ignore it when configured not to use SAE. This allows WPA-PSK connection
to and AP that advertises WPA-PSK and SAE while requiring H2E for SAE.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agotests: parallel-vm: allow running without curses
Johannes Berg [Wed, 15 Jan 2020 11:48:43 +0000 (12:48 +0100)] 
tests: parallel-vm: allow running without curses

Allow running without curses, in which case the log is simply written to
stdout instead of a file. This is useful for automated (but parallel)
testing. Note that in most cases, you'd want to specify --debug, and so
I added a .rstrip() there on the lines to clean that up a bit.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
4 years agotrace: Handle binutils bfd.h breakage
Johannes Berg [Wed, 15 Jan 2020 09:10:03 +0000 (10:10 +0100)] 
trace: Handle binutils bfd.h breakage

Some things in bfd.h that we use were renamed, and in the case of
bfd_get_section_vma() a parameter was dropped. Work around this.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
4 years agohostapd: Fix a typo in sample configuration
Daniel Golle [Thu, 16 Jan 2020 08:22:29 +0000 (10:22 +0200)] 
hostapd: Fix a typo in sample configuration

'assocition' -> 'association'

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
4 years agotests: Flush scan results in more Hotspot 2.0 test cases
Jouni Malinen [Fri, 10 Jan 2020 20:55:44 +0000 (22:55 +0200)] 
tests: Flush scan results in more Hotspot 2.0 test cases

This makes testing of INTERWORKING_CONNECT more robust.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agotests: Opportunistic Wireless Encryption transition mode disabled on STA
Jouni Malinen [Fri, 10 Jan 2020 18:37:41 +0000 (20:37 +0200)] 
tests: Opportunistic Wireless Encryption transition mode disabled on STA

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoEAP-SIM/AKA peer: Add support for EAP Method prefix
Hai Shalom [Fri, 27 Dec 2019 17:44:49 +0000 (09:44 -0800)] 
EAP-SIM/AKA peer: Add support for EAP Method prefix

Add support for EAP method prefix in the anonymous identity
used during EAP-SIM/AKA/AKA' authentication when encrypted IMSI
is used. The prefix is a single character that indicates which
EAP method is required by the client.

Signed-off-by: Hai Shalom <haishalom@google.com>
4 years agotests: Call stop_sigma_dut() in more failure cases
Jouni Malinen [Thu, 9 Jan 2020 22:19:27 +0000 (00:19 +0200)] 
tests: Call stop_sigma_dut() in more failure cases

Some of the sigma_dut test cases were not yet using try/finally to
ensure stop_sigma_dut() gets called. That could result in not logging
all failure reasons in the log and getting stuck with being unable to
start new sigma_dut processes after failed test cases.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agotests: Enable sigma_dut debug log for all test cases
Jouni Malinen [Thu, 9 Jan 2020 22:08:52 +0000 (00:08 +0200)] 
tests: Enable sigma_dut debug log for all test cases

There is no point in having to enable this separately for each test case
since the debug details are always useful if something fails.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agotests: Verify that sigma_dut is functional after startup
Jouni Malinen [Thu, 9 Jan 2020 22:04:43 +0000 (00:04 +0200)] 
tests: Verify that sigma_dut is functional after startup

There is no point in continuing the test ase if sigma_dut is not in
functional state.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agotests: Log sigma_dut stdout/stderr separately for each command
Jouni Malinen [Thu, 9 Jan 2020 21:31:29 +0000 (23:31 +0200)] 
tests: Log sigma_dut stdout/stderr separately for each command

This makes logs easier to understand and this may also help in running
over buffer space and getting stuck with sigma_dut termination.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoACS: Populate channel config from external ACS per documented behavior
Vamsi Krishna [Tue, 24 Dec 2019 12:01:39 +0000 (17:31 +0530)] 
ACS: Populate channel config from external ACS per documented behavior

Based on the now documented seg0/seg1 values from offloaded ACS, there
is a mismatch between the driver interface and internal hostapd use.

The value of segment0 field in ACS results is the index of the channel
center frequency for 20 MHz, 40 MHz, and 80M Hz channels. The value is
the center frequency index of the primary 80 MHz segment for 160 MHz and
80+80 MHz channels.

The value of segment1 field in ACS results is zero for 20 MHz, 40 MHz,
and 80 MHz channels. The value is the index of the channel center
frequency for 160 MHz channels and the center frequency index of the
secondary 80 MHz segment for 80+80 MHz channels.

However, in struct hostapd_config, for 160 MHz channels, the value of
the segment0 field is the index of the channel center frequency of 160
MHz channel and the value of the segment1 field is zero. Map the values
from ACS event into hostapd_config fields accordingly.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoACS: Update documentation of external ACS results event parameters
Vamsi Krishna [Tue, 24 Dec 2019 12:46:37 +0000 (18:16 +0530)] 
ACS: Update documentation of external ACS results event parameters

Update the documentation with values to be sent for seg0 and seg1 fields
in external ACS result event for 20 MHz, 40 MHz, 80 MHz, 160 MHz, and
80+80 MHz channels. These values match the changes done to definitions
of seg0 and seg1 fields in the IEEE 802.11 standard.

This vendor command had not previously been documented in this level of
detail and had not actually been used for the only case that could have
two different interpretation (160 MHz) based on which version of IEEE
802.11 standard is used.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago6 GHz: Fix Channel Width value for 80+80 in 6 GHZ Operation Info field
Vamsi Krishna [Tue, 24 Dec 2019 12:02:29 +0000 (17:32 +0530)] 
6 GHz: Fix Channel Width value for 80+80 in 6 GHZ Operation Info field

The Channel Width field value is 0 for 20 MHz, 1 for 40 MHz, 2 for 80
MHz, and 3 for both 160 MHz and 80+80 MHz channels. The 80+80 MHz case
was not addressed previously correctly since it cannot be derived from
seg0 only.

The Channel Center Frequency Segment 0 field value is the index of
channel center frequency for 20 MHz, 40 MHz, and 80 MHz channels. The
value is the center frequency index of the primary 80 MHz segment for
160 MHz and 80+80 MHz channels.

The Channel Center Frequency Segment 1 field value is zero for 20 MHz,
40 MHz, and 80 MHz channels. The value is the index of the channel
center frequency for 160 MHz channel and the center frequency index of
the secondary 80 MHz segment for 80+80 MHz channels.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoSilence compiler warning in no-NEED_AP_MLME builds
Jouni Malinen [Thu, 9 Jan 2020 10:44:08 +0000 (12:44 +0200)] 
Silence compiler warning in no-NEED_AP_MLME builds

Make the dummy hostapd_hw_mode_txt() wrapper return "UNKNOWN" instead of
NULL to avoid a warning from a debug printf using %s with NULL.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoSilence compiler warning with CONFIG_NO_ROAMING=y
Jouni Malinen [Thu, 9 Jan 2020 10:40:17 +0000 (12:40 +0200)] 
Silence compiler warning with CONFIG_NO_ROAMING=y

Comment out unused static functions if CONFIG_NO_ROAMING is defined.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agotests: Set key_flag when using SET_KEY
Alexander Wetzel [Sat, 4 Jan 2020 22:10:04 +0000 (23:10 +0100)] 
tests: Set key_flag when using SET_KEY

Signed-off-by: Alexander Wetzel <alexander@wetzel-home.de>
4 years agoIntroduce and add key_flag
Alexander Wetzel [Sat, 4 Jan 2020 22:10:04 +0000 (23:10 +0100)] 
Introduce and add key_flag

Add the new set_key() parameter "key_flag" to provide more specific
description of what type of a key is being configured. This is needed to
be able to add support for "Extended Key ID for Individually Addressed
Frames" from IEEE Std 802.11-2016. In addition, this may be used to
replace the set_tx boolean eventually once all the driver wrappers have
moved to using the new key_flag.

The following flag are defined:

  KEY_FLAG_MODIFY
    Set when an already installed key must be updated.
    So far the only use-case is changing RX/TX status of installed
    keys. Must not be set when deleting a key.

  KEY_FLAG_DEFAULT
    Set when the key is also a default key. Must not be set when
    deleting a key. (This is the replacement for set_tx.)

  KEY_FLAG_RX
    The key is valid for RX. Must not be set when deleting a key.

  KEY_FLAG_TX
    The key is valid for TX. Must not be set when deleting a key.

  KEY_FLAG_GROUP
    The key is a broadcast or group key.

  KEY_FLAG_PAIRWISE
    The key is a pairwise key.

  KEY_FLAG_PMK
    The key is a Pairwise Master Key (PMK).

Predefined and needed flag combinations so far are:

  KEY_FLAG_GROUP_RX_TX
    WEP key not used as default key (yet).

  KEY_FLAG_GROUP_RX_TX_DEFAULT
    Default WEP or WPA-NONE key.

  KEY_FLAG_GROUP_RX
    GTK key valid for RX only.

  KEY_FLAG_GROUP_TX_DEFAULT
    GTK key valid for TX only, immediately taking over TX.

  KEY_FLAG_PAIRWISE_RX_TX
    Pairwise key immediately becoming the active pairwise key.

  KEY_FLAG_PAIRWISE_RX
    Pairwise key not yet valid for TX. (Only usable with Extended Key ID
    support.)

  KEY_FLAG_PAIRWISE_RX_TX_MODIFY
    Enable TX for a pairwise key installed with KEY_FLAG_PAIRWISE_RX.

  KEY_FLAG_RX_TX
    Not a valid standalone key type and can only used in combination
    with other flags to mark a key for RX/TX.

This commit is not changing any functionality. It just adds the new
key_flag to all hostapd/wpa_supplicant set_key() functions without using
it, yet.

Signed-off-by: Alexander Wetzel <alexander@wetzel-home.de>
4 years agotests: Fix Python sleep function
Markus Theil [Wed, 8 Jan 2020 23:03:02 +0000 (00:03 +0100)] 
tests: Fix Python sleep function

Current Python versions have no os.sleep(), use time.sleep() instead.

module 'os' has no attribute 'sleep'
Traceback (most recent call last):
  File "./run-tests.py", line 521, in main
    t(dev, apdev)
  File "/home/mtheil/hostap/tests/hwsim/test_pmksa_cache.py", line 356, in test_pmksa_cache_expiration
    hapd.wait_ptkinitdone(dev[0].own_addr())
  File "/home/mtheil/hostap/tests/hwsim/hostapd.py", line 282, in wait_ptkinitdone
    os.sleep(0.1)

Signed-off-by: Markus Theil <markus.theil@tu-ilmenau.de>
4 years agonl80211: Pass set_key() parameter struct to wpa_driver_nl80211_set_key()
Jouni Malinen [Wed, 8 Jan 2020 22:47:03 +0000 (00:47 +0200)] 
nl80211: Pass set_key() parameter struct to wpa_driver_nl80211_set_key()

This is the function that actually uses the parameters, so pass the full
parameter struct to it instead of hiding the struct from it in the
simple wrapper.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agohostapd: Support VLAN offload to the driver
Gurumoorthi Gnanasambandhan [Thu, 5 Dec 2019 10:38:47 +0000 (12:38 +0200)] 
hostapd: Support VLAN offload to the driver

If the driver supports VLAN offload mechanism with a single netdev, use
that instead of separate per-VLAN netdevs.

Signed-off-by: Gurumoorthi Gnanasambandhan <gguru@codeaurora.org>
4 years agonl80211: VLAN offload support
Gurumoorthi Gnanasambandhan [Thu, 5 Dec 2019 10:38:47 +0000 (12:38 +0200)] 
nl80211: VLAN offload support

Add indication for driver VLAN offload capability and configuration of
the VLAN ID to the driver.

Signed-off-by: Gurumoorthi Gnanasambandhan <gguru@codeaurora.org>
4 years agoAdd vlan_id to driver set_key() operation
Gurumoorthi Gnanasambandhan [Thu, 5 Dec 2019 10:38:47 +0000 (12:38 +0200)] 
Add vlan_id to driver set_key() operation

This is in preparation for adding support to use a single WLAN netdev
with VLAN operations offloaded to the driver. No functional changes are
included in this commit.

Signed-off-by: Gurumoorthi Gnanasambandhan <gguru@codeaurora.org>
4 years agodriver: Move set_key() parameters into a struct
Jouni Malinen [Wed, 8 Jan 2020 20:15:18 +0000 (22:15 +0200)] 
driver: Move set_key() parameters into a struct

This makes it more convenient to add, remove, and modify the parameters
without always having to update every single driver_*.c implementation
of this callback function.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agotests: SAE and AP sending Confirm message without waiting STA (2)
Jouni Malinen [Wed, 8 Jan 2020 18:57:26 +0000 (20:57 +0200)] 
tests: SAE and AP sending Confirm message without waiting STA (2)

This goes through sae_confirm_immediate=2 behavior.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoSAE: A bit optimized sae_confirm_immediate=2 for testing purposes
Jouni Malinen [Wed, 8 Jan 2020 18:52:26 +0000 (20:52 +0200)] 
SAE: A bit optimized sae_confirm_immediate=2 for testing purposes

sae_confirm_immediate=2 can now be used in CONFIG_TESTING_OPTIONS=y
builds to minimize the latency between SAE Commit and SAE Confirm by
postponing transmission of SAE Commit until the SAE Confirm frame is
generated. This does not have significant impact, but can get the frames
tiny bit closer to each other over the air to increase testing coverage.
The only difference between sae_confirm_immediate 1 and 2 is in the
former deriving KCK, PMK, PMKID, and CN between transmission of the
frames (i.e., a small number of hash operations).

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoDo not select APs found on disabled channels for connection
Vamsi Krishna [Wed, 11 Dec 2019 12:57:47 +0000 (18:27 +0530)] 
Do not select APs found on disabled channels for connection

If a channel list changed event is received after a scan and before
selecting a BSS for connection, a BSS found on a now disabled channel
may get selected for connection. The connect request issued with the BSS
found on a disabled channel is rejected by cfg80211. Filter out the BSSs
found on disabled channels and select from the other BSSs found on
enabled channels to avoid unnecessary connection attempts that are bound
to fail.

The channel list information will be updated by the driver in cases like
country code update, disabling/enabling specific bands, etc. which can
occur between the scan and connection attempt.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoFix QCA_WLAN_VENDOR_ATTR_ACS_VHT_SEG1_CENTER_CHANNEL NULL check
Vamsi Krishna [Fri, 6 Dec 2019 10:52:18 +0000 (16:22 +0530)] 
Fix QCA_WLAN_VENDOR_ATTR_ACS_VHT_SEG1_CENTER_CHANNEL NULL check

Correct the check for presence of
QCA_WLAN_VENDOR_ATTR_ACS_VHT_SEG1_CENTER_CHANNEL attribute before using it
while processing acs_result event.

Fixes: 857d94225a94 ("Extend offloaded ACS QCA vendor command to support VHT")
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agotests: Add digestmod for Python 3.8
Markus Theil [Wed, 8 Jan 2020 10:04:53 +0000 (11:04 +0100)] 
tests: Add digestmod for Python 3.8

The digestmod argument also exists in earlier Python versions,
version 3.8 does not set a default argument anymore.

Signed-off-by: Markus Theil <markus.theil@tu-ilmenau.de>
4 years agotests: Fix undefined behavior in module tests
Markus Theil [Wed, 8 Jan 2020 10:04:52 +0000 (11:04 +0100)] 
tests: Fix undefined behavior in module tests

Test: wpa_supplicant module tests
../src/utils/utils_module_tests.c:933:7: runtime error: left shift of 1 by 31 places cannot be represented in type 'int'

Signed-off-by: Markus Theil <markus.theil@tu-ilmenau.de>
4 years agoOpenSSL: Fix memory leak in TOD policy validation
Jouni Malinen [Tue, 7 Jan 2020 18:40:12 +0000 (20:40 +0200)] 
OpenSSL: Fix memory leak in TOD policy validation

Returned policies from X509_get_ext_d2i() need to be freed.

Fixes: 21f1a1e66c39 ("Report TOD policy")
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoRSN IBSS: Fix EAPOL TX using control port
Markus Theil [Mon, 6 Jan 2020 15:21:07 +0000 (16:21 +0100)] 
RSN IBSS: Fix EAPOL TX using control port

This was previously done only in supplicant role, but a similar change
is needed for the authenticator role.

Signed-off-by: Markus Theil <markus.theil@tu-ilmenau.de>
4 years agotests: PSK/EAP without nl80211 control port
Jouni Malinen [Sun, 5 Jan 2020 19:20:00 +0000 (21:20 +0200)] 
tests: PSK/EAP without nl80211 control port

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agonl80211: Allow control port to be disabled with a driver param
Jouni Malinen [Sun, 5 Jan 2020 19:18:18 +0000 (21:18 +0200)] 
nl80211: Allow control port to be disabled with a driver param

This is mainly for testing purposes to allow wpa_supplicant and hostapd
functionality to be tested both with and without using the nl80211
control port which is by default used whenever supported by the driver.
control_port=0 driver parameter will prevent that from happening.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agonl80211: Use control port TX for AP mode
Markus Theil [Fri, 3 Jan 2020 15:17:42 +0000 (16:17 +0100)] 
nl80211: Use control port TX for AP mode

Signed-off-by: Markus Theil <markus.theil@tu-ilmenau.de>
4 years agonl80211: Report control port RX events
Markus Theil [Fri, 3 Jan 2020 15:17:42 +0000 (16:17 +0100)] 
nl80211: Report control port RX events

This allows EAPOL frames to be received over the separate controlled
port once rest of the driver interface is ready for this. By itself,
this commit does not actually change behavior since cfg80211 will not be
delivering these events without them being explicitly requested.

Signed-off-by: Markus Theil <markus.theil@tu-ilmenau.de>
4 years agoAdd no_encrypt flag for control port TX
Markus Theil [Fri, 3 Jan 2020 15:17:42 +0000 (16:17 +0100)] 
Add no_encrypt flag for control port TX

In order to correctly encrypt rekeying frames, wpa_supplicant now checks
if a PTK is currently installed and sets the corresponding encrypt
option for tx_control_port().

Signed-off-by: Markus Theil <markus.theil@tu-ilmenau.de>
4 years agowpa_supplicant: Send EAPOL frames over nl80211 where available
Brendan Jackman [Fri, 3 Jan 2020 15:17:41 +0000 (16:17 +0100)] 
wpa_supplicant: Send EAPOL frames over nl80211 where available

Linux kernel v4.17 added the ability to request sending control port
frames via nl80211 instead of a normal network socket. Doing this
provides the device driver with ordering information between the
control port frames and the installation of keys. This empowers it to
avoid race conditions between, for example, PTK replacement and the
sending of frame 4 of the 4-way rekeying handshake in an RSNA. The
key difference between a TX_CONTROL_PORT and normal socket send is
that the device driver will certainly get any EAPOL frames comprising
a 4-way handshake before it gets the key installation call
for the derived key. By flushing its TX buffers it can then ensure
that no pending EAPOL frames are inadvertently encrypted with a key
that the peer will not yet have installed.

Update the RSN supplicant system to use this new operation for sending
EAPOL-Key frames when the driver reports that this capability is
available; otherwise, fall back to a normal Ethernet TX.

I have tested this on DMG (11ad/ay) devices with an out-of-tree Linux
driver that does not use mac80211. Without this patch I consistently see
PTK rekeying fail if message 4/4 shares a stream with other in-flight
traffic. With this patch, and the driver updated to flush the relevant TX
queue before overwriting a PTK (knowing, now, that if there was a message
4/4 related to the key installation, it has already entered the driver
queue), rekeying is reliable.

There is still data loss surrounding key installation - this problem is
alluded to in IEEE Std 802.11-2016, 12.6.21, where extended Key ID
support is described as the eventual solution. This patch aims to at
least prevent rekeying from totally breaking the association, in a way
that works on kernels as far back as 4.17 (as per Alexander Wetzel
extended Key ID support should be possible on 5.2).

See http://lists.infradead.org/pipermail/hostap/2019-May/040089.html for
a little more context.

Signed-off-by: Brendan Jackman <brendan.jackman@bluwireless.co.uk>
4 years agonl80211: Control port over nl80211 helpers
Brendan Jackman [Fri, 3 Jan 2020 15:17:41 +0000 (16:17 +0100)] 
nl80211: Control port over nl80211 helpers

Linux kernel v4.17 added the ability to request sending controlled port
frames (e.g., IEEE 802.1X controlled port EAPOL frames) via nl80211
instead of a normal network socket. Doing this provides the device
driver with ordering information between the control port frames and the
installation of keys. This empowers it to avoid race conditions between,
for example, PTK replacement and the sending of frame 4 of the 4-way
rekeying handshake in an RSNA. The key difference between the specific
control port and normal socket send is that the device driver will
certainly get any EAPOL frames comprising a 4-way handshake before it
gets the key installation call for the derived key. By flushing its TX
buffers it can then ensure that no pending EAPOL frames are
inadvertently encrypted with a key that the peer will not yet have
installed.

Add a CONTROL_PORT flag to the hostap driver API to report driver
capability for using a separate control port for EAPOL frames. This
operation is exactly like an Ethernet send except for the extra ordering
information it provides for device drivers. The nl80211 driver is
updated to support this operation when the device reports support for
NL80211_EXT_FEATURE_CONTROL_PORT_OVER_NL80211. Also add a driver op
tx_control_port() for request a frame to be sent over the controlled
port.

Signed-off-by: Brendan Jackman <brendan.jackman@bluwireless.co.uk>
4 years agodriver: Remove unused send_ether() driver op
Jouni Malinen [Sun, 5 Jan 2020 16:32:10 +0000 (18:32 +0200)] 
driver: Remove unused send_ether() driver op

This was used only for FT RRB sending with driver_test.c and
driver_test.c was removed more than five years ago, so there is no point
in continuing to maintain this driver op.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: WPS Application Extension attribute
Jouni Malinen [Sat, 4 Jan 2020 21:39:40 +0000 (23:39 +0200)] 
tests: WPS Application Extension attribute

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoWPS: Add application extension data to WPS IE
Bilal Hatipoglu [Fri, 3 Jan 2020 08:58:26 +0000 (11:58 +0300)] 
WPS: Add application extension data to WPS IE

Application Extension attribute is defined in WSC tech spec v2.07 page
104. Allow hostapd to be configured to add this extension into WPS IE in
Beacon and Probe Response frames. The implementation is very similar to
vendor extension.

A new optional entry called "wps_application_ext" is added to hostapd
config file to configure this. It enodes the payload of the Application
Extension attribute in hexdump format.

Signed-off-by: Veli Demirel <veli.demirel@airties.com>
Signed-off-by: Bilal Hatipoglu <bilal.hatipoglu@airties.com>
4 years agoP2P: Move p2p_long_listen into struct wpa_global
Jouni Malinen [Sat, 4 Jan 2020 21:11:28 +0000 (23:11 +0200)] 
P2P: Move p2p_long_listen into struct wpa_global

This variable is not specific to any P2P group interface and since it
was already used through global->p2p_init_wpa_s, it is cleaner to simply
move this to the global structure so that there is a single variable
instead of per-interface variables and need to pick the correct
interface.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: Test p2p_long_listen longer than remain-on-channel
Benjamin Berg [Fri, 3 Jan 2020 21:18:52 +0000 (22:18 +0100)] 
tests: Test p2p_long_listen longer than remain-on-channel

This tests an error, where the p2p_long_listen information from the
wrong device was used internally in wpa_supplicant when using the
separate P2P Device interface.

Signed-off-by: Benjamin Berg <bberg@redhat.com>
4 years agoP2P: Always use global p2p_long_listen
Benjamin Berg [Fri, 3 Jan 2020 21:18:51 +0000 (22:18 +0100)] 
P2P: Always use global p2p_long_listen

The p2p_long_listen value was set on the control wpa_s struct while in a
lot of cases it operated on the p2p struct. Explicitly use the global
p2p_init_wpa_s struct in cases where we might not be operating on it
already.

Without this, simply starting a p2p_listen operation (e.g., using
wpa_cli) will not work properly. As the p2p_long_listen is set on the
controlling interface and wpas_p2p_cancel_remain_on_channel_cb() uses
p2p_init_wpa_s, it would not actually work. This results in
wpa_supplicant stopping listening after the maximum remain-on-channel
time passes when using a separate P2P Device interface.

Signed-off-by: Benjamin Berg <bberg@redhat.com>
4 years agotests: PMF tests with not-protected disconnection using hostapd
Jouni Malinen [Sat, 4 Jan 2020 18:41:52 +0000 (20:41 +0200)] 
tests: PMF tests with not-protected disconnection using hostapd

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agonl80211: Use monitor interface for sending no-encrypt test frames
Jouni Malinen [Sat, 4 Jan 2020 18:23:05 +0000 (20:23 +0200)] 
nl80211: Use monitor interface for sending no-encrypt test frames

Since NL80211_CMD_FRAME does not allow encryption to be disabled for the
frame, add a monitor interface temporarily for cases where this type of
no-encrypt frames are to be sent. The temporary monitor interface is
removed immediately after sending the frame.

This is testing functionality (only in CONFIG_TESTING_OPTIONS=y builds)
that is used for PMF testing where the AP can use this to inject an
unprotected Robust Management frame (mainly, Deauthentication or
Disassociation frame) even in cases where PMF has been negotiated for
the association.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: Detect tshark regression in wpas_mesh_gate_forwarding
Jouni Malinen [Sat, 4 Jan 2020 16:08:03 +0000 (18:08 +0200)] 
tests: Detect tshark regression in wpas_mesh_gate_forwarding

Skip this test case if the used tshark version has regression in mesh
control field parsing:
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=15521

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: Initial GTK/IGTK RSC setting
Jouni Malinen [Sat, 4 Jan 2020 11:07:47 +0000 (13:07 +0200)] 
tests: Initial GTK/IGTK RSC setting

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoAllow testing override for GTK/IGTK RSC from AP to STA
Jouni Malinen [Sat, 4 Jan 2020 11:05:26 +0000 (13:05 +0200)] 
Allow testing override for GTK/IGTK RSC from AP to STA

The new hostapd gtk_rsc_override and igtk_rsc_override configuration
parameters can be used to set an override value for the RSC that the AP
advertises for STAs for GTK/IGTK. The contents of those parameters is a
hexdump of the RSC in little endian byte order.

This functionality is available only in CONFIG_TESTING_OPTIONS=y builds.
This can be used to verify that stations implement initial RSC
configuration correctly for GTK/ and IGTK.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: ROAM command failure cases
Jouni Malinen [Fri, 3 Jan 2020 16:09:57 +0000 (18:09 +0200)] 
tests: ROAM command failure cases

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoSME: Postpone current BSSID clearing until IEs are prepared
Jouni Malinen [Fri, 3 Jan 2020 16:06:01 +0000 (18:06 +0200)] 
SME: Postpone current BSSID clearing until IEs are prepared

sme_send_authentication() could fail before actually requesting the
driver to authenticate with a new AP. This could happen after
wpa_s->bssid got cleared even though in such a case, the old association
is maintained and still valid. This can result in unexpected behavior
since wpa_s->bssid would not match the current BSSID anymore.

Fix this by postponing clearing of wpa_s->bssid until the IE preparation
has been completed successfully.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: DFS with RRM
Jouni Malinen [Fri, 3 Jan 2020 13:53:03 +0000 (15:53 +0200)] 
tests: DFS with RRM

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agonl80211: Don't set offchan-OK flag if doing on-channel frame in AP mode
Ben Greear [Tue, 19 Mar 2019 21:34:24 +0000 (14:34 -0700)] 
nl80211: Don't set offchan-OK flag if doing on-channel frame in AP mode

I saw a case where the kernel's cfg80211 rejected hostapd's attempt to
send a neighbor report response because nl80211 flagged the frame as
offchannel-OK, but kernel rejects because channel was 100 (DFS) and so
kernel failed thinking it was constrained by DFS/CAC requirements that
do not allow the operating channel to be left (at least in FCC).

Don't set the packet as off-channel OK if we are transmitting on the
current operating channel of an AP to avoid such issues with
transmission of Action frames.

Signed-off-by: Ben Greear <greearb@candelatech.com>
4 years agotests: Remove allow_failure from DFS test cases
Jouni Malinen [Fri, 3 Jan 2020 13:41:54 +0000 (15:41 +0200)] 
tests: Remove allow_failure from DFS test cases

This functionality has been available in mac80211_hwsim for years, so
there is no need to maintain this old workaround.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agonl80211: Use current command for NL80211_CMD_REGISTER_ACTION
Jouni Malinen [Fri, 3 Jan 2020 13:26:31 +0000 (15:26 +0200)] 
nl80211: Use current command for NL80211_CMD_REGISTER_ACTION

This was renamed to NL80211_CMD_REGISTER_FRAME long time ago.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agonl80211: Rename send_action_cookie to send_frame_cookie
Jouni Malinen [Fri, 3 Jan 2020 13:23:49 +0000 (15:23 +0200)] 
nl80211: Rename send_action_cookie to send_frame_cookie

This is to match the NL80211_CMD_ACTION renaming to NL80211_CMD_FRAME
that happened long time ago. This command can be used with any IEEE
802.11 frame and it should not be implied to be limited to Action
frames.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agonl80211: Clean up nl80211_send_frame_cmd() callers
Jouni Malinen [Fri, 3 Jan 2020 13:18:46 +0000 (15:18 +0200)] 
nl80211: Clean up nl80211_send_frame_cmd() callers

Replace a separate cookie_out pointer argument with save_cookie boolean
since drv->send_action_cookie is the only longer term storage place for
the cookies. Merge all nl80211_send_frame_cmd() callers within
wpa_driver_nl80211_send_mlme() to use a single shared call to simplify
the function.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agonl80211: Get rid of separate wpa_driver_nl80211_send_frame()
Jouni Malinen [Fri, 3 Jan 2020 12:53:37 +0000 (14:53 +0200)] 
nl80211: Get rid of separate wpa_driver_nl80211_send_frame()

Merge this function into wpa_driver_nl80211_send_mlme() that is now the
only caller for the previously shared helper function. This is a step
towards cleaning up the overly complex code path for sending Management
frames.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agodriver: Remove unused send_frame() driver op
Jouni Malinen [Fri, 3 Jan 2020 11:56:12 +0000 (13:56 +0200)] 
driver: Remove unused send_frame() driver op

All the previous users have now been converted to using send_mlme() so
this unused send_frame() callback can be removed.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoConvert the only remaining send_frame() users to send_mlme()
Jouni Malinen [Fri, 3 Jan 2020 11:50:35 +0000 (13:50 +0200)] 
Convert the only remaining send_frame() users to send_mlme()

Since send_mlme() now has support for the no_encrypt argument it is
possible to get rid of the remaining send_frame() uses.

Signed-off-by: Jouni Malinen <j@w1.fi>