]> git.ipfire.org Git - thirdparty/hostap.git/log
thirdparty/hostap.git
3 years agotests: WPA3 with SAE password from RADIUS
Jouni Malinen [Fri, 4 Mar 2022 10:25:47 +0000 (12:25 +0200)] 
tests: WPA3 with SAE password from RADIUS

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agoSAE: Add support for RADIUS passphrase as the SAE password
Mario Hros [Sat, 19 Feb 2022 20:25:30 +0000 (21:25 +0100)] 
SAE: Add support for RADIUS passphrase as the SAE password

Allow the first Tunnel-Password RADIUS entry to be used for SAE in
addition to the sae_password entries and wpa_passphrase parameters from
the static configuration file.

Signed-off-by: Mario Hros <git@reversity.org>
3 years agocleanup: Remove unreachable code
Baligh Gasmi [Fri, 18 Feb 2022 16:22:23 +0000 (17:22 +0100)] 
cleanup: Remove unreachable code

There is no need for unreachable code in these places, so remove it.

Signed-off-by: Baligh Gasmi <gasmibal@gmail.com>
3 years agoqca-vendor: Fix typos
Yegor Yefremov [Tue, 1 Feb 2022 10:33:29 +0000 (11:33 +0100)] 
qca-vendor: Fix typos

Fix typos found with codespell utility.

Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
3 years agobrcm_vendor: Fix typos
Yegor Yefremov [Tue, 1 Feb 2022 10:33:29 +0000 (11:33 +0100)] 
brcm_vendor: Fix typos

Fix typos found with codespell utility.

Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
3 years agosrc/drivers: Fix typos
Yegor Yefremov [Tue, 1 Feb 2022 08:31:44 +0000 (09:31 +0100)] 
src/drivers: Fix typos

Fix typos found with codespell utility.

Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
3 years agonl80211: Report background radar/CAC detection capability
Lorenzo Bianconi [Mon, 20 Dec 2021 15:48:19 +0000 (16:48 +0100)] 
nl80211: Report background radar/CAC detection capability

Report background radar/CAC detection capability if supported
by the underlying driver/hardware.

Tested-by: Owen Peng <owen.peng@mediatek.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
3 years agoDFS: Add capability to select radar-only channels
Lorenzo Bianconi [Mon, 20 Dec 2021 15:48:18 +0000 (16:48 +0100)] 
DFS: Add capability to select radar-only channels

Introduce type parameter to dfs_get_valid_channel() routine to allow
selection of a radar-only channel where the CAC detection has not been
performed yet. This is a preliminary patch to enable background
radar/CAC detection.

Tested-by: Owen Peng <owen.peng@mediatek.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
3 years agoDFS: Introduce dfs_set_valid_channel() utility routine
Lorenzo Bianconi [Mon, 20 Dec 2021 15:48:17 +0000 (16:48 +0100)] 
DFS: Introduce dfs_set_valid_channel() utility routine

This is a preliminary change to introduce radar/CAC background detection
support.

Tested-by: Owen Peng <owen.peng@mediatek.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
3 years agoFix removal of wpa_passphrase on 'make clean'
Jouni Malinen [Thu, 3 Mar 2022 11:26:42 +0000 (13:26 +0200)] 
Fix removal of wpa_passphrase on 'make clean'

Fixes: 0430bc8267b4 ("build: Add a common-clean target")
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agobuild: Re-enable options for libwpa_client.so and wpa_passphrase
Sergey Matyukevich [Tue, 22 Feb 2022 08:52:19 +0000 (11:52 +0300)] 
build: Re-enable options for libwpa_client.so and wpa_passphrase

Commit a41a29192e5d ("build: Pull common fragments into a build.rules
file") introduced a regression into wpa_supplicant build process. The
build target libwpa_client.so is not built regardless of whether the
option CONFIG_BUILD_WPA_CLIENT_SO is set or not. This happens because
this config option is used before it is imported from the configuration
file. Moving its use after including build.rules does not help: the
variable ALL is processed by build.rules and further changes are not
applied. Similarly, option CONFIG_NO_WPA_PASSPHRASE also does not work
as expected: wpa_passphrase is always built regardless of whether the
option is set or not.

Re-enable these options by adding both build targets to _all
dependencies.

Fixes: a41a29192e5d ("build: Pull common fragments into a build.rules file")
Signed-off-by: Sergey Matyukevich <geomatsi@gmail.com>
3 years agotests: HE AP and capability parsing
Jouni Malinen [Wed, 2 Mar 2022 23:22:44 +0000 (01:22 +0200)] 
tests: HE AP and capability parsing

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agoHE: Fix invalid length checking for HE Capability element
Jouni Malinen [Wed, 2 Mar 2022 23:24:02 +0000 (01:24 +0200)] 
HE: Fix invalid length checking for HE Capability element

Do not use the first octet of the PPE Thresholds field without
explicitly confirming that that octet was included in the element.
Furthermore, allow the received element to have additional octets in the
end since IEEE Std 802.11ax-2021 defines this to be an extensible
element and new fields could be added to the end of it in the future.

Fixes: 0497e4148197 ("HE: Fix HE Capabilities element size")
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agoHE: Fix calculation of the PPE Threshold field length
Shiva Sankar Gajula [Fri, 4 Feb 2022 17:43:30 +0000 (23:13 +0530)] 
HE: Fix calculation of the PPE Threshold field length

The previously used calculation was not correct for the cases where the
extra padding field was needed. Fix this by properly calculating the
number of full octets in the field.

Fixes: 0497e4148197 ("HE: Fix HE Capabilities element size")
Signed-off-by: Shiva Sankar Gajula <quic_sgajula@quicinc.com>
3 years agotests: Fetch all event messages in wpas_ctrl_many_networks
Jouni Malinen [Sat, 26 Feb 2022 17:07:10 +0000 (19:07 +0200)] 
tests: Fetch all event messages in wpas_ctrl_many_networks

Do not leave a large number of network added/removed events remaining
for the following test case to handle. This removes some possible
failure test case sequences like the following one:
wpas_ctrl_many_networks dbus_ap_scan_2_ap_mode_scan

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agotests: wpa_supplicant AP mode and PSK/PTK lifetime in memory"
Jouni Malinen [Fri, 25 Feb 2022 23:15:16 +0000 (01:15 +0200)] 
tests: wpa_supplicant AP mode and PSK/PTK lifetime in memory"

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agoClear PSK explicitly from memory in couple more cases on deinit
Jouni Malinen [Sat, 26 Feb 2022 11:39:35 +0000 (13:39 +0200)] 
Clear PSK explicitly from memory in couple more cases on deinit

Couple of the WPS/P2P/RADIUS-PSK cases were freeing heap memory
allocations without explicitly clearing the PSK value. Add such clearing
for these to avoid leaving the PSK in memory after it is not needed
anymore.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agoClear PMK explicitly even without FT support in AP build
Jouni Malinen [Sat, 26 Feb 2022 11:38:34 +0000 (13:38 +0200)] 
Clear PMK explicitly even without FT support in AP build

Unlike the other keys that were cleared here, the PMK is available
without FT support built into hostapd and as such, should be cleared in
all cases.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agoRemove duplicated pointer check
Jouni Malinen [Sat, 26 Feb 2022 09:22:04 +0000 (11:22 +0200)] 
Remove duplicated pointer check

The following if statement verifies the exact same thing here.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agoClear temporary results from stack in PBKDF2-SHA1
Jouni Malinen [Sat, 26 Feb 2022 08:58:15 +0000 (10:58 +0200)] 
Clear temporary results from stack in PBKDF2-SHA1

Force stack memory to be cleared of temporary values that might contain
keying material.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agoRemove GTK/IGTK/BIGTK from memory explicitly in AP mode
Jouni Malinen [Fri, 25 Feb 2022 23:14:25 +0000 (01:14 +0200)] 
Remove GTK/IGTK/BIGTK from memory explicitly in AP mode

Make sure these keys do not remain in memory beyond the time they are
needed.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agoClear last set keys (for testing purposes) from memory explicitly
Jouni Malinen [Fri, 25 Feb 2022 23:10:32 +0000 (01:10 +0200)] 
Clear last set keys (for testing purposes) from memory explicitly

This makes it easier to scan process memory for key information that is
not supposed to remain there after the last use.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agonl80211: Clear bss->freq when stopping AP mode
Jouni Malinen [Fri, 25 Feb 2022 20:39:54 +0000 (22:39 +0200)] 
nl80211: Clear bss->freq when stopping AP mode

The current operating frequency information was already cleared when
stopping other modes, but the cases for stopping AP mode were not
covered. Clear bss->freq in wpa_driver_nl80211_del_beacon() to cover
these cases. In addition, move clearing of bss->beacon_set there to
avoid having to clear that in all callers separately.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agotests: Make test cases more robust by clearing scan cache explicitly
Jouni Malinen [Fri, 25 Feb 2022 18:04:50 +0000 (20:04 +0200)] 
tests: Make test cases more robust by clearing scan cache explicitly

This test cases can fail if previously executed tests leave older scan
results in cfg80211 scan table. Clear that scan table explicitly to
avoid such issues.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agoDefine a vendor specific NDP attribute for NAN service id
Ajit Vaishya [Tue, 15 Feb 2022 16:24:31 +0000 (21:54 +0530)] 
Define a vendor specific NDP attribute for NAN service id

Add a NAN NDP attribute QCA_WLAN_VENDOR_ATTR_NDP_SERVICE_ID which
indicates service id with 6 bytes of length and it's derived from the
SHA-256 hash of the NAN service name. As per Wi-Fi Aware Specfication
version 3.2, this service ID is used to calculate the NAN PMK.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agotests: Make OCV test cases more robust by clearing scan results on AP
Jouni Malinen [Wed, 23 Feb 2022 22:13:52 +0000 (00:13 +0200)] 
tests: Make OCV test cases more robust by clearing scan results on AP

This is needed to avoid pri/sec channel switching based on potential
scan results from the previous test cases.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agoDPP: Clear SCANNING state when starting network introduction
Jouni Malinen [Wed, 23 Feb 2022 22:07:07 +0000 (00:07 +0200)] 
DPP: Clear SCANNING state when starting network introduction

This is needed to avoid leaving wpa_state to SCANNING if network
introduction fails and a new association is not started.

This was found with the following test case sequence:
dpp_conn_status_connector_mismatch scan_trigger_failure

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
3 years agoDPP: Clear netrole on starting chirping or reconfiguration
Jouni Malinen [Wed, 23 Feb 2022 19:58:07 +0000 (21:58 +0200)] 
DPP: Clear netrole on starting chirping or reconfiguration

A previously set netrole (e.g., from DPP_LISTEN or DPP_AUTH_INIT) could
have been used in a following DPP_CHIRP or DPP_RECONFIG operation. This
could result in trying to request incorrect configuration and likely
rejection from the Configurator. Fix this by clearing the netrole when
starting these operations.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
3 years agoClear wpa_s->last/current_ssid in more cases
Jouni Malinen [Wed, 23 Feb 2022 19:47:10 +0000 (21:47 +0200)] 
Clear wpa_s->last/current_ssid in more cases

It was possible for at least the wpa_s->last_ssid to be left pointing to
a removed network which could result in processing the following
association as a reassociation-within-an-ESS even when it was moving to
a different ESS. This could result in unexpected behavior. This was
found with the following test case sequence:
sigma_dut_ap_psk_sae_ft sae_h2e_password_id ap_wps_pk_oom sigma_dut_client_privacy

Move clearing of wpa_s->last_ssid and wpa_s->current_ssid into
wpas_notify_network_removed() to catch all cases similarily to the way
wpa_s->next_ssid was already cleared.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agotests: Add a script for find a minimal failing test sequence
Jouni Malinen [Wed, 23 Feb 2022 09:16:40 +0000 (11:16 +0200)] 
tests: Add a script for find a minimal failing test sequence

min-seq.py can be used to find a minimal test sequence that can be used
to reproduce test failures. This is meant for being able to process the
recently added "Failure sequence:" entries from parallel-vm.log to
reduce manual work needed to debug commonly failing test case sequences.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agotests: Clear sae_groups in sigma_dut_ap_ft_rsnxe_used_mismatch
Jouni Malinen [Wed, 23 Feb 2022 09:15:31 +0000 (11:15 +0200)] 
tests: Clear sae_groups in sigma_dut_ap_ft_rsnxe_used_mismatch

This is needed to avoid test failures when a previous test case might
have restricted the set of allowed SAE groups.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agoDPP: Stop offchannel frame TX wait on DPP_STOP_LISTEN in a corner case
Jouni Malinen [Mon, 21 Feb 2022 22:24:56 +0000 (00:24 +0200)] 
DPP: Stop offchannel frame TX wait on DPP_STOP_LISTEN in a corner case

The offchannel frame TX wait was stopped whenever processing
DPP_STOP_LISTEN in most cases. However, there was a corner case on the
Responder side where this operation was skipped after PKEX was completed
successful and the Authentication Request frame had not yet been
received from the Initiator.

While this does not normally cause any significant issue, this could
result in unexpected behavior especially in test cases that run multiple
DPP PKEX operations in a row since the start of a new TX operation might
get delayed while waiting for the previous TX-wait to complete.

This was found with the following test case sequence:
dpp_reconfig_retries dpp_pkex_alloc_fail

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agotests: Make rrm_beacon_req_frame_body_fragmentation more robust
Jouni Malinen [Mon, 21 Feb 2022 22:05:56 +0000 (00:05 +0200)] 
tests: Make rrm_beacon_req_frame_body_fragmentation more robust

Flush scan results to avoid unexpected behavior due to scan results
remaining available from previous test cases.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agotests: Make WNM BSS TM tests more robust
Jouni Malinen [Mon, 21 Feb 2022 21:58:45 +0000 (23:58 +0200)] 
tests: Make WNM BSS TM tests more robust

Flush scan results to avoid unexpected behavior due to scan results
remaining available from previous test cases.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agotests: Fix a test case name
Jouni Malinen [Mon, 21 Feb 2022 16:34:42 +0000 (18:34 +0200)] 
tests: Fix a test case name

The test case name ap_ft_pmf_over_ds was used for two different test
cases which resulted in only one of those being used. Fix this by using
unique test case names.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agotests: Make FT-over-DS test cases more robust
Jouni Malinen [Mon, 21 Feb 2022 16:11:25 +0000 (18:11 +0200)] 
tests: Make FT-over-DS test cases more robust

Clear scan cache to avoid issues with old scan results from earlier test
cases. This caused issues like the following test case sequence failing:
rrm_beacon_req_active_ap_channels ap_ft_eap_dis_over_ds

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agotests: Make wpas_mesh_mode_scan more robust
Jouni Malinen [Fri, 18 Feb 2022 14:47:29 +0000 (16:47 +0200)] 
tests: Make wpas_mesh_mode_scan more robust

Clear scan results to avoid issues with get_bss() finding an entry from
an earlier test case when checking for mesh information.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agotests: MACsec with GCM-AES-256
Jouni Malinen [Wed, 16 Feb 2022 20:45:10 +0000 (22:45 +0200)] 
tests: MACsec with GCM-AES-256

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agomacsec_linux: Support cipher suite configuration
leiwei [Mon, 15 Nov 2021 10:43:33 +0000 (18:43 +0800)] 
macsec_linux: Support cipher suite configuration

Set the cipher suite for the link. Unlike the other parameters, this
needs to be done with the first rtnl_link_add() call (NLM_F_CREATE))
instead of the update in try_commit() since the kernel is rejecting
changes to the cipher suite after the link is first added.

Signed-off-by: leiwei <quic_leiwei@quicinc.com>
3 years agoMACsec: Support GCM-AES-256 cipher suite
leiwei [Mon, 15 Nov 2021 10:22:19 +0000 (18:22 +0800)] 
MACsec: Support GCM-AES-256 cipher suite

Allow macsec_csindex to be configured and select the cipher suite when
the participant acts as a key server.

Signed-off-by: leiwei <quic_leiwei@quicinc.com>
3 years agotests: Make wpa2_ocv_ap_ht_mismatch more robust
Jouni Malinen [Wed, 16 Feb 2022 19:29:54 +0000 (21:29 +0200)] 
tests: Make wpa2_ocv_ap_ht_mismatch more robust

Clear the scan cache on the AP before running this test since the HT40
operation on the 2.4 GHz band might get disallowed based on scan results
from earlier test cases. This was found with the following hwsim test
case sequence failing:
ap_acs_with_fallback_to_20 wpa2_ocv_ap_ht_mismatch

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agonl80211: Do not store no-wait TX frame cookies to be cancelled
Jouni Malinen [Wed, 16 Feb 2022 19:09:57 +0000 (21:09 +0200)] 
nl80211: Do not store no-wait TX frame cookies to be cancelled

If the TX frame operation does not request any wait time, there is not
going to be any pending wait that could be cancelled later. As such,
there is no need to store the cookie value for these cases. This removes
unnecessary cancel-TX-wait operations that would result in some extra
latency and confusing debug log entries.

This was found with the following hwsim test case sequence where the
second test was failing due to the extra latency and this commit gets
rid of that failure:
rrm_ftm_range_req_timeout dpp_qr_code_auth_neg_chan

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agotests: Make SAE roaming test cases more reliable
Jouni Malinen [Wed, 16 Feb 2022 17:56:24 +0000 (19:56 +0200)] 
tests: Make SAE roaming test cases more reliable

Flush the scan table explicitly to avoid issues with the ROAM command if
the new AP is not found and an entry from a previous test case is used
instead. This was happening in a number of cases where a SAE test case
was run after sigma_dut_ap_cipher_gcmp_256 which used the second AP
instance and allowed that to show up in the scan results in the next
text case.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agotests: Write full failure sequences into parallel-vm.log
Jouni Malinen [Tue, 15 Feb 2022 18:54:24 +0000 (20:54 +0200)] 
tests: Write full failure sequences into parallel-vm.log

This can be helpful in discovering test case sequences that result in
failures frequently.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agotests: DPP session clearing on failure during GAS request handling
Jouni Malinen [Tue, 15 Feb 2022 14:41:25 +0000 (16:41 +0200)] 
tests: DPP session clearing on failure during GAS request handling

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agoDPP: Clear state on configuration failure in GAS server hander
Jouni Malinen [Tue, 15 Feb 2022 14:18:12 +0000 (16:18 +0200)] 
DPP: Clear state on configuration failure in GAS server hander

There is no need to maintain the DPP authentication state if config
request processing fails, so clear state also in the GAS server request
handler similarly to the other failure cases.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agonl80211: Clear the last saved TX frame cookie on wait expiration
Jouni Malinen [Tue, 15 Feb 2022 14:15:41 +0000 (16:15 +0200)] 
nl80211: Clear the last saved TX frame cookie on wait expiration

drv->send_frame_cookies[] was already cleared, but
dev->send_frame_cookie was not. This resulted in unnecessary attempts of
canceling the TX wait for a wait that had already expired. While this
does not really result in real issues, it is cleaner to get rid of the
error messages from the debug log by skipping the unnecessary
operations.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agotests: Make FILS BSS result checks more robust
Jouni Malinen [Tue, 15 Feb 2022 11:06:36 +0000 (13:06 +0200)] 
tests: Make FILS BSS result checks more robust

These can fail if the scan results from the previous test case remain,
e.g., when run immediately after scan_bss_limit.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agotests: Additional wpa_supplicant AP mode testing
Jouni Malinen [Tue, 15 Feb 2022 10:45:09 +0000 (12:45 +0200)] 
tests: Additional wpa_supplicant AP mode testing

Add a couple of more channel configuration cases and log the channel
parameters with more details in the test log.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agotests: Clear AP scan cache after primary BSS on channel 40
Jouni Malinen [Mon, 14 Feb 2022 22:34:55 +0000 (00:34 +0200)] 
tests: Clear AP scan cache after primary BSS on channel 40

A number of test cases using 40 MHz or wider channels with the primary
channel 36 were failing when executed after dpp_chirp_ap_5g since that
test case was running an AP on the channel 40 and resulting in need to
swap the primary and the secondary channels in the following test case.
Fix this by clearing the AP scan cache explicitly for such cases.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agotests: Make GAS/ANQP test cases more robust
Jouni Malinen [Mon, 14 Feb 2022 22:18:07 +0000 (00:18 +0200)] 
tests: Make GAS/ANQP test cases more robust

Flush the scan cache for all test cases that used get_bss() to check for
particular ANQP information. This was already done for one such case
based on commit dd900637b2d0 ("tests: Make gas_anqp_extra_elements more
robust"), but other test cases need this as well.

This was showing with frequent errors in test cases sequences like this
one:
dfs_radar_no_ht gas_fragment_with_comeback_delay gas_unknown_adv_proto gas_anqp_venue_url

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agotests: Clear scan cache at the end of ap_wps_cancel
Jouni Malinen [Mon, 14 Feb 2022 22:02:34 +0000 (00:02 +0200)] 
tests: Clear scan cache at the end of ap_wps_cancel

This is needed to avoid leaving behind a BSS entry with WPS enabled for
the next text case in some cases. In particular, this was causing issues
in the following sequence of test cases:
ap_wps_conf_chan14 ap_wps_cancel ap_wps_pin_request_file

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agoUpdate QCA vendor attribute to indicate maximum PCL attributes
Sreeramya Soratkal [Tue, 14 Dec 2021 12:10:46 +0000 (17:40 +0530)] 
Update QCA vendor attribute to indicate maximum PCL attributes

Add the enum qca_wlan_vendor_attr_pcl elements to mark the maximum value
of the defined attributes for the preferred channel list. This is
helpful for nla_parse().

Signed-off-by: Sreeramya Soratkal <quic_ssramya@quicinc.com>
3 years agoatheros: Do not include p2p.h
Jouni Malinen [Thu, 10 Feb 2022 15:52:40 +0000 (17:52 +0200)] 
atheros: Do not include p2p.h

That wpa_supplicant header file is not needed for driver_atheros.c and
maybe was never really needed, so do not include it here to avoid
potentially conflicting C preprocessor defines.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agonl80211: Debug print association comeback event data
Jouni Malinen [Wed, 9 Feb 2022 18:43:53 +0000 (20:43 +0200)] 
nl80211: Debug print association comeback event data

This is helpful for understanding why an assocation attempt takes
unexpectedly long time to complete.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agoOCV: Don't start SA Query timer on CSA when SA Query is offloaded
Narasimha Rao PVS [Thu, 3 Feb 2022 08:03:45 +0000 (08:03 +0000)] 
OCV: Don't start SA Query timer on CSA when SA Query is offloaded

Check driver support for SA Query offload in AP mode and skip starting
SA Query timer on CSA for OCV enabled STAs when the driver indicates
support for offloading SA Query procedures.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agoSync with mac80211-next.git include/uapi/linux/nl80211.h
Jouni Malinen [Wed, 9 Feb 2022 18:15:30 +0000 (20:15 +0200)] 
Sync with mac80211-next.git include/uapi/linux/nl80211.h

This brings in nl80211 definitions as of 2022-01-04. In addition, update
nl80211_command_to_string() to cover the new defined commands.

Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agotests: WPA2-PSK-FT and different OCV capability between APs
Jouni Malinen [Wed, 9 Feb 2022 15:30:02 +0000 (17:30 +0200)] 
tests: WPA2-PSK-FT and different OCV capability between APs

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agotests: Remove ignore_old_scan_res clearing from the test scripts
Jouni Malinen [Fri, 4 Feb 2022 19:29:52 +0000 (21:29 +0200)] 
tests: Remove ignore_old_scan_res clearing from the test scripts

Now that wpa_supplicant does this internally as a part of the FLUSH
command, there is no need for the test scripts to try to clear the
parameter between test cases.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agoClear ignore_old_scan_res on FLUSH command
Jouni Malinen [Fri, 4 Feb 2022 19:26:24 +0000 (21:26 +0200)] 
Clear ignore_old_scan_res on FLUSH command

The hwsim test cases are trying to clear this parameter between test
cases, but that was not really done correctly for many of the sigma_dut
test cases. Instead of fixing the text scripts to do this more
carefully, it seems to be simpler to just force the FLUSH command to
clear this.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agotests: Use a more reasonable age for a scan result in scan_parsing
Jouni Malinen [Fri, 4 Feb 2022 19:24:19 +0000 (21:24 +0200)] 
tests: Use a more reasonable age for a scan result in scan_parsing

This test case could fail in some sequences like "sigma_dut_sae
scan_parsing" due to the ignore_old_scan_res parameter accidentally
being left to 1 by the former test case and the simulated scan result
being older than the previous scan trigger. Reduce the age of that scan
entry to make this less likely to happen.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agoAdd QCA vendor MCC channel quota command and event
Liangwei Dong [Tue, 28 Dec 2021 06:42:02 +0000 (14:42 +0800)] 
Add QCA vendor MCC channel quota command and event

Add QCA_NL80211_VENDOR_SUBCMD_MCC_QUOTA. When two or more interfaces are
active on the same band and two different home channels (MCC), the
target may allocate quota of "on channel" time for each home channel.
The target will indicate the quota information to application layer with
this event. Application may do TX bitrate control based on the
information. The user may also set the MCC quota for an interface by
using this command.

Signed-off-by: Liangwei Dong <quic_liangwei@quicinc.com>
Signed-off-by: Madhvapathi Sriram <quic_msriram@quicinc.com>
3 years agoWhitespace/coding style cleanup for QCA vendor attribute definitions
Jouni Malinen [Fri, 4 Feb 2022 16:22:17 +0000 (18:22 +0200)] 
Whitespace/coding style cleanup for QCA vendor attribute definitions

Use more consistent style with whitespace around enums.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agoVendor command to configure rate mask
Jayachandran Sreekumaran [Wed, 22 Dec 2021 05:42:30 +0000 (11:12 +0530)] 
Vendor command to configure rate mask

Introduce a new vendor command
QCA_NL80211_VENDOR_SUBCMD_RATEMASK_CONFIG. This is used to set the rate
mask config to be used in MCS rate selection per PHY type.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agoRename moderate latency level to XR latency level in vendor attributes
Nirav Shah [Tue, 25 Jan 2022 04:56:52 +0000 (10:26 +0530)] 
Rename moderate latency level to XR latency level in vendor attributes

Currently the moderate latency level is not used. Rename the moderate
latency level to XR latency level to be used in XR (extended reality)
applications.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agonl80211: Clear frequency information on leaving mesh
Jouni Malinen [Thu, 3 Feb 2022 22:31:20 +0000 (00:31 +0200)] 
nl80211: Clear frequency information on leaving mesh

Not doing this was resulting in test failures with many sequences of a
mesh test case (e.g., wpas_mesh_peer_connected) followed by
ap_csa_1_switch which was checking the driver wrapper frequency
information at the beginning.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agoDPP: Use a 120 second timeout for GAS query
Jouni Malinen [Thu, 3 Feb 2022 15:14:16 +0000 (17:14 +0200)] 
DPP: Use a 120 second timeout for GAS query

This is needed since the gas_query_req() operation could remain waiting
indefinitely for the response if the Configurator keeps sending out
comeback responses with additional delay. The DPP technical
specification expects the Enrollee to continue sending out new Config
Requests for 60 seconds, so this gives an extra 60 second time after the
last expected new Config Request for the Configurator to determine what
kind of configuration to provide.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agoGAS server: Increase query timeout to 60 seconds for DPP
Jouni Malinen [Thu, 3 Feb 2022 09:36:43 +0000 (11:36 +0200)] 
GAS server: Increase query timeout to 60 seconds for DPP

DPP Enrollee might wait for the configuration for 60 seconds, so
increase the DPP Configurator timeout for the GAS server operation to 60
seconds to cover that full wait time. This is needed for cases where
user interaction can take significant amount of time before the
configuration response can be generated.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agoDPP: Start a listen operation for GAS server if needed
Jouni Malinen [Thu, 3 Feb 2022 09:30:06 +0000 (11:30 +0200)] 
DPP: Start a listen operation for GAS server if needed

Instead of depending on the TX-wait-response-time to be sufficient to
cover the full GAS exchange, start an ongoing listen operation on the
negotiation channel (if no such listen operation is already in place) to
allow the configuration exchange to take longer amount of time. This is
needed for cases where the conf=query is used to request Configurator
parameters from upper layers and that upper layer processing (e.g., user
interaction) takes significant amount of time.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agotests: Increase the wait time of Configurator GAS timeout
Jouni Malinen [Thu, 3 Feb 2022 22:22:33 +0000 (00:22 +0200)] 
tests: Increase the wait time of Configurator GAS timeout

dpp_gas_timeout could fail with an increased timeout for the
Configurator.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agotests: Increase wait in dpp_qr_code_config_event_initiator_no_response
Jouni Malinen [Thu, 3 Feb 2022 09:35:35 +0000 (11:35 +0200)] 
tests: Increase wait in dpp_qr_code_config_event_initiator_no_response

The DPP Enrollee might wait for up to 60 seconds for the configuration,
so use a longer timeout value to be able to cover this negative test
case where the Configurator never sends the response.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agonl80211: Add a handler for NL80211_CMD_FRAME_WAIT_CANCEL events
Jouni Malinen [Thu, 3 Feb 2022 22:12:13 +0000 (00:12 +0200)] 
nl80211: Add a handler for NL80211_CMD_FRAME_WAIT_CANCEL events

This can be helpful in figuring out when the driver has stopped waiting
on a specific channel and would need a remain-on-channel command to
continue listening on that channel.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agoP2P: Update GO operating frequency after interface setup is completed
Sunil Ravi [Tue, 29 Jun 2021 18:18:20 +0000 (11:18 -0700)] 
P2P: Update GO operating frequency after interface setup is completed

Once the GO/AP interface initialization is completed, check if the
operating frequency set in the wpa_supplicant group interface structure
is different than the one set in the hostapd interface structure
associated with the group interface. If yes, update the frequency in the
wpa_supplicant group interface and network configuration to the
frequency set in the hostapd interface structure.

The frequency set in the hostapd interface is the correct/final
frequency wpa_supplicant configured in the kernel/driver. This is done
because wpa_supplicant may switch the initially requested primary and
secondary frequencies to get a secondary frequency with no beacons (to
avoid interference or 20/40 MHz coex logic). And the updated frequency
is informed by the driver only after the interface setup is completed
through the channel switch event - EVENT_CH_SWITCH. But wpa_supplicant
updates the frequency to applications through the P2P_GROUP_STARTED
event which is triggered before the EVENT_CH_SWITCH event. To send the
correct frequency to applications the frequency must be updated before
sending the P2P_GROUP_STARTED event.

Bug: 191272346
Test: Manual - Verified that GO frequency is updated and reported
correctly to Nearby application.

Signed-off-by: Sunil Ravi <sunilravi@google.com>
3 years agotests: DPP Configurator with config query
Jouni Malinen [Wed, 2 Feb 2022 14:39:57 +0000 (16:39 +0200)] 
tests: DPP Configurator with config query

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agoDPP: Allow Configurator parameters to be provided during config exchange
Jouni Malinen [Wed, 2 Feb 2022 14:52:01 +0000 (16:52 +0200)] 
DPP: Allow Configurator parameters to be provided during config exchange

This provides an alternative mechanism for upper layer components to
control configuration parameters to be used by the local Configurator.
Instead of the previously used design where the Configurator parameters
had to be provided before initiating the DPP Authentication exchange,
the new alternative approach allows the DPP Authentication exchange to
be started before any Configurator parameters have been determined and
wpa_supplicant will then request the parameters once the DPP
Configuration Request has been received from the Enrollee. This allows
the Config Request information to be used at upper layers to determine
how the Enrollee should be configured.

For example for an Initiator:

CTRL: DPP_QR_CODE <URI from Responder/Enrollee>
CTRL: DPP_AUTH_INIT peer=1 conf=query
<3>DPP-CONF-NEEDED peer=1 src=02:00:00:00:00:00 net_role=sta name="Test" opclass=81,82,83,84,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130 mud_url=N/A
(upper layer processing; potentially including user interaction)
CTRL: DPP_CONF_SET peer=1 conf=sta-sae ssid=736165 pass=70617373776f7264
<3>DPP-CONF-SENT

For example for a Responder:

CTRL: SET dpp_configurator_params conf=query
CTRL: DPP_LISTEN 2412 role=configurator
<3>DPP-CONF-NEEDED peer=2 src=02:00:00:00:01:00 net_role=sta name="Test" opclass=81,82,83,84,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130 mud_url=N/A
(upper layer processing; potentially including user interaction)
CTRL: DPP_CONF_SET peer=2 conf=sta-sae ssid=736165 pass=70617373776f7264
<3>DPP-CONF-SENT

For example for an Initiator that can act both as a Configurator and an
Enrollee in a case where the Initiator becomes the Enrollee:

CTRL: DPP_AUTH_INIT peer=1 role=either conf=query
<3>DPP-CONF-RECEIVED

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agoGAS server: Asynchronous request handler comeback time indication
Jouni Malinen [Wed, 2 Feb 2022 14:48:51 +0000 (16:48 +0200)] 
GAS server: Asynchronous request handler comeback time indication

Extend the GAS server functionality to allow a request handler to return
the initial comeback delay with a later callback instead of having to
indicate the comeback delay when returning from the handler function.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agoDPP: Store Enrollee config request information
Jouni Malinen [Wed, 2 Feb 2022 14:45:05 +0000 (16:45 +0200)] 
DPP: Store Enrollee config request information

This information can be helpful for upper layers in deciding how to
configure the Enrollee.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agoDPP: Make dpp_netrole_str() non-static
Jouni Malinen [Wed, 2 Feb 2022 14:42:50 +0000 (16:42 +0200)] 
DPP: Make dpp_netrole_str() non-static

This function is going to be needed outside dpp.c.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agoEAP-pwd: Fix the prefix in a debug message
Jouni Malinen [Tue, 1 Feb 2022 17:58:40 +0000 (19:58 +0200)] 
EAP-pwd: Fix the prefix in a debug message

This was copied from sae.c, but the debug message prefix was not changed
to match the use here.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agotests: WPA2-PSK AP with PMF association comeback (using radio_disabled)
Jouni Malinen [Tue, 1 Feb 2022 17:04:06 +0000 (19:04 +0200)] 
tests: WPA2-PSK AP with PMF association comeback (using radio_disabled)

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agonl80211: Partial support for radio_disable
Jouni Malinen [Tue, 1 Feb 2022 17:03:09 +0000 (19:03 +0200)] 
nl80211: Partial support for radio_disable

This is for testing purposes to allow a station mode associated to be
dropped without sending the AP a Deauthentication frame.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agotests: DPP/PKEXv2 over TCP while associated
Jouni Malinen [Tue, 1 Feb 2022 16:39:34 +0000 (18:39 +0200)] 
tests: DPP/PKEXv2 over TCP while associated

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agotests: Use check_sae_capab() where possible
Jouni Malinen [Tue, 1 Feb 2022 16:16:35 +0000 (18:16 +0200)] 
tests: Use check_sae_capab() where possible

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agotests: Fix CONFIG_DPP3=y dependency in couple of test cases
Jouni Malinen [Mon, 31 Jan 2022 16:16:29 +0000 (18:16 +0200)] 
tests: Fix CONFIG_DPP3=y dependency in couple of test cases

These could not pass without DPP3 support.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agotests: DPP PKEX over TCP and automatic connection and result reporting
Jouni Malinen [Fri, 28 Jan 2022 15:30:42 +0000 (17:30 +0200)] 
tests: DPP PKEX over TCP and automatic connection and result reporting

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agoDPP: Fix connection result reporting when using TCP
Jouni Malinen [Fri, 28 Jan 2022 15:28:49 +0000 (17:28 +0200)] 
DPP: Fix connection result reporting when using TCP

The TCP code path did not handle the postponed connection attempt on TX
status and the following result message from the Enrollee to the
Configurator. Fix this by adding TCP-versions of these operations to
match the way wpa_supplicant implemented this for the Public Action
frames.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agotests: sigma_dut and DPP PKEX over TCP
Jouni Malinen [Thu, 27 Jan 2022 18:50:39 +0000 (20:50 +0200)] 
tests: sigma_dut and DPP PKEX over TCP

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agotests: sigma_dut and additional protocol tests for DPP Network Intro
Jouni Malinen [Thu, 27 Jan 2022 16:44:57 +0000 (18:44 +0200)] 
tests: sigma_dut and additional protocol tests for DPP Network Intro

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agoDPP: Testing capability for invalid Protocol Version in Network Intro
Jouni Malinen [Thu, 27 Jan 2022 16:42:54 +0000 (18:42 +0200)] 
DPP: Testing capability for invalid Protocol Version in Network Intro

This extends dpp_test functionality to allow DPP Network Introduction
exchanges to use an incorrect value in the Protocol Version attribute.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agotests: sigma_dut forcing PKEX v1 only
Jouni Malinen [Tue, 25 Jan 2022 22:14:27 +0000 (00:14 +0200)] 
tests: sigma_dut forcing PKEX v1 only

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agotests: DPP PKEX over TCP
Jouni Malinen [Mon, 24 Jan 2022 22:35:58 +0000 (00:35 +0200)] 
tests: DPP PKEX over TCP

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
3 years agoDPP3: PKEX over TCP
Jouni Malinen [Mon, 24 Jan 2022 22:35:36 +0000 (00:35 +0200)] 
DPP3: PKEX over TCP

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
3 years agotests: Update DPP PKEX version indication style
Jouni Malinen [Tue, 25 Jan 2022 18:16:18 +0000 (20:16 +0200)] 
tests: Update DPP PKEX version indication style

Update test cases to match implementation.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agoDPP: Change PKEX version configuration design
Jouni Malinen [Tue, 25 Jan 2022 18:06:49 +0000 (20:06 +0200)] 
DPP: Change PKEX version configuration design

Use a separate ver=<1|2> parameter to DPP_PKEX_ADD instead of
overloading init=1 with version indication. This allows additional
options for forcing v1-only and v2-only in addition to automatic mode
(start with v2 and fall back to v1, if needed).

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agotests: DPP PKEXv2 initiator fallback to v1 in hostapd
Jouni Malinen [Mon, 24 Jan 2022 18:59:12 +0000 (20:59 +0200)] 
tests: DPP PKEXv2 initiator fallback to v1 in hostapd

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agoDPP3: Add PKEX initiator retries and fallback from v2 to v1 for hostapd
Jouni Malinen [Mon, 24 Jan 2022 18:57:19 +0000 (20:57 +0200)] 
DPP3: Add PKEX initiator retries and fallback from v2 to v1 for hostapd

This extends hostapd with the design used in wpa_supplicant for PKEX
initiator retries and automatic version fallback from v2 to v1 (the
latter is enabled only with CONFIG_DPP3=y).

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agoDPP: Handle TX status events for broadcast DPP messages
Jouni Malinen [Mon, 24 Jan 2022 18:28:13 +0000 (20:28 +0200)] 
DPP: Handle TX status events for broadcast DPP messages

Report TX status for DPP messages even if the destination address was
broadcast. This is needed to get appropriate trigger for PKEX retries.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agotests: sigma_dut DPP/PKEXv2 initiator and fallback to v1
Jouni Malinen [Mon, 24 Jan 2022 18:24:53 +0000 (20:24 +0200)] 
tests: sigma_dut DPP/PKEXv2 initiator and fallback to v1

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agoDPP3: Start with PKEXv2 and fall back to v1
Jouni Malinen [Mon, 24 Jan 2022 18:21:24 +0000 (20:21 +0200)] 
DPP3: Start with PKEXv2 and fall back to v1

Use automatic PKEX version negotiation as the initiator by starting with
PKEXv2 and if no response is received, trying again with PKEXv1. For
now, this is enabled only in wpa_supplicant CONFIG_DPP3=y builds.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agotests: Update dpp_proto_after_wrapped_data_pkex_cr_req for PKEXv2
Jouni Malinen [Mon, 24 Jan 2022 20:58:04 +0000 (22:58 +0200)] 
tests: Update dpp_proto_after_wrapped_data_pkex_cr_req for PKEXv2

Check for both PKEX v1 and v2 variants of the message.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>