Commit graph

17442 commits

Author SHA1 Message Date
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
Sunil Ravi
9aaf3e1d13 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>
2022-02-03 00:35:49 +02:00
Jouni Malinen
263daa30b5 tests: DPP Configurator with config query
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-02-03 00:35:49 +02:00
Jouni Malinen
033ad6ffaa 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>
2022-02-03 00:35:49 +02:00
Jouni Malinen
d4961a7755 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>
2022-02-02 16:59:59 +02:00
Jouni Malinen
9a90aab12b 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>
2022-02-02 16:59:59 +02:00
Jouni Malinen
6751fb0604 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>
2022-02-02 16:59:59 +02:00
Jouni Malinen
34575ad72e 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>
2022-02-01 19:58:40 +02:00
Jouni Malinen
bf4002e251 tests: WPA2-PSK AP with PMF association comeback (using radio_disabled)
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-02-01 19:53:08 +02:00
Jouni Malinen
e07000e748 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>
2022-02-01 19:53:08 +02:00
Jouni Malinen
c0e6aa3450 tests: DPP/PKEXv2 over TCP while associated
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-02-01 19:53:08 +02:00
Jouni Malinen
a8c43b1822 tests: Use check_sae_capab() where possible
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-02-01 18:16:35 +02:00
Jouni Malinen
4feb46ddb4 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>
2022-01-31 18:16:29 +02:00
Jouni Malinen
8670a80ea7 tests: DPP PKEX over TCP and automatic connection and result reporting
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-01-28 17:30:42 +02:00