]> git.ipfire.org Git - thirdparty/hostap.git/log
thirdparty/hostap.git
9 months agoP2P2: Start client for join without WPS
Shivani Baranwal [Wed, 3 Jul 2024 16:41:26 +0000 (22:11 +0530)] 
P2P2: Start client for join without WPS

Do not use WPS enrollee for P2P2 connection.

Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
9 months agoP2P2: Support for GO to allow a client to join the group
Shivani Baranwal [Wed, 3 Jul 2024 16:41:26 +0000 (22:11 +0530)] 
P2P2: Support for GO to allow a client to join the group

Enable P2P GO to authorize a client device to join the group. In the
case of opportunistic bootstrapping, P2P GO must share the password with
the client device during PASN authentication in an Encrypted Data
element. P2P GO retrieves the ssid->sae_password and stores it in
p2p->dev_sae_password and authorizes the client. The SAE password and
the random passphrase derived for WPA-PSK connection are same. This
allows use of the get_passphrase API to connect a P2P-R1 and P2P-R2
client in PCC mode which will be covered in separate commits.

The P2P Client initiates PASN authentication with the GO using either
the password or opportunistic bootstrapping method. In the password
method, the client initiates PASN authentication with SAE tunneling
using the password and proceeds with the connection using open
authentication. In the opportunistic bootstrapping method, the client
obtains the SAE password from the GO and initiates the connection with
SAE authentication.

Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
9 months agoP2P2: Provisioning step on GO when a client joins
Shivani Baranwal [Wed, 3 Jul 2024 16:41:26 +0000 (22:11 +0530)] 
P2P2: Provisioning step on GO when a client joins

Add the PMKSA on the P2P2 GO when a new P2P2 Client joins the group
instead of going through the WPS step. This commit is adding just the
mechanism to add the PMKSA and the actual use for this is in a separate
commit.

Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
9 months agoP2P2: Fix a typo in function documentation
Jouni Malinen [Tue, 29 Oct 2024 22:08:21 +0000 (00:08 +0200)] 
P2P2: Fix a typo in function documentation

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
9 months agoP2P2: Fix peer entry generation based on USD
Jouni Malinen [Tue, 29 Oct 2024 10:27:12 +0000 (12:27 +0200)] 
P2P2: Fix peer entry generation based on USD

All cases calling dev_found() for a P2P peer will need to set the peer
flags to indicate it has been reported. In particular, this is needed to
avoid memory leaks in D-Bus code and in P2P peer cleanup. The recently
added P2P2 case using USD did not update the flags, so fix it to match
other cases.

Fixes: b4f9742ee246 ("P2P2: Process Element container attribute from NAN SDFs")
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
9 months agoRemove STA entries if association is not completed in 60 seconds
Jouni Malinen [Wed, 30 Oct 2024 10:04:01 +0000 (12:04 +0200)] 
Remove STA entries if association is not completed in 60 seconds

While the IEEE 802.11 standard allows STAs to authenticate with multiple
APs and later associate with one such AP, it is not really good for an
AP to maintain STA entries for not fully associated STA for significant
amount of time. Time out such STA entries in hostapd to clean state and
resources.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
9 months agoSAE: More robust password identifier checks for AP mode
Jouni Malinen [Wed, 30 Oct 2024 10:30:35 +0000 (12:30 +0200)] 
SAE: More robust password identifier checks for AP mode

Do not update the more persistent sae->tmp->pw_id value based on each
received SAE commit message before having successfully processed the
commit. In particular, this includes checking for a matcing password
identifier in cases where the AP has enabled one or more SAE passwords
with identifiers.

A per-received message sae->tmp->parsed_pw_id is used during parsing and
processing of each individual message and sae->tmp->pw_id is set only
after having successfully processed a commit message. This avoids
getting sae->tmp->pw_id being bound to an unknown value.

An earlier commit addressed some of the sequences that could have this
issue, but it missed some cases. This newer more robust version covers
what the earlier commit did, so that part can be removed with the new
design.

Fixes: 761041b18ab2 ("SAE: Free password identifier if SAE commit is rejected due to it")
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
9 months agoSAE: Reject unexpected password identifier in commit message parser
Jouni Malinen [Wed, 30 Oct 2024 09:33:44 +0000 (11:33 +0200)] 
SAE: Reject unexpected password identifier in commit message parser

While the list of possible SAE password identifiers might not be
available at the time of parsing a SAE commit message, an AP knows
whether any password identifiers have been enabled (since it has to
advertise that in the Beacon frames). When parsing a commit message on
an AP with no password identifiers in use, the parser can already reject
the unexpected case of an SAE password identifier.

Check for this specific case and reject the SAE commit based on unknown
password identifier if the received value cannot be for an enabled
password. This prevents some cases where an active attacker might have
been able to cause DoS by binding an STA entry in hostapd to a specific
SAE password identifier even when that identifier is not in use.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
9 months agotests: Enable SAE Pw Id on AP in sae_proto_hostapd_valid_commit_after_fail
Jouni Malinen [Thu, 31 Oct 2024 09:11:46 +0000 (11:11 +0200)] 
tests: Enable SAE Pw Id on AP in sae_proto_hostapd_valid_commit_after_fail

This is in preparation to implementation changes that use knowledge of
whether SAE Password Identifiers have been enabled to reject unexpected
commit messages.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
9 months agoSAE: Avoid duplicated debug entries for IEs in SAE commit messages
Jouni Malinen [Wed, 30 Oct 2024 09:05:50 +0000 (11:05 +0200)] 
SAE: Avoid duplicated debug entries for IEs in SAE commit messages

Print the "SAE: Possible elements at the end of the frame" debug message
only once (and only if there is actually some additional data) instead
of printing it for each element separately. There was some use for the
separated prints earlier, but that is not really helpful anymore with
the reduced mixing of IEs and non-IE fields at the end of the SAE commit
messages.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
9 months agohostapd: Fix clearing up settings for color switch
Stone Zhang [Mon, 14 Oct 2024 10:47:32 +0000 (18:47 +0800)] 
hostapd: Fix clearing up settings for color switch

Settings for color switch (struct cca_settings settings)
is used without zero clearing, which causes the member
settings->ubpr->unsol_bcast_probe_resp_intervalettings
to be a random value. It is againsts the NLA policy of
NL80211_UNSOL_BCAST_PROBE_RESP_ATTR_INT and causes
BSS color switch failure.

Fixes: 654d2395dddf ("BSS coloring: Handling of collision events and triggering CCA")
Signed-off-by: Stone Zhang <quic_stonez@quicinc.com>
9 months agoP2P2: Do not add WPS IE to join-a-group scan
Shivani Baranwal [Wed, 3 Jul 2024 16:41:26 +0000 (22:11 +0530)] 
P2P2: Do not add WPS IE to join-a-group scan

Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
9 months agoP2P2: Use PASN for joining a group
Shivani Baranwal [Wed, 3 Jul 2024 16:41:26 +0000 (22:11 +0530)] 
P2P2: Use PASN for joining a group

When joining a P2P2 group, use PASN negotiation instead of the older
design.

Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
9 months agoP2P2: Allow group to be added for P2P2 as autonomous GO
Shivani Baranwal [Wed, 3 Jul 2024 16:41:26 +0000 (22:11 +0530)] 
P2P2: Allow group to be added for P2P2 as autonomous GO

Add a "p2p2" parameter for P2P_GROUP_ADD to allow a group to be added
specifically for P2P2.

Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
9 months agoP2P2: Add PMKSA entry on successful group formation
Shivani Baranwal [Sun, 4 Aug 2024 22:12:08 +0000 (03:42 +0530)] 
P2P2: Add PMKSA entry on successful group formation

Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
9 months agoP2P2: Fix to check if sae_password is present
Shivani Baranwal [Tue, 15 Oct 2024 06:13:14 +0000 (11:43 +0530)] 
P2P2: Fix to check if sae_password is present

Fix the check for whether sae_password is present. Instead of checking
the static array's address which is always going to be true, verify that
the string is not empty.

Fixes: cf30af7c2f23 ("P2P2: Start P2P Client appropriately for P2P2 group")
Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
9 months agotests: Use pasn_data_deinit() in pasn-resp fuzzing tester
Jouni Malinen [Wed, 23 Oct 2024 20:49:45 +0000 (23:49 +0300)] 
tests: Use pasn_data_deinit() in pasn-resp fuzzing tester

The fuzzing tester for PASN responder needs to use pasn_data_deinit() to
free allocated memory in struct pasn_data after recent changes of adding
more allocated items into the struct. Without this, fuzz testing will
cause false positives due to memory leaks.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
9 months agoP2P2: Invitation using pairing verification
Shivani Baranwal [Mon, 1 Jul 2024 19:11:48 +0000 (00:41 +0530)] 
P2P2: Invitation using pairing verification

Add support for P2P2 pairing verification using invitation.

Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
9 months agoP2P2: Do not override peer_addr from BSSID in pairing verification
Shivani Baranwal [Mon, 1 Jul 2024 19:11:48 +0000 (00:41 +0530)] 
P2P2: Do not override peer_addr from BSSID in pairing verification

Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
9 months agoP2P2: Indicate P2P2 group in GO parameters
Shivani Baranwal [Mon, 1 Jul 2024 19:11:48 +0000 (00:41 +0530)] 
P2P2: Indicate P2P2 group in GO parameters

Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
9 months agoP2P2: Set up PMKSA for pairing verification
Shivani Baranwal [Mon, 1 Jul 2024 19:11:48 +0000 (00:41 +0530)] 
P2P2: Set up PMKSA for pairing verification

Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
9 months agoP2P2: Export p2p_build_inviation_req()
Shivani Baranwal [Mon, 1 Jul 2024 19:11:48 +0000 (00:41 +0530)] 
P2P2: Export p2p_build_inviation_req()

This will be needed for P2P2 invitation/pairing verification outside the
p2p_invitation.c file.

Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
9 months agoP2P2: Do not add WSC IE for P2P2 Invitation Request
Shivani Baranwal [Mon, 1 Jul 2024 19:11:48 +0000 (00:41 +0530)] 
P2P2: Do not add WSC IE for P2P2 Invitation Request

Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
9 months agoP2P2: Fetch PMK and PMKID for invitation using pairing verification
Shivani Baranwal [Mon, 1 Jul 2024 19:11:48 +0000 (00:41 +0530)] 
P2P2: Fetch PMK and PMKID for invitation using pairing verification

Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
9 months agoP2P2: Stop invitation process before sending out Invitation Request
Shivani Baranwal [Mon, 1 Jul 2024 19:11:48 +0000 (00:41 +0530)] 
P2P2: Stop invitation process before sending out Invitation Request

This is needed for the P2P2 case of invitation using pairing validation.

Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
9 months agoP2P2: Indication on whether P2P2 is used with P2P_INVITE
Shivani Baranwal [Mon, 1 Jul 2024 19:11:48 +0000 (00:41 +0530)] 
P2P2: Indication on whether P2P2 is used with P2P_INVITE

Add a new parameter "p2p2" to the P2P_INVITE control interface
command. This can be used to indicate that the operation is for a P2P2
group.

Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
9 months agoP2P2: Parameter setting for testing purpose
Shivani Baranwal [Wed, 26 Jun 2024 21:24:59 +0000 (02:54 +0530)] 
P2P2: Parameter setting for testing purpose

Add support to configure following parameters using the P2P_SET command
for testing purposes:

    P2P_SET pasn_type <u8>
    - Bitmap of supported PASN types

    P2P_SET supported_bootstrapmethods <u16>
    - Supported P2P bootstrapping methods

    P2P_SET pairing_setup <0/1>
    - Enable/disable P2P pairing setup

    P2P_SET pairing_cache <0/1>
    - Enable/disable P2P pairing cache for verification

    P2P_SET pairing_verification <0/1>
    - Enable/disable P2P pairing verification with cached NIK/NPK

    P2P_SET comeback_after <u16>
    - Bootstrap request for unauthorized peer is asked to come back after
      this many TUs.

    P2P_SET reginfo <u8>
    - Regulatory info encoding for operation in 6 GHz band

    P2P_SET twt_power_mgmt <0/1>
    - Enable TWT based power management for P2P

As these parameters could be varying based on the test requirement these
should not be set in the wpa_supplicant configuration while testing.

Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
9 months agoP2P2: Enable GCMP-256 as a pairwise cipher
Shivani Baranwal [Sun, 4 Aug 2024 22:12:08 +0000 (03:42 +0530)] 
P2P2: Enable GCMP-256 as a pairwise cipher

Add GCMP-256 as a pairwise cipher based on PASN type during pairing.

Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
9 months agoP2P2: Clone P2P2 and bootstrapping state to group interfaces
Shivani Baranwal [Sun, 4 Aug 2024 22:12:08 +0000 (03:42 +0530)] 
P2P2: Clone P2P2 and bootstrapping state to group interfaces

Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
9 months agoP2P2: Start P2P Client appropriately for P2P2 group
Shivani Baranwal [Sun, 4 Aug 2024 22:12:08 +0000 (03:42 +0530)] 
P2P2: Start P2P Client appropriately for P2P2 group

Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
9 months agoP2P2: Add P2P2 IE for groups using P2P2
Shivani Baranwal [Sun, 4 Aug 2024 22:12:08 +0000 (03:42 +0530)] 
P2P2: Add P2P2 IE for groups using P2P2

Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
9 months agoP2P2: Start GO with suitable parameters for P2P2
Shivani Baranwal [Sun, 4 Aug 2024 22:12:08 +0000 (03:42 +0530)] 
P2P2: Start GO with suitable parameters for P2P2

Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
9 months agoP2P2: Indicate SAE password and PMK from pairing with GO negotiation
Shivani Baranwal [Sun, 4 Aug 2024 22:12:08 +0000 (03:42 +0530)] 
P2P2: Indicate SAE password and PMK from pairing with GO negotiation

Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
9 months agoP2P: Clear GO negotiation results from stack after use
Jouni Malinen [Thu, 10 Oct 2024 20:45:07 +0000 (23:45 +0300)] 
P2P: Clear GO negotiation results from stack after use

struct p2p_go_neg_results contains private keys, so clear it from stack
explicitly to avoid leaving any unnecessary copies of keys in memory.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
9 months agoP2P2: Select PMKSA based on P2P Device Address and PMKID match
Shivani Baranwal [Sun, 4 Aug 2024 22:12:08 +0000 (03:42 +0530)] 
P2P2: Select PMKSA based on P2P Device Address and PMKID match

Extend GO (AP) PMKSA selection to use P2P Device Address when searching
for a matching PMKSA.

Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
9 months agoP2P2: Function callbacks for PASN
Shivani Baranwal [Sun, 4 Aug 2024 21:13:59 +0000 (02:43 +0530)] 
P2P2: Function callbacks for PASN

Add function callbacks for PASN through P2P to handle cases where direct
calls from PASN to P2P are not viable.

Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
9 months agoP2P2: Add a SAE password in PASN Encrypted Data element
Shivani Baranwal [Sun, 4 Aug 2024 21:13:59 +0000 (02:43 +0530)] 
P2P2: Add a SAE password in PASN Encrypted Data element

This is added for opportunistic bootstrapping cases. In addition,
generate a random SAE password for pairing when needed, i.e., when the
request is not for an existing GO.

Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
9 months agoP2P2: Parse and store peer's SAE password
Shivani Baranwal [Sun, 4 Aug 2024 21:13:59 +0000 (02:43 +0530)] 
P2P2: Parse and store peer's SAE password

Store the peer's password during group formation after opportunistic
PASN authentication or while joining an existing group.

Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
9 months agoP2P2: Parser function for PASN Encrypted Data element and DevIK
Shivani Baranwal [Sun, 4 Aug 2024 21:13:59 +0000 (02:43 +0530)] 
P2P2: Parser function for PASN Encrypted Data element and DevIK

Parse the encrypted P2P2 IE from PASN authentication frames and store a
copy of DevIK information so that this is available for use if the
connection succeeds for a persistent group.

Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
9 months agotests: Fix fuzzing tester build
Jouni Malinen [Sun, 13 Oct 2024 17:39:30 +0000 (20:39 +0300)] 
tests: Fix fuzzing tester build

The new pasn_common.c needs to included in PASN fuzzing testers.

Fixes: e15242565794 ("PASN: Routines for generating and processing encrypted data")
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
9 months agotests: sigma_dut and all AKM suites for EAP
Jouni Malinen [Thu, 10 Oct 2024 14:44:01 +0000 (17:44 +0300)] 
tests: sigma_dut and all AKM suites for EAP

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
9 months agotests: FILS with RSNXE
Jouni Malinen [Thu, 10 Oct 2024 08:57:34 +0000 (11:57 +0300)] 
tests: FILS with RSNXE

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
9 months agoFILS: Verify RSNXE when processing (Re)Association Response frame
Jouni Malinen [Thu, 10 Oct 2024 09:10:21 +0000 (12:10 +0300)] 
FILS: Verify RSNXE when processing (Re)Association Response frame

IEEE Std 802.11ai-2016 did not cover this since the RSNXE did not exist
at the time FILS was designed and IEEE Std 802.11-2020 did not seem to
catch this case either. However, the AP's RSNXE should be verified in
FILS in a similar manner to how the AP's RSNE is verified.

Add code to verify the RSNXE in FILS. However, since this has not been
clear in the standard and there has been hostapd releases that might
omit the RSNXE from (Re)Association Response frame when the STA does not
include the RSNXE in (Re)Association Request frame, do not reject
association based on this comparison result if the STA did not include
an RSNXE in the (Re)Association Request frame. This workaround might be
removed in the future.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
9 months agoRSNO: Omit RSNXE in (Re)Association Response frame like in Beacon frame
Jouni Malinen [Thu, 10 Oct 2024 08:53:29 +0000 (11:53 +0300)] 
RSNO: Omit RSNXE in (Re)Association Response frame like in Beacon frame

When rsn_override_omit_rsnxe=1 is used to omit the RSNXE from Beacon and
Probe Response frames, it should also be omitted from (Re)Association
Response frames since there is a general expectation on the RSNXE being
used consistently between these frames. This is unlikely to have much of
a difference for most use cases in practice, but this could impact FILS
association if the non-AP STA were to confirm that the unprotected and
protected version of the RSNXE from the AP were identical.

Fixes: 8b2ddfdbb688 ("RSNO: Allow RSNXE to be omitted")
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
9 months agoFT: Omit RSNXE from Reassociation Response frame only with FT protocol
Jouni Malinen [Thu, 10 Oct 2024 08:29:01 +0000 (11:29 +0300)] 
FT: Omit RSNXE from Reassociation Response frame only with FT protocol

The special case for having to omit the RSNXE from Reassociation
Response frames applies only for FT protocol. This was incorrectly
applied to all cases where the (Re)Association Request frame did not
include an RSNXE. This should not have changed behavior for the FT initial
mobility domain association or any non-FT association.

Fix the conditions for omitting the RSNXE to apply only when actually
going through FT protocol. While this does not really have much, if any,
impact to most cases since non-AP STAs that do not include the RSNXE in
Association Request frame are unlikely to do anything with this element
(or its omission), this could have significant impact to FILS
authentication. The current IEEE 802.11 standard does not actually say
anything about validating the RSNXE in FILS (Re)Association Response
frame, but it should really be verified in the same manner as the RSNE
is (i.e., compared against the RSNXE in the Beacon frame) and that
should happen even if the non-AP STA does not include the RSNXE.

Fixes: b7366a942a58 ("FT: Omit RSNXE from FT protocol Reassociation Response when needed")
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
9 months agotests: SAE PWE derivation with both options
Jouni Malinen [Thu, 10 Oct 2024 08:16:30 +0000 (11:16 +0300)] 
tests: SAE PWE derivation with both options

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
9 months agoAP: Use helper functions in ap_sta_disconnect()
Jouni Malinen [Wed, 9 Oct 2024 17:05:32 +0000 (20:05 +0300)] 
AP: Use helper functions in ap_sta_disconnect()

There is a long history with ap_sta_disconnect() being added as the
handler for Disconnect operation from the RSN Authenticator state
machine and then evolving over years with
ap_sta_deauthenticate/disassociate() doing very similar operations, but
not exactly identical. This mess should really be cleaned up since many
of the differences are unlikely to be on purpose. As a step towards
that, use shared helper functions to make these functions avoid
duplicated implementation for the clearly common parts.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
9 months agoAP: Clean up MLD changes that modified skipping DMG deauthentication
Jouni Malinen [Wed, 9 Oct 2024 16:46:23 +0000 (19:46 +0300)] 
AP: Clean up MLD changes that modified skipping DMG deauthentication

Commit 05e5e615e6a2 ("AP: Skip authentication/deauthentication phase for
DMG/IEEE 802.11ad") added the check for DMG in the beginnign of
ap_sta_deauthenticate() to convert that call to ap_sta_disassociate()
since deauthentication is not used in DMG. Commit c6f519ff15b2 ("AP:
Support deauthenticate/disassociate with MLD") ended up moving this DMG
check into the ap_sta_handle_deauthenticate() function that gets called
once for each link. This is confusing even though DMG is not really used
in MLD.

Move the DMG check back to the beginning of ap_sta_deauthenticate() to
make this clearer.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
9 months agoAvoid memcmp() with NULL pointer even if for zero length
Sunil Ravi [Fri, 20 Sep 2024 19:24:55 +0000 (19:24 +0000)] 
Avoid memcmp() with NULL pointer even if for zero length

Explicitly check for last_ssid->ssid to be set in wpa_bss_flush_by_age()
before using memcmp() to compare the SSID against the one in the BSS
entry. This is not really expected to do any real comparison here since
the case where last_ssid->ssid is NULL implies bss->ssid_len to be 0.
Anyway, avoid the unexpected memcmp(ptr, NULL, 0) call in such a case to
avoid issues with C libraries that might prevent such as unexpected
behavior.

Signed-off-by: Sunil Ravi <sunilravi@google.com>
9 months agotests: Mesh EHT 320 test case
Aditya Kumar Singh [Tue, 27 Aug 2024 05:27:49 +0000 (10:57 +0530)] 
tests: Mesh EHT 320 test case

Add a simple mesh test case for EHT 6 GHz/320 MHz operation.

And now since 9 is a possible value for max_oper_chwidth, modify test
case wpas_config_range_check as well.

Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
9 months agowpa_supplicant: 320 MHz bandwidth support for mesh
Aditya Kumar Singh [Tue, 27 Aug 2024 05:27:48 +0000 (10:57 +0530)] 
wpa_supplicant: 320 MHz bandwidth support for mesh

Mesh supported a maximum operational channel width of up to 160 or 80+80
MHz. Extend this to support a maximum operational channel width of up to
320 MHz.

Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
9 months agoAP MLD: Allow link ID to be specified for Action frame TX operations
Balamurugan Ramar [Wed, 28 Aug 2024 11:26:36 +0000 (16:56 +0530)] 
AP MLD: Allow link ID to be specified for Action frame TX operations

The Action frame sent by hostapd currently lacks a link ID, causing the
driver to independently determine the link ID based on available data.
This can sometimes result in the driver selecting an unintended link for
the Action frame transmission. To address this, add support to allow
hostapd to send the link ID along with Action frames to the driver.

This commit introduces only the function arguments to allow the link ID
to be provided.  A subsequent commit will fill the link ID based on the
required conditions.

Signed-off-by: Balamurugan Ramar <quic_bramar@quicinc.com>
Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
9 months agonl80211: Handle radar event properly during MLO
Aditya Kumar Singh [Fri, 6 Sep 2024 13:23:57 +0000 (18:53 +0530)] 
nl80211: Handle radar event properly during MLO

Currently, the driver while sending an NL80211_CMD_RADAR_DETECT command
does not send a link ID at all. Hence the condition on whether the link
ID is passed is not required. At the same time, for certain commands,
if_idx will not be given and hence the event will be routed to the drv's
first BSS only which might not have any 5 GHz link. Hence there is need
to refactor the logic for such cases and identify the intended BSS
properly and then pass the event to it.

Hence,
  * identify the link ID based on the freq info present in the event.
  * identify the correct BSS to which the event should be routed in case
    the event comes without any if_idx.
  * check for the underlying link even when the link is not operating on
    the same frequency for events like NL80211_RADAR_NOP_FINISHED.

Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
9 months agonl80211: Send link ID when starting CAC for radar detection
Aditya Kumar Singh [Fri, 6 Sep 2024 13:23:56 +0000 (18:53 +0530)] 
nl80211: Send link ID when starting CAC for radar detection

For MLO, link ID needs to be sent along with the nl80211 command to
start CAC for radar detection. Pass the link ID if operating as an AP
MLD.

Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
10 months agowlantest: Avoid compiler warnings on printing out u64 in 32-bit builds
Jouni Malinen [Wed, 2 Oct 2024 21:52:19 +0000 (00:52 +0300)] 
wlantest: Avoid compiler warnings on printing out u64 in 32-bit builds

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
10 months agohostapd: Fix clearing old BSS during config reload
Ajith C [Wed, 21 Aug 2024 04:09:01 +0000 (09:39 +0530)] 
hostapd: Fix clearing old BSS during config reload

After a configuration reload, stations that were previously associated
with the AP could have failed to reconnect under the new configuration.

This issue arises because the new configuration is assigned to the
interface’s configuration pointer too early. The old configuration needs
to remain in the pointer until all existing stations are cleared.

Resolve this issue by assigning the new configuration only after all
existing stations have been cleared.

Fixes: b37c3fbad4a4 ("hostapd: Add config_id parameter")
Signed-off-by: Ajith C <quic_ajithc@quicinc.com>
10 months agoRemove unused arguments in ieee802_11_parse_link_assoc_req()
Adil Saeed Musthafa [Thu, 19 Sep 2024 17:16:02 +0000 (10:16 -0700)] 
Remove unused arguments in ieee802_11_parse_link_assoc_req()

The unparsed buffer of all IEs was not actually used at all in
ieee802_11_parse_link_assoc_req().

Signed-off-by: Adil Saeed Musthafa <quic_adilm@quicinc.com>
10 months agoscan: Pass correct link ID in all cases
Aditya Kumar Singh [Sat, 7 Sep 2024 04:08:00 +0000 (09:38 +0530)] 
scan: Pass correct link ID in all cases

In hostapd, when a scan was initiated, the link ID parameter was not
populated in all scenarios, such as ACS. Additionally, each caller of
hostapd_driver_scan() provided the link ID. However, since
hostapd_driver_scan() has access to the hapd pointer, it can populate
the link ID itself.

And from wpa_supplicant, link ID was passed as 0 which does not seem to
be correct. Fix that as well.

Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
10 months agoAdd a QCA vendor event to indicate status of the idle shutdown
Ashish Kumar Dhanotiya [Tue, 24 Sep 2024 10:25:17 +0000 (15:55 +0530)] 
Add a QCA vendor event to indicate status of the idle shutdown

If there are no active Wi-Fi interfaces for a certain duration, the host
driver triggers idle shutdown. Add a new vendor event
QCA_NL80211_VENDOR_SUBCMD_IDLE_SHUTDOWN to indicate user space when the
idle shutdown is started or completed.

This uses attributes defined in enum qca_wlan_vendor_attr_idle_shutdown.

Signed-off-by: Ashish Kumar Dhanotiya <quic_adhanoti@quicinc.com>
10 months agoUpdate documentation of the QCA vendor ACS channel list attributes
Veerendranath Jakkam [Thu, 26 Sep 2024 10:12:37 +0000 (15:42 +0530)] 
Update documentation of the QCA vendor ACS channel list attributes

Add more detailed documentation for QCA_WLAN_VENDOR_ATTR_ACS_CH_LIST
and QCA_WLAN_VENDOR_ATTR_ACS_FREQ_LIST attributes on how the specified
channel list information is used by the driver during the ACS function.

The specified channel list represents the allowed channels for the
primary and non-primary channel operations. If any channel is not
present in the allowed channel list it shouldn't be used as a primary or
non-primary channel.

Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
10 months agowlantest: Fix BIP replay protection check
Jouni Malinen [Wed, 2 Oct 2024 17:01:22 +0000 (20:01 +0300)] 
wlantest: Fix BIP replay protection check

IPN/BIPN are encoded using little endian byte order, so memcmp() cannot
be used to check the validity of a received IPN/BIPN. Fix this by
converting IPN/BIPN into an integer in host byte order for processing.

Fixes: bacc31286cd1 ("wlantest: Validate MMIE MIC")
Fixes: faf6894f35f6 ("wlantest: BIGTK fetching and Beacon protection validation")
Fixes: 2e4c34691b73 ("wlantest: Add support for protecting injected broadcast frames")
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
10 months agotests: FT with RSNXE only from STA
Jouni Malinen [Fri, 27 Sep 2024 20:02:26 +0000 (23:02 +0300)] 
tests: FT with RSNXE only from STA

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
10 months agoFT: Do not omit RSNXE from FT initial mobility domain association
Jouni Malinen [Fri, 27 Sep 2024 19:59:22 +0000 (22:59 +0300)] 
FT: Do not omit RSNXE from FT initial mobility domain association

The special case for having to omit the RSNXE from Reassociation Request
frames applies only for FT protocol. This was incorrectly applied to all
cases using FT, i.e., both the initial mobility domain association and
FT protocol. This should not have changed behavior for the initial
mobility domain association regardless of whether Association Request
frame or Reassociation Request frame is used.

Fix the conditions for omitting the RSNXE to apply only when actually
going through FT protocol.

Fixes: 6140cca8191e ("FT: Omit RSNXE from FT protocol Reassociation Request when needed")
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
10 months agoSAE: Allow network profile sae_pwe to be configured
Jouni Malinen [Fri, 27 Sep 2024 19:40:05 +0000 (22:40 +0300)] 
SAE: Allow network profile sae_pwe to be configured

This was supposed to be exposed in wpa_supplicant network profile for
configuration instead of just internal use.

Fixes: 5fb90cf3fa96 ("SAE: Use sae_pwe in network profile for STA mode")
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
10 months agoP2P2: PASN Authentication frame TX status handling
Shivani Baranwal [Sun, 4 Aug 2024 21:13:59 +0000 (02:43 +0530)] 
P2P2: PASN Authentication frame TX status handling

Handle PASN Authentication frame TX status in cases where this is for
the P2P2 specific use of PASN.

Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
10 months agoP2P2: Initiate PASN on bootstrapping completion
Shivani Baranwal [Sun, 4 Aug 2024 21:13:59 +0000 (02:43 +0530)] 
P2P2: Initiate PASN on bootstrapping completion

Start PASN to complete pairing.

Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
10 months agoP2P2: Add support for GO Negotiation wrapped in PASN auth frame
Shivani Baranwal [Sun, 4 Aug 2024 21:13:59 +0000 (02:43 +0530)] 
P2P2: Add support for GO Negotiation wrapped in PASN auth frame

Add P2P2 support for GO Negotiation wrapped in PASN authentication
frames as an Action wrapper attribute.

Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
10 months agoPASN: Store PASN authentication frames 1 and 2
Shivani Baranwal [Sun, 4 Aug 2024 21:13:59 +0000 (02:43 +0530)] 
PASN: Store PASN authentication frames 1 and 2

These are needed for P2P2 support.

Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
10 months agoPASN: Extend maximum buffer length in 3rd auth frame
Shivani Baranwal [Sun, 4 Aug 2024 21:13:59 +0000 (02:43 +0530)] 
PASN: Extend maximum buffer length in 3rd auth frame

This can be longer than 255 octets, so u8 is not sufficient.

Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
10 months agoPASN: Routines for generating and processing encrypted data
Shivani Baranwal [Sun, 4 Aug 2024 21:13:59 +0000 (02:43 +0530)] 
PASN: Routines for generating and processing encrypted data

This adds functions to use the PASN Encrypted Data element based on the
definition in IEEE P802.11bh/D6.0.

Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
10 months agoP2P2: Set DevIK expiration time to 24 hours
Shivani Baranwal [Sun, 4 Aug 2024 21:13:59 +0000 (02:43 +0530)] 
P2P2: Set DevIK expiration time to 24 hours

Add a location for storing expiration time for DevIK. For now, this is
hardcoded to 24 hours and the value will be used in a subsequence commit
to construct the indication to the peer.

Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
10 months agoSAE: Use sae_pwe in network profile for STA mode
Jouni Malinen [Thu, 26 Sep 2024 20:19:54 +0000 (23:19 +0300)] 
SAE: Use sae_pwe in network profile for STA mode

Commit 891bb1305bbd ("P2P: Enforce SAE-H2E for P2P GO in 6 GHz")
introduced a network profile specific sae_pwe to avoid having to change
the global sae_pwe parameter. However, this was enabled only for AP/P2P
GO mode. Extend that to cover STA mode as well.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
10 months agotests: WPA2-PSK AP and TKIP as a group cipher, but not pairwise
Jouni Malinen [Thu, 26 Sep 2024 08:49:30 +0000 (11:49 +0300)] 
tests: WPA2-PSK AP and TKIP as a group cipher, but not pairwise

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
10 months agoSAE: Extend Basic MLE Recognition to external auth case
Hu Wang [Fri, 20 Sep 2024 01:58:18 +0000 (18:58 -0700)] 
SAE: Extend Basic MLE Recognition to external auth case

This commit extends ccba6921de63 ("SAE: Recognize Basic MLE in
Authentication frames even without H2E") to cover external auth case.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
10 months agoExtend EAPOL frames processing workaround for reassociation to same AP
Kavita Kavita [Wed, 24 Jul 2024 12:23:06 +0000 (17:53 +0530)] 
Extend EAPOL frames processing workaround for reassociation to same AP

With commit 3ab35a660364 ("Extend EAPOL frames processing workaround for
roaming cases") wpa_supplicant postpones EAPOL frame processing till
roam indication from the driver when the source address of EAPOL frame
does not match the current BSSID/AP MLD MAC address.

However, this does not handle the cases in which STA tries to
reassociate with the current AP. When STA tries to reassociate with the
current AP, the source address of the EAPOL frame will be same as the
current BSSID. So, wpa_supplicant does not postpone the EAPOL frame from
the current connected AP since AP might have sent the EAPOL frame for
PTK rekey.

To address this issue, add additional support for reassociating to the
same AP case. Check if replay counter value of the new EAPOL frame is
greater than the reply counter of the last EAPOL frame, and if the new
EAPOL frame replay counter is less, postpone the new EAPOL frame
processing until roam indication from the driver.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
10 months agoSTA: Update driver roaming policy on connection completion
Purushottam Kushwaha [Fri, 23 Aug 2024 13:23:08 +0000 (18:53 +0530)] 
STA: Update driver roaming policy on connection completion

When the network profile is configured with BSSID before connection,
roaming policy in the driver (for driver-based BSS selection) doesn't
get updated if the same BSSID is configured after connection. Update
roaming policy to the driver on connection completion to cover this
case.

Signed-off-by: Purushottam Kushwaha <quic_pkushwah@quicinc.com>
10 months agoAdd QCA vendor command to fetch offload scan data from firmware
Veerendranath Jakkam [Tue, 17 Sep 2024 05:13:28 +0000 (10:43 +0530)] 
Add QCA vendor command to fetch offload scan data from firmware

Add a new QCA vendor command
QCA_NL80211_VENDOR_SUBCMD_GET_FW_SCAN_REPORT to fetch scan data stored
by firmware during offload scans.

Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
10 months agotests: sigma_dut controlled SAE association and random RSNXE
Jouni Malinen [Thu, 19 Sep 2024 10:40:03 +0000 (13:40 +0300)] 
tests: sigma_dut controlled SAE association and random RSNXE

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
10 months agotests: SAE with EAPOL-Key msg 2/4 Key Info field reserved bits set
Jouni Malinen [Thu, 19 Sep 2024 10:35:06 +0000 (13:35 +0300)] 
tests: SAE with EAPOL-Key msg 2/4 Key Info field reserved bits set

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
10 months agoAdd TEST_RSNXE_DATA for RSNXE testing of AP functionality
Veerendranath Jakkam [Mon, 9 Sep 2024 20:01:28 +0000 (01:31 +0530)] 
Add TEST_RSNXE_DATA for RSNXE testing of AP functionality

Add support to set test data in the default RSNXE with wpa_supplicant
control interface command "TEST_RSNXE_DATA <data hexdump> <mask
hexdump>". This can be used to do protocol testing of AP side processing
of RSNXE.

Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
10 months agoAllow forced enabling of EAPOL-Key msg 2/4 key info bits for testing
Veerendranath Jakkam [Tue, 10 Sep 2024 21:36:15 +0000 (03:06 +0530)] 
Allow forced enabling of EAPOL-Key msg 2/4 key info bits for testing

This can be used to increasing AP testing coverage for different 4-way
handshake behavior.

Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
10 months agoQCA vendor interface to exclude 6 GHz non-PSC channels as primary channel in ACS
Veerendranath Jakkam [Tue, 17 Sep 2024 09:15:19 +0000 (14:45 +0530)] 
QCA vendor interface to exclude 6 GHz non-PSC channels as primary channel in ACS

Add support to exclude 6 GHz non-PSC channels as primary channel with
QCA_NL80211_VENDOR_SUBCMD_DO_ACS.

Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
10 months agoAdd QCA vendor status for TWT termination due to multiple MLO links activated
Veerendranath Jakkam [Wed, 11 Sep 2024 19:21:19 +0000 (00:51 +0530)] 
Add QCA vendor status for TWT termination due to multiple MLO links activated

Add a new status value
QCA_WLAN_VENDOR_TWT_STATUS_MULTIPLE_LINKS_ACTIVE_TERMINATE to indicate
the TWT session termination due to more than one MLO link being in
active state.

Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
10 months agoFix STA's SSID protection capability when AP SME is offloaded to driver
Shreyat Pandey [Mon, 16 Sep 2024 09:43:05 +0000 (15:13 +0530)] 
Fix STA's SSID protection capability when AP SME is offloaded to driver

Correctly set STA's SSID protection capability to STA's wpa_sm for AP
SME offload to the driver case when processing association events.

Signed-off-by: Shreyat Pandey <quic_shrepand@quicinc.com>
10 months agotests: D-Bus interface for NAN USD
Jouni Malinen [Sat, 14 Sep 2024 15:24:24 +0000 (18:24 +0300)] 
tests: D-Bus interface for NAN USD

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
10 months agodbus: Methods for NAN USD
Lo,Chin-Ran [Mon, 15 Jul 2024 06:01:11 +0000 (14:01 +0800)] 
dbus: Methods for NAN USD

USD had a control interface commands and events defined for it. Extend
this by providing similar USD methods through the dbus control
interface.

Signed-off-by: Lo,Chin-Ran <chin-ran.lo@nxp.com>
10 months agodbus: Signals for NAN USD
Lo,Chin-Ran [Mon, 15 Jul 2024 06:01:11 +0000 (14:01 +0800)] 
dbus: Signals for NAN USD

USD had a control interface events defined for it. Extend this by
providing similar USD signals through the dbus control interface.

Signed-off-by: Lo,Chin-Ran <chin-ran.lo@nxp.com>
10 months agodbus: Dict helpers for fetching integers of any type
Jouni Malinen [Sun, 15 Sep 2024 08:59:24 +0000 (11:59 +0300)] 
dbus: Dict helpers for fetching integers of any type

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
10 months agoNAN: Fix UpdatePublish offload to driver
Jouni Malinen [Sat, 14 Sep 2024 11:11:40 +0000 (14:11 +0300)] 
NAN: Fix UpdatePublish offload to driver

This was supposed to call wpa_drv_nan_update_publish() instead of
wpa_drv_nan_cancel_publish().

Fixes: 633e969311ed ("NAN: Option to offload NAN DE for USD into the driver")
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
10 months agoNAN: Handle A3 copying internally to simplify control interface
Jouni Malinen [Sat, 14 Sep 2024 09:54:04 +0000 (12:54 +0300)] 
NAN: Handle A3 copying internally to simplify control interface

There is no need to copy the A3 value for follow-up frames through the
control interface events and commands since it can be handled internally
in the service with sufficient accuracy. More parallel operations with
multiple peers might need per-peer information, but that can be extended
in the future, if that level of complexity is really needed in practice.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
10 months agoRevert "tests: Copy A3 into NAN SDF Follow-up"
Jouni Malinen [Sat, 14 Sep 2024 10:04:14 +0000 (13:04 +0300)] 
Revert "tests: Copy A3 into NAN SDF Follow-up"

This reverts commit 81322fa43d1d ("tests: Copy A3 into NAN SDF
Follow-up") to allow simplification of the control interface by removing
the external A3 copying.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
10 months agotests: Copy A3 into NAN SDF Follow-up
Jouni Malinen [Fri, 13 Sep 2024 18:58:29 +0000 (21:58 +0300)] 
tests: Copy A3 into NAN SDF Follow-up

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
10 months agoNAN: Update A3 for USD to use NAN Network ID or NAN Cluster ID in A3
Jouni Malinen [Fri, 13 Sep 2024 18:58:51 +0000 (21:58 +0300)] 
NAN: Update A3 for USD to use NAN Network ID or NAN Cluster ID in A3

Wi-Fi Aware spec v4.0 was not clear on all cases and used a bit unclear
definition of A3 use in Table 5 (Address field definiton for NAN SDF
frames in USD). That resulted in the initial implementation using
Wildcard BSSID to comply with the IEEE 802.11 rules on Public Action
frame addressing.

For USD to have chances of working with synchronized NNA devices, A3
needs to be set to the NAN Cluster ID when replying to a frame received
from a synchronized NAN device. While there is no cluster ID for USD,
this can be done by copying the A3 from the received frame. For the
cases where sending out an unsolicited multicast frame, the NAN Network
ID should be used instead of the Wildcard BSSID.

While this behavior is not strictly speaking compliant with the IEEE
802.11 standard, this is the expected behavior for NAN devices, so
update the USD implementation to match.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
10 months agohostapd: Add drv_send_action variant for forcing A3
Jouni Malinen [Fri, 13 Sep 2024 18:58:51 +0000 (21:58 +0300)] 
hostapd: Add drv_send_action variant for forcing A3

This is needed for cases that are not compliant with the IEEE 802.11
standard rules for Public Action frame addressing. For example, NAN USD
needs this.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
10 months agoNAN: Process received NAN SDFs with NAN Network ID in A3 on AP
Jouni Malinen [Fri, 13 Sep 2024 18:58:51 +0000 (21:58 +0300)] 
NAN: Process received NAN SDFs with NAN Network ID in A3 on AP

hostapd did not accept NAN SDFs that used NAN Network ID instead of
Wildcard BSSID in A3. Extend this to process NAN Network ID just like
Wildcard BSSID for these frames to allow the specific group address to
be used.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
10 months agoSAE: Recognize Basic MLE in Authentication frames even without H2E
Jouni Malinen [Fri, 13 Sep 2024 00:15:31 +0000 (03:15 +0300)] 
SAE: Recognize Basic MLE in Authentication frames even without H2E

IEEE P802.11be requires H2E to be used whenever SAE is used for ML
association. However, some early Wi-Fi 7 APs enable MLO without H2E.
Recognize this special case based on the fixed length Basic Multi-Link
element being at the end of the data that would contain the unknown
variable length Anti-Clogging Token field. The Basic Multi-Link element
in Authentication frames include the MLD MAC addreess in the Common Info
field and all subfields of the Presence Bitmap subfield of the
Multi-Link Control field of the element zero and consequently, has a
fixed length of 12 octets.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
10 months agoFT: Discard EAPOL-Start frames when FT was used for association
Jouni Malinen [Thu, 12 Sep 2024 19:26:24 +0000 (22:26 +0300)] 
FT: Discard EAPOL-Start frames when FT was used for association

When FT is used, reauthentication to generate a new PMK-R0 would be
complicated since the current AP might not be the one with which the
currently used PMK-R0 was generated. IEEE Std 802.11-2020, 13.4.2 (FT
initial mobility domain association in an RSN) mandates STA to perform a
new FT initial mobility domain association whenever its Supplicant would
trigger sending of an EAPOL-Start frame.

Discard received EAPOL-Start frames from STAs that use FT to avoid
unexpected behavior. This is important in particular if a driver were to
allow unprotected EAPOL-Start frames to be processed when TK has been
configured.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
10 months agonl80211: Remove nl_msg free on send failure for NAN USD commands
Shivani Baranwal [Thu, 12 Sep 2024 12:19:03 +0000 (17:49 +0530)] 
nl80211: Remove nl_msg free on send failure for NAN USD commands

Remove nl_msg_free() after send failure for NAN USD commands. Freeing
the nl_msg is already taken care as part of send_and_recv_cmd() for both
success and failure cases.

Fixes: 58f04221fdef ("nl80211: NAN USD commands for offloading")
Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
10 months agoPASN: Fix pasn-resp fuzzing tester build
Jouni Malinen [Thu, 12 Sep 2024 18:33:30 +0000 (21:33 +0300)] 
PASN: Fix pasn-resp fuzzing tester build

The recently added calls to src/ap/pmksa_cache_auth.c needs to be faked
to allow pasn-resp to be built without having to pull in multiple
additional files from src/ap.

Fixes: b7de417c8a47 ("PASN: Define PMKSA helper functions for initiator and responder")
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
10 months agoPASN: Fix fuzzing tester compilation after function prototype change
Jouni Malinen [Thu, 12 Sep 2024 18:26:03 +0000 (21:26 +0300)] 
PASN: Fix fuzzing tester compilation after function prototype change

Addition of the new argument to handle_auth_pasn_1() forgot to update
testing code.

Fixes: 8f21cdf9d765 ("PASN: Add support to reject PASN auth 1 based on user input")
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>