Commit graph

18849 commits

Author SHA1 Message Date
Chunquan Luo
c80ded25c2 Refine roam stats frame subtypes in a QCA vendor attribute
Enumeration qca_wlan_roam_stats_frame_subtype defines the various frame
subtypes which may be collected by the driver and reported via the
QCA_WLAN_VENDOR_ATTR_ROAM_STATS_FRAME_SUBTYPE attribute.

Two of the enumerators are:
* QCA_WLAN_ROAM_STATS_FRAME_SUBTYPE_PREAUTH
* QCA_WLAN_ROAM_STATS_FRAME_SUBTYPE_REASSOC

These were initially defined and used to respectively report
Authentication Response and Reassociation Response frames.

Now there is a requirement to also report Authentication Request and
Reassociation Request frames. In order to satisfy this requirement,
add two new enumerators:
* QCA_WLAN_ROAM_STATS_FRAME_SUBTYPE_AUTH_REQ
* QCA_WLAN_ROAM_STATS_FRAME_SUBTYPE_REASSOC_REQ

Note that the first of these uses the standard term "AUTH" instead of
the confusing term "PREAUTH" used previously.

And to align with that naming, and in order to clearly show the usage
of the original enumerators, rename them to:
* QCA_WLAN_ROAM_STATS_FRAME_SUBTYPE_AUTH_RESP
* QCA_WLAN_ROAM_STATS_FRAME_SUBTYPE_REASSOC_RESP

Furthermore, Authentication Request/Response frame refers to the
Authentication frames sent by the non-AP STA and AP, respectively.

And finally, to support backward compatibility with applications using
the original enumerators, redefine those in terms of the new names.

Signed-off-by: Chunquan Luo <quic_chunquan@quicinc.com>
2023-09-22 11:20:18 +03:00
Chunquan Luo
ed89ab429f Update roam stats of AP BSSID to user space in a QCA vendor attribute
Fetch AP BSSID from each roam connection frame and cache the info in the
WLAN driver. When user space gets roam stats by
QCA_WLAN_VENDOR_ATTR_ROAM_STATS_INFO, user space can now collect the AP
BSSID info for roam issue.

Signed-off-by: Chunquan Luo <quic_chunquan@quicinc.com>
2023-09-22 11:15:25 +03:00
Jouni Malinen
881cb4198b EAP-SIM/AKA peer: Simplify identity selection for MK derivation
Redesign the identity selection for MK derivation to be done explicitly
based on the last indicated identity (whether it is from
EAP-Response/Identity or method specific AT_IDENTITY) during the current
exchange. This makes the implementation cleaner and avoids cases were
more or less duplicated selection steps ended up being slightly
different. This is not as clean as it could otherwise be due to the
exception needed for the IMSI privacy case where the identity used in MK
derivation is actually not the one exchanged in the EAP messages.

Furthermore, this moves the somewhat confusing EAP method specific
tracking of the lasgt EAP-Response/Identity value from EAP-SIM/AKA into
the main EAP peer implementation.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2023-09-21 11:55:49 +03:00
Jouni Malinen
71b26a7675 tests: Adding EAP-SIM/AKA coverage for ID selection
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2023-09-21 11:55:49 +03:00
Jouni Malinen
ec6acdbb6b EAP-SIM/AKA server: Configurable limit to fast re-authentication
Allow the EAP-SIM/AKA server to be configured to use a smaller limit for
the number of times fast re-authentication can be used before falling
back to running full authentication. This is particularly useful for EAP
peer testing to cover cases when falling back from fast
re-authentication to full authentication in various different cases.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2023-09-21 11:55:49 +03:00
Jouni Malinen
c6268e103f EAP-SIM/AKA server: Allow method specific identity exchange to be skipped
While the EAP-SIM/AKA RFCs recommend against doing this, some deployed
authentication servers use the identity from the EAP-Response/Identity
directly without using an EAP method specific indication (AT_IDENTITY).
Having a capability to configure hostapd EAP server to behave in this
manner helps in increasing testing coverage for the EAP peer
implementation.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2023-09-21 11:55:49 +03:00
Jouni Malinen
40af6560ba EAP-SIM/AKA peer: Fix identity selection for MK derivation with AT_IDENTITY
A case was missing in the way wpa_supplicant was tracking the identity
that is used when deriving MK if the EAP server does not follow the RFC
guidance on using EAP method specific identity determination (i.e.,
AT_IDENTITY for EAP-SIM/AKA) combined with a fallback from fast
re-authentication to full authentication. wpa_supplicant ended up using
the actual identity instead of the last identity included in an EAP
message even though MK derivation is supposed to use the identity that
was included in the last AT_IDENTITY or in the EAP-Response/Identity if
AT_IDENTITY was not used. This resulted in such an authentication
attempt failing due to incorrect MK being derived and AT_MAC validation
resulting in an mismatch.

Fix this by checking for the case where fast re-authentication is
attempted and the server recognizes the fast re-auth identity, but
decides to fall back to full authentication without a separate EAP
method specific identity exchange using AT_IDENTITY. This allows the
fast re-auth identity from EAP-Response/Identity to be used in MK
derivation in such cases.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2023-09-21 11:55:49 +03:00
Shailendra Singh
bc9256980e Define a QCA vendor attribute to set traffic shaping policy
Define a new QCA vendor attribute to configure traffic
shaping policy applied during coex scenarios.

Signed-off-by: Shailendra Singh <quic_shasing@quicinc.com>
2023-09-19 23:47:00 +03:00
Adil Saeed Musthafa
dec5ab645c Add _IS_ML flag attribute to the ADD_STA_NODE QCA vendor command
Add an attribute QCA_WLAN_VENDOR_ATTR_ADD_STA_NODE_IS_ML to the
ADD_STA_NODE command. If this attribute is set, it implies that the node
being added is an MLD node.

Signed-off-by: Adil Saeed Musthafa <quic_adilm@quicinc.com>
2023-09-19 23:41:48 +03:00
Veerendranath Jakkam
0d65e27fb2 Extend maximum allowed bandwidth update type QCA vendor interface
Extend QCA_WLAN_VENDOR_ATTR_CONFIG_CHAN_WIDTH_UPDATE_TYPE attribute to
support handling interoperability issues with APs which don't handle
the maximum bandwidth change indication correctly.

Additionally define an enum for possible values of
QCA_WLAN_VENDOR_ATTR_CONFIG_CHAN_WIDTH_UPDATE_TYPE.

Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
2023-09-19 23:32:49 +03:00
mukul sharma
e510a3badc Add QCA vendor attributes to indicate MLO capabilities
Add QCA vendor attributes to indicate various MLO capabilities supported
by the WLAN driver to userspace. These capabilities are usually reported
by the firmware during the initial bootup handshake with the driver.

Signed-off-by: Mukul Sharma <quic_mukul@quicinc.com>
2023-09-19 23:26:56 +03:00
Yu Wang
e5ccbfc69e Split long comment lines in QCA vendor related definitions
Fix one of the style problems in qca-vendor.h.

Signed-off-by: Yu Wang <quic_yyuwang@quicinc.com>
2023-09-08 19:57:00 +03:00
Yu Wang
4c9af238c1 Fix inconsistent whitespace use in QCA vendor related definitions
Fix one of the style problems in qca-vendor.h.

Signed-off-by: Yu Wang <quic_yyuwang@quicinc.com>
2023-09-08 19:55:35 +03:00
Yu Wang
af6e0306b2 Fix typos in QCA vendor related definitions
Signed-off-by: Yu Wang <quic_yyuwang@quicinc.com>
2023-09-08 19:54:27 +03:00
Yu Wang
dd25885a9d Remove space-before-tab in QCA vendor related definitions
Fix one of the style problems in qca-vendor.h.

Signed-off-by: Yu Wang <quic_yyuwang@quicinc.com>
2023-09-08 19:53:17 +03:00
Kiran Kumar Lokere
f429064189 TDLS: Set EHT/MLO information for TDLS STA into the driver
Add the copied EHT capabilities into the sta_add() call when adding a
TDLS peer.

The mld_link_id value was previously only for AP mode, but it can now be
used for TDLS links as well to indicate the link on which a
single-link-TDLS direct link is negotiated.

Signed-off-by: Jouni Malinen <quic_klokere@quicinc.com>
2023-09-08 13:20:31 +03:00
Kiran Kumar Lokere
940ef9a05c TDLS: Use link-specific BSSID instead of sm->bssid for MLO cases
When the current association is with an AP MLD, the BSSID for TDLS
operations needs to be selected based on which link is used to transmit
the frames.

Signed-off-by: Jouni Malinen <quic_klokere@quicinc.com>
2023-09-08 13:20:31 +03:00
Kiran Kumar Lokere
5f30f62eea TDLS: Reply to Discovery Request on the link with matching BSSID
When the current association is with an AP MLD, the Discovery Response
needs to be sent using the link that matches the indicated BSSID.

Signed-off-by: Jouni Malinen <quic_klokere@quicinc.com>
2023-09-08 13:20:31 +03:00
Kiran Kumar Lokere
626501434b TDLS: Learn MLD link ID from TDLS Discovery Response
This is needed to be able to determine which link is used for TDLS setup
when the current association is with an AP MLD.

Signed-off-by: Jouni Malinen <quic_klokere@quicinc.com>
2023-09-08 13:13:24 +03:00
Kiran Kumar Lokere
a41c8dbdd8 TDLS: Copy peer's EHT capabilities
This is needed to be able to configure the STA entry into the driver
with the information for EHT.

Signed-off-by: Jouni Malinen <quic_klokere@quicinc.com>
2023-09-08 12:54:29 +03:00
Kiran Kumar Lokere
c7561502f2 nl80211: Use a QCA vendor command to set the link for TDLS Discovery Response
For now, only a vendor command is available for this functionality that
is needed to implement single-link TDLS during an MLO association.

Signed-off-by: Jouni Malinen <quic_klokere@quicinc.com>
2023-09-08 12:52:41 +03:00
Kiran Kumar Lokere
e3a68081bc driver: Add option for link ID to be specified for send_tdls_mgmt()
This is needed to allow the driver to know on which operating channel
(as specified by the link that is affiliated with AP MLD for the current
association) is used for transmitting TDLS Discovery Response. This
commit adds the link_id parameter to various functions, but does not
implement the driver interface change itself.

Signed-off-by: Jouni Malinen <quic_klokere@quicinc.com>
2023-09-08 12:51:37 +03:00
Kiran Kumar Lokere
f85b2b2dee Extend wpa_parse_kde_ies() to include EHT capabilities
This is needed for TDLS.

Signed-off-by: Jouni Malinen <quic_klokere@quicinc.com>
2023-09-08 12:51:30 +03:00
Jouni Malinen
3e71516936 Document per-ESS MAC address (mac_addr=3 and mac_value)
Commit 9025def55c ("wpa_supplicant: Add support for pregenerated MAC")
added this capability, but did not update wpa_supplicant.conf to
document it. Add such documentation to match the information in
config_ssid.h.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2023-09-07 18:28:24 +03:00
Jouni Malinen
b46c4b9a91 tests: Beacon protection and reconnection
Regression test case for the issue fixed in the previous commit.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2023-09-05 20:38:47 +03:00
Veerendranath Jakkam
ba1579f3bf Clear BIGTK values from wpa_supplicant state machine when not needed
wpa_supplicant does not configure BIGTK(s) to the driver when the STA
reconnects to the same AP after disconnect due to not clearing the last
configured BIGTK values during disconnect. To avoid such issues clear
the BIGTK values while clearing PTK and other group keys.

Fixes: 2d4c78aef7 ("Configure received BIGTK on station/supplicant side")
Fixes: f15cc834cb ("MLD STA: Processing of EAPOL-Key msg 3/4 frame when using MLO")
Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
2023-09-05 20:02:18 +03:00
Jouni Malinen
bae1ec693c wlantest: Minimal parsing of Basic MLE STA Profile
Debug print RSNE and RSNXE if they are present in the STA Profile.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2023-09-01 19:26:41 +03:00
Jouni Malinen
de043ec01a wlantest: Defragment the Per-STA Profile subelement
This subelement within the Basic MLE Link Info can be long enough to
require fragmentation, so defragment it before parsing.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2023-09-01 19:26:41 +03:00
Jouni Malinen
990600753d wlantest: Defragment Basic MLE before processing
The Basic Multi-Link element is going to be fragmented in many cases, so
defragment it first before trying to parse it.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2023-09-01 19:26:41 +03:00
Jouni Malinen
528abdeb67 wlantest: Learn group keys from MLO FT Reassociation Response frames
Extend FT Reassociation Response frame processing to support the new MLO
GTK/IGTK/BIGTK subelements similarly to how the MLO group keys were
already learned from EAPOL-Key msg 3/4.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2023-09-01 11:51:47 +03:00
Jouni Malinen
0cd2bfc8a4 wlantest: Fix FTE MIC calculation for MLO Reassociation Response frames
The AP's RSNE needs to be modified by inserting the PMKR1Name in the
PMKID List field for each affiliated link.

Fixes: 8cf919ffd5 ("wlantest: FTE MIC calculation for MLO Reassociation Response frame")
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2023-09-01 00:03:16 +03:00
Jouni Malinen
a845601ffe wlantest: Derive PTK in MLO using MLD MAC addresses for FT over-the-air
IEEE P802.11be/D4.0 does not seem to have changed the rules for deriving
PTK in FT hierarchy since there were no changes to 12.7.1.6.5 (PTK)
where BSSID and STA-ADDR are used. However, the MLO changes for FT and
for PTK derivation in non-FT cases seem to imply that this FT case is
also supposed to use MLD MAC addresses.

Commit 628b9f1022 ("wlantest: Derive PMK-R1 and PTK using AA/SPA for
MLO FT over-the-DS") did this already for FT over-the-DS, so do the same
for FT over-the-air.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2023-08-31 21:10:54 +03:00
Jouni Malinen
d3ab6e001f wlantest: Use non-AP MLD's MLD MAC address in FT over-the-air derivation
S1KH-ID is supposed to be SPA, so learn the MLD MAC address of the
non-AP MLD from the FT Authentication frame and use that instead of the
link address when deriving keys in FT over-the-air case.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2023-08-31 20:47:00 +03:00
Kiran Kumar Lokere
377d617b57 Define new BSS command info mask for AP MLD address
The ap_mld_addr entry was added without introducing a new mask bit which
does not follow the expected style for adding new information into the
BSS command and might result in unexpected behavior for external
components. Define a new BSS command information mask bit for this AP
MLD address and print the AP MLD address in the BSS info only if the
mask bit is set.

Fixes: db99e7341a ("Add AP MLD address into BSS command output")
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2023-08-31 15:23:05 +03:00
Jouni Malinen
770e5a808f wlantest: Determine whether A1 points to STA once in rx_data_bss_prot()
Use the initial BSS/STA routines to determine whether A1 points to STA
instead of maintaining multiple somewhat different ways of doing this.
In addition to making the code easier to maintain, this fixes at least
some cases where incorrect tx/rx_tid or rsc_tods/fromds value was
selected for 4-address frames.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2023-08-31 15:02:02 +03:00
Jouni Malinen
850dc14829 wlantest: Remove duplicated A1/A2/A3 override detection for MLO
Use the A1/A2/A3 overrides for MLO determined within rx_data_bss_prot()
in try_ptk_decrypt() to avoid duplicated code in these two functions.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2023-08-31 14:44:41 +03:00
Jouni Malinen
6ce745bb87 wlantest: MLO support for decrypting 4-address frames
Search the A1/A2 values in 4-address frames using the MLO enabled
functions to allow appropriate STA entries to be located when these
frames are used with MLO.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2023-08-31 14:32:55 +03:00
Jouni Malinen
f6dcd326fe wlantest: Indicate ToDS/FromDS values for BSS DATA entries
This makes it a bit more convenient to debug decryption issues.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2023-08-31 12:33:45 +03:00
Gururaj Pandurangi
f6eaa7b729 Add QCA vendor attribute for TTLM negotiation support type
Add a vendor attribute for an EHT DUT to configure the type of TID-To-Link
Mapping Negotiation Support for testing purposes.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2023-08-31 12:13:53 +03:00
Will Huang
12fabc4765 Add QCA vendor attribute for configuring max A-MPDU aggregation count
Add a QCA vendor attribute QCA_WLAN_VENDOR_ATTR_CONFIG_PEER_AMPDU_CNT to
enable configuration of TX maximum aggregate size with a specific peer.
This can be used to improve performance in noisy environment. In AP
mode, the peer MAC address of the associated STA is specified with
QCA_WLAN_VENDOR_ATTR_CONFIG_PEER_MAC.

Signed-off-by: Will Huang <quic_wilhuang@quicinc.com>
2023-08-31 12:06:33 +03:00
Will Huang
b3d852560b Change QCA vendor configure attribution name of peer MAC address
Rename the attribute QCA_WLAN_VENDOR_ATTR_CONFIG_RX_BLOCKSIZE_PEER_MAC
to a generic name QCA_WLAN_VENDOR_ATTR_CONFIG_PEER_MAC, so other
configuration commands can reuse it. And make backward compatibility of
QCA_WLAN_VENDOR_ATTR_CONFIG_RX_BLOCKSIZE_PEER_MAC, define it as same
value of QCA_WLAN_VENDOR_ATTR_CONFIG_PEER_MAC (35).

Signed-off-by: Will Huang <quic_wilhuang@quicinc.com>
2023-08-31 12:01:45 +03:00
Nijun Gong
123d16d860 Update hw_mode when CSA finishes
The driver might decide to change the operating band on its own, e.g.,
when trying to use a single channel in AP + AP case. A CSA event will be
notified to hostapd to update the channel/frequency, but hw_mode did not
get updated accordingly.

This may cause hostapd interface restarting to fail, e.g., with control
interface DISABLE / ENABLE commands at configured_fixed_chan_to_freq(),
because of the mismatch between conf->channel and conf->hw_mode.

Update hw_mode right after channel change to fix this.

Signed-off-by: ngong <quic_ngong@quicinc.com>
2023-08-30 16:37:37 +03:00
Veerendranath Jakkam
32dcec9529 Send actual MFP configuration when driver takes care of BSS selection
Send the actual MFP configuration value to the driver instead of
overriding it with MFP required based on the wpa_supplicant selected BSS
when the driver takes care of BSS selection.

This is needed to allow the driver to know whether it can select an MFP
disabled BSS.

Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
2023-08-30 15:25:51 +03:00
Purushottam Kushwaha
edfca280cb SCS: Add support for optional QoS Charateristics parameters
Per IEEE P802.11be/D4.0, 9.4.2.316 (QoS Characteristics element), enable
support for the following optional QoS Characteristics parameters:
 - Maximum MSDU Size
 - Service Start Time
 - Service Start Time LinkID
 - Mean Data Rate
 - Delayed Bounded Burst Size
 - MSDU Lifetime
 - MSDU Delivery Info
 - Medium Time

Signed-off-by: Purushottam Kushwaha <quic_pkushwah@quicinc.com>
2023-08-28 16:06:50 +03:00
Purushottam Kushwaha
33da386553 SCS: Add support for QoS Characteristics in SCS request
Add support to configure the mandatory QoS Characteristics parameters
per IEEE P802.11be/D4.0, 9.4.2.316 (QoS Characteristics element), in SCS
request:
 - Minimum Service Interval
 - Maximum Service Interval
 - Minimum Data Rate
 - Delay Bound

Enable STA SCS traffic descriptor support for EHT connection when the
connected EHT AP advertises SCS traffic descriptor capability in the EHT
Capabilities element.

Signed-off-by: Purushottam Kushwaha <quic_pkushwah@quicinc.com>
2023-08-28 16:06:50 +03:00
Purushottam Kushwaha
c437665041 Add Non EHT SCS Capability in (Re)Association Request frames
Set WFA capability to allow non-EHT SCS Traffic support in association
elements when the AP advertises support for non-EHT SCS Traffic support
via Beacon or Probe Response frame. This capability is upper layer
functionality and as such, does not need a separate driver capability
indication or configuration, but indicate this only if the AP supports
the feature to minimize risk of interoperability issues with a new
information element.

Signed-off-by: Purushottam Kushwaha <quic_pkushwah@quicinc.com>
2023-08-28 16:06:50 +03:00
Purushottam Kushwaha
12154861e2 Add support for conversion to little endian for 24 bits
Like le16/le32, add support for conversion to le24.

Signed-off-by: Purushottam Kushwaha <quic_pkushwah@quicinc.com>
2023-08-28 13:58:13 +03:00
Gururaj Pandurangi
609864d6a8 Add QCA vendor attribute to configure MLD ID in ML probe request
Add a vendor attribute for EHT testbed STA to configure MLD ID in the ML
Probe Request frame transmitted as part of host initiated scan request.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2023-08-28 13:57:14 +03:00
Jouni Malinen
20febfd783 wlantest: Dump MLO association information in debug
Print the MLD MAC addresses and link addresses for both the AP MLD and
non-AP MLD when processing (Re)Association Request frames.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2023-08-28 13:25:07 +03:00
Jouni Malinen
d12a3dce82 wlantest: Store and check SNonce/ANonce for FT Authentication
Store SNonce and ANonce from FT Authentication frames during FT
over-the-air so that these values are available for processing the FT
reassociation frames.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2023-08-28 13:25:07 +03:00