]> git.ipfire.org Git - thirdparty/hostap.git/log
thirdparty/hostap.git
12 months agoeapol_test: Move Message-Authenticator attribute to be the first one
Jouni Malinen [Sat, 16 Mar 2024 09:16:12 +0000 (11:16 +0200)] 
eapol_test: Move Message-Authenticator attribute to be the first one

Even if this is not strictly speaking necessary for mitigating certain
RADIUS protocol attacks, be consistent with the RADIUS server behavior
and move the Message-Authenticator attribute to be the first attribute
in the message from RADIUS client.

Signed-off-by: Jouni Malinen <j@w1.fi>
12 months agoRADIUS server: Place Message-Authenticator attribute as the first one
Jouni Malinen [Sat, 16 Mar 2024 09:13:32 +0000 (11:13 +0200)] 
RADIUS server: Place Message-Authenticator attribute as the first one

Move the Message-Authenticator attribute to be the first attribute in
the RADIUS messages. This mitigates certain MD5 attacks against
RADIUS/UDP.

Signed-off-by: Jouni Malinen <j@w1.fi>
12 months agoRADIUS: Allow Message-Authenticator attribute as the first attribute
Jouni Malinen [Sat, 16 Mar 2024 09:11:44 +0000 (11:11 +0200)] 
RADIUS: Allow Message-Authenticator attribute as the first attribute

If a Message-Authenticator attribute was already added to a RADIUS
message, use that attribute instead of adding a new one when finishing
message building. This allows the Message-Authenticator attribute to be
placed as the first attribute in the message.

Signed-off-by: Jouni Malinen <j@w1.fi>
12 months agotests: Include Message-Authenticator attribute in RADIUS tests
Jouni Malinen [Sun, 17 Mar 2024 09:10:16 +0000 (11:10 +0200)] 
tests: Include Message-Authenticator attribute in RADIUS tests

This is in preparation for hostapd requiring this attribute for all
cases.

Signed-off-by: Jouni Malinen <j@w1.fi>
12 months agotests: SAE H2E and rejected groups with different APs and different config
Jouni Malinen [Sun, 7 Jul 2024 09:14:11 +0000 (12:14 +0300)] 
tests: SAE H2E and rejected groups with different APs and different config

Signed-off-by: Jouni Malinen <j@w1.fi>
12 months agoSAE: Clear rejected groups list on completing authentication
Jouni Malinen [Sun, 7 Jul 2024 09:11:06 +0000 (12:11 +0300)] 
SAE: Clear rejected groups list on completing authentication

The rejected groups list is valid only during each individual SAE
authentication instance and it should not be maintained between separate
instances. In particular, it should not be maintained when roaming to
another AP since the APs might use different configuration for the
allowed SAE groups.

Signed-off-by: Jouni Malinen <j@w1.fi>
12 months agotests: SAE protocol testing - Invalid Rejected Groups element
Jouni Malinen [Sun, 7 Jul 2024 08:59:16 +0000 (11:59 +0300)] 
tests: SAE protocol testing - Invalid Rejected Groups element

Signed-off-by: Jouni Malinen <j@w1.fi>
12 months agoSAE: Clear rejected groups list on continuous failures
Jouni Malinen [Sun, 7 Jul 2024 08:52:36 +0000 (11:52 +0300)] 
SAE: Clear rejected groups list on continuous failures

wpa_supplicant used to maintain the list of rejected groups for SAE over
multiple failed attempts. This could have some DoS issues, so clear this
list if SAE authentication attempts fails continuously.

Signed-off-by: Jouni Malinen <j@w1.fi>
12 months agoSAE: Clear peer_rejected_groups when no element is included
Jouni Malinen [Sun, 7 Jul 2024 08:48:35 +0000 (11:48 +0300)] 
SAE: Clear peer_rejected_groups when no element is included

When parsing a SAE Commit message, the temporary peer_rejected_groups
parameter was left to its old value in cases where the new SAE Commit
message did not include the Rejected Groups element. This could result
in unexpected behavior if a previously processed SAE Commit message
included a Rejected Groups element that claimed one of the enabled
groups to be rejected.

Explicitly clear the peer_rejected_groups value when parsing an SAE
Commit message without a Rejected Groups element to avoid rejecting the
new message based on some previously received incorrect information.
This avoids some potential denial-of-service issues during the lifetime
of the SAE temporary data.

Signed-off-by: Jouni Malinen <j@w1.fi>
12 months agoSAE: Check for invalid Rejected Groups element length explicitly
Jouni Malinen [Sun, 7 Jul 2024 08:46:49 +0000 (11:46 +0300)] 
SAE: Check for invalid Rejected Groups element length explicitly

Instead of practically ignoring an odd octet at the end of the element,
check for such invalid case explicitly. This is needed to avoid a
potential group downgrade attack.

Signed-off-by: Jouni Malinen <j@w1.fi>
13 months agoVendor attribute to configure STA to follow AP preference for candidates
Gururaj Pandurangi [Tue, 18 Jun 2024 01:18:01 +0000 (18:18 -0700)] 
Vendor attribute to configure STA to follow AP preference for candidates

Add a vendor attribute to configure a STA to follow AP advertised
preference values to select roam candidates with BTM.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
13 months agoVendor command extension for Responder PM Mode bit in TWT SET Request
Purushottam Kushwaha [Fri, 7 Jun 2024 11:10:16 +0000 (16:40 +0530)] 
Vendor command extension for Responder PM Mode bit in TWT SET Request

Use the existing QCA_WLAN_VENDOR_ATTR_TWT_SETUP_RESPONDER_PM_MODE
attribute for TWT setup request to configure the Responder PM Mode bit
in the control field of the TWT element or broadcast TWT schedule.

Signed-off-by: Purushottam Kushwaha <quic_pkushwah@quicinc.com>
13 months agoAdd vendor flag to indicate unavailability mode in TWT responder mode
Purushottam Kushwaha [Fri, 7 Jun 2024 11:18:29 +0000 (16:48 +0530)] 
Add vendor flag to indicate unavailability mode in TWT responder mode

Add a flag attribute
QCA_WLAN_VENDOR_ATTR_TWT_SET_PARAM_UNAVAILABILITY_MODE into enum
qca_wlan_vendor_attr_twt_set_param to configure the TWT responder
unavailability outside of the SPs of its broadcast TWT schedule.

Signed-off-by: Purushottam Kushwaha <quic_pkushwah@quicinc.com>
13 months agotests: SAE protocol testing and a valid commit after a failed one
Jouni Malinen [Thu, 20 Jun 2024 15:24:10 +0000 (18:24 +0300)] 
tests: SAE protocol testing and a valid commit after a failed one

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
13 months agoSAE: Free password identifier if SAE commit is rejected due to it
Chenming Huang [Fri, 31 May 2024 02:28:36 +0000 (07:58 +0530)] 
SAE: Free password identifier if SAE commit is rejected due to it

Authentication rejection was found when doing fuzz testing even with a
valid SAE commit message when it was sent after a SAE commit message
that included an incorrect password identifier. The test steps for this
are as below:

1. Peer sends an abnormal commit message with incorrect password
   identifier
2. APUT rejects as expected
3. Peer sends a valid commit message
4. APUT rejects again, which is not expected

In step 2, as the abnormal data fakes an empty password identifier
element, it passes sae_is_password_id_elem() checking. Memory is then
allocated for sae->tmp->pw_id. The authentication process then fails
due to no available password with this invalid password identifier.

In step 4, though the peer sends a valid commit message, APUT rejects
this SAE commit again due to no password identifier element (due to that
sae->tmp->pw_id being set), which is not expected.

Free the sae->tmp->pw_id field and set it to NULL when SAE commit
message processing fails due to an unknown password identifier so that
the bogus value is not used as a requirement for any consecutive SAE
commit from the same STA before the STA entry gets cleared.

Signed-off-by: Chenming Huang <quic_chenhuan@quicinc.com>
13 months agoDefine Link Id attribute for secure ranging context vendor command
Nidhi Jain [Thu, 6 Jun 2024 05:10:42 +0000 (10:40 +0530)] 
Define Link Id attribute for secure ranging context vendor command

The Link Id attribute is required for secure ranging context to identify
the link on which the command is received for an MLD.

Signed-off-by: Nidhi Jain <quic_nidhjain@quicinc.com>
13 months agoDefine Link Id attribute for QCA_NL80211_VENDOR_SUBCMD_PASN
Nidhi Jain [Thu, 6 Jun 2024 06:47:05 +0000 (12:17 +0530)] 
Define Link Id attribute for QCA_NL80211_VENDOR_SUBCMD_PASN

The Link Id attribute is required for QCA_NL80211_VENDOR_SUBCMD_PASN to
identify the link on which the command is received for an MLD.

Signed-off-by: Nidhi Jain <quic_nidhjain@quicinc.com>
13 months agoAdd Link ID for External ACS vendor command
Diya Sati [Tue, 11 Jun 2024 06:46:03 +0000 (12:16 +0530)] 
Add Link ID for External ACS vendor command

The Link Id attribute is required for external ACS context to identify
the link on which the command is received for an AP MLD.

Signed-off-by: Diya Sati <quic_dsati@quicinc.com>
13 months agotests: SAE with SSID protection in 4-way handshake
Jouni Malinen [Tue, 18 Jun 2024 22:11:40 +0000 (01:11 +0300)] 
tests: SAE with SSID protection in 4-way handshake

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
13 months agoSSID protection in 4-way handshake on AP
Jouni Malinen [Tue, 18 Jun 2024 22:09:52 +0000 (01:09 +0300)] 
SSID protection in 4-way handshake on AP

Add support for SSID protection in 4-way handshake based on the
mechanism added in IEEE 802.11REVme/D6.0. This is a mitigation against
CVE-2023-52424 (a.k.a. the SSID Confusion Attack).

This functionality is disabled by default and can be enabled with
ssid_protection=1. Once there has been more testing of this to confirm
there is no significant interoperability issues, the goal is to be able
to change this to be enabled by default.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
13 months agoSSID protection in 4-way handshake on STA
Jouni Malinen [Tue, 18 Jun 2024 22:07:36 +0000 (01:07 +0300)] 
SSID protection in 4-way handshake on STA

Add support for SSID protection in 4-way handshake based on the
mechanism added in IEEE 802.11REVme/D6.0. This is a mitigation against
CVE-2023-52424 (a.k.a. the SSID Confusion Attack).

This functionality is disabled by default and can be enabled with
ssid_protection=1 in the network profile. Once there has been more
testing of this to confirm there is no significant interoperability
issues, the goal is to be able to change this to be enabled by default.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
13 months agoSTA: Update scan results when BSS entry with current SSID is not found
Veerendranath Jakkam [Mon, 15 Apr 2024 20:00:43 +0000 (01:30 +0530)] 
STA: Update scan results when BSS entry with current SSID is not found

wpa_supplicant might use a wrong BSS entry with the SSID different from
the current SSID of the current BSS while processing a roam event from
the driver when wpa_supplicant has a stale BSS entry with the old SSID
and the driver roams to the same BSS after it is restarted with a new
SSID.

To avoid this, update scan results from the driver when a BSS entry is
not found with the current SSID and try to fetch the BSS entry again
with the current SSID after this.

Also, with this change wpa_supplicant_get_new_bss() itself will update
the BSS table and search for the current BSS entry if it is not found in
the BSS table. So, remove the BSS table update and search logic from the
callers of wpa_supplicant_get_new_bss().

Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
13 months agotests: Add color change test for an AP MLD
Aditya Kumar Singh [Mon, 22 Apr 2024 12:40:05 +0000 (18:10 +0530)] 
tests: Add color change test for an AP MLD

Add the eht_mlo_color_change test case to perform color change on the
first link of an AP MLD. Performing on non-first link will be done
later.

Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
13 months agotests: Add HE BSS color change test
Aditya Kumar Singh [Mon, 22 Apr 2024 12:40:04 +0000 (18:10 +0530)] 
tests: Add HE BSS color change test

Add the he_bss_color_change test case which brings up an HE AP and
performs color change operations and validates the result.

Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
13 months agoAP MLD: Send link id to the driver during color change
Aditya Kumar Singh [Mon, 22 Apr 2024 12:40:03 +0000 (18:10 +0530)] 
AP MLD: Send link id to the driver during color change

Send the link ID in the nl80211 command to switch color if the AP is
affiliated with an AP MLD.

Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
13 months agoUpdate Beacon frames after color change
Aditya Kumar Singh [Mon, 22 Apr 2024 12:40:02 +0000 (18:10 +0530)] 
Update Beacon frames after color change

Once CCA is finished, Beacon frames need to be updated. The BCCA element
needs to be removed and the new color value shall be advertised in the
BSS Color Information field of the HE Operation element.

Update the Beacon frames accordingly.

Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
13 months agoRemove double "on" from debug prints in CCA event callbacks
Aditya Kumar Singh [Mon, 22 Apr 2024 12:40:01 +0000 (18:10 +0530)] 
Remove double "on" from debug prints in CCA event callbacks

Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
13 months agohostapd: Add support to change BSS color from the control interface
Aditya Kumar Singh [Mon, 22 Apr 2024 12:40:00 +0000 (18:10 +0530)] 
hostapd: Add support to change BSS color from the control interface

Add hostapd_cli command "color_change <color>" to change BSS color at
run time. hostapd_cli status can be used to check the updated color.

Usage: hostapd_cli -i <interface> color_change <color>

If 0 value is given, HE BSS color would be disabled. Same or a non-zero
value between [1-63] can be given to enable color again.

Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
13 months agoACS: Handle scan start request failure with error code -EBUSY
Harshitha Prem [Mon, 22 Apr 2024 11:19:06 +0000 (16:49 +0530)] 
ACS: Handle scan start request failure with error code -EBUSY

Currently, if ACS scan request fails, states are cleared and returned.
However, in case of MLO, there is a possibilty of getting return value
of -EBUSY. In this case, ACS can retry the scan request after some time
similary to the HT40 scan.

Hence, retry the scan after 5 seconds if -EBUSY is returned. Maximum of
15 re-attempts are made before giving up.

Signed-off-by: Harshitha Prem <quic_hprem@quicinc.com>
Co-developed-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
13 months agoAP MLD: Fix deferred first link BSS's authentication server init
Aditya Kumar Singh [Mon, 22 Apr 2024 11:19:03 +0000 (16:49 +0530)] 
AP MLD: Fix deferred first link BSS's authentication server init

Currently, RADIUS client, auth server, and 802.1X are copied from the
first link's BSS into the non-first link during its setup. However,
there could be a case where the first link is not initialized fully
because of ACS/HT40 SCAN/DFS. Hence, in such cases, NULL is getting
copied and later it leads to segmentation fault.

Initialize those on behalf of the first link in such case and update it
so that the next time other non-first link can use it.

Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
13 months agowlantest: Initial support for Multiple BSSID procedure
Jouni Malinen [Mon, 10 Jun 2024 18:27:00 +0000 (21:27 +0300)] 
wlantest: Initial support for Multiple BSSID procedure

Parse the Multiple BSSID element in Beacon frames and create and update
all the nontransmitted BSSs.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
13 months agoAdd a new QCA vendor attribute to set interface offload type
Balamurugan Mahalingam [Thu, 6 Jun 2024 01:53:21 +0000 (18:53 -0700)] 
Add a new QCA vendor attribute to set interface offload type

Userspace tools can use QCA_WLAN_VENDOR_ATTR_CONFIG_IF_OFFLOAD_TYPE to
configure the different below acceleration features (hardware, software)
on a per interface basis.

0 - No acceleration Packets are processed through the Linux kernel
networking stack.

1 - Software based acceleration: Packets are processed through the
shortcut forwarding engine (SFE) to bypass the Linux networking stack
for improved throughput performance. This option is applicable for AP,
STA, and Mesh mode and available for all radio designs. From the
performance aspect, this option consumes more CPU compared to the other
two options. Linux traffic control can be further applied with this
option to have more control on the traffic flows.

2 - Hybrid acceleration (software and hardware acceleration combined):
Packets are processed through both hardware and software in this case.
Packet classification is done by the hardware and then the packets are
delivered to software along with classification results as meta data.
Software can choose to do more classification/QoS based on use cases.
This is applicable for AP, STA, and Mesh modes and is available for all
radio designs. From the performance aspect, this option consumes
relatively less CPU compared to the SFE option above. Linux traffic
control rules cannot be applied with this option.

3 - Hardware based acceleration : Packets are processed through special
hardware (Direct Switch) rings which can directly forward the packets
between ethernet hardware and Wi-Fi hardware with very less software
involvement. This is applicable only for AP and STA modes; not
applicable for Mesh mode. From the performance aspect, this option
consumes very much less CPU compared to the other options. Linux traffic
control rules cannot be applied when this option is used. This option is
applicable only for specific radio designs. When this option is not
available, the default option (SFE) would be configured.

Signed-off-by: Balamurugan Mahalingam <quic_bmahalin@quicinc.com>
13 months agoAdd vendor attributes to detect data stall for consecutive TX no ack
Jianmin Zhu [Tue, 7 May 2024 09:53:44 +0000 (02:53 -0700)] 
Add vendor attributes to detect data stall for consecutive TX no ack

Add following vendor attributes to dynamically configure parameters to
detect data stall for consecutive TX no ack.
 - QCA_WLAN_VENDOR_ATTR_CONFIG_CONSECUTIVE_TX_NO_ACK_DURATION
 - QCA_WLAN_VENDOR_ATTR_CONFIG_CONSECUTIVE_TX_NO_ACK_THRESHOLD

Signed-off-by: Jianmin Zhu <quic_jianminz@quicinc.com>
13 months agoAdd new traffic type values for flow report vendor attribute
Kiran Kumar Lokere [Mon, 20 May 2024 05:07:17 +0000 (22:07 -0700)] 
Add new traffic type values for flow report vendor attribute

Define new traffic type values for
QCA_WLAN_VENDOR_ATTR_FLOW_STATS_TRAFFIC_TYPE attribute.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
14 months agotests: WNM BSS max idle period management
Jouni Malinen [Wed, 29 May 2024 18:43:26 +0000 (21:43 +0300)] 
tests: WNM BSS max idle period management

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
14 months agoWNM: Include BSS max idle period in STATUS command output
Jouni Malinen [Wed, 29 May 2024 18:01:28 +0000 (21:01 +0300)] 
WNM: Include BSS max idle period in STATUS command output

This makes it a bit easier to test BSS max idle period management.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
14 months agoWNM: AP configuration to allow BSS max idle period requests
Jouni Malinen [Wed, 29 May 2024 16:41:59 +0000 (19:41 +0300)] 
WNM: AP configuration to allow BSS max idle period requests

Add a new hostapd configuration parameter max_acceptable_idle_period to
allow the AP to accept per-STA requested BSS max idle periods.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
14 months agoWNM: Allow a specific BSS max idle period to be requested
Jouni Malinen [Wed, 29 May 2024 16:40:27 +0000 (19:40 +0300)] 
WNM: Allow a specific BSS max idle period to be requested

Add a new wpa_supplicant network profile parameter max_idle that can be
used to specify a specific maximum idle period in units of 1000 TUs
(1.024 s) for associations.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
14 months agotests: Use consistent indentation level for clear_regdom_state()
Jouni Malinen [Wed, 29 May 2024 10:21:02 +0000 (13:21 +0300)] 
tests: Use consistent indentation level for clear_regdom_state()

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
14 months agotests: More coverage for WNM BSS max idle period management
Jouni Malinen [Wed, 29 May 2024 10:20:02 +0000 (13:20 +0300)] 
tests: More coverage for WNM BSS max idle period management

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
14 months agoWNM: Group rekeying skipping with BSS max idle period management
Jouni Malinen [Wed, 29 May 2024 09:57:08 +0000 (12:57 +0300)] 
WNM: Group rekeying skipping with BSS max idle period management

Allow hostapd to be configured to not disconnect a STA if the STA fails
to reply to a group key handshake when BSS max idle period management is
used. This might be needed for some STAs that use aggressive power
saving (e.g., battery powered IoT devices).

This is disabled by default since this can delayed group rekeying
slightly and also to maintain the previous behavior. The more relaxed
operation can be enabled with the new configuration parameter
no_disconnect_on_group_keyerror=1.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
14 months agoWNM: Configurable BSS Max Idle Period management on AP
Jouni Malinen [Wed, 29 May 2024 09:41:51 +0000 (12:41 +0300)] 
WNM: Configurable BSS Max Idle Period management on AP

Allow AP's behavior for BSS Max Idle Period management to be configured.
Previously, this was automatically enabled for all CONFIG_WNM_AP=y
builds. This can now be changed with the new hostapd configuration
parameter bss_max_idle:
0 = BSS Max Idle Period management disabled
1 = BSS Max Idle Period management enabled
    (default and the previous behavior)
2 = BSS Max Idle Period management enabled with requirement for
    protected keep-alive frames

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
14 months agoAdd QCA vendor attribute to get number of TX/RX packets for each NSS
Aleti Nageshwar Reddy [Mon, 6 May 2024 10:01:33 +0000 (15:31 +0530)] 
Add QCA vendor attribute to get number of TX/RX packets for each NSS

Add support to get the number of TX/RX packets for each NSS value from
the driver.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
14 months agoAdd vendor attributes to configure TX/RX NSS and chains per band
Aditya Kodukula [Wed, 8 May 2024 01:04:31 +0000 (18:04 -0700)] 
Add vendor attributes to configure TX/RX NSS and chains per band

Add attributes to QCA_NL80211_VENDOR_SUBCMD_SET_WIFI_CONFIGURATION
vendor command to configure asymmetric TX/RX NSS and chains per band.
Also document driver's response when existing attributes to configure
TX/RX NSS and chains for all the bands 2.4 GHz and 5/6 GHz are used in
the same command.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
14 months agoAdd kernel documentation for nss and chain configuration vendor command
Aditya Kodukula [Tue, 7 May 2024 19:48:42 +0000 (12:48 -0700)] 
Add kernel documentation for nss and chain configuration vendor command

Add kernel documentation to the attributes used in the vendor command
QCA_NL80211_VENDOR_SUBCMD_SET_WIFI_CONFIGURATION to configure the NSS
and chains values used for transmitting and receiving the data.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
14 months agoAdd QCA vendor attribute for uplink delay jitter
Veerendranath Jakkam [Fri, 3 May 2024 15:24:33 +0000 (20:54 +0530)] 
Add QCA vendor attribute for uplink delay jitter

Add uplink delay jitter attribute in responses of
QCA_NL80211_VENDOR_SUBCMD_GET_STA_INFO vendor command.

Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
14 months agoP2P: Fix fast IP address allocation for invitation of a persistent group
mtk30479 [Wed, 24 Jan 2024 03:51:43 +0000 (11:51 +0800)] 
P2P: Fix fast IP address allocation for invitation of a persistent group

Allocate static IPv4 address in EAPOL frames during 4-way handshake
instead of DHCP when using P2P invitation. wpa_s->current_bss needs to
be set for the P2P specific IP address assignment mechanism to be used
in wpa_supplicant_rsn_supp_set_config(). This worked for the initial P2P
connection, but not for some cases reinvoking a persistent group.

Since there is only one AP (P2P GO) in the P2P client case, the
conditions added in commit 4d3be9cdd143 ("Postpone updating of
wpa_s->current_bss till association event") are not needed and the
easiest approach for this is to allow current_bss to be set for
p2p_in_invitation cases. If the GO P2P Interface Address (BSSID) could
be determined for all the related cases, this could be addressed a bit
more cleanly by setting the go_bssid argument for
wpas_start_p2p_client(), but that can be left as a possible future step.

Signed-off-by: tzu-meng wang <tzu-meng.wang@mediatek.com>
14 months agoAdd a new QCA vendor attribute to set reduced power scan mode
Mukul Sharma [Fri, 3 May 2024 10:27:14 +0000 (15:57 +0530)] 
Add a new QCA vendor attribute to set reduced power scan mode

Userspace can use QCA_WLAN_VENDOR_ATTR_CONFIG_REDUCED_POWER_SCAN_MODE to
configure reduce power scan mode to the driver/firmware.

Signed-off-by: Mukul Sharma <quic_mukul@quicinc.com>
15 months agoAP MLD: Remove unused get_ml_rsn_info callback definition
Jouni Malinen [Thu, 25 Apr 2024 08:56:23 +0000 (11:56 +0300)] 
AP MLD: Remove unused get_ml_rsn_info callback definition

This is not used anymore after the previous AP MLD cleanup.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
15 months agotests: Cohosted MLDs connectivity testing
Aditya Kumar Singh [Mon, 22 Apr 2024 04:12:39 +0000 (09:42 +0530)] 
tests: Cohosted MLDs connectivity testing

Add a test case 'eht_mld_cohosted_connectivity' which creates two 2 link
AP MLDs and connect a 2 link MLD client to each one of them and test
data traffic.

Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
15 months agotests: Basic cohosted MLDs functionality testing
Aditya Kumar Singh [Mon, 22 Apr 2024 04:12:38 +0000 (09:42 +0530)] 
tests: Basic cohosted MLDs functionality testing

Add test cases to test basic cohosted MLDs functionality. Add helper
functions to create the configuration file, start hostapd instance.

Client connectivity test case will be added via a subsequent commit.

eht_mld_cohosted_discovery: 2 co-hosted MLDs without non-MLD RNR. Basic
bring up and beacon, MLD RNR, scan validation.

eht_mld_cohosted_discovery_with_rnr: Same like eht_mld_cohosted_discovery
but additionally non-MLD RNR (rnr=1) is also enabled. Validate the non-MLD
RNR as well.

Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
15 months agoUpdate Probe Response template on BSS color change
Rathees Kumar R Chinannan [Mon, 8 Apr 2024 06:35:16 +0000 (12:05 +0530)] 
Update Probe Response template on BSS color change

When AP is beaconing only on the 6 GHz band and unsol_bcast_presp
interval is set, AP sends unsolicited broadcast Probe Response frames
for in-band discovery. hostapd sent the Probe Response template for this
frame only when setting a new Beacon frame template.

Extend this to update the Probe Response template during BSS color
change.

Signed-off-by: Rathees Kumar R Chinannan <quic_rrchinan@quicinc.com>
15 months agoUpdate Probe Response template on channel switch
Rathees Kumar R Chinannan [Mon, 8 Apr 2024 06:35:16 +0000 (12:05 +0530)] 
Update Probe Response template on channel switch

When AP is beaconing only on the 6 GHz band and unsol_bcast_presp
interval is set, AP sends unsolicited broadcast Probe Response frames
for in-band discovery. hostapd sent the Probe Response template for this
frame only when setting a new Beacon frame template.

Extend this to update the Probe Response template during channel switch.

Signed-off-by: Rathees Kumar R Chinannan <quic_rrchinan@quicinc.com>
15 months agoMore generic unsolicited broadcast Probe Response template setup
Rathees Kumar R Chinannan [Mon, 8 Apr 2024 06:35:16 +0000 (12:05 +0530)] 
More generic unsolicited broadcast Probe Response template setup

When AP is beaconing only on the 6 GHz band and unsol_bcast_presp
interval is set, AP sends unsolicited broadcast Probe Response frames
for in-band discovery. hostapd sent the Probe Response template for this
frame only when setting a new beacon.

As a preparation for extending this functionality to other cases, move
the generation of the unsolicited broadcast Probe Response template into
a more generic function and data structure.

Signed-off-by: Rathees Kumar R Chinannan <quic_rrchinan@quicinc.com>
15 months agotests: Update opclass 124 test to use opclass 125
Jouni Malinen [Wed, 24 Apr 2024 18:06:33 +0000 (21:06 +0300)] 
tests: Update opclass 124 test to use opclass 125

This is needed to match the implementation change to map the 5 GHz
channels 149-175 to the global operating class 125 instead of 124.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
15 months agotests: Fix a typo in opclass test descriptions
Jouni Malinen [Wed, 24 Apr 2024 18:01:28 +0000 (21:01 +0300)] 
tests: Fix a typo in opclass test descriptions

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
15 months agoMake selection of current opclass more generic for 20 MHz UNI-III channels
Amith A [Mon, 8 Apr 2024 09:11:16 +0000 (14:41 +0530)] 
Make selection of current opclass more generic for 20 MHz UNI-III channels

According to IEEE Std 802.11-2020, Operating classes Table E-2 (Europe)
and Table E-6 (China) map channels in the range 149 to 161 to the global
operating class 125, while Table E-1 (United States) maps these channels
to global operating classes 125 and 124 as well. The global operating
class 125 contains all channels from the global operating class 124 and
some additional channels.

Hence, to make the selection of the current operating class generic, use
operating class 125 for all 20 MHz channels in the range 149 to 161.

Signed-off-by: Amith A <quic_amitajit@quicinc.com>
15 months agoFILS: Add Operating Class and Primary Channel in FD for non-PSC chan
Sriram R [Mon, 22 Apr 2024 17:08:42 +0000 (22:38 +0530)] 
FILS: Add Operating Class and Primary Channel in FD for non-PSC chan

If a non-PSC 6 GHz channel with bandwidth higher than 20 MHz is
configured, duplicate beacons/FD/UBPR will be transmitted in other 20
MHz channels of the current configured bandwidth to aid in faster scan.
In such cases the duplicate FD needs to carry the Operating Class and
Primary Channel subfields for non-AP STAs to identify the primary
non-PSC.

IEEE Std 802.11-2020, 9.6.7.36 (FILS Discovery frame format):
"The Operating Class subfield specifies the operating class of the
Primary Channel of the transmitting AP (see 9.4.1.36).

The Primary Channel subfield is set to the channel number of the primary
channel (see 11.15.2) if the FILS Discovery frame is transmitted as a
non-HT duplicate PPDU; otherwise, the subfield is not present."

Hence, add the Operating Class and Primary Channel subfields if the
current channel is non-PSC and the channel bandwidth is 40 MHz or
higher.

Signed-off-by: Sriram R <quic_srirrama@quicinc.com>
Signed-off-by: Karthikeyan Kathirvel <quic_kathirve@quicinc.com>
15 months agoDefine QCA vendor commands for flow stats/classification
Rakesh Pillai [Mon, 11 Mar 2024 10:33:42 +0000 (03:33 -0700)] 
Define QCA vendor commands for flow stats/classification

Add nl80211 vendor commands and attributes for the collection of flow
stats and classification.

- QCA_NL80211_VENDOR_SUBCMD_FLOW_STATS
- QCA_NL80211_VENDOR_SUBCMD_FLOW_CLASSIFY_RESULT
- QCA_NL80211_VENDOR_SUBCMD_ASYNC_STATS_POLICY
- QCA_NL80211_VENDOR_SUBCMD_CLASSIFIED_FLOW_REPORT

Signed-off-by: Rakesh Pillai <quic_pillair@quicinc.com>
15 months agonl80211: Update link bandwidth when receiving channel switch event
Chenming Huang [Wed, 17 Apr 2024 03:32:27 +0000 (09:02 +0530)] 
nl80211: Update link bandwidth when receiving channel switch event

There is a chance that the driver has switched the channel width so we
should update the bandwidth, too, when receiving a channel switch event.
Otherwise, this may cause out of sync for bandwidth between i802_link
and hostapd_config.

Signed-off-by: Chenming Huang <quic_chenhuan@quicinc.com>
15 months agoAP MLD: Set link_id field in hostapd_freq_params when setting up AP
Chenming Huang [Wed, 17 Apr 2024 01:23:30 +0000 (06:53 +0530)] 
AP MLD: Set link_id field in hostapd_freq_params when setting up AP

If not set, 0 is set by default and this could fail in the following
code path when link ID is not matching:
hostapd_drv_set_ap -> wpa_driver_nl80211_set_ap -> nl80211_set_channel

Signed-off-by: Chenming Huang <quic_chenhuan@quicinc.com>
15 months agoAdd QCA vendor subcommand to suspend/resume AP interface
Purushottam Kushwaha [Fri, 29 Mar 2024 12:27:36 +0000 (17:57 +0530)] 
Add QCA vendor subcommand to suspend/resume AP interface

Add a new QCA vendor subcommand QCA_NL80211_VENDOR_SUBCMD_AP_SUSPEND to
allow suspend and resume the AP interface. When an AP is suspended, it
disconnects all connected clients and stops all TX/RX operations on the
AP interface. The driver retains the AP configuration and on resume, all
AP operations are resumed with the same configuration.

This subcommand is also used in the event path to notify userspace about
AP suspended or resumed state changes.

This uses attributes defined in enum qca_wlan_vendor_attr_ap_suspend.

Signed-off-by: Purushottam Kushwaha <quic_pkushwah@quicinc.com>
15 months agotests: Fix a race condition in mesh_link_probe
Jouni Malinen [Mon, 22 Apr 2024 20:14:08 +0000 (23:14 +0300)] 
tests: Fix a race condition in mesh_link_probe

Wait for both peers to be connected before checking MESH_LINK_PROBE
behavior. Without this, it was possible for a MESH_LINK_PROBE command to
be issues before the specific peer had been added and that would result
in the nl80211 command failing.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
15 months agotests: Fix autogo_chan_switch to not drop HT capability
Jouni Malinen [Mon, 22 Apr 2024 13:17:39 +0000 (16:17 +0300)] 
tests: Fix autogo_chan_switch to not drop HT capability

This test case ended up dropping HT capability on channel switch which
is now resulting in mac80211 disconnecting. Avoid this by leaving HT
enabled. In addition, check the P2P Client events explicitly.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
15 months agotests: AP MLD with two links when only one of the links is negotiated
Jouni Malinen [Mon, 22 Apr 2024 10:31:06 +0000 (13:31 +0300)] 
tests: AP MLD with two links when only one of the links is negotiated

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
15 months agoAP MLD: Add MLO Link KDE for each affiliated link in EAPOL-Key 3/4
Jouni Malinen [Mon, 22 Apr 2024 11:35:35 +0000 (14:35 +0300)] 
AP MLD: Add MLO Link KDE for each affiliated link in EAPOL-Key 3/4

Previously, MLO Link KDE was added only for each link that was
negotiated for the ML association. However, IEEE Std 802.11be/D5.0,
12.7.6.1 defines the MLO Link KDE to be included "for each affiliated
AP" which is not constrained by what the non-AP MLD might have requested
or what the negotiation outcome for this particular ML association is.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
15 months agoAP MLD: Do not store per-supplicant AP RSNE/RSNXE information
Jouni Malinen [Mon, 22 Apr 2024 11:19:57 +0000 (14:19 +0300)] 
AP MLD: Do not store per-supplicant AP RSNE/RSNXE information

There is no need to store the AP MLD's RSNE/RSNXE within per-supplicant
data structure in struct wpa_state_machine since those elements are
available from the generic authenticator data in struct
wpa_authenticator.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
15 months agoAP MLD: Do not store per-supplicant AP link MAC address information
Jouni Malinen [Mon, 22 Apr 2024 11:08:57 +0000 (14:08 +0300)] 
AP MLD: Do not store per-supplicant AP link MAC address information

There is no need to store the AP MLD's link MAC addresses within
per-supplicant data structure in struct wpa_state_machine since those
MAC addresses are available from the generic authenticator data in
struct wpa_authenticator.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
15 months agoAP MLD: Do not store per-supplicant AP MLD MAC address information
Jouni Malinen [Mon, 22 Apr 2024 10:31:43 +0000 (13:31 +0300)] 
AP MLD: Do not store per-supplicant AP MLD MAC address information

There is no need to store the AP MLD MAC address within per-supplicant
data structure in struct wpa_state_machine since that MLD MAC address is
available from the generic authenticator data in struct
wpa_authenticator.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
15 months agoAdd a vendor attribute value to set aggressive roaming mode
Aleti Nageshwar Reddy [Thu, 28 Mar 2024 09:35:13 +0000 (15:05 +0530)] 
Add a vendor attribute value to set aggressive roaming mode

Add QCA_ROAMING_MODE_AGGRESSIVE in enum qca_roaming_policy to set
aggressive roaming mode. In addition, document the existing enum values.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
15 months agotests: WPA2-PSK from RADIUS during 4-way handshake with Session-Timeout
Jouni Malinen [Sun, 21 Apr 2024 08:35:25 +0000 (11:35 +0300)] 
tests: WPA2-PSK from RADIUS during 4-way handshake with Session-Timeout

Signed-off-by: Jouni Malinen <j@w1.fi>
15 months agoAllow Session-Timeout with PSK RADIUS during 4-way handshake
Lee Harding [Tue, 9 Apr 2024 22:06:38 +0000 (15:06 -0700)] 
Allow Session-Timeout with PSK RADIUS during 4-way handshake

When the RADIUS response included a Session-Timeout attribute, but is
otherwise valid (an Access-Accept with a valid Tunnel-Password), the
association still failed due to the strict comparison of the accepted
value with HOSTAPD_ACL_ACCEPT. Apparently this combination wasn't
previously tested.

Extend this to allow a packet containing a valid Session-Timeout
attribute to be accepted by extending the "success" comparison to
include HOSTAPD_ACL_ACCEPT_TIMEOUT.

Fixes: 1c3438fec4ba ("RADIUS ACL/PSK check during 4-way handshake")
Signed-off-by: Lee Harding <somerandomstring@gmail.com>
15 months agowpa_cli: Make WPA_EVENT_CHANNEL_SWITCH events accessible to action scripts
arun.jose [Mon, 15 Apr 2024 08:48:22 +0000 (14:18 +0530)] 
wpa_cli: Make WPA_EVENT_CHANNEL_SWITCH events accessible to action scripts

Make the channel switch complete event, WPA_EVENT_CHANNEL_SWITCH,
accessible to the action script.

Signed-off-by: arun.jose <arun.jose.wg@bp.renesas.com>
15 months agoFix center segment indexes in channel switch fallback to non-5 GHz cases
Jurijs Soloveckis [Tue, 16 Apr 2024 11:47:36 +0000 (11:47 +0000)] 
Fix center segment indexes in channel switch fallback to non-5 GHz cases

Hardcoded conversion for 5 GHz band was used, but this won't work for
other cases. Set the correct center segment indexes in channel switch
fallback for non-5GHz band.

Signed-off-by: Jurijs Soloveckis <jsoloveckis@maxlinear.com>
15 months agoP2P: Call normal SD query callback on RX/TX race
Benjamin Berg [Wed, 17 Apr 2024 12:45:24 +0000 (15:45 +0300)] 
P2P: Call normal SD query callback on RX/TX race

If the TX success response races with the RX frame then the state
machine was simply move to P2P_SD_DURING_FIND to continue the operation.
However, this does not take into account broadcast queries where the
callback handler updates the peer's sd_pending_bcast_queries.

Fix this by exporting the callback and calling it directly. This is
fine, as the operation is cancelled immediately afterwards, ensuring
that the callback is not called a second time.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
15 months agodbus: Use correct values for persistent group
Andrei Otcheretianski [Wed, 17 Apr 2024 12:28:12 +0000 (15:28 +0300)] 
dbus: Use correct values for persistent group

D-Bus expects "persistent" to be a bool (0/1) and crashes otherwise.
Since persistent may also be 2 convert it to boolean.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
15 months agowpa_supplicant: Do not allow fast associate before scanning 6 GHz
Ilan Peer [Mon, 8 Apr 2024 13:07:01 +0000 (16:07 +0300)] 
wpa_supplicant: Do not allow fast associate before scanning 6 GHz

In case the channel map was updated to include the 6 GHz but these channels
were not scanned yet, do not allow fast associate.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
15 months agoctrl_iface: Allow sending ML probe without AP MLD ID
Benjamin Berg [Mon, 8 Apr 2024 13:07:00 +0000 (16:07 +0300)] 
ctrl_iface: Allow sending ML probe without AP MLD ID

If one sends a Probe Request frame to a non-TX BSSID, no AP MLD ID
should be included in the request. Permit mld_id to be -1 so that it is
not a required argument and can be left out.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
15 months agoMLD: Use AP MLD MAC address with deauthenticate
Ilan Peer [Mon, 8 Apr 2024 13:06:59 +0000 (16:06 +0300)] 
MLD: Use AP MLD MAC address with deauthenticate

When the authentication is an MLD authentication need to use the AP MLD
MAC address when requesting the driver to deauthenticate.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
15 months agoSME: MLD: Clear MLD state only after the deauthentication
Ilan Peer [Mon, 8 Apr 2024 13:06:59 +0000 (16:06 +0300)] 
SME: MLD: Clear MLD state only after the deauthentication

In case of failure handling an Authentication frame from the AP MLD,
clear the MLD state only after the deauthentication is done. This allows
deauthentication process to use the AP MLD MAC address.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
15 months agoSME: MLD: Deauthenticate when failing to parse ML element
Ilan Peer [Mon, 8 Apr 2024 13:06:57 +0000 (16:06 +0300)] 
SME: MLD: Deauthenticate when failing to parse ML element

If parsing the basic ML element in the Authenticate frame fails,
instead of only disassociating, completely deauthenticate so all
state machines would be in a consistent state.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
15 months agowpa_supplicant: Do not roam to an associated link
Ilan Peer [Mon, 8 Apr 2024 13:06:56 +0000 (16:06 +0300)] 
wpa_supplicant: Do not roam to an associated link

When considering to roam to a different BSS and the connection
is an MLD connection, do not roam to a BSS which is already
included in the MLD connection.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
15 months agotests: Wait after removing a BSS
Ilan Peer [Mon, 8 Apr 2024 13:06:55 +0000 (16:06 +0300)] 
tests: Wait after removing a BSS

When a BSS is removed, the flow continues without actually
waiting for the AP to be stopped. This is racy in flows that
actually expect the AP to be stopped, e.g., test_ap_bss_add_remove().

Try to mitigate such cases by adding a short sleep after the
AP is removed.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
15 months agoClear connect_without_scan on network profile removal
Jouni Malinen [Sat, 20 Apr 2024 15:37:35 +0000 (18:37 +0300)] 
Clear connect_without_scan on network profile removal

wpa_s->connect_without_scan could have been left pointing to invalid
network when a network profile was removed. It seems to be possible for
this to happen in some hwsim test case scenarios under specific timing,
but the exact reason for this is not clear. In any case, this pointer
needs to be cleared.

Signed-off-by: Jouni Malinen <j@w1.fi>
15 months agotests: Clear scan cache in ap_hs20_anqp_invalid_gas_response
Jouni Malinen [Sat, 20 Apr 2024 09:27:03 +0000 (12:27 +0300)] 
tests: Clear scan cache in ap_hs20_anqp_invalid_gas_response

This is needed to avoid unexpected behavior if a previously executed
test case has left a BSS entry with Interworking emabled into the case.

Signed-off-by: Jouni Malinen <j@w1.fi>
15 months agoCheck whether to skip a BSS in RNR with a shared helper
Jouni Malinen [Sat, 20 Apr 2024 15:11:55 +0000 (18:11 +0300)] 
Check whether to skip a BSS in RNR with a shared helper

The functions that determine the length of the RNR information and that
build the actual RNR need to use the same conditions for skipping BSSs.
Use a shared helper function for this to avoid having to maintain two
copies of the same implementation and the risking those getting out of
sync.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
15 months agoFix RNR building for co-location and MLO
Aditya Kumar Singh [Thu, 28 Mar 2024 18:16:50 +0000 (23:46 +0530)] 
Fix RNR building for co-location and MLO

RNR formation for co-location or MLO did not work as expected. Fix this.

For example, during co-location, if the BSS is also its ML partner
there is no need to include a separate TBTT for it.

Also, during co-location, if the BSS is not its partner but it is ML
capable, the TBTT length should be 16 bytes and it should include the
MLD Parameters for it in the RNR.

During co-location, for a given Neighbor AP (operating on a given
channel and op-class) if it has BSSs which are ML capable as well as
BSSs which are not, there should be two Neighbor AP Info present: one
indicating TBTT length as 13 bytes and one indicating TBTT info length
as 16 bytes.

Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
15 months agoAP MLD: Add link details in STATUS command
Harshitha Prem [Thu, 28 Mar 2024 18:16:49 +0000 (23:46 +0530)] 
AP MLD: Add link details in STATUS command

Include link ID and partner link details in the STATUS command output
for AP MLDs.

The details would be seen as below for an AP MLD interface:

$ hostapd_cli -i wlan0 status | grep link
num_links=1
link_id=0
link_addr=AA:BB:CC:DD:EE:FF

$ hostapd_cli -i wlan1 status | grep link
num_links=2
link_id=0
link_addr=AA:BB:CC:DD:EE:FF
partner_link[1]=AA:BB:CC:DD:EE:AA

Signed-off-by: Harshitha Prem <quic_hprem@quicinc.com>
Co-developed-by: Manish Dharanenthiran <quic_mdharane@quicinc.com>
Signed-off-by: Manish Dharanenthiran <quic_mdharane@quicinc.com>
Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
15 months agoAP MLD: Link-specific flushing of stations
Aditya Kumar Singh [Thu, 28 Mar 2024 18:16:48 +0000 (23:46 +0530)] 
AP MLD: Link-specific flushing of stations

Whenever a BSS was set up,hostapd flushed all stations via the flush()
driver operation which maps to NL80211_CMD_DEL_STATION in the nl80211
interface. However, in case of MLO, a station could have been connected
to other links by the time this link is coming up. Since link ID was not
passed to flush(), all those stations entries were also removed in the
driver which is wrong.

Include the link ID along with the command in AP MLD so that the driver
can use this link ID and flush only the stations that use the passed
link ID as one of their links.

Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
15 months agoAP MLD: Run authenticator state machine for all links
Rameshkumar Sundaram [Thu, 28 Mar 2024 18:16:47 +0000 (23:46 +0530)] 
AP MLD: Run authenticator state machine for all links

This is needed for MLO group rekeying.

Signed-off-by: Rameshkumar Sundaram <quic_ramess@quicinc.com>
Co-developed-by: Adil Saeed Musthafa <quic_adilm@quicinc.com>
Signed-off-by: Adil Saeed Musthafa <quic_adilm@quicinc.com>
Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
15 months agoAP MLD: Support group rekeying for MLO
Rameshkumar Sundaram [Thu, 28 Mar 2024 18:16:47 +0000 (23:46 +0530)] 
AP MLD: Support group rekeying for MLO

Group rekeying was not supported for ML stations when non-association
link initiates a group rekey. Support this by arming the group key rekey
timer on one of the affiliated links and whenever this timer fires,
rekey group keys on all the affiliated links.

Signed-off-by: Rameshkumar Sundaram <quic_ramess@quicinc.com>
Co-developed-by: Adil Saeed Musthafa <quic_adilm@quicinc.com>
Signed-off-by: Adil Saeed Musthafa <quic_adilm@quicinc.com>
Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
15 months agoAP MLD: Calculate ML KDE length separately for each link
Rameshkumar Sundaram [Thu, 28 Mar 2024 18:16:47 +0000 (23:46 +0530)] 
AP MLD: Calculate ML KDE length separately for each link

Calculate links specific MLO GTK/IGTK/BIGTK KDE lengths based on
corresponding cipher and key instead of taking length of one link and
multiplying it by no of associated links. This is needed since the group
ciphers might be different between the affiliated links.

Signed-off-by: Rameshkumar Sundaram <quic_ramess@quicinc.com>
Co-developed-by: Adil Saeed Musthafa <quic_adilm@quicinc.com>
Signed-off-by: Adil Saeed Musthafa <quic_adilm@quicinc.com>
Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
15 months agoAP MLD: Mark GKeyDone completed for STAs in a helper function
Rameshkumar Sundaram [Thu, 28 Mar 2024 18:16:47 +0000 (23:46 +0530)] 
AP MLD: Mark GKeyDone completed for STAs in a helper function

This makes it easier to extend the design for MLO group rekeying.

Signed-off-by: Rameshkumar Sundaram <quic_ramess@quicinc.com>
Co-developed-by: Adil Saeed Musthafa <quic_adilm@quicinc.com>
Signed-off-by: Adil Saeed Musthafa <quic_adilm@quicinc.com>
Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
15 months agoAP MLD: Debug print of MLO KDE lengths
Rameshkumar Sundaram [Thu, 28 Mar 2024 18:16:47 +0000 (23:46 +0530)] 
AP MLD: Debug print of MLO KDE lengths

Signed-off-by: Rameshkumar Sundaram <quic_ramess@quicinc.com>
Co-developed-by: Adil Saeed Musthafa <quic_adilm@quicinc.com>
Signed-off-by: Adil Saeed Musthafa <quic_adilm@quicinc.com>
Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
15 months agoAP MLD: Require same AKM and pairwise cipher for all links
Rameshkumar Sundaram [Thu, 28 Mar 2024 18:16:47 +0000 (23:46 +0530)] 
AP MLD: Require same AKM and pairwise cipher for all links

Signed-off-by: Rameshkumar Sundaram <quic_ramess@quicinc.com>
Co-developed-by: Adil Saeed Musthafa <quic_adilm@quicinc.com>
Signed-off-by: Adil Saeed Musthafa <quic_adilm@quicinc.com>
Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
15 months agoUse defined values for RSN PN length
Jouni Malinen [Sat, 20 Apr 2024 13:15:01 +0000 (16:15 +0300)] 
Use defined values for RSN PN length

Make the code more readable by using a define for the PN length to avoid
potential confusion of this 6 octet length with the MAC address length.
In addition, Use ETH_ALEN more consistently for the latter.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
15 months agoAP MLD: Enhance authenticator state machine
Rameshkumar Sundaram [Thu, 28 Mar 2024 18:16:46 +0000 (23:46 +0530)] 
AP MLD: Enhance authenticator state machine

Add required ML specific members in struct wpa_authenticator and struct
wpa_state_machine to maintain self and partner link information.

Maintain state machine object in all associated link stations and
destroy/remove references from the same whenever link stations are
getting removed.

Increase the wpa_group object reference count for all links in which ML
station is getting associated and release the same whenever link
stations are getting removed.

Signed-off-by: Rameshkumar Sundaram <quic_ramess@quicinc.com>
Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
15 months agoAP MLD: Skip association link processing in ML info
Aditya Kumar Singh [Thu, 28 Mar 2024 18:16:45 +0000 (23:46 +0530)] 
AP MLD: Skip association link processing in ML info

All links were iterated over during processing ML info in Association
Request frame. However, the association link info will not be present in
the ML info and hence the following debug print is observed during ML
association (assoc link is 1):

MLD: No link match for link_id=1

Skip processing for the association link to avoid this.

Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
15 months agoAP MLD: Update all partner links' beacons
Sriram R [Thu, 28 Mar 2024 18:16:44 +0000 (23:46 +0530)] 
AP MLD: Update all partner links' beacons

Whenever there is a beacon update for any one of the affiliated link,
all the other partner links' beacon should be refreshed.

Signed-off-by: Sriram R <quic_srirrama@quicinc.com>
Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
15 months agoAP MLD: Handle link_id in EAPOL RX handler
Sriram R [Thu, 28 Mar 2024 18:16:43 +0000 (23:46 +0530)] 
AP MLD: Handle link_id in EAPOL RX handler

Add link ID support into EAPOL RX handler so that the events can
be routed to the appropriate link BSSs.

Signed-off-by: Sriram R <quic_srirrama@quicinc.com>
Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>