Commit graph

19855 commits

Author SHA1 Message Date
Jouni Malinen
ffc9fa0132 Pass CSA parameters by reference instead by value
There is no need to make a copy of the full struct csa_settings for
this.

Fixes: 5cb6747f97 ("Add support to switch channel when CAC is in progress")
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2024-09-06 01:06:32 +03:00
Shivani Baranwal
1527a95ba0 Add QCA vendor subcommand to trigger Channel Usage Request
Add a new QCA vendor subcommand QCA_NL80211_VENDOR_SUBCMD_CHAN_USAGE_REQ
to support Channel Usage Request. It carries channel usage information
for BSSs that are not infrastructure BSSs or an off channel TDLS direct
link.

Implementation and scheduling of Channel Usage frames are present in the
driver/firmware. One of the key reason for this is that the TSF
timestamp required to be filled in these frames is available only in the
firmware.  So, this interface is used to configure the required
parameters to the driver/firmware for Channel Usage Request frame.

This uses attributes defined in enum
qca_wlan_vendor_attr_chan_usage_req.

Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
2024-09-06 01:06:32 +03:00
Veerendranath Jakkam
c0c877a1f1 QCA vendor test configuration to add random PMKIDs in RSNE
Add QCA vendor test configuration interface to add random PMKIDs in the
RSNE of the (Re)Association Request frames.

Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
2024-09-06 01:06:32 +03:00
Shivani Baranwal
a6fd2467b9 PASN: Allow frequency to be set for responder
This will be needed for P2P2 cases.

Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
2024-09-06 01:06:32 +03:00
Shivani Baranwal
d5c07aaab9 P2P2: Parse new attributes
Recognize new attributes when parsing P2P2 IE.

Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
2024-09-06 01:06:32 +03:00
Shivani Baranwal
0f854cb351 P2P2: Add PMKSA caches for PASN initiator and responder
These are needed for pairing.

Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
2024-09-06 01:06:32 +03:00
Shivani Baranwal
8426e5274f PASN: Use allocated memory for RSNXE and allow its contents to be set
This will be needed for P2P2 cases.

Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
2024-09-06 01:06:32 +03:00
Shivani Baranwal
d582f8ce9b PASN: PASN Encrypted Data element parsing
Add the PASN Encrypted Data element from IEEE P802.11bh/D6.0 into the
element parser. This is needed for P2P2.

Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
2024-09-06 01:06:32 +03:00
Shivani Baranwal
58cc67c72f P2P2: Export p2p_build_go_neg_req()
This is needed for PASN pairing.

Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
2024-09-06 01:06:32 +03:00
Shivani Baranwal
ff97a762bc P2P: Debug print details on address mapping errors
Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
2024-09-06 01:06:32 +03:00
Shivani Baranwal
27de11ca5c nl80211: Configure capability flag for NAN USD offload
Configure the capability flag based on the nl80211 feature advertisement
for NAN USD offload support.

Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
2024-09-06 01:06:32 +03:00
Vinay Gannevaram
5cb1929da6 Add QCA vendor feature flags to indicate NAN USD offload support
Add a separate feature flag to indicate support for NAN USD offload
feature.

Signed-off-by: Vinay Gannevaram <quic_vganneva@quicinc.com>
2024-09-06 01:06:32 +03:00
Shivani Baranwal
58f04221fd nl80211: NAN USD commands for offloading
Add driver nl80211 support for the NAN USD flush, publish, subscribe,
update publish, cancel publish and cancel subscribe commands for cases
where these operations are offloaded to the driver
(WPA_DRIVER_FLAGS2_NAN_OFFLOAD).

Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
2024-09-06 01:06:32 +03:00
Shivani Baranwal
456c3a0237 P2P2: Do not include WPS IE in GO Negotiation
Do not include WPS IE when going through GO Negotiation with a P2P2
peer.

Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
2024-09-06 01:06:32 +03:00
Shivani Baranwal
839b52eaf8 P2P2: Fragment P2P IE if subelements are too long in GO Negotiation
Add a function to fragment P2P/P2P2 IE exceeding 255 bytes in size and
use this for P2P IE in GO Negotiation frames in preparation for P2P2.

Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
2024-09-06 01:06:32 +03:00
Shivani Baranwal
c958a571a4 P2P2: GO Negotiation Action frame contents for wrapped case
Support generation of the GO Negotiation frames with contents that is
needed for P2P2 wrapped case.

Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
2024-09-06 01:06:32 +03:00
Jouni Malinen
64bfba98bd P2P: Use enum p2p_status_code more consistently for PD
It is clearer to use enum p2p_status_code instead of u8 when processing
and passing the P2P Status Code to other components.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2024-09-06 01:06:32 +03:00
Shivani Baranwal
e633b471bc P2P2: Refactor GO Negotiation and Invitation processing
Add wrapper functions to process and prepare a response for GO
Negotiation and Invitation frames. Send the response Action frames in
handle_ functions. This is in preparation for encapsulating these
messages within PASN Authentication frames for P2P2.

Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
2024-09-06 01:06:27 +03:00
Shivani Baranwal
b7de417c8a PASN: Define PMKSA helper functions for initiator and responder
Define helper functions to init, add, get, remove, flush, and deinit
PMKSA cache for PASN initiator and responder. P2P devices can be in
a role of pairing initiator and responder. Hence define a cache for
each role separately.

Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
2024-09-05 23:56:16 +03:00
Shivani Baranwal
cb9b1f8c5a PASN: Optional KEK derivation in PTK
Add support to derive KEK in PTK per IEEE P802.11bh/D6.0. This can be
used to encrypt keys and passwords in opportunistic P2P pairing defined
in P2P2.

Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
2024-09-05 23:56:16 +03:00
Shivani Baranwal
17a891fd5e P2P2: Notify bootstrapping request and completed events
Add support to notify P2P2 bootstrapping request and completed events to
the user.

Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
2024-09-05 23:56:13 +03:00
Shivani Baranwal
11a573f313 P2P2: Add a new method to P2P_CONNECT control interface command
Add a new method "pair" to indicate the connect request perform the
Wi-Fi Direct R2 methods like bootstrapping and pairing for connection.
This fixes control interface command parsing which expects method as
mandatory.

Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
2024-09-03 11:05:45 +03:00
Michael-CY Lee
bde17063d5 hostapd: Do not indicate a punctured secondary channel in HT operation
If the secondary channel is punctured, the HT operation in the Beacon
frames should not indicate a secondary channel offset.

Co-developed-by: Money Wang <money.wang@mediatek.com>
Signed-off-by: Michael-CY Lee <michael-cy.lee@mediatek.com>
2024-09-01 16:39:57 +03:00
Sergey Matyukevich
809d9d8172 macsec_linux: Hardware offload requires Linux headers >= v5.7
Hardware offload in Linux macsec driver is enabled in compile time if
libnl version is >= v3.6. This is not sufficient for successful build
since enum 'macsec_offload' has been added to Linux header if_link.h
in kernels v5.6 and v5.7, see commits:
- 21114b7fee
- 76564261a7

New libnl with older Linux headers is a valid combination. This is how
hostapd build failure has been detected by Buildroot autobuilder, see:
- http://autobuild.buildroot.net/results/b59d5bc5bd17683a3a1e3577c40c802e81911f84/

Extend compile time condition for the enablement of the macsec hardware
offload adding Linux headers version check.

Fixes: 40c1396644 ("macsec_linux: Add support for MACsec hardware offload")
Signed-off-by: Sergey Matyukevich <geomatsi@gmail.com>
2024-09-01 16:36:11 +03:00
Jouni Malinen
3ab781fb29 tests: DPP and SAE password identifier
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2024-09-01 16:33:26 +03:00
Jouni Malinen
0012c4433c DPP: Support for provisioning SAE password identifiers (Configurator)
Allow SAE password identifiers to be provisioned to Enrollees that
indicate support for this capability.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2024-09-01 16:32:39 +03:00
Dan Harkins
782c89c359 DPP: Support for provisioning SAE password identifiers (Enrollee)
DPP supports provisioning of SAE password identifiers to uniquely
identify a password if the enrollee indicates support for them. Indicate
Enrollee support for that and add the received value into the network
profile.

I put everything under defines for CONFIG_DPP3 as this is a bleeding
edge feature in DPP.

This was tested against my DPP reference implementation acting as the
Configurator.

Signed-off-by: Dan Harkins <dharkins@lounge.org>
2024-09-01 16:06:18 +03:00
Cermak Dominik
de40e08f70 nl80211: Pass "global" events to all interfaces
We got connection failures because of outdated channel information.
That's because the NL80211_CMD_REG_CHANGE event is important for all
interfaces.

Commit f136837202 ("nl80211: Pass wiphy events to all affected
interfaces") skips the early termination for events directed to a wiphy,
but that doesn't cover the regulatory change event because it doesn't
have a wiphy set either. Therefore the early termination still kicks in
and from three interfaces, only one got the updated channel list.

Fix this by changing the early termination logic to only apply to events
directed either to a specific interface index for wdev.

Signed-off-by: Dominik Cermak <dominik.cermak@joynext.com>
2024-09-01 15:39:36 +03:00
Jouni Malinen
c3ee46bcbe AP MLD: Check SAE message length without depending on pointer arithemetic
The way this was checked previously used pointer arithmetic could result
in undefined behavior due to the pointer ending up pointing more than
one byte beyond the end of the buffer. Avoid this by checking the buffer
length before incrementing the pointer.

Fixes: bcbe80a66a ("AP: MLO: Handle Multi-Link element during authentication")
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2024-09-01 13:24:29 +03:00
Jouni Malinen
63df62c6c0 AP MLD: Work around delayed STA entry addition for SAE confirm
The driver is expected to have an STA entry for a non-AP MLD ready to
translate the address fields for SAE confirm messages. However, there is
at least a theoretical race condition in a case where the peer sends the
SAE confirm message quickly enough for the driver translation mechanism
to not be available to update the SAE confirm message addresses. Work
around that by searching for the STA entry using the link address of the
non-AP MLD if no match is found based on the MLD MAC address.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2024-09-01 13:14:12 +03:00
Aditya Kumar Singh
f3fd2f699f tests: AP MLD control socket connectivity test case
Add a simple test case to bring up a two link AP MLD and get the status
of each link via the MLD level control socket.

Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
2024-09-01 12:09:46 +03:00
Aditya Kumar Singh
14cb3906af AP MLD: Introduce MLD level control interface socket
With MLO, each link have socket created with "<ifname>_link<link id>"
under the control interface directory.

Introduce a MLD level socket "<ifname>" as well under the same control
interface directory. This socket can be used to pass the command to its
partner links directly instead of using the link level socket. Link ID
needs to be passed with the command in a prefix way. If no Link ID is
provided the first link ID is selected.

The structure of the command is -
 "LINKID <link id> <COMMAND APPLICABALE FOR THE LINK>"

Directory looks something like this -
  $ ls /var/run/hostapd/
    wlan0
    wlan0_link0
    wlan0_link1

wlan0 here is the MLD level socket. Rest are each link level sockets.

This also helps to maintain backwards compatibility with applications
which looks for <ifname> under the control interface directory.

Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
2024-09-01 11:49:00 +03:00
Aditya Kumar Singh
757d8d9aac tests: MLO: Use link ID to access control sockets
With MLO, each BSS will create sockets under the given ctrl_iface
directory with the socket name being '<ifname>_link<link_ID>'.

Make necessary changes in MLO related test cases so that it can access
the new socket and proceed further as expected.

Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
2024-09-01 11:17:11 +03:00
Karthikeyan Kathirvel
61dfd7ae35 AP MLD: Create link based hostapd control sockets
Create link based control sockets to access the link based commands
through hostapd_cli. This will create the link interfaces in the name of
<ifname>_link<X>

Example:
To fetch link 0 status from wlan0, below command can be used -
    $ hostapd_cli -i wlan0 -l 0 status

On failure of link/interface selection, below error will be observed
    $ hostapd_cli -i wlan0 -l 2 status
    Failed to connect to hostapd - wpa_ctrl_open: No such file or directory

Signed-off-by: Karthikeyan Kathirvel <quic_kathirve@quicinc.com>
Co-developed-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
2024-09-01 11:17:03 +03:00
Jouni Malinen
8625001ce5 tests: Clear scan cache in wifi_display_parsing
This is needed to avoid false failures if an old BSS entry is still
present for dev[0]. This could happen, e.g., with the following test
case sequence: wpas_mesh_max_peering wifi_display_parsing

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2024-08-29 20:21:31 +03:00
Shivani Baranwal
b7963348cd Add QCA vendor attribute to disable channel switch initiation
Add a test config u8 attribute to disable the channel switch
initiation in P2P GO mode.

Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
2024-08-29 20:11:06 +03:00
Jouni Malinen
d15403aefb tests: Make rsn_override_mld_too_long_elems more robust
Wait longer for the disconnection event since the previous wait was
exactly the same length as the authentication timeout in wpa_supplicant
and as such, subject to race conditions.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2024-08-29 20:10:22 +03:00
Jouni Malinen
3935d78e7b tests: More robust error handling for wifi_display_parsing
Check explicitly that wfd_subelems is present in the dict instead of
failing on a key error when trying to fetch it.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2024-08-29 20:10:22 +03:00
Lo,Chin-Ran
2b7277d3f0 USD: Move control interface events to notify.c
This separates the control interface specific generation of a text event
message away from the main implementation of USD and makes it more
convenient to add support for other control interface mechanisms like
dbus.

Signed-off-by: Lo,Chin-Ran <chin-ran.lo@nxp.com>
2024-08-28 11:24:11 +03:00
Vinay Gannevaram
97c6ef2588 QCA vendor interface to set the P2P mode configuration
Add the QCA_NL80211_VENDOR_SUBCMD_SET_P2P_MODE for setting the P2P mode
in which the P2P Group Owner (GO) should be brought up. These modes
include Wi-Fi Direct R1 only, Wi-Fi Direct R2 only, and P2P Connection
Compatibility Mode, which supports both R1 and R2. These modes are
defined in the enum qca_wlan_vendor_p2p_mode.

Signed-off-by: Vinay Gannevaram <quic_vganneva@quicinc.com>
2024-08-28 00:11:42 +03:00
Kiran Kumar Lokere
e33acc2178 Add QCA vendor attribute to change P2P GO beacon interval
Add new QCA vendor attribute to configure the P2P GO beacon interval
dynamically while the BSS continues operating.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2024-08-28 00:05:12 +03:00
Shivani Baranwal
59299a8a7d P2P2: Add bootstrapping support with PD frames
Add support for P2P2 bootstrapping with comeback mechanism using
Provision Discovery frames. Extend the control interface command
P2P_CONNECT to allow P2P2 bootstrapping handshake.

Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
2024-08-27 23:50:20 +03:00
Shivani Baranwal
6aa9ad8f8f P2P2: Refactor provision discovery request/response processing
Parse the P2P IEs in functions that handle provision discovery request
and response. Process the frames based on the IEs received in the PD
frames. This makes it easier to extend PD for P2P2 cases.

Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
2024-08-27 10:51:56 +03:00
Shivani Baranwal
b4f9742ee2 P2P2: Process Element container attribute from NAN SDFs
Process the Element Container attribute from NAN SDF frames and check if
P2P attributes are present. Add a P2P peer device entry if the NAN SDF
frame has matching service and P2P capabilities.

Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
2024-08-27 10:51:56 +03:00
Shivani Baranwal
fa389f2a3b P2P2: Parse P2P2 IE
Add parsing of the P2P2 IE similarly to the way the P2P IE is parsed.

Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
2024-08-27 10:51:56 +03:00
Shivani Baranwal
25c6598f30 NAN USD: Add publishChannelList option for Subscriber
Add frequency list to active NAN USD Subscriber to search for a
Publisher on multiple channels. This is the publish channel list used by
the Subscriber to periodically search for a service on these channels.
publishChannelList was already supported in the Publisher and this
commit extends that to the Subscriber.

This is needed for a P2P2 seeker that is an active subscriber looking
for an advertiser on a list of publish channels.

Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
2024-08-27 10:51:56 +03:00
Shivani Baranwal
bcab29a78c P2P2: Device Identity Key generation and storage in configuration
Generate a random device identity key and save it to the config file.
Use the same identity key from config to derive DIRA for NAN SDF frames.

Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
2024-08-27 10:51:56 +03:00
Shivani Baranwal
58ba550c53 FT: Fix writing of ft_prepend_pmkid configuration parameter
This was missing a newline at the end of the line.

Fixes: 8fa52a7974 ("FT: Allow wpa_supplicant to be configured to prepend PMKR1Name")
Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
2024-08-27 10:51:56 +03:00
Shivani Baranwal
5b0112a185 P2P2: Add DIRA attributes to P2P2 IE of NAN SDFs
Add DIRA attribute in P2P2 IE of NAN Subscribe and Publish frames
to enable support for device identity of paired peers.

Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
2024-08-27 10:51:56 +03:00
Shivani Baranwal
29f70292e5 P2P2: Add PCEA and PBMA attributes to P2P2 IE of NAN SDFs
Add PCEA and PBMA attribute in P2P2 IE of NAN Subscribe and Publish frames
to include the P2P2 capabilities and bootstrapping methods.

Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
2024-08-27 10:51:56 +03:00