]> git.ipfire.org Git - thirdparty/hostap.git/log
thirdparty/hostap.git
4 years agoAdd EAPOL_TX command to extend ext_eapol_frame_io possibilities
Jouni Malinen [Mon, 1 Feb 2021 14:57:14 +0000 (16:57 +0200)] 
Add EAPOL_TX command to extend ext_eapol_frame_io possibilities

This makes it convenient for an external test script to use
ext_eapol_frame_io=1 to delay and/or modify transmission of EAPOL-Key
msg 1/4 without having to use separate frame injection mechanisms.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoReport EAPOL-RX events for testing purposes
Jouni Malinen [Sat, 30 Jan 2021 09:42:04 +0000 (11:42 +0200)] 
Report EAPOL-RX events for testing purposes

This makes it more convenient to track EAPOL frame reception from an
external test script.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoAdd REKEY_PTK to allow upper layer request to force PTK rekeying
Jouni Malinen [Fri, 29 Jan 2021 18:17:22 +0000 (20:17 +0200)] 
Add REKEY_PTK to allow upper layer request to force PTK rekeying

"REKEY_PTK <STA MAC address>" can now be used to force rekeying of the
PTK for the specified associated STA.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agowlantest: TKIP frame reassembly for Michael MIC check in fragmented case
Jouni Malinen [Mon, 8 Feb 2021 16:38:39 +0000 (18:38 +0200)] 
wlantest: TKIP frame reassembly for Michael MIC check in fragmented case

Reassemble the full MSDU when processing TKIP protected fragmented
frames so that the Michael MIC can be validated once the last fragment
has been received.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agowlantest: Report decrypted TKIP frames even if cannot check Michael MIC
Jouni Malinen [Sat, 30 Jan 2021 15:28:49 +0000 (17:28 +0200)] 
wlantest: Report decrypted TKIP frames even if cannot check Michael MIC

This can be useful for debugging, so return successfully decrypted TKIP
frame even if the Michael MIC cannot be verified (fragment reassembly
not yet supported) or if the Michael MIC value is incorrect. Add a note
in the frame to point out that the Michael MIC was not verified or is
incorrect.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agotests: WPA2-PSK AP and GTK rekey request from multiple stations
Jouni Malinen [Mon, 10 May 2021 22:05:22 +0000 (01:05 +0300)] 
tests: WPA2-PSK AP and GTK rekey request from multiple stations

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoSkip GTK rekeying request if rekeying already in process
Jouni Malinen [Mon, 10 May 2021 22:03:57 +0000 (01:03 +0300)] 
Skip GTK rekeying request if rekeying already in process

Do not start yet another rekeying of GTK when receiving an EAPOL-Key
request frame at the point when the GTK is already being rekeyed. This
fixes issues where the AP might end up configuring a different GTK than
the one it sends to the associated stations.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoAdd QCA vendor definitions for DFS radar history
Hu Wang [Thu, 15 Apr 2021 08:03:39 +0000 (16:03 +0800)] 
Add QCA vendor definitions for DFS radar history

Introduce definitions for QCA vendor specific subcommands and attributes
to report DFS radar history.

Signed-off-by: Hu Wang <huw@codeaurora.org>
4 years agotests: Extend estimated throughput testing
Jouni Malinen [Fri, 7 May 2021 10:05:21 +0000 (13:05 +0300)] 
tests: Extend estimated throughput testing

Cover VHT160 and HE cases.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoPrefer 6 GHz APs for connection in BSS selection
Vamsi Krishna [Tue, 4 May 2021 13:46:44 +0000 (19:16 +0530)] 
Prefer 6 GHz APs for connection in BSS selection

Prefer 6 GHz APs when estimated throughputs are equal with APs from the
2.4/5 GHz bands while selecting APs for connection. Also add a 6 GHz
specific noise floor default value for the 6 GHz band (with the same
value as was used for 5 GHz previously) to make this step clearer.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoAdd support to calculate estimated throughputs for HE rates
Vamsi Krishna [Tue, 4 May 2021 13:01:18 +0000 (18:31 +0530)] 
Add support to calculate estimated throughputs for HE rates

Add support to consider HE rates while estimating throughputs for the
scan results from HE enabled APs. HE 0.8 usec GI rates are used in all
tables. The minimum SNR values for HE rates (1024-QAM) are derived by
adding the existing minimum SNR values of 256-QAM rates from VHT tables
and the difference between the values of minimum sensitivity levels of
256-QAM rates and 1024-QAM rates defined in Table 27-51 (Receiver
minimum input level sensitivity) in IEEE P802.11ax/D8.0.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoAdd support to estimate throughput for VHT 160/80+80 MHz supporting APs
Vamsi Krishna [Tue, 4 May 2021 19:34:54 +0000 (01:04 +0530)] 
Add support to estimate throughput for VHT 160/80+80 MHz supporting APs

Add support to calculate estimated throughputs for APs which support the
160 MHz (including 80+80 MHz) mode in VHT. The minimum SNR values for
VHT 160 MHz mode are derived from minimum SNR values used for VHT 80 MHz
mode + 3 dBm. The min-SNR values are derived relatively based on the
information that the minimum sensitivity levels defined in Table 21-25
(Receiver minimum input level sensitivity) in IEEE Std 802.11-2020 for
the 160 MHz mode are higher by 3 dBm compared to the values of the 80
MHz mode for each rate.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoCheck local supported features for estimating BSS throughputs accurately
Vamsi Krishna [Tue, 4 May 2021 19:15:30 +0000 (00:45 +0530)] 
Check local supported features for estimating BSS throughputs accurately

Add checks for features supported by the specific hardware mode of the
local device that has the channel for which the throughput is being
estimated instead of assuming the local device supports all optional
features. This is more accurate for cases where the local capabilities
might differ based on the band. In addition, this is in preparation for
extending rate estimates to cover optional VHT and HE features.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agotests: Fix eap_proto_sake_server with Session ID = 255
Jouni Malinen [Thu, 6 May 2021 20:49:12 +0000 (23:49 +0300)] 
tests: Fix eap_proto_sake_server with Session ID = 255

Need to wrap back to 0 when changing value 255 to avoid generating a too
large value to fit an octet field. This was resulting in errors due to a
python exception (likely for about every 256th run).

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agowlantest: Support HT Control field in QoS Data frames
Jouni Malinen [Thu, 6 May 2021 20:28:27 +0000 (23:28 +0300)] 
wlantest: Support HT Control field in QoS Data frames

Extend Data frame processing (and decryption) to handle +HTC frames by
skipping the HT Control field at the end of the frame header. While this
is not an exact match of the rules in IEEE Std 802.11-2020 for when the
HT Control field is present in frames (e.g., no check of the TXVECTOR
value), this is good enough to cover the most likely used cases.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoRename the Frame Control field subfield Order define to +HTC
Jouni Malinen [Thu, 6 May 2021 09:12:51 +0000 (12:12 +0300)] 
Rename the Frame Control field subfield Order define to +HTC

This moves the implementation closer to the current IEEE 802.11 standard
since B15 of Frame Control field was renamed to +HTC to match it newer
uses.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoAdd QCA vendor interface to query usable channels
Vamsi Krishna [Thu, 8 Apr 2021 11:43:48 +0000 (17:13 +0530)] 
Add QCA vendor interface to query usable channels

Add QCA vendor interface for userspace to get information of usable
channels for different interface types from the driver/firmware.

Signed-off-by: Vamsi Krishna <vamsin@codeaurora.org>
4 years agotests: Limit maximum number of frames in fuzzing tests
Jouni Malinen [Tue, 4 May 2021 15:19:23 +0000 (18:19 +0300)] 
tests: Limit maximum number of frames in fuzzing tests

This limits the EAP-SIM and EAP-AKA tests to 100 test frames to avoid
undesired timeouts in automated fuzz testing. The real world uses are
limited to 50 rounds, so there is not really any point in trying with
thousands of frames.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoDetermine 6 GHz bandwidth in AP mode ACS using op_class parameter
Pradeep Kumar Chitrapu [Thu, 22 Apr 2021 20:01:03 +0000 (13:01 -0700)] 
Determine 6 GHz bandwidth in AP mode ACS using op_class parameter

Determine bandwidth from op_class parameter when set in config. When not
configured, use he_oper_chwidth for determining 80 MHz or 160 MHz. When
both are not set, fall back to 20 MHz by default. This helps in removing
the dependency on op_class parameter in 6 GHz ACS.

Signed-off-by: Pradeep Kumar Chitrapu <pradeepc@codeaurora.org>
4 years agoAdd AP mode ACS support for the 6 GHz band
Pradeep Kumar Chitrapu [Thu, 22 Apr 2021 20:01:02 +0000 (13:01 -0700)] 
Add AP mode ACS support for the 6 GHz band

Add support for the 6 GHz frequencies using 40, 80, and 160 MHz
bandwidths in the AP mode ACS.

Signed-off-by: Pradeep Kumar Chitrapu <pradeepc@codeaurora.org>
4 years agoConvert channel to frequency based selection for AP mode ACS
Pradeep Kumar Chitrapu [Thu, 22 Apr 2021 20:01:01 +0000 (13:01 -0700)] 
Convert channel to frequency based selection for AP mode ACS

Convert channel based selection to frequency based selection for AP mode
ACS to accommodate for the 6 GHz band needs.

Signed-off-by: Pradeep Kumar Chitrapu <pradeepc@codeaurora.org>
4 years ago6 GHz: Fix operating class in Supported Operating Classes element
Pradeep Kumar Chitrapu [Thu, 22 Apr 2021 18:30:09 +0000 (11:30 -0700)] 
6 GHz: Fix operating class in Supported Operating Classes element

Previously, the secondary channel was set only in presence of HT
capabilities based on HT40+ or HT40-. As HT capabilities and
secondary_channel are not present for the 6 GHz bamd, this causes
incorrect operating class indication in the Supported Operating Classes
element.

Fix this by assigning the secondary channel for bandwidths greater than
20 MHz in the 6 GHz band.

Signed-off-by: Pradeep Kumar Chitrapu <pradeepc@codeaurora.org>
4 years agotests: Update server and user certificates (2020)
Jouni Malinen [Mon, 3 May 2021 17:03:28 +0000 (20:03 +0300)] 
tests: Update server and user certificates (2020)

The previous versions expired, so need to re-sign these to fix number of
the EAP test cases. This contains updates from running
tests/hwsim/auth_server/update.sh.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agohostapd: Update 160 MHz center freq calculation in 6 GHz
P Praneesh [Mon, 5 Apr 2021 05:45:26 +0000 (11:15 +0530)] 
hostapd: Update 160 MHz center freq calculation in 6 GHz

In the 6 GHz Operation Information field, the Channel Center Frequency
Segment 0 field indicates the channel center frequency index for
the 20 MHz, 40 MHz, 80 MHz, or 80+80 MHz channel on which the
BSS operates in the 6 GHz band. If the BSS channel width is 160 MHz
then the Channel Center Frequency Segment 0 field indicates the
channel center frequency index of the primary 80 MHz.

The Channel Center Frequency Segment 1 field indicates the channel
center frequency index of the 160 MHz channel on which the BSS operates
in the 6 GHz band or the channel center frequency of the secondary 80
MHz for the 80+80 MHz channel.

Since Channel Center Frequency Segment 1 was 0 for 160 MHz, 6 GHz STA
associated using 80 MHz. Update seg0 and seg1 fields per standard (IEEE
P802.11ax/D8.0: 9.4.2.249 HE Operation element).

Signed-off-by: P Praneesh <ppranees@codeaurora.org>
4 years agohostapd: Disable VHT/HE when WMM is not enabled
Lavanya Suresh [Thu, 1 Apr 2021 17:25:39 +0000 (22:55 +0530)] 
hostapd: Disable VHT/HE when WMM is not enabled

When WMM is disabled, HT/VHT/HE capabilities should not be used for any
STA. If any STA advertises these capabilities, hostapd AP disables HT
capabilities in STA flags during STA assoc, but VHT/HE was not handled
similarly. This could allow a STA to associate in VHT/HE mode even in
WMM disable case.

To avoid this, disable VHT/HE capabilities similarly to HT during STA
association, if WMM is not enabled by the STA.

Signed-off-by: Lavanya Suresh <lavaks@codeaurora.org>
4 years agonl80211: Map internal TDLS_PEER_* to NL80211_TDLS_PEER_*
Jouni Malinen [Fri, 23 Apr 2021 09:40:07 +0000 (12:40 +0300)] 
nl80211: Map internal TDLS_PEER_* to NL80211_TDLS_PEER_*

Even though these enum definitions are currently identical, it is better
to explicitly map these bits to the kernel interface instead of using
the internal definition for this. This makes it much clearer that new
enum tdls_peer_capability value needs to be assigned in nl80211 before
they can be added into wpa_supplicant.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoAdd support to indicate TDLS peer's HE capability to driver
Sreeramya Soratkal [Tue, 2 Mar 2021 15:19:18 +0000 (20:49 +0530)] 
Add support to indicate TDLS peer's HE capability to driver

Indicate TDLS peer's capability to driver after processing TDLS setup
response frame. This information can be used by the driver to decide
whether to include HE operation IE in TLDS setup confirmation frame.

Signed-off-by: Sreeramya Soratkal <ssramya@codeaurora.org>
4 years agoSync with mac80211-next.git include/uapi/linux/nl80211.h
Jouni Malinen [Fri, 23 Apr 2021 09:31:50 +0000 (12:31 +0300)] 
Sync with mac80211-next.git include/uapi/linux/nl80211.h

This brings in nl80211 definitions as of 2021-04-19.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: UPDATE_BEACON on disabled interface
Jouni Malinen [Wed, 21 Apr 2021 20:24:58 +0000 (23:24 +0300)] 
tests: UPDATE_BEACON on disabled interface

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoFix UPDATE_BEACON processing when disabled
Kani M [Thu, 18 Feb 2021 07:25:44 +0000 (12:55 +0530)] 
Fix UPDATE_BEACON processing when disabled

The hostapd process crashed when the UPDATE_BEACON control interface
command was issue after the interface was disabled. Check for this case
and return an error if the interface is disabled.

Signed-off-by: Kani M <kanisumi@codeaurora.org>
4 years agoDPP2: Fix channel 6 inclusion for chirping with non-2 GHz interfaces
Kani M [Tue, 13 Apr 2021 04:56:47 +0000 (10:26 +0530)] 
DPP2: Fix channel 6 inclusion for chirping with non-2 GHz interfaces

When the driver provides a list of supported modes, chan6 ended getting
added even if the 2.4 GHz mode was not included. This resulted in
incorrect behavior of trying to transmit on a not supported channel in
case of 5 GHz only radios.

Fix this by adding the channel 6 by default only if the driver does not
provide a list of supported modes. Whenever the supported modes are
available, only add this channel if it is explicitly listed as an
enabled channel.

Fixes: 8e5739c3ac31 ("DPP2: Check channel 6 validity before adding it to chirp channel list")
Signed-off-by: Kani M <kanisumi@codeaurora.org>
4 years agoDPP2: Get DPP Relay Controller context based on hostapd callback context
Disha Das [Thu, 15 Apr 2021 13:21:06 +0000 (18:51 +0530)] 
DPP2: Get DPP Relay Controller context based on hostapd callback context

Get the DPP Relay Controller context from the list of configured
Controllers based on the correct hostapd callback context. This is
needed to pick the correct hostapd interface for sending out the
response over air, e.g., when the same hostapd process controls a 2.4
GHz only and a 5 GHz only interface.

Signed-off-by: Disha Das <dishad@codeaurora.org>
4 years agotests: SAE and WPA3-Personal transition mode roaming
Jouni Malinen [Wed, 21 Apr 2021 20:01:10 +0000 (23:01 +0300)] 
tests: SAE and WPA3-Personal transition mode roaming

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoAdd vendor reason code for TWT setup reject due to scan in progress
Mohammad Asaad Akram [Wed, 14 Apr 2021 05:42:44 +0000 (11:12 +0530)] 
Add vendor reason code for TWT setup reject due to scan in progress

The firmware rejects the TWT setup request when scan is in
progress. Extend enum qca_wlan_vendor_twt_status to represent new
reason code for it.

Signed-off-by: Mohammad Asaad Akram <asadkrm@codeaurora.org>
4 years agoAdd vendor hang reason code for tasklet/credit latency
Jingxiang Ge [Wed, 21 Apr 2021 04:57:42 +0000 (12:57 +0800)] 
Add vendor hang reason code for tasklet/credit latency

Define a new reason code in enum qca_wlan_vendor_hang_reason,
QCA_WLAN_TASKLET_CREDIT_LATENCY_DETECT, for tasklet/credit latency
detection.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoVendor command to configure concurrent STA connection policies
Sunil Dutt [Wed, 17 Mar 2021 15:53:45 +0000 (08:53 -0700)] 
Vendor command to configure concurrent STA connection policies

Introduce a QCA vendor command to configure the concurrent connection
policies when multiple STA interfaces are (getting) active.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agotests: DPP Relay and incomplete connections
Jouni Malinen [Mon, 12 Apr 2021 21:31:36 +0000 (00:31 +0300)] 
tests: DPP Relay and incomplete connections

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoDPP2: Close incomplete Relay connections
Disha Das [Thu, 11 Feb 2021 08:36:47 +0000 (14:06 +0530)] 
DPP2: Close incomplete Relay connections

Add timeout to close incomplete DPP relay connections. This is needed to
avoid getting stuck with old entries that prevent new connections from
getting started.

Signed-off-by: Disha Das <dishad@codeaurora.org>
4 years agoOpenSSL: Fix compilation for version < 1.1.0 without CONFIG_ECC
Wolfgang Steinwender [Wed, 7 Apr 2021 14:06:01 +0000 (16:06 +0200)] 
OpenSSL: Fix compilation for version < 1.1.0 without CONFIG_ECC

When CONFIG_ECC is not defined, openssl/ec.h is not included and EC_KEY
not known. Fix be not defining EVP_PKEY_get0_EC_KEY() when CONFIG_ECC is
not defined.

Signed-off-by: Wolfgang Steinwender <wsteinwender@pcs.com>
4 years agoAdd helper functions for parsing RSNXE capabilities
Jouni Malinen [Sat, 10 Apr 2021 09:43:38 +0000 (12:43 +0300)] 
Add helper functions for parsing RSNXE capabilities

Simplify the implementation by using shared functions for parsing the
capabilities instead of using various similar but not exactly identical
checks throughout the implementation.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoSAE: Remove now unused password identifier argument from non-H2E case
Jouni Malinen [Fri, 9 Apr 2021 19:17:29 +0000 (22:17 +0300)] 
SAE: Remove now unused password identifier argument from non-H2E case

IEEE Std 802.11-2020 mandates H2E to be used whenever an SAE password
identifier is used. While this was already covered in the
implementation, the sae_prepare_commit() function still included an
argument for specifying the password identifier since that was used in
an old test vector. Now that that test vector has been updated, there is
no more need for this argument anymore. Simplify the older non-H2E case
to not pass through a pointer to the (not really used) password
identifier.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoPASN: Change PASN flows to use SAE H2E only
Ilan Peer [Thu, 8 Apr 2021 09:06:24 +0000 (12:06 +0300)] 
PASN: Change PASN flows to use SAE H2E only

Do so for both wpa_supplicant and hostapd. While this was not explicitly
required in IEEE P802.11az/D3.0, likely direction for the draft is to
start requiring use of H2E for all cases where SAE is used with PASN.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
4 years agotests: Update PASN tests with SAE to use sae_pwe=2
Ilan Peer [Thu, 8 Apr 2021 09:06:23 +0000 (12:06 +0300)] 
tests: Update PASN tests with SAE to use sae_pwe=2

As a preparation for changing wpa_supplicant and hostapd
implementation to use SAE H2E only.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
4 years agotests: Use the correct SSID in PASN SAE tests
Ilan Peer [Thu, 8 Apr 2021 09:06:22 +0000 (12:06 +0300)] 
tests: Use the correct SSID in PASN SAE tests

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
4 years agotests: Add coverage for PASN authentication with KDK derivation
Ilan Peer [Thu, 8 Apr 2021 09:06:21 +0000 (12:06 +0300)] 
tests: Add coverage for PASN authentication with KDK derivation

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
4 years agoPASN: Derive KDK only when required
Ilan Peer [Thu, 8 Apr 2021 09:06:20 +0000 (12:06 +0300)] 
PASN: Derive KDK only when required

When a PTK derivation is done as part of PASN authentication flow, a KDK
derivation should be done if and only if the higher layer protocol is
supported by both parties.

Fix the code accordingly, so KDK would be derived if and only if both
sides support Secure LTF.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
4 years agoVendor attributes to configure broadcast TWT parameters
Kiran Kumar Lokere [Thu, 25 Mar 2021 05:28:30 +0000 (22:28 -0700)] 
Vendor attributes to configure broadcast TWT parameters

Define the new TWT attributes for configuring the broadcast TWT
parameters in enum qca_wlan_vendor_attr_twt_setup.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoAdd vendor reason codes for TWT setup reject on roaming/channel switch
Mohammad Asaad Akram [Wed, 24 Mar 2021 14:33:02 +0000 (20:03 +0530)] 
Add vendor reason codes for TWT setup reject on roaming/channel switch

The firmware rejects the TWT setup request when roaming and channel
switch is in progress. Extend enum qca_wlan_vendor_twt_status to
represent new reason codes for these cases.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoSet last_eapol_matches_bssid=1 on a roam+auth indication from driver
Sunil Dutt [Thu, 25 Mar 2021 14:17:13 +0000 (07:17 -0700)] 
Set last_eapol_matches_bssid=1 on a roam+auth indication from driver

Commit 3ab35a660364 ("Extend EAPOL frames processing workaround for
roaming cases") added a work around to address the issue of EAPOL frame
reception after reassociation replied to with an incorrect destination
address (the BSSID of the old AP). This is due to association events and
EAPOL RX events being reordered for the roaming cases with drivers that
perform BSS selection internally.

This mechanism relies on the fact that the driver always forwards the
EAPOL handshake to wpa_supplicant after the roaming (sets
last_eapol_matches_bssid during the EAPOL processing and resets on the
assoc/reassoc indication).

The above approach does not address the case where the driver does the
EAPOL handshake on the roam, indicating the authorized status to
wpa_supplicant but also forwards the EAPOL handshake to wpa_supplicant
for few other roam attempts. This is because the flag
last_eapol_matches_bssid is not set with the roam+authorized event from
the driver. Thus, the next reorder of roam and EAPOL RX events would
miss this workaround.

Address this by setting last_eapol_matches_bssid=1 on a roam+authorized
event from the driver.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoSAE: Increment the Sc counter before generating each Confirm
Jouni Malinen [Thu, 8 Apr 2021 20:55:03 +0000 (23:55 +0300)] 
SAE: Increment the Sc counter before generating each Confirm

This changes the Send-Confirm value for the first SAE Confirm message to
be 1 instead of 0 for all cases to match the design shown in IEEE Std
802.11-2020, Figure 12-4 (SAE finite state machine).

Sc is defined to be "the number of SAE Confirm messages that have been
sent" which is a bit vague on whether the current frame is included in
the count or not. However, the state machine is showing inc(Sc)
operation in all cases before the "2" event to build the Confirm.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agotests: Update SAE test vector to IEEE Std 802.11-2020
Jouni Malinen [Fri, 9 Apr 2021 18:49:25 +0000 (21:49 +0300)] 
tests: Update SAE test vector to IEEE Std 802.11-2020

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agonl80211: Support larger number of MAC ACL entries
Yu Wang [Tue, 19 Jan 2021 08:28:28 +0000 (16:28 +0800)] 
nl80211: Support larger number of MAC ACL entries

If the maximum size of MAC ACL entries is large enough, the
configuration message may exceed the default buffer size of a netlink
message which is allocated with nlmsg_alloc(), and result in a failure
when putting the attributes into the message.

To fix this, calculate the required buffer size of the netlink message
according to MAC ACL size and allocate a sufficiently large buffer with
nlmsg_alloc_size().

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agonl80211: Fix the size of the maximum MAC ACL size
Yu Wang [Tue, 19 Jan 2021 08:28:28 +0000 (16:28 +0800)] 
nl80211: Fix the size of the maximum MAC ACL size

NL80211_ATTR_MAC_ACL_MAX is a u32 attribute to advertise the maximum
number of MAC addresses that a device can support for MAC ACL. This was
incorrectly used as a u8 attribute which would not work with any values
larger than 255 or on big endian CPUs. Fix this by moving from
nla_get_u8() to nla_get_u32().

Fixes: 3c4ca36330c0 ("hostapd: Support MAC address based access control list")
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agotests: Multi-AP and WPS parameter update
Jouni Malinen [Sun, 28 Mar 2021 15:43:47 +0000 (18:43 +0300)] 
tests: Multi-AP and WPS parameter update

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: WPS Registrar init errors
Jouni Malinen [Sun, 28 Mar 2021 15:35:46 +0000 (18:35 +0300)] 
tests: WPS Registrar init errors

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoWPS: Share a single error handling path in wps_set_ie()
Jouni Malinen [Sun, 28 Mar 2021 15:26:19 +0000 (18:26 +0300)] 
WPS: Share a single error handling path in wps_set_ie()

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: WPS PBC session overlap workaround
Jouni Malinen [Sun, 28 Mar 2021 15:23:41 +0000 (18:23 +0300)] 
tests: WPS PBC session overlap workaround

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: WPS ER and UNSUBSCRIBE errors
Jouni Malinen [Sun, 28 Mar 2021 15:15:25 +0000 (18:15 +0300)] 
tests: WPS ER and UNSUBSCRIBE errors

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: WPS ER and HTTP client timeout
Jouni Malinen [Sun, 28 Mar 2021 15:05:47 +0000 (18:05 +0300)] 
tests: WPS ER and HTTP client timeout

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: assoc+auth driver event
Jouni Malinen [Sun, 28 Mar 2021 10:33:40 +0000 (13:33 +0300)] 
tests: assoc+auth driver event

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: IEEE 802.1X and FORCE_UNAUTH state
Jouni Malinen [Sun, 28 Mar 2021 09:36:18 +0000 (12:36 +0300)] 
tests: IEEE 802.1X and FORCE_UNAUTH state

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agohostapd: Enable WMM automatically when HE is configured
Lavanya Suresh [Tue, 16 Mar 2021 16:01:19 +0000 (21:31 +0530)] 
hostapd: Enable WMM automatically when HE is configured

If WMM is not set explicitly in the configuration, it can be set based
on HT/HE config. As HE can be used without HT/VHT (which was introduced
as a special behavior for the 6 GHz band), add a similar automatic
enabling of WMM for HE without HT.

Signed-off-by: Lavanya Suresh <lavaks@codeaurora.org>
4 years agotests: P2P peer table limit
Jouni Malinen [Tue, 8 Dec 2020 21:56:46 +0000 (23:56 +0200)] 
tests: P2P peer table limit

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agotests: INTERFACE_ADD behavior on driver init failure
Jouni Malinen [Thu, 4 Feb 2021 22:27:22 +0000 (00:27 +0200)] 
tests: INTERFACE_ADD behavior on driver init failure

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoFlush pending control interface message for an interface to be removed
Jouni Malinen [Thu, 4 Feb 2021 22:28:17 +0000 (00:28 +0200)] 
Flush pending control interface message for an interface to be removed

wpa_supplicant_ctrl_iface_deinit() was executed only if the
per-interface control interface initialization had been completed. This
is not the case if driver initialization fails and that could result in
leaving behind references to the freed wpa_s instance in a corner case
where control interface messages ended up getting queued.

Fix this by calling wpa_supplicant_ctrl_iface_deinit() in all cases to
cancel the potential eloop timeout for wpas_ctrl_msg_queue_timeout with
the reference to the wpa_s pointer. In addition, flush any pending
message from the global queue for this interface since such a message
cannot be of use after this and there is no need to leave them in the
queue until the global control interface gets deinitialized.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agotests: FT with beacon protection
Jouni Malinen [Wed, 24 Mar 2021 23:06:34 +0000 (01:06 +0200)] 
tests: FT with beacon protection

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: OCV testing with AP special functionality set after ENABLE
Jouni Malinen [Wed, 24 Mar 2021 23:03:04 +0000 (01:03 +0200)] 
tests: OCV testing with AP special functionality set after ENABLE

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: WPA2-PSK AP and GTK rekey failure
Jouni Malinen [Wed, 24 Mar 2021 22:49:02 +0000 (00:49 +0200)] 
tests: WPA2-PSK AP and GTK rekey failure

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: WNM-Sleep Mode exit with PMF and beacon protection
Jouni Malinen [Wed, 24 Mar 2021 22:37:58 +0000 (00:37 +0200)] 
tests: WNM-Sleep Mode exit with PMF and beacon protection

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoFix WNM-Sleep Mode exit debug print of BIGTK
Jouni Malinen [Wed, 24 Mar 2021 22:30:04 +0000 (00:30 +0200)] 
Fix WNM-Sleep Mode exit debug print of BIGTK

Previous debug print used IGTK instead of BIGTK, so fix that to use the
correct key. Actual generation of the BIGTK subelement itself was using
the correct key, though, so this is only needed to fix the debug print.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: Re-enable op class 118-120 tests with new regdb
Jouni Malinen [Tue, 23 Mar 2021 22:51:10 +0000 (00:51 +0200)] 
tests: Re-enable op class 118-120 tests with new regdb

Move from RS to PA country code to allow these test cases to work since
regdb was updated to require DFS for these operating classes in RS.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: hostapd configuration with op_class
Jouni Malinen [Tue, 23 Mar 2021 22:46:57 +0000 (00:46 +0200)] 
tests: hostapd configuration with op_class

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: DPP PFS error cases
Jouni Malinen [Tue, 23 Mar 2021 22:05:05 +0000 (00:05 +0200)] 
tests: DPP PFS error cases

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: MSCS
Jouni Malinen [Mon, 22 Mar 2021 22:38:45 +0000 (00:38 +0200)] 
tests: MSCS

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoMSCS: Fix MSCS Response frame Status field parsing
Jouni Malinen [Mon, 22 Mar 2021 22:30:49 +0000 (00:30 +0200)] 
MSCS: Fix MSCS Response frame Status field parsing

This is a 2 octet field, so need to use WPA_GET_LE16() here instead of
using only the first octet of the value.

Fixes: bbd3178af45b ("MSCS: Add support to process MSCS Response frames")
Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoAdd REGISTER_FRAME hostapd control interface command for testing purposes
Jouni Malinen [Mon, 22 Mar 2021 10:32:16 +0000 (12:32 +0200)] 
Add REGISTER_FRAME hostapd control interface command for testing purposes

This can be used to register reception of new types of Management frames
through nl80211.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoAllow AP mode extended capabilities to be overridden
Jouni Malinen [Mon, 22 Mar 2021 09:29:31 +0000 (11:29 +0200)] 
Allow AP mode extended capabilities to be overridden

The new hostapd configuration parameters ext_capa_mask and ext_capa can
now be used to mask out or add extended capability bits. While this is
not without CONFIG_TESTING_OPTIONS, the main use case for this is for
testing purposes.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoMake hostapd_config_fill() easier to auto indent
Jouni Malinen [Mon, 22 Mar 2021 09:33:16 +0000 (11:33 +0200)] 
Make hostapd_config_fill() easier to auto indent

The conditional compilation block with only the opening brace included
in two variants was messing up auto indentation in emacs. Work around
this by defining the maximum value conditionally while leave the if
block outside any conditional building rules.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoSimplify extended capability determination in AP mode
Jouni Malinen [Mon, 22 Mar 2021 09:12:39 +0000 (11:12 +0200)] 
Simplify extended capability determination in AP mode

There is no need to determine the exact length of the element before
filling in the octets since this function is already capable of
truncated the fields based on what the actual values are.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoPASN: Use a helper function to free radio work data
Jouni Malinen [Sun, 21 Mar 2021 16:33:17 +0000 (18:33 +0200)] 
PASN: Use a helper function to free radio work data

This is safer in avoiding memory leaks now that there is a dynamically
allocated member within the data struct.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoPASN: Mark pubkey/comeback arguments constant for frame construction
Jouni Malinen [Sun, 21 Mar 2021 16:30:52 +0000 (18:30 +0200)] 
PASN: Mark pubkey/comeback arguments constant for frame construction

These parameters are only copied to the frame, so mark them as constant.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: Add PASN tests with comeback flow
Ilan Peer [Sun, 21 Mar 2021 11:55:10 +0000 (13:55 +0200)] 
tests: Add PASN tests with comeback flow

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
4 years agoPASN: Add support for comeback flow to wpa_supplicant
Ilan Peer [Sun, 21 Mar 2021 11:55:09 +0000 (13:55 +0200)] 
PASN: Add support for comeback flow to wpa_supplicant

Process the received comeback cookie and retry automatically if the AP
allows this. Otherwise, provide the cookie to upper layers to allow a
later attempt with the cookie.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
4 years agoPASN: Add support for comeback flow in AP mode
Ilan Peer [Sun, 21 Mar 2021 11:55:08 +0000 (13:55 +0200)] 
PASN: Add support for comeback flow in AP mode

Reuse the SAE anti-clogging token implementation to support similar
design with the PASN comeback cookie.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
4 years agotests: DPP NFC operation failures in hostapd
Jouni Malinen [Sun, 21 Mar 2021 14:55:44 +0000 (16:55 +0200)] 
tests: DPP NFC operation failures in hostapd

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: DPP bootstrapping via NFC URI record (hostapd reading tag)
Jouni Malinen [Sun, 21 Mar 2021 14:39:46 +0000 (16:39 +0200)] 
tests: DPP bootstrapping via NFC URI record (hostapd reading tag)

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: DPP GAS Query error cases with hostapd
Jouni Malinen [Sun, 21 Mar 2021 11:18:00 +0000 (13:18 +0200)] 
tests: DPP GAS Query error cases with hostapd

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoDPP: Fix GAS client error case handling in hostapd
Jouni Malinen [Sun, 21 Mar 2021 09:47:39 +0000 (11:47 +0200)] 
DPP: Fix GAS client error case handling in hostapd

The GAS client processing of the response callback for DPP did not
properly check for GAS query success. This could result in trying to
check the Advertisement Protocol information in failure cases where that
information is not available and that would have resulted in
dereferencing a NULL pointer. Fix this by checking the GAS query result
before processing with processing of the response.

This is similar to the earlier wpa_supplicant fix in commit 931f7ff65609
("DPP: Fix GAS client error case handling").

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoEAP-SIM/AKA: Fix check for anonymous decorated identity
Jouni Malinen [Sat, 20 Mar 2021 14:25:50 +0000 (16:25 +0200)] 
EAP-SIM/AKA: Fix check for anonymous decorated identity

eap_sim_anonymous_username() gets called with an argument that is not a
null terminated C string and as such, os_strrchr() and os_strlen()
cannot be used with it. The previous implementation resulted in use of
uninitialized values and a potential read beyond the end of the buffer.

Credit to OSS-Fuzz: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=32277
Fixes: 73d9891bd722 ("EAP-SIM/AKA peer: Support decorated anonymous identity prefix")
Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoDPP: Indicate authentication success on ConfReqRX if needed (hostapd)
Jouni Malinen [Sat, 20 Mar 2021 14:09:19 +0000 (16:09 +0200)] 
DPP: Indicate authentication success on ConfReqRX if needed (hostapd)

It is possible to receive the Configuration Request frame before having
seen TX status for the Authentication Confirm. In that sequence, the
DPP-AUTH-SUCCESS event would not be indicated before processing the
configuration step and that could confuse upper layers that follow the
details of the DPP exchange. As a workaround, indicate DPP-AUTH-SUCCESS
when receiving the Configuration Request since the Enrollee/Responser
has clearly receive the Authentication Confirm even if the TX status for
it has not been received.

This was already done in wpa_supplicant in commit 422e73d623b4 ("DPP:
Indicate authentication success on ConfReqRX if needed") and matching
changes are now added to hostapd.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: PMKSA cache add failure
Jouni Malinen [Sat, 20 Mar 2021 11:38:49 +0000 (13:38 +0200)] 
tests: PMKSA cache add failure

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoFix full EAP authentication after PMKSA cache add failure
Jouni Malinen [Sat, 20 Mar 2021 11:36:55 +0000 (13:36 +0200)] 
Fix full EAP authentication after PMKSA cache add failure

Need to get EAP state machine into a state where it is willing to
proceed with a new EAP-Request/Identity if PMKSA cache addition fails
after a successful EAP authentication before the initial 4-way handshake
can be completed.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: hostapd ctrl_iface SET_NEIGHBOR failures
Jouni Malinen [Sat, 20 Mar 2021 11:13:24 +0000 (13:13 +0200)] 
tests: hostapd ctrl_iface SET_NEIGHBOR failures

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: DPP and hostapd as Enrollee with GAS fragmentation/timeout
Jouni Malinen [Sat, 20 Mar 2021 10:24:50 +0000 (12:24 +0200)] 
tests: DPP and hostapd as Enrollee with GAS fragmentation/timeout

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: DPP connection status - success with hostapd as Configurator
Jouni Malinen [Sat, 20 Mar 2021 10:19:12 +0000 (12:19 +0200)] 
tests: DPP connection status - success with hostapd as Configurator

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoDPP2: Fix connection status result wait in hostapd
Jouni Malinen [Sat, 20 Mar 2021 10:17:58 +0000 (12:17 +0200)] 
DPP2: Fix connection status result wait in hostapd

The waiting_conn_status_result flag was not set which made hostapd
discard the Connection Status Result. Fix this to match the
wpa_supplicant implementation.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: hostapd airtime policy configuration
Jouni Malinen [Fri, 19 Mar 2021 22:22:28 +0000 (00:22 +0200)] 
tests: hostapd airtime policy configuration

Add minimal testing for airtime policy configuration. mac80211_hwsim
does not actually support this functionality, so this is just for
testing coverage of src/ap/airtime_policy.c.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoTesting functionality for airtime policy
Jouni Malinen [Sat, 20 Mar 2021 10:02:18 +0000 (12:02 +0200)] 
Testing functionality for airtime policy

Add a new testing parameter to allow airtime policy implementation to be
tested for more coverage even without kernel driver support.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: DPP with hostapd as configurator/initiator with v1 enrollee
Jouni Malinen [Sat, 20 Mar 2021 09:09:25 +0000 (11:09 +0200)] 
tests: DPP with hostapd as configurator/initiator with v1 enrollee

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: DPP chirp by an AP on 5 GHz
Jouni Malinen [Sat, 20 Mar 2021 09:03:09 +0000 (11:03 +0200)] 
tests: DPP chirp by an AP on 5 GHz

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