Commit graph

17555 commits

Author SHA1 Message Date
Jouni Malinen
6c850a1c06 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>
2022-02-26 19:12:11 +02:00
Jouni Malinen
fa34e3255e 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>
2022-02-26 19:12:11 +02:00
Ajit Vaishya
a44fa15cb1 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>
2022-02-24 01:47:53 +02:00
Jouni Malinen
7a8fff486f 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>
2022-02-24 00:23:25 +02:00
Jouni Malinen
414ca953f1 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>
2022-02-24 00:23:25 +02:00
Jouni Malinen
0b5f8e3d8e 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>
2022-02-24 00:23:25 +02:00
Jouni Malinen
2fcc076d1c 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>
2022-02-24 00:23:25 +02:00
Jouni Malinen
d5fba20c1e 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>
2022-02-24 00:23:25 +02:00
Jouni Malinen
010e7dddce 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>
2022-02-24 00:23:25 +02:00
Jouni Malinen
7a7f803a90 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>
2022-02-24 00:23:11 +02:00
Jouni Malinen
00163fd741 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>
2022-02-22 00:05:56 +02:00
Jouni Malinen
b367366dd7 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>
2022-02-22 00:04:15 +02:00
Jouni Malinen
aa2f595bf2 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>
2022-02-21 18:34:42 +02:00
Jouni Malinen
e942c32e97 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>
2022-02-21 18:26:02 +02:00
Jouni Malinen
d5fbbbbc4c 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>
2022-02-18 16:47:29 +02:00
Jouni Malinen
d2e11b7dea tests: MACsec with GCM-AES-256
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-02-17 01:05:08 +02:00
leiwei
7e941e7a15 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>
2022-02-17 01:05:08 +02:00
leiwei
46c635910a 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>
2022-02-16 22:54:49 +02:00
Jouni Malinen
1e0af0cc7e 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>
2022-02-16 21:29:54 +02:00
Jouni Malinen
42944de69b 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>
2022-02-16 21:09:57 +02:00
Jouni Malinen
64008a1ee8 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>
2022-02-16 19:57:49 +02:00
Jouni Malinen
2e166d9e5b 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>
2022-02-15 20:54:24 +02:00
Jouni Malinen
346b490505 tests: DPP session clearing on failure during GAS request handling
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-02-15 16:41:25 +02:00
Jouni Malinen
340ec48cdd 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>
2022-02-15 16:24:43 +02:00
Jouni Malinen
7e6f59c702 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>
2022-02-15 16:24:43 +02:00
Jouni Malinen
db7f14c825 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>
2022-02-15 13:06:36 +02:00
Jouni Malinen
b81c568223 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>
2022-02-15 12:45:09 +02:00
Jouni Malinen
b9897f1f3c 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>
2022-02-15 00:34:55 +02:00
Jouni Malinen
f5ce9111c5 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 dd900637b2 ("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>
2022-02-15 00:18:07 +02:00
Jouni Malinen
781720fb1a 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>
2022-02-15 00:02:34 +02:00
Sreeramya Soratkal
9d5fd33282 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>
2022-02-10 17:57:23 +02:00
Jouni Malinen
19169a53aa 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>
2022-02-10 17:54:43 +02:00
Jouni Malinen
f43d31dda7 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>
2022-02-09 20:43:53 +02:00
Narasimha Rao PVS
a91072503c 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>
2022-02-09 20:32:17 +02:00
Jouni Malinen
f5c8697c04 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>
2022-02-09 20:25:30 +02:00
Jouni Malinen
f1e4b23086 tests: WPA2-PSK-FT and different OCV capability between APs
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-02-09 17:30:02 +02:00
Jouni Malinen
c4dc90c1c0 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>
2022-02-04 21:29:52 +02:00
Jouni Malinen
632a9995c8 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>
2022-02-04 21:26:24 +02:00
Jouni Malinen
f80d7757fa 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>
2022-02-04 21:24:19 +02:00
Liangwei Dong
ac1e3a7f0e 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>
2022-02-04 18:58:55 +02:00
Jouni Malinen
1d1e3184b9 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>
2022-02-04 18:23:47 +02:00
Jayachandran Sreekumaran
1646883f43 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>
2022-02-04 18:23:41 +02:00
Nirav Shah
2faaa193f3 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>
2022-02-04 18:10:23 +02:00
Jouni Malinen
f9905f8d94 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>
2022-02-04 12:15:41 +02:00
Jouni Malinen
1f26a0a34c 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>
2022-02-04 12:15:33 +02:00
Jouni Malinen
07e26b2926 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>
2022-02-04 12:15:30 +02:00
Jouni Malinen
a6d157b6f6 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>
2022-02-04 00:23:19 +02:00
Jouni Malinen
3fb6b7fed6 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>
2022-02-04 00:23:19 +02:00
Jouni Malinen
8121cd3934 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>
2022-02-04 00:23:19 +02:00
Jouni Malinen
da65e71360 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>
2022-02-04 00:13:12 +02:00