]> git.ipfire.org Git - thirdparty/hostap.git/log
thirdparty/hostap.git
3 years agoQCA vendor command for CoAP offload processing
Yu Wang [Tue, 24 May 2022 10:10:23 +0000 (18:10 +0800)] 
QCA vendor command for CoAP offload processing

Add vendor command QCA_NL80211_VENDOR_SUBCMD_COAP_OFFLOAD to
enable/disable offload processing in firmware for CoAP messages
(RFC7252: The Constrained Application Protocol) or fetch the
CoAP messages cached during offload processing.

Signed-off-by: Yu Wang <quic_yyuwang@quicinc.com>
3 years agoAdd QCA vendor attribute for TIM beacon statistics
Jingxiang Ge [Wed, 15 Jun 2022 03:22:18 +0000 (11:22 +0800)] 
Add QCA vendor attribute for TIM beacon statistics

Add the following two vendor attributes to send TIM beacon
statistics to userspace which can be used for power saving:
QCA_WLAN_VENDOR_ATTR_LL_STATS_TIM_BEACON
QCA_WLAN_VENDOR_ATTR_LL_STATS_TIM_BEACON_ERR

Signed-off-by: Jingxiang Ge <quic_jge@quicinc.com>
3 years agoAdd QCA vendor interface for PASN offload to userspace
Vinay Gannevaram [Mon, 13 Jun 2022 11:43:50 +0000 (17:13 +0530)] 
Add QCA vendor interface for PASN offload to userspace

Define QCA vendor interface for PASN offload to userspace from the driver.

The driver can send this command as an event to a userspace component to
perform PASN authentication with a list of peers with which the driver
needs to do ranging. The userspace component, if capable of performing
PASN handshake, can perform PASN handshake with all the peer devices and
set the relevant keys by sending the
QCA_NL80211_VENDOR_SUBCMD_SECURE_RANGING_CONTEXT command for each peer
to the driver.

Once PASN handshake is completed with all requested peers, the userspace
component sends consolidated status for all the peers to the driver. The
consolidated report is required for the driver to understand that the
PASN handshake process is complete and whether it succeeded/failed for
each of the peers it was requested for. The secure ranging context is
configured only for the peers with which the PASN handshake succeeded.

When the driver requests PASN keys, the userspace component can set the
keys from its cache if those keys have not already expired and were
derived with the same source MAC address that is requested by the driver
instead of doing the full PASN handshake again.

If the driver detects that current keys of a peer are not valid anymore,
it sends a notification to userspace using the
QCA_NL80211_VENDOR_SUBCMD_PASN command and setting the action to
QCA_WLAN_VENDOR_PASN_ACTION_DELETE_SECURE_RANGING_CONTEXT. The userspace
component should delete the corresponding keys from its cache.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agoAdd a vendor attribute to configure concurrency policy for AP interface
Purushottam Kushwaha [Mon, 20 Jun 2022 13:08:17 +0000 (18:38 +0530)] 
Add a vendor attribute to configure concurrency policy for AP interface

Add a new QCA vendor attribute
QCA_WLAN_VENDOR_ATTR_CONCURRENT_POLICY_AP_CONFIG to
QCA_NL80211_VENDOR_SUBCMD_CONCURRENT_POLICY sub command to set the
concurrency policy for AP interface.
QCA_WLAN_VENDOR_ATTR_CONCURRENT_POLICY_AP_CONFIG uses the values
defined in enum qca_wlan_concurrent_ap_policy_config to specify
concurrency policy.

Signed-off-by: Purushottam Kushwaha <quic_pkushwah@quicinc.com>
3 years agoRename QCA_NL80211_VENDOR_SUBCMD_CONCURRENT_MULTI_STA_POLICY
Purushottam Kushwaha [Tue, 24 May 2022 10:52:20 +0000 (16:22 +0530)] 
Rename QCA_NL80211_VENDOR_SUBCMD_CONCURRENT_MULTI_STA_POLICY

Rename QCA_NL80211_VENDOR_SUBCMD_CONCURRENT_MULTI_STA_POLICY to
QCA_NL80211_VENDOR_SUBCMD_CONCURRENT_POLICY to allow extension for other
interface type(s). A subsequent commit will extend the renamed
definitions in a manner that is inconsistent with the current naming.

This is a precursor for AP/P2P concurrency policy configuration support
via updated vendor command QCA_NL80211_VENDOR_SUBCMD_CONCURRENT_POLICY.

Signed-off-by: Purushottam Kushwaha <quic_pkushwah@quicinc.com>
3 years agoEHT: Add 320 channel width support
Veerendranath Jakkam [Fri, 13 May 2022 16:17:41 +0000 (21:47 +0530)] 
EHT: Add 320 channel width support

Add initial changes to support 320 MHz channel width.

Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
Signed-off-by: Karthikeyan Periyasamy <quic_periyasa@quicinc.com>
3 years agoMove CHANWIDTH_* definitions from ieee80211_defs.h to defs.h
Aleti Nageshwar Reddy [Fri, 13 May 2022 16:17:40 +0000 (21:47 +0530)] 
Move CHANWIDTH_* definitions from ieee80211_defs.h to defs.h

Move most of CHANWIDTH_* definitions from ieee80211_defs.h to defs.h as
the definitions are getting used mostly for internal purpose only. Also
change prefix of the definitions to CONF_OPER_CHWIDTH_* and update in
all the files accordingly.

Leave the couple of VHT-specific exceptions to use the old defines (the
reason why they were originally added as VHT values), to avoid use of
clearly marked configuration values in information elements. In
addition, use the defines instead of magic values where appropriate.

Signed-off-by: Aleti Nageshwar Reddy <quic_anageshw@quicinc.com>
3 years agotests: Remove the 80+80 vs. 160 part from wpa2_ocv_ap_vht160_mismatch
Jouni Malinen [Thu, 16 Jun 2022 17:31:45 +0000 (20:31 +0300)] 
tests: Remove the 80+80 vs. 160 part from wpa2_ocv_ap_vht160_mismatch

This started failing with the OCV implementation change to ignore the
second segment when using a 160 MHz channel.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agotests: Make OCV negative test error cases more robust
Jouni Malinen [Thu, 16 Jun 2022 17:26:11 +0000 (20:26 +0300)] 
tests: Make OCV negative test error cases more robust

Try to avoid an exception while processing an exception that indicates
the test case failed. Explicit DISCONNECT command here can avoid the
undesired FAIL-BUSY from cleanup SCAN.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agoAdd QCA vendor event to indicate driver recovery after internal failures
Veerendranath Jakkam [Wed, 15 Jun 2022 14:10:21 +0000 (19:40 +0530)] 
Add QCA vendor event to indicate driver recovery after internal failures

Add QCA vendor event to indicate user space that the driver recovery is
completed after the internal failure reported with
QCA_NL80211_VENDOR_SUBCMD_HANG.

Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
3 years agoSet current_ssid before changing state to ASSOCIATING
Xinyue Ling [Mon, 13 Jun 2022 06:29:56 +0000 (14:29 +0800)] 
Set current_ssid before changing state to ASSOCIATING

For hidden GBK encoding of a Chinese SSID, both the UTF-8 and GBK
encoding profiles are added into wpa_supplicant to make sure the
connection succeeds. In this situation, wpa_supplicant_select_network()
will not be called so current_ssid is NULL when association begins.

Android monitors the WPA_EVENT_STATE_CHANGE event to get the SSID and
BSSID. When connecting to a Chinese SSID, in case of association
rejection happens, Android will report null SSID to OEM APP because
current_ssid is updated after wpa_supplicant_set_state(wpa_s,
WPA_ASSOCIATING), which may cause confusion.

Fix this by setting the current_ssid before changing state to
ASSOCIATING.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agoQCA vendor attribute to configure direct data path for audio traffic
Purushottam Kushwaha [Fri, 3 Jun 2022 09:44:24 +0000 (15:14 +0530)] 
QCA vendor attribute to configure direct data path for audio traffic

Add a new QCA vendor attribute
QCA_WLAN_VENDOR_ATTR_CONFIG_AUDIO_DATA_PATH to
QCA_NL80211_VENDOR_SUBCMD_SET_WIFI_CONFIGURATION to configure audio data
path.

Possible audio data paths are defined in enum qca_wlan_audio_data_path.

Signed-off-by: Purushottam Kushwaha <quic_pkushwah@quicinc.com>
3 years agoQCA vendor command support to get WLAN radio combinations
Kiran Kumar Lokere [Thu, 21 Apr 2022 17:50:00 +0000 (10:50 -0700)] 
QCA vendor command support to get WLAN radio combinations

Vendor command to get the WLAN radio combinations matrix supported by
the device which provides the device simultaneous radio configurations
such as standalone, dual band simultaneous, and single band
simultaneous.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agoOCV: Check the Frequency Segment 1 Channel Number only on 80+80 MHz
Jouni Malinen [Tue, 14 Jun 2022 14:19:27 +0000 (17:19 +0300)] 
OCV: Check the Frequency Segment 1 Channel Number only on 80+80 MHz

The initial OCV implementation validating this field in the OCI element
for both the 80+80 MHz and 160 MHz cases. However, IEEE Std 802.11-2020,
12.2.9 ("Requirements for Operating Channel Validation") limitis that
verification step for the 80+80 MHz case: "Verifying that, if operating
an 80+80 MHz operating class, the frequency segment 1 channel number ...
is equal to the Frequency Segment 1 Channel Number field of the OCI."

Remove this check for the 160 MHz case since there has been incorrect
interpretation on how the Frequency Segment 1 Channel Number field of
the OCI element is set in this case (using VHT rules for CCFS2). The
modified validation step is meets the real need here, is compliant with
the standard, and avoids potential interoperability issues when using
contiguous 160 MHz channels.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agoP2P: Use weighted preferred channel list for channel selection
Sreeramya Soratkal [Thu, 5 Nov 2020 16:25:55 +0000 (21:55 +0530)] 
P2P: Use weighted preferred channel list for channel selection

Previously, the driver could optionally (using QCA vendor command)
provide a preferred channel list to wpa_supplicant for channel selection
during the GO negotiation. Channel selection process can be more
efficient with the information of weights and flags of the preferred
channel list that can be provided by the driver. Use a weighted
preferred channel list provided by the driver for channel selection
during GO negotiation if such a list is available.

Signed-off-by: Sreeramya Soratkal <quic_ssramya@quicinc.com>
3 years agoQCA vendor attribute to configure RX link speed threshold for roaming
Jianmin Zhu [Wed, 18 May 2022 14:32:26 +0000 (22:32 +0800)] 
QCA vendor attribute to configure RX link speed threshold for roaming

Add QCA_ATTR_ROAM_CONTROL_RX_LINKSPEED_THRESHOLD value as the RX link
speed threshold to disable roaming. If the current link speed is above
the threshold, there is no need to roam.

Signed-off-by: Jianmin Zhu <quic_jianminz@quicinc.com>
3 years agoAdd QCA vendor attribute for DO_ACS to allow using existing scan entries
Purushottam Kushwaha [Thu, 12 May 2022 07:34:54 +0000 (13:04 +0530)] 
Add QCA vendor attribute for DO_ACS to allow using existing scan entries

Add a new QCA vendor attribute
QCA_WLAN_VENDOR_ATTR_ACS_LAST_SCAN_AGEOUT_TIME to
QCA_NL80211_VENDOR_SUBCMD_DO_ACS and opportunistically optimize time
taken for ACS scan. Avoid scanning the channels which were scanned
within last QCA_WLAN_VENDOR_ATTR_ACS_LAST_SCAN_AGEOUT_TIME milliseconds
and use scan results from the scan results cache for ACS scoring. For
other channels, perform ACS scan and use the received scan results.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agoP2P: Filter 6 GHz channels if peer doesn't support them
Qiwei Cai [Mon, 9 May 2022 05:16:37 +0000 (13:16 +0800)] 
P2P: Filter 6 GHz channels if peer doesn't support them

When 6 GHz channels are included in channel list of P2P Action frames
but some peer devices don't support the 6 GHz feature and cannot parse
P2P IE data correctly, P2P handshake will fail.

Remove 6 GHz channels from the P2P Action frames if the peer doesn't
support 6 GHz feature to avoid such failures.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agoReserve QCA vendor sub command id 206..212
Vikram Kandukuri [Mon, 16 May 2022 09:26:27 +0000 (14:56 +0530)] 
Reserve QCA vendor sub command id 206..212

This is reserved for QCA use.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agoRemove space before tab in QCA vendor commands
Jeff Johnson (QUIC) [Fri, 8 Apr 2022 20:19:53 +0000 (13:19 -0700)] 
Remove space before tab in QCA vendor commands

A few of the comments in the QCA vendor commands have a space
character before a tab. That is pointless, and some code style
checkers may complain about it, so remove the spaces.

Signed-off-by: Jeff Johnson <quic_jjohnson@quicinc.com>
3 years agoProxyARP: Clear bridge parameters on deinit only if hostapd set them
Jouni Malinen [Tue, 31 May 2022 08:53:05 +0000 (11:53 +0300)] 
ProxyARP: Clear bridge parameters on deinit only if hostapd set them

Skip the x_snoop_deinit() operations if hostapd did not actually
configure the parameters in the first place. While clearing these
specific parameters is unlikely to change how they were set outside the
scope of hostapd, it is better to leave them as-is to avoid surprises if
hostapd was not configured to use ProxyARP.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agohs20-osu-client: Explicit checks for snprintf() result
Jouni Malinen [Thu, 26 May 2022 21:23:25 +0000 (00:23 +0300)] 
hs20-osu-client: Explicit checks for snprintf() result

Get rid of the gcc warnings on potentially truncating the output buffer
by explicitly checking that there was enough room to write the full
string.

Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agoFIPS PRF: Avoid duplicate SHA1Init() functionality
Jouni Malinen [Thu, 26 May 2022 20:40:09 +0000 (23:40 +0300)] 
FIPS PRF: Avoid duplicate SHA1Init() functionality

The initialization values used for the FIPS 186-2 PRF are identical to
the ones used in SHA1Init(), so use that internal function instead of
maintaining a duplicate set of values here. fips186_2_prf() was already
using an internal SHA1Transform() function so using another internal
function does not make this any worse.

Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agoOpenSSL: Use internal FIPS 186-2 PRF with OpenSSL 3.0
Jouni Malinen [Thu, 26 May 2022 20:35:16 +0000 (23:35 +0300)] 
OpenSSL: Use internal FIPS 186-2 PRF with OpenSSL 3.0

OpenSSL 3.0 has deprecated the low-level SHA1 functions and does not
include an upper layer interface that could be used to use the
SHA1_Transform() function. Use the internal SHA-1 implementation instead
as a workaround.

While this type of duplicate implementation of SHA-1 is not really
ideal, this PRF is needed only for EAP-SIM/AKA and there does not seem
to be sufficient justification to try to get this working more cleanly
with OpenSSL 3.0.

Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agoSAE-PK: Fix build without AES-SIV
Jouni Malinen [Thu, 26 May 2022 17:45:37 +0000 (20:45 +0300)] 
SAE-PK: Fix build without AES-SIV

CONFIG_SAE_PK=y was not pulling in AES-SIV implementation even though it
needs this.

Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agoOpenSSL: Convert more crypto_ec_key routines to new EVP API
Jouni Malinen [Thu, 26 May 2022 15:54:51 +0000 (18:54 +0300)] 
OpenSSL: Convert more crypto_ec_key routines to new EVP API

This avoids some more uses of the deprecated EC_KEY API when using
OpenSSL 3.0.

Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agoOpenSSL: crypto_ec_key_get_public_key() using new EVP_PKEY API
Jouni Malinen [Thu, 26 May 2022 14:07:00 +0000 (17:07 +0300)] 
OpenSSL: crypto_ec_key_get_public_key() using new EVP_PKEY API

Implement crypto_ec_key_get_public_key() without the deprecated EC_KEY
API when using OpenSSL 3.0.

Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agoOpenSSL: crypto_ec_key_get_private_key() using new EVP_PKEY API
Jouni Malinen [Thu, 26 May 2022 13:40:18 +0000 (16:40 +0300)] 
OpenSSL: crypto_ec_key_get_private_key() using new EVP_PKEY API

Implement crypto_ec_key_get_private_key() without the deprecated EC_KEY
API when using OpenSSL 3.0.

Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agocrypto: Convert crypto_ec_key_get_public_key() to return new ec_point
Jouni Malinen [Thu, 26 May 2022 13:34:36 +0000 (16:34 +0300)] 
crypto: Convert crypto_ec_key_get_public_key() to return new ec_point

This makes it easier for the crypto library/wrapper to avoid direct
references to internal EC key parameters.

Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agocrypto: Convert crypto_ec_key_get_private_key() to return new bignum
Jouni Malinen [Thu, 26 May 2022 11:23:46 +0000 (14:23 +0300)] 
crypto: Convert crypto_ec_key_get_private_key() to return new bignum

This makes it easier for the crypto library/wrapper to avoid direct
references to internal EC key parameters.

Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agoOpenSSL: Fix a memory leak on crypto_hash_init() error path
Jouni Malinen [Thu, 26 May 2022 13:04:24 +0000 (16:04 +0300)] 
OpenSSL: Fix a memory leak on crypto_hash_init() error path

The EVP_MAC context data needs to be freed on error paths.

Fixes: e31500adea72 ("OpenSSL: Implement HMAC using the EVP_MAC API")
Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agoOpenSSL: Free OSSL_DECODER_CTX in tls_global_dh()
Jouni Malinen [Thu, 26 May 2022 11:01:28 +0000 (14:01 +0300)] 
OpenSSL: Free OSSL_DECODER_CTX in tls_global_dh()

The conversion to the new OpenSSL 3.0 API had forgotten to free the
context structure.

Fixes: bcd299b326d8 ("OpenSSL: Convert DH/DSA parameter loading to new API")
Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agoOpenSSL: crypto_ec_key_parse_{priv,pub}() without EC_KEY API
Jouni Malinen [Thu, 26 May 2022 10:59:25 +0000 (13:59 +0300)] 
OpenSSL: crypto_ec_key_parse_{priv,pub}() without EC_KEY API

Avoid using the deprecated EC_KEY API when building these functions with
OpenSSL 3.0.

Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agotests: imsi_privacy_attr
Jouni Malinen [Wed, 25 May 2022 17:19:52 +0000 (20:19 +0300)] 
tests: imsi_privacy_attr

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agoEAP-SIM/AKA peer: IMSI privacy attribute
Jouni Malinen [Wed, 25 May 2022 17:18:40 +0000 (20:18 +0300)] 
EAP-SIM/AKA peer: IMSI privacy attribute

Extend IMSI privacy functionality to allow an attribute (in name=value
format) to be added using the new imsi_privacy_attr parameter.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agotests: Testing functionality to discard DPP Public Action frames
Jouni Malinen [Tue, 24 May 2022 20:30:39 +0000 (23:30 +0300)] 
tests: Testing functionality to discard DPP Public Action frames

This can be used to make sure wpa_supplicant does not process DPP
messages sent in Public Action frames when a test setup is targeting
DPP-over-TCP.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agotests: Add forgotten files for expired IMSI privacy cert tests
Jouni Malinen [Tue, 24 May 2022 18:16:36 +0000 (21:16 +0300)] 
tests: Add forgotten files for expired IMSI privacy cert tests

Fixes: 426932f061c5 ("tests: EAP-AKA and expired imsi_privacy_key")
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agotests: sigma_dut and DPP curve-from-URI special functionality
Jouni Malinen [Tue, 24 May 2022 09:49:27 +0000 (12:49 +0300)] 
tests: sigma_dut and DPP curve-from-URI special functionality

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agotests: sigma_dut controlled STA and EAP-AKA parameters
Jouni Malinen [Mon, 23 May 2022 21:24:54 +0000 (00:24 +0300)] 
tests: sigma_dut controlled STA and EAP-AKA parameters

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agoRename wpa_supplicant imsi_privacy_key configuration parameter
Jouni Malinen [Mon, 23 May 2022 21:07:12 +0000 (00:07 +0300)] 
Rename wpa_supplicant imsi_privacy_key configuration parameter

Use imsi_privacy_cert as the name of the configuration parameter for the
X.509v3 certificate that contains the RSA public key needed for IMSI
privacy. The only allowed format for this information is a PEM-encoded
X.509 certificate, so the previous name was somewhat confusing.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agotests: Update VM setup example to use Ubuntu 22.04 and UML
Jouni Malinen [Mon, 23 May 2022 20:55:12 +0000 (23:55 +0300)] 
tests: Update VM setup example to use Ubuntu 22.04 and UML

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agotests: EAP-AKA and expired imsi_privacy_key
Jouni Malinen [Mon, 23 May 2022 20:51:32 +0000 (23:51 +0300)] 
tests: EAP-AKA and expired imsi_privacy_key

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agoEAP-SIM peer: Free imsi_privacy_key on an error path
Jouni Malinen [Mon, 23 May 2022 20:49:49 +0000 (23:49 +0300)] 
EAP-SIM peer: Free imsi_privacy_key on an error path

This is an allocated resource so it needs to be free on the error path.

Fixes: 42871a5d25ea ("EAP-SIM/AKA peer: IMSI privacy")
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agoDo not try to use network profile with invalid imsi_privacy_key
Jouni Malinen [Mon, 23 May 2022 20:46:37 +0000 (23:46 +0300)] 
Do not try to use network profile with invalid imsi_privacy_key

Disable a network profile that has set the imsi_privacy_key if a valid
key cannot be read from the specified file. Previously, this check was
done only after having associated, but there is no point in associating
just to see EAP authentication fail in such a case. This is needed for
avoiding connection attempts if the X.509 certificate for IMSI privacy
has expired.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agoOpenSSL: Refuse to accept expired RSA certificate
Jouni Malinen [Mon, 23 May 2022 20:32:26 +0000 (23:32 +0300)] 
OpenSSL: Refuse to accept expired RSA certificate

This is needed for IMSI privacy to avoid trying to use an expired public
key.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agoOpenSSL: Include rsa.h for OpenSSL 3.0
Jouni Malinen [Sun, 22 May 2022 20:13:28 +0000 (23:13 +0300)] 
OpenSSL: Include rsa.h for OpenSSL 3.0

This is needed to get RSA_PKCS1_OAEP_PADDING.

Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agoOpenSSL: Drop security level to 0 with OpenSSL 3.0 when using TLS 1.0/1.1
Jouni Malinen [Sun, 22 May 2022 14:01:35 +0000 (17:01 +0300)] 
OpenSSL: Drop security level to 0 with OpenSSL 3.0 when using TLS 1.0/1.1

Commit 9afb68b03976 ("OpenSSL: Allow systemwide secpolicy overrides for
TLS version") with commit 58bbcfa31b18 ("OpenSSL: Update security level
drop for TLS 1.0/1.1 with OpenSSL 3.0") allow this workaround to be
enabled with an explicit network configuration parameter. However, the
default settings are still allowing TLS 1.0 and 1.1 to be negotiated
just to see them fail immediately when using OpenSSL 3.0. This is not
exactly helpful especially when the OpenSSL error message for this
particular case is "internal error" which does not really say anything
about the reason for the error.

It is is a bit inconvenient to update the security policy for this
particular issue based on the negotiated TLS version since that happens
in the middle of processing for the first message from the server.
However, this can be done by using the debug callback for printing out
the received TLS messages during processing.

Drop the OpenSSL security level to 0 if that is the only option to
continue the TLS negotiation, i.e., when TLS 1.0/1.1 are still allowed
in wpa_supplicant default configuration and OpenSSL 3.0 with the
constraint on MD5-SHA1 use.

Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agotests: Work around reentrant logging issues due to __del__ misuse
Johannes Berg [Sun, 22 May 2022 08:46:09 +0000 (11:46 +0300)] 
tests: Work around reentrant logging issues due to __del__ misuse

Unfortunately, some objects (WlantestCapture, WpaSupplicant
and wpaspy.Ctrl) use __del__ and actually have some logic
there. This is more or less wrong, and we should be using
context managers for it. However, cleaning that up is a
pretty large task.

Unfortunately, __del__ can cause reentrant logging which is
wrong too, because it might be invoked while in the middle
of a logging call, and the __del__ of these objects closes
connections and logs while doing that.

Since we're (likely) using cpython, we can work around this
by explicitly calling gc.collect() in a context where the
logging and close is fine, not only ensuring that all the
connections are closed properly before the next test, but
also fixing the issue with reentrant logging.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
3 years agotests: Clean up failed test list in parallel-vm.py
Jouni Malinen [Sun, 22 May 2022 08:43:38 +0000 (11:43 +0300)] 
tests: Clean up failed test list in parallel-vm.py

Instead of printing a very long line of the failed tests, print the test
case names on separate lines up to the number of available lines at the
bottom of the screen. This avoids some issues with curses and overlong
lines. Furthermore, display the last failed test cases instead of
somewhat confusing sequence of test case names from the VMs.

Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agotests: Support pycryptodome
Jouni Malinen [Sun, 22 May 2022 08:03:39 +0000 (11:03 +0300)] 
tests: Support pycryptodome

This is a drop-in replacement for pycrypto and the only version that is
now available in Ubuntu 22.04.

Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agotests: Set ECB mode for AES explicitly to work with cryptodome
Jouni Malinen [Sun, 22 May 2022 08:07:05 +0000 (11:07 +0300)] 
tests: Set ECB mode for AES explicitly to work with cryptodome

AES.new() needs the mode to be set explicitly.

Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agotests: sigma_dut DPP TCP Configurator as initiator with addr from URI
Jouni Malinen [Thu, 19 May 2022 19:54:44 +0000 (22:54 +0300)] 
tests: sigma_dut DPP TCP Configurator as initiator with addr from URI

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agoDPP: Allow TCP destination (address/port) to be used from peer URI
Jouni Malinen [Thu, 19 May 2022 19:53:36 +0000 (22:53 +0300)] 
DPP: Allow TCP destination (address/port) to be used from peer URI

tcp_addr=from-uri can now be used as a special case for initiating
DPP-over-TCP to the destination indicated in the peer bootstrapping URI.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agotests: DPP URI with host info
Jouni Malinen [Thu, 19 May 2022 14:29:51 +0000 (17:29 +0300)] 
tests: DPP URI with host info

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agoDPP: Host information in bootstrapping URI
Jouni Malinen [Thu, 19 May 2022 14:30:41 +0000 (17:30 +0300)] 
DPP: Host information in bootstrapping URI

Parse the host information, if present, in bootstrapping URI and allow
such information to be added when generating the URI.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agoEHT: Do not check HE PHY capability info reserved fields
Jouni Malinen [Mon, 16 May 2022 16:39:57 +0000 (19:39 +0300)] 
EHT: Do not check HE PHY capability info reserved fields

Only use the bandwidth bits that are applicable for the current
operating band. This avoids use of reserved bits when determining the
length of the Support EHT-MCS And NSS Set field length.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agotests: Flush scan table in ap_wps_priority to make it more robust
Jouni Malinen [Mon, 16 May 2022 16:09:23 +0000 (19:09 +0300)] 
tests: Flush scan table in ap_wps_priority to make it more robust

This test case could fail if there was an old BSS entry from a previous
test case in the scan results.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agotests: Update ap_wpa2_psk_ext_delayed_ptk_rekey to match implementation
Jouni Malinen [Mon, 16 May 2022 16:06:47 +0000 (19:06 +0300)] 
tests: Update ap_wpa2_psk_ext_delayed_ptk_rekey to match implementation

This test case was checking the exact key info bits in EAPOL-Key frames
during PTK rekeying as such, needs to be updated to match the
implementation change on the Secure bit setting.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agoUse Secure=1 in PTK rekeying EAPOL-Key msg 1/4 and 2/4
Jouni Malinen [Mon, 16 May 2022 14:34:12 +0000 (17:34 +0300)] 
Use Secure=1 in PTK rekeying EAPOL-Key msg 1/4 and 2/4

IEEE Std 802.11-2020 is ambiguous on how the Secure bit is set in
EAPOL-Key msg 1/4 and 2/4 in the case where 4-way handshake is use to
rekey the PTK. 12.7.2 describes this with "set to 1 once the initial key
exchange is complete" while 12.7.6 shows EAPOL-Key msg 1/4 and 2/4 using
Secure=0 without any consideration on whether the handshake is for
rekeying.

TGme seems to be moving towards clarifying this to use Secure=1 based on
there being a shared PTKSA between the Authenticator and the Supplicant.
In other words, this would use Secure=1 in EAPOL-Key msg 1/4 and 2/4 in
the case of rekeying. Change implementation to match that. This bit was
already practically ignored on the reception side, so this should not
have impact on actual functionality beyond this one bit changing its
value in the frame.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agotests: Wait for request before responding in dscp_response
Jouni Malinen [Mon, 9 May 2022 08:45:33 +0000 (11:45 +0300)] 
tests: Wait for request before responding in dscp_response

There was a possible race condition here between the hostapd request
transmission and wpa_supplicant response command. Wait for the
wpa_supplicant event that indicates reception of the request before
issuing the DSCP_RESP command to avoid failures.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agoSimplify wpa_bss_get_vendor_ie_multi_beacon() bounds checking
Jouni Malinen [Sun, 8 May 2022 14:28:58 +0000 (17:28 +0300)] 
Simplify wpa_bss_get_vendor_ie_multi_beacon() bounds checking

This makes it easier for static analyzers to understand.

Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agoDPP: Debug print if not relay is available for PKEX exchange
Jouni Malinen [Sun, 8 May 2022 14:25:09 +0000 (17:25 +0300)] 
DPP: Debug print if not relay is available for PKEX exchange

This makes it easier to see what happened with the received PKEX frame.

Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agoFST: More robust bounds checking of local data in fst_dump_mb_ies()
Jouni Malinen [Sun, 8 May 2022 14:18:58 +0000 (17:18 +0300)] 
FST: More robust bounds checking of local data in fst_dump_mb_ies()

Check the full MBIE length against the buffer length explicitly before
the debug print. This is for locally generated data, so the bounds
checking is not critical here, but it is better to use proper checking
anyway to avoid static analyzer complaints.

Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agoSAE: Make Anti-Clogging token element parsing simpler
Jouni Malinen [Sun, 8 May 2022 14:14:34 +0000 (17:14 +0300)] 
SAE: Make Anti-Clogging token element parsing simpler

This will hopefully be easier for static analyzers to understand.

Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agoSimplify DSCP policy parsing
Jouni Malinen [Sun, 8 May 2022 14:09:08 +0000 (17:09 +0300)] 
Simplify DSCP policy parsing

Make the bounds checking easier for static analyzers to understand.

Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agoP2P: Maintain ip_pool bitfield index separately
Jouni Malinen [Sun, 8 May 2022 13:59:31 +0000 (16:59 +0300)] 
P2P: Maintain ip_pool bitfield index separately

Avoid the somewhat confusing mechanism of determining the bitfield index
from the assigned IP address to make this easier for static analyzers.

Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agoCheck sscanf() return value in TWT_SETUP parsing
Jouni Malinen [Sun, 8 May 2022 13:55:45 +0000 (16:55 +0300)] 
Check sscanf() return value in TWT_SETUP parsing

Reject invalid values instead of proceeding.

Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agoEAP-SAKA: Simplify attribute parser for static analyzers
Jouni Malinen [Sun, 8 May 2022 13:53:38 +0000 (16:53 +0300)] 
EAP-SAKA: Simplify attribute parser for static analyzers

Make bounds checking in eap_sake_parse_attributes() easier to analyze.

Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agoGAS: Limit maximum comeback delay value
Jouni Malinen [Sun, 8 May 2022 09:02:40 +0000 (12:02 +0300)] 
GAS: Limit maximum comeback delay value

Limit the GAS comeback delay to 60000 TUs, i.e., about 60 seconds. This
is mostly to silence static analyzers that complain about unbounded
value from external sources even though this is clearly bounded by being
a 16-bit value.

Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agoWNM: Try to make bounds checking easier for static analyzers
Jouni Malinen [Sun, 8 May 2022 09:19:42 +0000 (12:19 +0300)] 
WNM: Try to make bounds checking easier for static analyzers

The length of the URL, i.e., pos[0], is verified here to be within the
bounds of the recieved message, but that seemed to be done in a manner
that might bee too complex for static analyzers to understand.

Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agoSimplify wpa_parse_kde_ies()
Jouni Malinen [Sun, 8 May 2022 09:55:32 +0000 (12:55 +0300)] 
Simplify wpa_parse_kde_ies()

Use a local variable to store the full IE length instead of calculating
it multiple times.

Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agoSimplify wpa_parse_generic()
Jouni Malinen [Sun, 8 May 2022 09:50:14 +0000 (12:50 +0300)] 
Simplify wpa_parse_generic()

Use local variables and common checking of the selector (or vendor
specific IE header) to make the bounds checking easier to understand.

Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agoBSS coloring: Fix bitmap check
Jouni Malinen [Sun, 8 May 2022 09:33:15 +0000 (12:33 +0300)] 
BSS coloring: Fix bitmap check

BIT(r) is not sufficient here since it does not cover 64 bit values.
Write this out with 1ULL to be large enough for the shift operation.

Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agoCheck he_cap pointer in hostapd_set_freq_params() consistently
Jouni Malinen [Sat, 7 May 2022 21:39:20 +0000 (00:39 +0300)] 
Check he_cap pointer in hostapd_set_freq_params() consistently

The EHT changes made this checking inconsistent. If he_cap can be NULL
in case of EHT being enabled, better make sure it does not get
dereferenced without an explicit check.

Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agoDPP: Verify that crypto_ec_point_to_bin() succeeds
Jouni Malinen [Sat, 7 May 2022 21:31:25 +0000 (00:31 +0300)] 
DPP: Verify that crypto_ec_point_to_bin() succeeds

This is testing code, but it's better to check the return value
explicitly even if this were not really able to fail in practice.

Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agonl80211: Verify that nla_put_flag() succeeds for background radar
Jouni Malinen [Sat, 7 May 2022 21:29:48 +0000 (00:29 +0300)] 
nl80211: Verify that nla_put_flag() succeeds for background radar

Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agoFST: Make sure get_hw_modes() callback is set for hostapd
Jouni Malinen [Sat, 7 May 2022 21:27:51 +0000 (00:27 +0300)] 
FST: Make sure get_hw_modes() callback is set for hostapd

It looks like fst_wpa_obj::get_hw_modes would have been left
uninitialized in hostapd. It is not obviously clear why this would not
have caused issues earlier, but in any case, better make this set
properly to allow unexpected behavior should that function pointer ever
be used.

Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agoP2P: Explicit nul termination of the generated passphrase
Jouni Malinen [Sat, 7 May 2022 20:58:03 +0000 (23:58 +0300)] 
P2P: Explicit nul termination of the generated passphrase

Nul terminate the struct p2p_go_neg_results::passphrase explicitly to
keep static analyzers happier. This was already nul terminated in
practice due to the full array being cleared to zero on initialization,
but that was apparently not clear enough for some analyzers.

Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agotests: Add coverage for testing disabling collocated 6 GHz scan
Ilan Peer [Sun, 24 Apr 2022 09:57:54 +0000 (12:57 +0300)] 
tests: Add coverage for testing disabling collocated 6 GHz scan

Extend 'scan' test to cover 'non_coloc_6ghz' parsing.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
3 years agoscan: Add option to disable 6 GHz collocated scanning
Ilan Peer [Sun, 24 Apr 2022 09:57:53 +0000 (12:57 +0300)] 
scan: Add option to disable 6 GHz collocated scanning

Add a parameter (non_coloc_6ghz=1) to the manual scan command to disable
6 GHz collocated scanning.

This option can be used to disable 6 GHz collocated scan logic. Note
that due to limitations on Probe Request frame transmissions on the 6
GHz band mandated in IEEE Std 802.11ax-2021 it is very likely that
non-PSC channels would be scanned passively and this can take a
significant amount of time.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
3 years agonl80211: Set NL80211_SCAN_FLAG_COLOCATED_6GHZ in scan
Tova Mussai [Sun, 24 Apr 2022 09:57:52 +0000 (12:57 +0300)] 
nl80211: Set NL80211_SCAN_FLAG_COLOCATED_6GHZ in scan

Set NL80211_SCAN_FLAG_COLOCATED_6GHZ in the scan parameters to enable
scanning for co-located APs discovered based on neighbor reports from
the 2.4/5 GHz bands when not scanning passively. Do so only when
collocated scanning is not disabled by higher layer logic.

Signed-off-by: Tova Mussai <tova.mussai@intel.com>
Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Avraham Stern <avraham.stern@intel.com>
3 years agohostapd: Add the destination address of unsolicited Probe Response frame
MeiChia Chiu [Fri, 6 May 2022 03:02:36 +0000 (11:02 +0800)] 
hostapd: Add the destination address of unsolicited Probe Response frame

Without this, hostapd generates Probe Response frames with the null
destination address when hostapd enables unsolicited Probe Response
frame transmission. Fix this to use the broadcast address instead.

Fixes: 024b4b2a298f ("AP: Unsolicited broadcast Probe Response configuration")
Signed-off-by: MeiChia Chiu <meichia.chiu@mediatek.com>
3 years agoAdd -q flag to hostapd in order to control log level
Orr Mazor [Tue, 3 May 2022 14:54:28 +0000 (16:54 +0200)] 
Add -q flag to hostapd in order to control log level

This allows the debugging level to be reduced from hostapd command line
similarly to the already existing flag in wpa_supplicant.

Signed-off-by: Orr Mazor <o.mazor@genexis.eu>
3 years agotests: WPA2-EAP AP with PMF and EAP frame injection
Jouni Malinen [Sat, 7 May 2022 14:46:07 +0000 (17:46 +0300)] 
tests: WPA2-EAP AP with PMF and EAP frame injection

Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agoDiscard unencrypted EAPOL/EAP when TK is set and PMF is enabled (AP)
Jouni Malinen [Sat, 7 May 2022 15:10:17 +0000 (18:10 +0300)] 
Discard unencrypted EAPOL/EAP when TK is set and PMF is enabled (AP)

RSN design is supposed to encrypt all Data frames, including EAPOL
frames, once the TK has been configured. However, there are deployed
implementations that do not really follow this design and there are
various examples from the older uses of EAPOL frame where those frames
were not encrypted. As such, strict filtering of unencrypted EAPOL
frames might results in undesired interoperation issues.

However, some of the most important cases of missing EAPOL frame
encryption should be possible to handle without causing too significant
issues. These are for cases where an attacker could potentially cause an
existing association to be dropped when PMF is used. EAPOL-Start and
EAPOL-Logoff are potential candidate for such attacks since those frames
could be used to terminate an authentication or initiate a new EAP
authentication. Such an attack could result in the station ending up
disconnecting or at minimum, getting into somewhat mismatching state
with the AP.

Drop EAPOL-Start/Logoff/EAP frames on the AP/Authenticator when it is
known that it was not encrypted but should have been and when PMF is
enabled. While it would be correct to drop this even without PMF, that
does not provide any significant benefit since it is trivial to force
disconnection in no-PMF cases. It should also be noted that not all
drivers provide information about the encryption status of the EAPOL
frames and this change has no impact with drivers that do not indicate
whether the frame was encrypted.

Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agoDiscard unencrypted EAPOL-EAP when TK is set and PMF is enabled
Jouni Malinen [Sat, 7 May 2022 14:42:51 +0000 (17:42 +0300)] 
Discard unencrypted EAPOL-EAP when TK is set and PMF is enabled

RSN design is supposed to encrypt all Data frames, including EAPOL
frames, once the TK has been configured. However, there are deployed
implementations that do not really follow this design and there are
various examples from the older uses of EAPOL frame where those frames
were not encrypted. As such, strict filtering of unencrypted EAPOL
frames might results in undesired interoperation issues.

However, some of the most important cases of missing EAPOL frame
encryption should be possible to handle without causing too significant
issues. These are for cases where an attacker could potentially cause an
existing association to be dropped when PMF is used. EAP-Request is one
potential candidate for such attacks since that frame could be used to
initiate a new EAP authentication and the AP/Authenticator might not
allow that to complete or a large number of EAP-Request frames could be
injected to exceed the maximum number of EAP frames. Such an attack
could result in the station ending up disconnecting or at minimum,
getting into somewhat mismatching state with the AP.

Drop EAPOL-EAP frames when it is known that it was not encrypted but
should have been and when PMF is enabled. While it would be correct to
drop this even without PMF, that does not provide any significant
benefit since it is trivial to force disconnection in no-PMF cases. It
should also be noted that not all drivers provide information about the
encryption status of the EAPOL frames and this change has no impact with
drivers that do not indicate whether the frame was encrypted.

Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agoDiscard unencrypted EAPOL-Key msg 1/4 when TK is set and PMF is enabled
Jouni Malinen [Sat, 7 May 2022 08:54:16 +0000 (11:54 +0300)] 
Discard unencrypted EAPOL-Key msg 1/4 when TK is set and PMF is enabled

RSN design is supposed to encrypt all Data frames, including EAPOL
frames, once the TK has been configured. However, there are deployed
implementations that do not really follow this design and there are
various examples from the older uses of EAPOL frame where those frames
were not encrypted. As such, strict filtering of unencrypted EAPOL
frames might results in undesired interoperation issues.

However, some of the most important cases of missing EAPOL frame
encryption should be possible to handle without causing too significant
issues. These are for cases where an attacker could potentially cause an
existing association to be dropped when PMF is used. EAPOL-Key msg 1/4
is one potential candidate for such attacks since that frame could be
used to initiate a 4-way handshake that the real AP might never complete
and the station might end up disconnecting because of that or at
minimum, getting into somewhat mismatching state with the AP.

Drop EAPOL-Key msg 1/4 when it is known that it was not encrypted but
should have been and when PMF is enabled. While it would be correct to
drop this even without PMF, that does not provide any significant
benefit since it is trivial to force disconnection in no-PMF cases. It
should also be noted that not all drivers provide information about the
encryption status of the EAPOL frames and this change has no impact with
drivers that do not indicate whether the frame was encrypted.

Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agoDo not prevent Michael MIC error report based on disallowed PTK0 rekey
Jouni Malinen [Sat, 7 May 2022 08:14:50 +0000 (11:14 +0300)] 
Do not prevent Michael MIC error report based on disallowed PTK0 rekey

EAPOL-Key Request frame with Error=1 is not really a request for a new
key, so allow that frame to be sent even if PTK0 rekey is not allowed
since the supplicant is required to report Michael MIC errors to the
authenticator.

Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agoProvide information about the encryption status of received EAPOL frames
Jouni Malinen [Fri, 6 May 2022 21:38:35 +0000 (00:38 +0300)] 
Provide information about the encryption status of received EAPOL frames

This information was already available from the nl80211 control port RX
path, but it was not provided to upper layers within wpa_supplicant and
hostapd. It can be helpful, so parse the information from the driver
event.

Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agoFILS: Set pairwise_set when configuring TK after association
Jouni Malinen [Sat, 7 May 2022 17:34:07 +0000 (20:34 +0300)] 
FILS: Set pairwise_set when configuring TK after association

sm->pairwise_set needs to be set whenever the TK has been configured to
the driver to request following EAPOL frames to be encrypted (or more
specifically, not to request them to not be encrypted). The FILS case
missed this setting and that could result in rekeying or
reauthentication in an associated started with FILS not working
correctly.

Fixes: da24c5aa1c47 ("FILS: Set TK after association (AP)")
Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agoFix no_encrypt flag in control port TX for rekeying
Jouni Malinen [Fri, 6 May 2022 21:58:41 +0000 (00:58 +0300)] 
Fix no_encrypt flag in control port TX for rekeying

The wpa_supplicant check for whether a TK is configured into the driver
was broken during the time this information is needed for rekeying or
reauthenticating with another 4-way handshake. sm->ptk.installed is not
set at the point the EAPOL-Key msg 4/4 is sent and while that means the
initial 4-way handshake needs to prevent encryption, the consecutive
4-way handshake must not be doing that since the old key (TK) is still
in the driver. Fix this so that the EAPOL-Key msg 4/4 during rekeying
does not get transmitted without encryption.

Fixes: a79ed0687197 ("Add no_encrypt flag for control port TX")
Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agotests: PMF and EAPOL-Key msg 1/4 injection
Jouni Malinen [Sat, 7 May 2022 08:13:43 +0000 (11:13 +0300)] 
tests: PMF and EAPOL-Key msg 1/4 injection

Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agoWPA: Discard EAPOL-Key msg 1/4 with corrupted information elements
Domien Schepers [Thu, 5 May 2022 19:53:26 +0000 (21:53 +0200)] 
WPA: Discard EAPOL-Key msg 1/4 with corrupted information elements

Currently a corrupted handshake message 1/4 causes the client to
disconnect from the network. This can lead to a denial-of-service
vulnerability allowing an adversary to forcibly disconnect a client from
protected networks even when Wi-Fi Management Frame Protection (MFP) is
enforced if the driver allows unencrypted EAPOL-Key frames to be
received after key configuration..

Fix this by discarding the corrupted handshake message 1/4.

This issue was discovered by Domien Schepers (Northeastern University)
and Mathy Vanhoef (imec-DistriNet, KU Leuven).

Signed-off-by: Domien Schepers <schepers.d@northeastern.edu>
3 years agotests: Do not require disconnection in ap_wpa2_psk_supp_proto_msg_1_invalid_kde
Jouni Malinen [Sat, 7 May 2022 10:40:56 +0000 (13:40 +0300)] 
tests: Do not require disconnection in ap_wpa2_psk_supp_proto_msg_1_invalid_kde

The wpa_supplicant implementation for this functionality is going to be
changed to not require disconnection, so prepare the test case to not
fail.

Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agotests: WPA2-PSK with PMF and Association Request frame injection
Jouni Malinen [Sat, 7 May 2022 15:50:58 +0000 (18:50 +0300)] 
tests: WPA2-PSK with PMF and Association Request frame injection

Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agoCheck need for SA Query/assoc comeback before updating RSNE parameters
Jouni Malinen [Sat, 7 May 2022 15:49:57 +0000 (18:49 +0300)] 
Check need for SA Query/assoc comeback before updating RSNE parameters

wpa_validate_wpa_ie() might update sm->* values, so it should not be
allowed for an existing STA entry if that STA has negotiated MFP to be
used for the association. Fix this by first checking whether an SA Query
procedure needs to be initiated. In particular, this prevents a
potential bypass of the disconnection protection.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agotests: EHT open connection
Veerendranath Jakkam [Tue, 3 May 2022 19:04:51 +0000 (00:34 +0530)] 
tests: EHT open connection

Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
3 years agoACS: Send EHT enabled info to driver
Veerendranath Jakkam [Tue, 3 May 2022 19:04:50 +0000 (00:34 +0530)] 
ACS: Send EHT enabled info to driver

The driver can consider EHT specific parameters such as the puncture
pattern for ACS when this flag attribute is indicated by userspace.

Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
3 years agonl80211: Don't force VHT channel definition with EHT
Veerendranath Jakkam [Tue, 3 May 2022 19:04:49 +0000 (00:34 +0530)] 
nl80211: Don't force VHT channel definition with EHT

Add a check to avoid sending VHT channel definition when EHT is enabled
in the 2.4 GHz band since the 2.4 GHz band isn't supposed to use VHT
operations. Also add EHT enabled info into debug prints.

Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
3 years agoEHT: Add [EHT] flag into AP mode STA command
Veerendranath Jakkam [Tue, 3 May 2022 19:04:48 +0000 (00:34 +0530)] 
EHT: Add [EHT] flag into AP mode STA command

This indicates whether an associated stations supports EHT.

Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>