Add QCA vendor attribute for triggered SU BF support
Add vendor attribute for EHT testbed STA to configure the triggered
single user beamforming feedback in the EHT capabilities of an
Association Request frame.
Jouni Malinen [Wed, 1 Jan 2025 09:17:31 +0000 (11:17 +0200)]
EAP-TEAP: Add a compatibility mode for FreeRADIUS
FreeRADIUS (at least the current snapshot of the v3.2.x branch) uses
different style for deriving S-IMCK[j]. It tracks S_IMCK_MSK[j] and
S_IMCK_EMSK[j] variants through all inner methods instead of selecting a
single S_IMCK[j] at the end of each inner method. IMHO, that does not
match what is most likely described in RFC 7170bis, it is a potential
interpretation of the draft and is closer to what wpa_supplicant used to
do earlier. However, that design has a weakness in EMSK derivation from
TEAP since it does not actually get any input from inner methods that do
not derive an EMSK.
Obviously, there should be only a single shared interpretation on how
TEAPv1 is supposed to work, but until we get to that point, it is
convenient to be able to test other parts of the protocol without having
to modify source code to work around differences. Introduce a new
phase1="teap_compat=freeradius" configuration parameter to
wpa_supplicant to allow EAP-TEAP peer behavior to be modified to match
what FreeRADIUS expects.
This compatibility mode was now able to successfully authenticate (and
also to derive matching MSK and EMSK) against FreeRADIUS v3.2.x branch
snapshot with all four combinations of machine(EAP-TLS) and
user(EAP-MSCHAPv2) authentication.
Jouni Malinen [Tue, 31 Dec 2024 18:07:09 +0000 (20:07 +0200)]
EAP-TEAP: Fix S-IMCK derivation based on RFC 7170bis
draft-ietf-emu-rfc7170bis-19 has clarified some of the operations
related to how keys are derived in EAP-TEAP. Update hostapd and
wpa_supplicant implementations to match this.
Derive S-IMCK_MSK[j] for Basic-Password-Auth using 32 octet all zeros
MSK. This was already done in the previous implementation, but this
updates that design to use the common S-IMCK/CMK derivation helper
function.
While there are two variants of IMSK, S-IMCK, and CMK being derived afte
r reach inner method, only one of those variants are selected based on
which MSK/EMSK combinations are supported by the server and the client.
This is not completely clear in Section 5.2, but the rules there for the
"received of the Crypto-Binding TLV" (which is really talking about the
EAP client, not server when the server is receiving Client-Binding TLV
from the client) seem to imply this design.
The design for crypto bindings and selection on MSK vs. EMSK related
keys as follows: Both the server and the client derive CMK_MSK[j] and
CMK_EMSK[j], if possible (i.e., if their implementation of the inner
method derived those keys). The server includes both MSK Compound MAC
and EMSK Compound MAC (if both MSK and EMSK were derived by the inner
method). The client selects which one of these to use based on what its
implementation of the inner method derived. The client includes only one
of these (i.e., EMSK Compound MAC if both the server and the client
derived EMSK or MSK Compound MAC otherwise). This determines which of
the S-IMCK[j] variants (i.e., S-IMCK_MSK[j] or S-IMCK_EMSK[j]) is
selected to be used as the S-IMCK[j].
With the clarified selection of a single S-IMCK[j] after each inner
method, the unclear parts about overall MSK/EMSK derivation from TEAP is
clarified since there is not actually need to explicitly indicate
variant of S-IMCK[n] is used.
In addition, this removes FIX comments for the cases that were clarified
in the draft to match what was previously implemented (e.g., fixed 20
octet length for Compound MAC).
These changes are not backwards compatible. Some cases might work, but
more or less everything with more than a single inner method is going to
fail between the previous and the new implementation. Taken into account
the limited deployment of EAP-TEAP so far and the work to clarify things
in RFC 7170bis, there is enough justification for this compatibility
breaking change at this point.
Jouni Malinen [Mon, 30 Dec 2024 16:31:21 +0000 (18:31 +0200)]
WNM: A more explicit check for a connection
wnm_scan_process() was only implicitly verifying that there is an
association based on wpa_s->wnm_dialog_token having been set. While that
may be sufficient for normal uses within wpa_supplicant, this was not
covered in a separate WNM fuzzer. Add an explicit check for
wpa_s->current_ssid to be set within wnm_scan_process() to avoid
unexpected behavior if something were to allow wnm_dialog_token to be
set when not actually associated.
Jouni Malinen [Mon, 30 Dec 2024 16:29:25 +0000 (18:29 +0200)]
tests: Fix WNM fuzzzer to work with wnm_sta.c changes
wpa_s->current_ssid needs to be set for processing BSS transition
management operations now witht he wnm_san_process() changes to use
wpa_supplicant_select_bss(), so set that in the WNM fuzzer to avoid
false errors due to dereferencing a NULL pointer.
Jouni Malinen [Sun, 29 Dec 2024 10:11:25 +0000 (12:11 +0200)]
MBO: Get rid of the is_first flag in neighbor report array
This was set to 1 for the entry at position 0 if
wnm_mbo_trans_reason_present is set. The flag was used only under that
condition and the array position is known, so it is simpler to just use
that without an explicit flag indicating which entry is first.
Benjamin Berg [Thu, 19 Sep 2024 10:19:17 +0000 (12:19 +0200)]
WNM: Use standard BSS selection and enable abridged bit handling
Most of the logic to reject BSSs during transition has been moved into
wnm_is_bss_excluded(). In addition to this, since commit 67bf89f55442
("WNM: Choose the best available BSS, not just the first one") we will
simply choose the BSS with the best throughput.
Overall, this matches the behavior that wpa_supplicant will use anyway
in wpa_supplicant_select_bss(). The only bigger difference is that using
this will check all known BSSs instead of only the ones in the candidate
list. This means that with this change the abridged bit is handled
according to standard.
There are some subtle changes to the logic. One is, that candidates with
a very low signal level are not explicitly dropped anymore. However,
that code pre-dates the logic to prefer the best BSS and should not be
relevant anymore.
Another small adjustment is to change the custom logic to avoid roaming
when it is not needed to use wpa_supplicant_need_to_roam_within_ess().
Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Benjamin Berg [Thu, 19 Sep 2024 10:19:16 +0000 (12:19 +0200)]
WNM: Fix pre-scan rejection heuristic for BTM handling
The idea was to only accept the cached scan results if the new target is
reasonably good. To avoid having to write a custom quality logic, a call
to wpa_supplicant_need_to_roam_within_ess() was used. However, the
intention was to swap the parameters and check whether we would want to
roam from the new BSS back to the current one.
Fix the heuristic to match the comment. To do that, we need to add a
parameter to not poll the current signal level as that would result in
comparing the current BSS with itself within the function.
Fixes: 20ed289a785c ("WNM: Clean up old scan data processing") Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Benjamin Berg [Thu, 19 Sep 2024 10:19:15 +0000 (12:19 +0200)]
WNM: Move driver MBO transition rejection into wnm_is_bss_excluded()
Change the logic a bit to not directly use the result of the
wpa_drv_get_bss_trans_status() call and instead use the same selection
logic as usual but taking into account the driver rejections.
This changes the logic in minor ways. The main change is that this
aligns the ordering of BSSs to be identical in all cases. More
precisely, we'll select the best BSS as found by find_better_target().
Beyond that, it also means that in the case of an non-abridged BTM
request we'll also consider candidates that were found through the scan
and not in the neighbor report. In this case, the driver will not have a
chance to reject them.
Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Jouni Malinen [Fri, 27 Dec 2024 21:51:55 +0000 (23:51 +0200)]
Clear the pending EAPOL RX on disconnection
Avoid any potentially unexpected behavior if the postponed EAPOL RX
could end up being processed in a different association that the one in
which the frame was postponed.
Jouni Malinen [Fri, 27 Dec 2024 21:49:57 +0000 (23:49 +0200)]
WPS: Fix a race condition on WPS_CANCEL handling
If the WPS_CANCEL command were issued between the driver command
requesting association and the driver event indicating completion of
association, i.e., within the WPA_ASSOCIATING state, it was possible for
the association to continue and the WPS procedure to be completed after
this.
Address this by forcing deauthentication and WPS state clearing also in
the WPS_ASSOCIATING state and not only if the association has been
completed.
Jouni Malinen [Fri, 27 Dec 2024 21:23:15 +0000 (23:23 +0200)]
Use BSS-specific ACL configuration when setting up driver-based ACL
This capability was originally added with only the entries from the
first BSS being supported likely due to the target use case not actually
using the multiple BSSs with a single radio. However, there does not
seem to be any specific reason for such constraint, so change this to
use the current BSS's own configuration instead of the first BSS's to
support per-BSS configuration with driver-based ACL.
Baligh Gasmi [Wed, 11 Dec 2024 20:37:38 +0000 (21:37 +0100)]
MBSSID: Allow BSS Index and maximum number of BSSs to be configured
Configuring hostapd's BSSs with a custom BSSID via the `bssid` parameter
in the config file can lead to a misconfigured Multiple BSSID element
consequently leading to stations failing to calculate the correct BSSID
for non-transmitting BSSs, as specified in IEEE Std 802.11-2020,
9.4.2.45.
To ensure consistency, the configuration need to include critical
parameters: `MaxBSSID Indicator` and `Multiple BSSID Index` to customize
the Multiple BSSID element following the custom BSSIDs as well.
Add a new global parameter, `mbssid_max`, to set the `MaxBSSID
Indicator` and a per-BSS parameter, `mbssid_index`, to explicitly set
the `Multiple BSSID Index`. If these are not set, the previous behavior
of determining these values automatically is maintained (with its limits
to dynamic addition of BSSs to a Multiple BSSID set).
Jouni Malinen [Fri, 27 Dec 2024 20:48:13 +0000 (22:48 +0200)]
tests: Run mbo_assoc_disallow in the beginning of UML VM
This test case could take significant amount of time in some cases when
run after large number of other test cases with UML. This might be due
to multiple tshark operations that seemed to suffer from some resource
issues with UML time travel.
Jouni Malinen [Fri, 27 Dec 2024 20:36:29 +0000 (22:36 +0200)]
Do not add extra IEs to scan request if they do not fit driver limit
For now, each separate IE is being checked on its own, so this is not a
complete check on the total length, but a useful step in avoiding some
known issues with drivers that do not support any IEs being added. A
more complete validation would need rules on determining which IE is of
higher priority than the other ones, but that might not be needed unless
there are drivers that have nonzero, but still quite small, limit on
extra IEs.
Marek Puzyniak [Wed, 9 Oct 2024 08:15:02 +0000 (10:15 +0200)]
Introduce DUMP_BEACON command
Occasionally, external applications require information about AP
configurations and capabilities. One potentially useful source for this
is the Beacon frame content. To support this need, introduce a new
control interface command: DUMP_BEACON. This return a hexdump of the
Beacon frame template, i.e., IEEE 802.11 frame header and frame body
with the TIM element missing since it is added by the driver and some of
the fields like the Timestamp field left to all zeros since they will be
filled in by the driver/hardware.
This can be fetched with hostapd_cli:
hostapd_cli -i wlxxx raw DUMP_BEACON 80000000ffffffffffff...
7f080400000200000040dd180050f2020101010003a4000027a4000042435e0062322f00
Signed-off-by: Marek Puzyniak <marek.puzyniak@holisticon.pl>
Jouni Malinen [Fri, 27 Dec 2024 17:50:07 +0000 (19:50 +0200)]
tests: Make WPS protocol tests for credential processing more robust
Clear the scan cache at the beginning of these test cases to avoid
issues with WPS_PBC and WPS_PIN commands if there were to be an old scan
result from a previous test case with the same BSSID.
Arowa Suliman [Tue, 5 Nov 2024 05:36:11 +0000 (05:36 +0000)]
Check last scan SSIDs before triggering new scan for hidden network
Commit 92374d59d4ef ("Enhance select_network() to trigger new scans in
some cases") introduced a redundant scan when selecting a hidden network
that was previously scanned and found. This occurs because the code only
checks for the condition `(wpa_s->no_suitable_network ||
wpa_s->last_scan_external)`, which doesn't cover the case where the last
scan successfully found the hidden SSID.
Save the scanned SSIDs from the last scan and updates the condition to
check if the hidden SSID was included. If the hidden SSID is not found
in `last_scan_ssids`, the code checks if the SSID was found in earlier
scan results. If not, it triggers a new scan. If the SSID is found, a
new scan is avoided, resulting in faster connection times.
Jouni Malinen [Thu, 26 Dec 2024 22:19:33 +0000 (00:19 +0200)]
Handle CONFIG_NO_WPA for wpa_sm_has_ptk_installed()
There was no empty wrapper for wpa_sm_has_ptk_installed() for the
CONFIG_NO_WPA=y builds. The previously renamed wpa_sm_has_ptk() wrapper
was still in place even though it is not used anymore, so rename it to
cover this newer need.
Tim Small [Wed, 23 Oct 2024 16:35:02 +0000 (17:35 +0100)]
mka: Accept MKPDU sent to any multicast address
Improve MKPDU 802.1X conformance by not requiring the PAE group address
(01-80-C2-00-00-03) to be used as the destination, but instead, allowing
any multicast address to be used. IEEE Std 802.1X-2020, 11.11.2
(Validation of MKPDUs) disallows only individual addresses as the
destination address.
IEEE Sts 802.1X-2010 and 802.1X-2020 both specify that MKPDU packets
should be discarded if their destination address is "an individual
address". ieee802_1x_kay_mkpdu_validity_check() previously also rejected
all destination addresses other than 01:80:c2:00:00:03 "Nearest non-TPMR
Bridge group address" (in contradiction to its comments).
This restriction may be a carry-over from IEEE Std 802.1X-2004, but is
explicitly discouraged in the 2010 and 2020 revisions (see 11.1.1
(Destination MAC address) and its references).
The additional restriction prevented wpa_supplicant and hostapd from
participating in MACsec communication in environments such as
third-party ("supplier") layer 2 networks.
Jouni Malinen [Thu, 26 Dec 2024 18:30:23 +0000 (20:30 +0200)]
tests: Make ap_cipher_tkip_countermeasures_sta2 more robust
Work around a race condition between Michael MIC error report processing
on the AP from two STAs and the 4-way handshake that might get started,
but not necessarily completed, during that window.
Vinayak Yadawad [Fri, 13 Dec 2024 08:45:27 +0000 (14:15 +0530)]
OWE: Fix SSID comparison in transition mode case
ret_ssid is a pointer to a pointer to the SSID and as such, it needs to
be referenced once here for the comparison just like ret_ssid_len. This
was broken recently as a part of duplicated code removal.
Fixes: ddfed3f08473 ("OWE: Reduce code duplication in OWE element parsing") Signed-off-by: Vinayak Yadawad <vinayak.yadawad@broadcom.com>
Jouni Malinen [Thu, 26 Dec 2024 10:30:22 +0000 (12:30 +0200)]
OWE: Accept only BSS entries with an actual SSID for ROAM command
An AP in OWE transition mode shows up in the BSS table twice due to use
of the hidden SSID. Since roaming requires the SSID to be known, don't
select the BSS entry with an empty SSID to force the one with the actual
SSID to be used when using the ROAM command to roam between APs that
might use OWE transition mode.
Nicolas Escande [Mon, 29 Apr 2024 10:13:25 +0000 (12:13 +0200)]
hostapd: Respect obss_interval on 40 MHz intolerant disconnect
When an AP is configured for HT operation on 40 MHz but has overlapping
BSS on the secondary channel, it will fall back to 20 MHz only. Also a
40 MHz AP will downgrade to 20 MHz while at least one 40 MHz intolerant
STA is connected.
However, in the current code, on such an AP, we do not check the
obss_interval parameter to be set on the last 40 MHz intolerant STA
disconnect and instead, start a timer that will unconditionnaly and
immediately bring the AP to 40 MHz operation even if it had overlapping
BSS.
A similar case was addressed for the 20/40 MHz co-ex report earlier in
commit d027c7b118fe ("Fix 20/40 MHz co-ex report processing with
obss_interval=0"), but this other case that gets called whenever a STA
entry is removed needs to have similar constraint on starting the timer.
Signed-off-by: Nicolas Escande <nico.escande@gmail.com>
Jouni Malinen [Wed, 25 Dec 2024 17:11:11 +0000 (19:11 +0200)]
tests: Set obss_interval for the test that verifies return to 40 MHz
This is in preparation for changing hostapd to require obss_interval to
be set to allow the channel bandwidth to be increased from 20 MHz to 40
MHz on disassociation of the last 40 MHz intolerant STA.
P2P2: Report R2 information in P2P-DEVICE-FOUND event
Add PCEA capability information, supported PASN types, and bootstrap
methods in P2P-DEVICE-FOUND event. This is needed to be able to start
P2P2 pairing with the discovered peer.
Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
According to the Wi-Fi Direct spec draft, address 3 in unicast USD
frames shall be set to the P2P Device Address of the sender (i.e., this
differs from the Wi-Fi Aware specification). Fix it.
Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
According to the Wi-Fi Direct spec draft, address 3 in multicast USD
frames shall be set to wildcard BSSID (i.e., this differs from the Wi-Fi
Aware specification). Fix it.
Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
Kan-Ru Chen [Sun, 22 Dec 2024 23:42:33 +0000 (08:42 +0900)]
Send CTRL-EVENT-SIGNAL-CHANGE message to control interfaces only
The default logging level for the CTRL-EVENT-SIGNAL-CHANGE message
may be repeated many times and fill the log file or journal.
For example https://bugzilla.redhat.com/show_bug.cgi?id=2309148 and
the first few results from searching CTRL-EVENT-SIGNAL-CHANGE on the
web contain various complaints and workarounds.
Change the logging method to wpa_msg_ctrl to avoid sending frequent
messages to the syslog but still allow the message to be consumed by
control interface monitors.
Jouni Malinen [Sun, 22 Dec 2024 22:55:09 +0000 (00:55 +0200)]
tests: Split hostapd_oom_wpa2_eap_connect into multiple test cases
This test case could take a long time to execute and it can be easily
split into a set of test cases that each cover a smaller range of
iterations (50 each for now). This is more robust and more efficient for
parallel VMs.
Petr Å tetiar [Wed, 18 Dec 2024 07:50:18 +0000 (07:50 +0000)]
hostapd: hostapd_cleanup_iface_partial: Fix hw_features use after free
Currently when the iface is being cleaned up, the
hostapd_free_hw_features() is called which frees the underlying
hw_features and the struct is being NULLed, but the num_hw_features
counter is not being reset, thus following commonly used access
constructs:
for (i = 0; i < iface->num_hw_features; i++)
acs_cleanup_mode(&iface->hw_features[i]);
This might then lead to use after free and hostapd for example might
crash during configuration reload on disabled interfaces:
So lets fix it by resetting the num_hw_features counter to 0, so the
code will not try to access the freed memory in hw_features struct.
Reported-by: Mohammed SI ALI <mohammed.siali@softathome.com> Tested-by: Houssem Dafdouf <houssem.dafdouf_ext@softathome.com> Signed-off-by: Petr Å tetiar <ynezz@true.cz> Signed-off-by: Petr Å tetiar <petr.stetiar@prplfoundation.org>
Vinayak Yadawad [Wed, 4 Dec 2024 09:13:59 +0000 (14:43 +0530)]
EAPOL: Fix PMK setting for driver-based FT-SHA384
Currently in eapol callback PMK update for FT is done wrongly with the
default PMK length even in case of SHA384. SHA384 needs longer 48-octet
PMK. Accordingly, fix the offset and length of the PMK that is
configured to the driver for driver-based FT.
andrewrpope [Mon, 25 Nov 2024 21:11:52 +0000 (08:11 +1100)]
DPP: Handle EVENT_TX_WAIT_EXPIRE path for push button
The DPP push button state machine will get stuck if an off-channel PB
announcement is cancelled via EVENT_TX_WAIT_EXPIRE. Handle a
TX_WAIT_EXPIRE by calling wpas_dpp_pb_next(), moving the state machine
forward.
Signed-off-by: Andrew Pope <andrew.pope@morsemicro.com>
Ming Kuang [Mon, 23 Sep 2024 15:25:29 +0000 (23:25 +0800)]
Fix using invalid memory during driver deinit
The address of hapd_iface->bss[0]->drv_priv is stored before calling
hostapd_free_hapd_data() and then passed to hostapd_deinit_driver()
after the call. However, hostapd_free_hapd_data() may free the
hapd->drv_priv memory, which could lead to hostapd_deinit_driver() using
an invalid memory address that has already been freed.
Commit 7554565299a1 ("hostapd: Add ctrl_iface for
enabling/reloading/disabling interface") added this split design of
storing a copy of driver/drv_priv before some deinit steps and then
using the stored values. That was likely done based on the earlier
examples of similar split which was needed in some cases a long time ago
before commit f7c478337957 ("Split hostapd_interface_deinit() into
deinit and free parts") when hostapd_interface_deinit() freed bss[0] and
as such, those pointers could not have been used without making the
separate copy first. That is not needed anymore, so get rid of it here.
Jouni Malinen [Sun, 22 Dec 2024 21:04:51 +0000 (23:04 +0200)]
Update STA authorized flag for AP SME in driver cases for open network
With AP SME in hostapd/wpa_supplicant, TX status handler for
(Re)Association Response frame takes care of this, but with AP SME in
driver cases, ap_sta_set_authorized(1) is not sufficient to update the
driver flags for the STA, so cover that case as well.
Jouni Malinen [Sun, 22 Dec 2024 17:44:24 +0000 (19:44 +0200)]
tests: MAke sae_anti_clogging_during_attack more robust
Reset apdev[1] into a known state before using it as montior interface
since issues have been seen when the previous test case used it as a 5
GHz AP. In addition, handle sock.recv() timeout more gracefully.
For example, this test case sequences had issues:
ap_track_sta_force_2ghz sae_anti_clogging_during_attack
he160b sae_anti_clogging_during_attack
When building with the no std output setting (CONFIG_NO_STDOUT_DEBUG),
the build fails with an undefined reference for wpa_debug_stop_log().
Define this as an empty function along with the others at the top of
wpa_debug.h in case no std out is configured.
The Makefile is not properly set up to compile the sae_pk_gen target.
Enabling CONFIG_SAE=y and CONFIG_SAE_PK=y in the configuration is not
sufficient to compile. The linker complains about undefined references.
These additions must be made to the Makefile to get it to compile, at
least with gcc. Once this is done, 'make sae_pk_gen' can be run without
issue.
ext_password_file: Do not use wpa_config_get_line()
The file-based backed of the ext_password framework uses
wpa_config_get_line() to read the passwords line-by-line from a file.
This function is meant to parse a single line from the
wpa_supplicant.conf file, so it handles whitespace, quotes and other
characters specially.
Its behavior, however, it's not compatible with the rest of the
ext_password framework implementation. For example, if a passphrase
contains a `#` character it must be quoted to prevent parsing the
remaining characters as an inline comment, but the code handling the
external password in wpa_supplicant_get_psk() does not handle quotes.
The result is that either it will hash the enclosing quotes, producing a
wrong PSK, or if the passphrase is long enough, fail the length check.
As a consequence, some passphrases are impossible to input correctly.
To solve this and other issues, this patch changes the behaviour of the
ext_password_file_get() function (which was not documented in details,
at least w.r.t. special characters) to simply treat all characters
literally: including trailing whitespaces (except CR and LF), `#` for
inline comments, etc. Empty lines and full-line comments are still
supported.
Jouni Malinen [Sun, 22 Dec 2024 16:16:32 +0000 (18:16 +0200)]
Add empty inline functions for CONFIG_NO_WPA
These recently added functions were used outside ifder CONFIG_NO_WPA, so
they need to have the empty inline functions in wpa.h to avoid
compilation issues.
Jouni Malinen [Sun, 22 Dec 2024 11:26:25 +0000 (13:26 +0200)]
tests: Stop hlr_auc_gw more cleanly
Use the new TERMINATE command through the socket to stop hlr_auc_gw
instead of depending on killall. There seemed to be some kind of race
condition with UML that could prevent cleanup previously.
Jouni Malinen [Sun, 22 Dec 2024 08:49:27 +0000 (10:49 +0200)]
AP MLD: Do not try to set hapd->mld multiple times
Now that there is more than one path that could end up calling
hostapd_bss_setup_multi_link(), it looks like it was possible to end up
allocating the MLD context twice and that resulted in resource leaks.
Avoid this by explicitly checking that hapd->mld is not set before
trying to determine whether to set it to an existing context or create a
new one.
Jouni Malinen [Sat, 21 Dec 2024 20:31:07 +0000 (22:31 +0200)]
tests: Make country code clearing in dbus_interface more robust
Wait for the specific CTRL-EVENT-REGDOM-CHANGE events to try to avoid
test failures due to some race conditions and the US country code being
left effective at the end of the test case.
Jouni Malinen [Sat, 21 Dec 2024 10:19:03 +0000 (12:19 +0200)]
tests: More robust way of killing hung UML VMs
The uml_mconsole halt command may hang when trying to terminate a hung
UML VM, so check for a timeout on that operation and kill the UML
process directly if that happens. In addition, do not try to terminate a
specific VM more than once to avoid confusing debug log entries.
Allen Ye [Thu, 5 Sep 2024 05:55:30 +0000 (13:55 +0800)]
hostapd: Fix wrong puncturing bitmap in Bandwidth Indication subelement
The Bandwidth Indication subelement should present the puncturing bitmap
of channel switch request, but the bitmap returned by
hostapd_get_punct_bitmap() is the original one.
Co-developed-by: Money Wang <money.wang@mediatek.com> Signed-off-by: Allen Ye <allen.ye@mediatek.com>
hostapd: Fix length of Bandwidth Indication subelement
The default length of the Bandwidth Indication subelement should be
equal to the minimum size of ieee80211_bw_ind_element structure. The
previously used value truncated this subelement by one octet.
Fixes: c7e704bdf9c3 ("hostapd: Add Bandwidth Indication subelement support for channel switch") Signed-off-by: Shayne Chen <shayne.chen@mediatek.com> Signed-off-by: Allen Ye <allen.ye@mediatek.com>
Avoid EAPOL trigger in reassoc path for AP with 4-way handshake offload
Currently avoiding of EAPOL exchange for AP with 4-way handshake offload
is handled only in the new STA assoc path. Extended this to cover
skipping authentication trigger in case reassoc path without
disconnection as well.
In case of an AP MLD it is assumed that the multi link information
(hapd->mld) is already initialized by the time this function is called.
However, if the interface is added without bss_config parameter,
hostapd_bss_setup_multi_link() would bail out immediately as mld_ap
parameter isn't set yet. When the interface gets enabled later,
hapd->mld would be NULL resulting in NULL dereference.
Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
Benjamin Berg [Sun, 1 Sep 2024 16:31:34 +0000 (19:31 +0300)]
BSS: MLD: Parse all TBTT entries after an invalid link
We would incorrectly exit the loop that iterates all TBTT entries if an
entry is found with an invalid link ID. This commonly happens if the AP
reports a link for another AP (or just another AP in the same MBSSID
set). Change it to continue with the next TBTT entry so that all entries
are parsed and all links can be found.
Fixes: de5e01010cb2 ("wpa_supplicant: Support ML probe request") Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Benjamin Berg [Sun, 1 Sep 2024 16:31:33 +0000 (19:31 +0300)]
BSS: MLD: Limit TBTT parsing to correct length
Logically, it makes more sense to pass the ap_info_len as that is the
length that the function is permitted to process. Effectively it does
not make a difference and the code was entirely safe, but change it
nontheless to be more correct.
Fixes: de5e01010cb2 ("wpa_supplicant: Support ML probe request") Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Jintao Lin [Wed, 7 Aug 2024 21:48:01 +0000 (21:48 +0000)]
P2P: Consult driver capabilities before setting HE bit in GO's conf
p2p_go_he could be set to 1 in the global config file while the device
might only has a VHT Wi-Fi NIC. Consult driver capabilities before
setting the HE bit for the GO's configuration so that latter AP
configuration does not fail due to wrong AP configuration, like
hostapd_get_oper_centr_freq_seg0_idx().
This config bit is checked and set in wpa_supplicant_conf_ap_ht() based
on a more recent commit 3459c54ac78b ("mesh: Add support for HE mode"),
Thus there is no need to override this bit specifically for P2P GO using
this older approach.
Signed-off-by: Jintao Lin <jintaolin@chromium.org>
Jouni Malinen [Thu, 19 Dec 2024 23:06:57 +0000 (01:06 +0200)]
tests: Clear AP scan cache in prefer_ht40
It was possible for the HT40+ AP to fail to start 40 MHz channel due to
a conflicting AP in the scan results from a previous test case. This
happened, e.g., with the following test case sequence:
olbc prefer_ht40
Jouni Malinen [Thu, 19 Dec 2024 22:45:25 +0000 (00:45 +0200)]
tests: Disconnect after OCV tests showing valid OCI
These test cases that used external EAPOL handling to test hostapd
behavior left the STA in associated state at the end and that could
result in race conditions showing up as a new association related event
in the following test case. Minimize risk of that resulting in test case
failures by explicit disconnecting at the end of the test case.
This was found with this test case sequence:
autogo_many wpa2_ocv_ap_unexpected1 wpa2_ocv_sta_override_eapol