]> git.ipfire.org Git - thirdparty/hostap.git/log
thirdparty/hostap.git
4 years agoASN.1: Validate DigestAlgorithmIdentifier parameters
Jouni Malinen [Sat, 13 Mar 2021 16:19:31 +0000 (18:19 +0200)] 
ASN.1: Validate DigestAlgorithmIdentifier parameters

The supported hash algorithms do not use AlgorithmIdentifier parameters.
However, there are implementations that include NULL parameters in
addition to ones that omit the parameters. Previous implementation did
not check the parameters value at all which supported both these cases,
but did not reject any other unexpected information.

Use strict validation of digest algorithm parameters and reject any
unexpected value when validating a signature. This is needed to prevent
potential forging attacks.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoASN.1: Fix AlgorithmInfo parsing for signatures
Jouni Malinen [Sat, 13 Mar 2021 16:00:55 +0000 (18:00 +0200)] 
ASN.1: Fix AlgorithmInfo parsing for signatures

Digest is within the DigestInfo SEQUENCE and as such, parsing for it
should use the end of that data instead of the end of the decrypted
signature as the end point. Fix this in the PKCS #1 and X.509
implementations to avoid accepting invalid digest data that is
constructed to get the hash value from after the actual DigestInfo
container.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoASN.1: Reject invalid definite long form length values in DER encoding
Jouni Malinen [Sat, 13 Mar 2021 15:26:54 +0000 (17:26 +0200)] 
ASN.1: Reject invalid definite long form length values in DER encoding

The definite long form for the length is allowed only for cases where
the definite short form cannot be used, i.e., if the length is 128 or
greater. This was not previously enforced and as such, multiple
different encoding options for the same length could have been accepted.

Perform more strict checks to reject invalid cases for the definite long
form for the length. This is needed for a compliant implementation and
this is especially important for the case of verifying DER encoded
signatures to prevent potential forging attacks.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoASN.1: Reject invalid extended tags in DER encoding
Jouni Malinen [Sat, 13 Mar 2021 14:49:07 +0000 (16:49 +0200)] 
ASN.1: Reject invalid extended tags in DER encoding

The extended tag case is allowed only for tag values that are 31 or
larger (i.e., the ones that would not fit in the single octet identifier
case with five bits). Extended tag format was previously accepted even
for the values 0..31 and this would enable multiple different encodings
for the same tag value. That is not allowed for DER.

Perform more strict checks to reject invalid extended tag values. This
is needed for a compliant implementation and this is especially
important for the case of verifying DER encoded signatures to prevent
potential forging attacks.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoASN.1: Explicitly validate constructed bit while parsing DER
Jouni Malinen [Sat, 13 Mar 2021 21:11:41 +0000 (23:11 +0200)] 
ASN.1: Explicitly validate constructed bit while parsing DER

The identifier octet in DER encoding includes three components. Only two
of these (Class and Tag) were checked in most cases when looking for a
specific data type. Also check the Primitive/Constructed bit to avoid
accepting invalid encoding.

This is needed for correct behavior in DER parsing and especially
important for the case of verifying DER encoded signatures to prevent
potential forging attacks.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoASN.1: Use the helper functions for recognizing tags and debug prints
Jouni Malinen [Sat, 13 Mar 2021 21:13:05 +0000 (23:13 +0200)] 
ASN.1: Use the helper functions for recognizing tags and debug prints

Simplify the core ASN.1 parser implementation by using the helper
functions.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoASN.1: Add helper functions for recognizing tag values
Jouni Malinen [Sat, 13 Mar 2021 21:14:23 +0000 (23:14 +0200)] 
ASN.1: Add helper functions for recognizing tag values

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoASN.1: Verify that NULL value has zero length
Jouni Malinen [Sat, 13 Mar 2021 21:09:28 +0000 (23:09 +0200)] 
ASN.1: Verify that NULL value has zero length

This value is required to contain no octets, so verify that its length
octet agrees with that.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoASN.1: Add helper functions for debug printing identifier/length info
Jouni Malinen [Sat, 13 Mar 2021 21:02:44 +0000 (23:02 +0200)] 
ASN.1: Add helper functions for debug printing identifier/length info

These can be helpful in cleaning up implementation of more or less
identical debug printing operations.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoASN.1: Define tag value for TIME
Jouni Malinen [Sat, 13 Mar 2021 21:15:02 +0000 (23:15 +0200)] 
ASN.1: Define tag value for TIME

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoASN.1: Fix a typo in a not-used tag name
Jouni Malinen [Sat, 13 Mar 2021 21:00:45 +0000 (23:00 +0200)] 
ASN.1: Fix a typo in a not-used tag name

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: Allow test-rsa-sig-ver data files to be set on command line
Jouni Malinen [Fri, 12 Mar 2021 21:24:29 +0000 (23:24 +0200)] 
tests: Allow test-rsa-sig-ver data files to be set on command line

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: Work around race conditions in OWE test cases
Jouni Malinen [Fri, 12 Mar 2021 17:59:07 +0000 (19:59 +0200)] 
tests: Work around race conditions in OWE test cases

Need to explicitly wait for hostapd to report STA connection before
starting the traffic test to avoid the potential race condition when
testing with UML and time travel mode.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: Make INTERWORKING_SELECT test cases more reliable
Jouni Malinen [Fri, 12 Mar 2021 09:46:22 +0000 (11:46 +0200)] 
tests: Make INTERWORKING_SELECT test cases more reliable

These could fail if a scan entry from a previous test case was still
present in the BSS table, e.g., by wpa_supplicant selecting the SSID
from that old entry instead of the new SSID. Try to avoid that by
explicitly flushing the scan results before starting these tests.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agonl80211: Restore station mode on deinit only if station when started
Peter Åstrand [Thu, 11 Mar 2021 20:58:48 +0000 (21:58 +0100)] 
nl80211: Restore station mode on deinit only if station when started

With the earlier code, a mesh interface was changed to station after
deinit.

Signed-off-by: Peter Astrand <peter.astrand@etteplan.com>
4 years agotests: TWT_SETUP with the control argument
Jouni Malinen [Fri, 12 Mar 2021 08:54:14 +0000 (10:54 +0200)] 
tests: TWT_SETUP with the control argument

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoTWT: Allow specifying Control field value in TWT Request
Ben Greear [Wed, 10 Mar 2021 17:28:12 +0000 (09:28 -0800)] 
TWT: Allow specifying Control field value in TWT Request

See IEEE P802.11ax/D8.0, Figure 9-687 (Control field format) for
details.

Signed-off-by: Ben Greear <greearb@candelatech.com>
4 years agotests: Disabling HE support in STA
Jouni Malinen [Fri, 12 Mar 2021 08:47:50 +0000 (10:47 +0200)] 
tests: Disabling HE support in STA

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agonl80211: Support disabling HE in infrastructure BSS as station
Ben Greear [Wed, 10 Mar 2021 17:27:54 +0000 (09:27 -0800)] 
nl80211: Support disabling HE in infrastructure BSS as station

Send a flag to the kernel when user has specified disable_he=1 in the
network configuration block. This extends the functionality added in
commit 7c8f540ee0a8 ("wpa_supplicant: Add HE override support") to cover
the cases that need kernel functionality.

Signed-off-by: Ben Greear <greearb@candelatech.com>
4 years agoP2P: Clear pending_listen_freq when stopping listen
Andrei Otcheretianski [Sun, 7 Mar 2021 21:40:02 +0000 (23:40 +0200)] 
P2P: Clear pending_listen_freq when stopping listen

If listen work never started, pending_listen_freq might be left
uncleared, preventing the subsequent listen to start. This could happen
in p2p_timeout_wait_peer_idle() after the commit 13256b8cf ("P2P: Stop
old listen radio work before go to WAIT_PEER_IDLE state") added a
stop_listen() call there.

Fixes: 13256b8cf3ed ("P2P: Stop old listen radio work before go to WAIT_PEER_IDLE state")
Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
4 years agowpa_supplicant: Don't process EAPOL frames while disconnecting
Andrei Otcheretianski [Sun, 7 Mar 2021 21:40:01 +0000 (23:40 +0200)] 
wpa_supplicant: Don't process EAPOL frames while disconnecting

An EAPOL frame may be pending when wpa_supplicant requests to
deauthenticate. At this stage the EAP SM cache is already cleaned by
calling eapol_sm_invalidate_cached_session(). Since at this stage the
wpa_supplicant's state is still set to associated, the EAPOL frame is
processed and results in a crash due to NULL dereference.

This wasn't seen previously as nl80211 wouldn't process the
NL80211_CMD_CONTROL_PORT_FRAME, since wpa_driver_nl80211_mlme() would
set the valid_handler to NULL. This behavior was changed in commit
ab89291928fa exposing this race.

Fix it by ignoring EAPOL frames while the deauthentication is in
progress.

Fixes: ab89291928fa ("nl80211: Use process_bss_event() for the nl_connect handler")
Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
4 years agoeapol_test: Add address family for IPv4 in Windows build
Stefan Paetow [Thu, 11 Mar 2021 18:47:36 +0000 (18:47 +0000)] 
eapol_test: Add address family for IPv4 in Windows build

Add the address family when manually constructing IPv4 addresses in
eapol_test on Windows. Otherwise other functions, like hostapd_ip_txt()
in src/utils/ip_addr.c, that rely on addr->af being set fail miserably.
The non-Windows option uses hostapd_parse_ip_addr() which does this as
part of the helper function.

Signed-off-by: Stefan Paetow <oss@eons.net>
4 years agoAdd support to return bandwidth for channel 2 of the 6 GHz band
Swarn Singh [Fri, 5 Mar 2021 05:10:04 +0000 (10:40 +0530)] 
Add support to return bandwidth for channel 2 of the 6 GHz band

The 6 GHz band operating class 136 is defined to use 20 MHz bandwidth.
Return the value accordingly from center_idx_to_bw_6ghz() to cover this
special case.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoNew vendor attribute to configure TWT mantissa in microseconds
Mohammad Asaad Akram [Mon, 1 Mar 2021 09:04:38 +0000 (14:34 +0530)] 
New vendor attribute to configure TWT mantissa in microseconds

Define the following additional TWT attribute for
qca_wlan_vendor_attr_twt_setup:
QCA_WLAN_VENDOR_ATTR_TWT_SETUP_WAKE_INTVL2_MANTISSA to configure the
mantissa in microseconds.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agowlantest: Skip Mesh Control field from the beginning of payload
Jouni Malinen [Tue, 9 Mar 2021 18:20:24 +0000 (20:20 +0200)] 
wlantest: Skip Mesh Control field from the beginning of payload

This allows correct processing of Data frames with Mesh Control field by
finding the LLC/SNAP header after that field.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agowlantest: Check all configured TKs if no matching GTK is known
Jouni Malinen [Tue, 9 Mar 2021 15:29:48 +0000 (17:29 +0200)] 
wlantest: Check all configured TKs if no matching GTK is known

This allows group-addressed frames to be decrypted by listing all
possible GTKs in the PTK file.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agotests: HE and TWT
Jouni Malinen [Sun, 7 Mar 2021 20:08:52 +0000 (22:08 +0200)] 
tests: HE and TWT

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoTWT: Support sending TWT Setup and Teardown Action frames
Ben Greear [Sat, 6 Mar 2021 16:18:38 +0000 (08:18 -0800)] 
TWT: Support sending TWT Setup and Teardown Action frames

This adds new control interface commands TWT_SETUP and TWT_TEARDOWN. For
now, these are only for testing purposes to be able to trigger
transmission of the TWT Action frames without configuring any local
behavior for TWT in the driver.

Signed-off-by: Ben Greear <greearb@candelatech.com>
4 years agowpabuf: Add helper functions for writing 64-bit integers
Jouni Malinen [Sun, 7 Mar 2021 19:31:22 +0000 (21:31 +0200)] 
wpabuf: Add helper functions for writing 64-bit integers

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: EAP-SIM DB error cases (SQLite)
Jouni Malinen [Sun, 7 Mar 2021 15:58:14 +0000 (17:58 +0200)] 
tests: EAP-SIM DB error cases (SQLite)

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: DPP NFC with hostapd
Jouni Malinen [Sun, 7 Mar 2021 15:32:44 +0000 (17:32 +0200)] 
tests: DPP NFC with hostapd

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: DPP chirp with an AP as a standalone Configurator
Jouni Malinen [Sun, 7 Mar 2021 11:18:01 +0000 (13:18 +0200)] 
tests: DPP chirp with an AP as a standalone Configurator

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: DPP PKEX errors with hostapd
Jouni Malinen [Sun, 7 Mar 2021 11:12:37 +0000 (13:12 +0200)] 
tests: DPP PKEX errors with hostapd

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: DPP chirp errors in hostapd
Jouni Malinen [Sun, 7 Mar 2021 11:02:59 +0000 (13:02 +0200)] 
tests: DPP chirp errors in hostapd

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: DPP Controller management in hostapd
Jouni Malinen [Sun, 7 Mar 2021 10:57:25 +0000 (12:57 +0200)] 
tests: DPP Controller management in hostapd

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: Invalid DAC_REQUEST values
Jouni Malinen [Sun, 7 Mar 2021 10:46:38 +0000 (12:46 +0200)] 
tests: Invalid DAC_REQUEST values

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: hostapd ATTACH errors
Jouni Malinen [Sun, 7 Mar 2021 10:41:16 +0000 (12:41 +0200)] 
tests: hostapd ATTACH errors

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: hostapd PMKSA_ADD failures
Jouni Malinen [Sun, 7 Mar 2021 10:34:32 +0000 (12:34 +0200)] 
tests: hostapd PMKSA_ADD failures

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoFix hostapd PMKSA_ADD with Authenticator disabled
Jouni Malinen [Sun, 7 Mar 2021 10:33:30 +0000 (12:33 +0200)] 
Fix hostapd PMKSA_ADD with Authenticator disabled

This function can get called with hapd->wpa_auth == NULL from the
control interface handler, so explicitly check for that.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: EAPOL/key config test command failures
Jouni Malinen [Sun, 7 Mar 2021 10:25:38 +0000 (12:25 +0200)] 
tests: EAPOL/key config test command failures

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: hostapd GET_CAPABILITY
Jouni Malinen [Sun, 7 Mar 2021 10:14:54 +0000 (12:14 +0200)] 
tests: hostapd GET_CAPABILITY

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: ADD_MAC/DEL_MAC special cases
Jouni Malinen [Sun, 7 Mar 2021 10:11:56 +0000 (12:11 +0200)] 
tests: ADD_MAC/DEL_MAC special cases

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: Additional invalid SET_NEIGHBOR coverage
Jouni Malinen [Sun, 7 Mar 2021 10:08:02 +0000 (12:08 +0200)] 
tests: Additional invalid SET_NEIGHBOR coverage

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: hostapd ctrl_iface SHOW_NEIGHBOR while neighbor report disabled
Jouni Malinen [Sun, 7 Mar 2021 10:05:09 +0000 (12:05 +0200)] 
tests: hostapd ctrl_iface SHOW_NEIGHBOR while neighbor report disabled

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: Additional invalid REQ_BEACON cases
Jouni Malinen [Sun, 7 Mar 2021 10:02:46 +0000 (12:02 +0200)] 
tests: Additional invalid REQ_BEACON cases

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: VENDOR command
Jouni Malinen [Sun, 7 Mar 2021 09:51:54 +0000 (11:51 +0200)] 
tests: VENDOR command

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: VHT CSA with VHT80+80 getting enabled
Jouni Malinen [Sat, 6 Mar 2021 23:42:48 +0000 (01:42 +0200)] 
tests: VHT CSA with VHT80+80 getting enabled

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoUpdate VHT capabilities info on channel switch event
Jouni Malinen [Sat, 6 Mar 2021 23:35:25 +0000 (01:35 +0200)] 
Update VHT capabilities info on channel switch event

This is needed to be able to move from 80 MHz or lower bandwidth to 160
or 80+80 MHz bandwidth (and back) properly without leaving the Beacon
frame VHT elements showing incorrect information.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agonl80211: Determine secondary channel offset for CS to 80+80 MHz
Jouni Malinen [Sat, 6 Mar 2021 23:21:12 +0000 (01:21 +0200)] 
nl80211: Determine secondary channel offset for CS to 80+80 MHz

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agonl80211: Debug print for channel switch request parameters
Jouni Malinen [Sat, 6 Mar 2021 23:11:18 +0000 (01:11 +0200)] 
nl80211: Debug print for channel switch request parameters

These can be helpful for debugging channel switch issues.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agonl80211: Add command-to-string mapping for previously missed commands
Jouni Malinen [Sat, 6 Mar 2021 23:06:00 +0000 (01:06 +0200)] 
nl80211: Add command-to-string mapping for previously missed commands

In addition, make the compiler warn if a new enum value is added without
defining the matching mapping to a string.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoMore specific set_freq_params debug prints for 80/80+80 MHz errors
Jouni Malinen [Sat, 6 Mar 2021 22:54:36 +0000 (00:54 +0200)] 
More specific set_freq_params debug prints for 80/80+80 MHz errors

It is more convenient to see the exact error in the debug log instead of
getting noted that something was invalid.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: VHT CSA with invalid parameters
Jouni Malinen [Sat, 6 Mar 2021 15:02:38 +0000 (17:02 +0200)] 
tests: VHT CSA with invalid parameters

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: Additional GET_PMK coverage
Jouni Malinen [Sat, 6 Mar 2021 14:33:03 +0000 (16:33 +0200)] 
tests: Additional GET_PMK coverage

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agonl80211: Use process_bss_event() for the nl_connect handler
Avraham Stern [Wed, 17 Feb 2021 10:14:33 +0000 (12:14 +0200)] 
nl80211: Use process_bss_event() for the nl_connect handler

The nl_connect is initialized with the process_bss_event() handler.
However, it is used several times with the default valid handler. As a
result, if a message that is only valid for process_bss_event() is
received while the default handler is used, it will be dropped.

This has been observed in a case where during the 4-way handshake, a
Beacon frame is received on the AP side, which triggers a beacon update,
just before receiving the next EAPOL. When send_and_recv_msgs_owner() is
called for sending the NL80211_CMD_SET_BEACON command, the
NL80211_CMD_CONTROL_PORT_FRAME event is already pending. As a result, it
is received with the default handler, which drops it. Since the EAPOL
frame is dropped, the connection attempt fails.

Fix it by using the process_bss_event() handler when the nl_connect
handler is used.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
4 years agotests: IGTK and BIGTK replay protection
Jouni Malinen [Sat, 6 Mar 2021 10:41:05 +0000 (12:41 +0200)] 
tests: IGTK and BIGTK replay protection

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: Invalid MGMT_TX_STATUS_PROCESS
Jouni Malinen [Sat, 6 Mar 2021 10:14:07 +0000 (12:14 +0200)] 
tests: Invalid MGMT_TX_STATUS_PROCESS

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: RELOAD_WPA_PSK failure
Jouni Malinen [Sat, 6 Mar 2021 10:10:29 +0000 (12:10 +0200)] 
tests: RELOAD_WPA_PSK failure

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoDPP: Clear hapd->gas pointer on deinit
Jouni Malinen [Sat, 6 Mar 2021 09:56:00 +0000 (11:56 +0200)] 
DPP: Clear hapd->gas pointer on deinit

While it does not look like the stale pointer could have been
dereferenced in practice, it is better not to leave the stale pointer to
freed memory in place to avoid accidental uses.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: hapd->tmp_eap_user clearing on interface deinit/reinit
Jouni Malinen [Sat, 6 Mar 2021 09:45:48 +0000 (11:45 +0200)] 
tests: hapd->tmp_eap_user clearing on interface deinit/reinit

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoSQLite: Fix temporary eap_user data freeing on interface restart
Jouni Malinen [Sat, 6 Mar 2021 09:44:38 +0000 (11:44 +0200)] 
SQLite: Fix temporary eap_user data freeing on interface restart

hapd->tmp_eap_user needs to be cleared on interface deinit to avoid
leaving stale pointers to freed memory.

Fixes: ee431d77a51b ("Add preliminary support for using SQLite for eap_user database")
Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: WNM time advertisement and interface restart
Jouni Malinen [Sat, 6 Mar 2021 09:38:18 +0000 (11:38 +0200)] 
tests: WNM time advertisement and interface restart

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoFix use after free with hapd->time_adv on interface restart
Michael Braun [Mon, 1 Mar 2021 21:27:46 +0000 (23:27 +0200)] 
Fix use after free with hapd->time_adv on interface restart

When an interface is disabled, e.g. due to radar detected,
hapd->time_adv is freed by hostapd_free_hapd_data(), but later
used by ieee802_11_build_ap_params() calling hostapd_eid_time_adv().

Thus hapd->time_adv needs to be cleared as well.

Fixes: 39b97072b2a4 ("Add support for Time Advertisement")
Signed-off-by: Michael Braun <michael-dev@fami-braun.de>
4 years agoAdd a link to Patchwork for a list of pending patches
Jouni Malinen [Sat, 6 Mar 2021 09:26:20 +0000 (11:26 +0200)] 
Add a link to Patchwork for a list of pending patches

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: Roam command during a scan operation
Jouni Malinen [Sat, 6 Mar 2021 09:01:29 +0000 (11:01 +0200)] 
tests: Roam command during a scan operation

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoReject authentication start during explicit roam requests
Matthew Wang [Sat, 6 Mar 2021 01:43:44 +0000 (17:43 -0800)] 
Reject authentication start during explicit roam requests

The roam D-Bus and ROAM control itnerface commands flip the reassociate
bit before calling wpa_supplicant_connect(). wpa_supplicant connect
eventually aborts ongoing scans (if any), which causes scan results to
be reported. Since the reassociate bit is set, this will trigger a
connection attempt based on the aborted scan's scan results and cancel
the initial connetion request. This often causes wpa_supplicant to
reassociate to the same AP it is currently associated to instead of the
explicitly requested roaming target.

Add a roam_in_progress flag to indicate that we're currently attempting
to roam via an explicitly request to a specific BSS so that we don't
initiate another connection attempt based on the possibly received scan
results from a scan that was in progress at the time the roam command
was received.

Signed-off-by: Matthew Wang <matthewmwang@chromium.org>
4 years agoQCA vendor attribute to allow 6 GHz connection with all security types
Kiran Kumar Lokere [Mon, 1 Mar 2021 22:56:09 +0000 (14:56 -0800)] 
QCA vendor attribute to allow 6 GHz connection with all security types

Add a QCA vendor attribute to configure the driver to allow the 6 GHz
connection with all security types. This attribute is used for testing
purposes.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoQCA vendor attribute to ignore SAE H2E requirement mismatch
Kiran Kumar Lokere [Mon, 1 Mar 2021 22:13:57 +0000 (14:13 -0800)] 
QCA vendor attribute to ignore SAE H2E requirement mismatch

Add a QCA vendor attribute to ignore SAE H2E requirement mismatch for 6
GHz connection. This attribute is used for testing purposes.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agowpaspy: Do not mark not-existing UNIX domain socket as UDP
Jouni Malinen [Mon, 1 Mar 2021 10:51:20 +0000 (12:51 +0200)] 
wpaspy: Do not mark not-existing UNIX domain socket as UDP

os.stat(path) failure is an ambigious indication of the control
interface "path" type (UDP hostname vs. UNIX domain socket path). The
path may be a valid UNIX domain socket path, but that socket could have
been removed just before reaching here. At least the hwsim test case
concurrent_p2pcli managed to hit the "connect exception" print below
from UDP handling even when using a UNIX domain socket.

Work around incorrect determination of control interface socket type by
assuming anything starting with '/' is a UNIX domain socket and not a
hostname.

Fixes: a2c88a8025b2 ("wpaspy: Add support for UDP connection")
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agotests: Fix openssl_systemwide_policy cleanup
Jouni Malinen [Mon, 1 Mar 2021 10:34:05 +0000 (12:34 +0200)] 
tests: Fix openssl_systemwide_policy cleanup

Need to close the WpaSupplicant instance on the extra radio before
returning from this test case since that interface is going to be
removed and WpaSupplicant.__del__() can time out on trying to detach the
monitor connection after that.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoUpdate old link to ACS wiki documentation
Nikolas Nyby [Mon, 1 Mar 2021 04:19:26 +0000 (23:19 -0500)] 
Update old link to ACS wiki documentation

The old links here were broken.

Signed-off-by: Nikolas Nyby <nikolas@gnu.org>
4 years agotests: hostapd RELOAD with invalid configuration
Jouni Malinen [Mon, 1 Mar 2021 09:13:46 +0000 (11:13 +0200)] 
tests: hostapd RELOAD with invalid configuration

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agotests: OCV override in FT Reassociation Response
Jouni Malinen [Sun, 28 Feb 2021 21:29:26 +0000 (23:29 +0200)] 
tests: OCV override in FT Reassociation Response

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoOCV: Fix OCV-FAILURE event address for FT Reassociation Response frame
Jouni Malinen [Sun, 28 Feb 2021 21:27:13 +0000 (23:27 +0200)] 
OCV: Fix OCV-FAILURE event address for FT Reassociation Response frame

sm->bssid is still the BSSID of the previous AP at this point in the FT
protocol, so need to show the target AP's BSSID instead in the failure
message.

Fixes: 8c1f61e820d6 ("OCV: Report OCI validation failures with OCV-FAILURE messages (STA)")
Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: OCV override in FILS Association Response
Jouni Malinen [Sun, 28 Feb 2021 21:16:11 +0000 (23:16 +0200)] 
tests: OCV override in FILS Association Response

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: Move ERP/FILS capability checks to utils.py
Jouni Malinen [Sun, 28 Feb 2021 21:15:57 +0000 (23:15 +0200)] 
tests: Move ERP/FILS capability checks to utils.py

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: WMM parameter update failing during beacon template update
Jouni Malinen [Sun, 28 Feb 2021 20:58:24 +0000 (22:58 +0200)] 
tests: WMM parameter update failing during beacon template update

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: DPP config overrides in hostapd
Jouni Malinen [Sun, 28 Feb 2021 20:48:00 +0000 (22:48 +0200)] 
tests: DPP config overrides in hostapd

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: hostapd and setband
Jouni Malinen [Sun, 28 Feb 2021 20:40:43 +0000 (22:40 +0200)] 
tests: hostapd and setband

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: wpa_deny_ptk0_rekey in hostapd GET_CONFIG
Jouni Malinen [Sun, 28 Feb 2021 19:07:55 +0000 (21:07 +0200)] 
tests: wpa_deny_ptk0_rekey in hostapd GET_CONFIG

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: hostapd GET_CONFIG entries for Multi-AP
Jouni Malinen [Sun, 28 Feb 2021 19:00:06 +0000 (21:00 +0200)] 
tests: hostapd GET_CONFIG entries for Multi-AP

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: Additional coverage for hostapd GET_CONFIG key_mgmt values
Jouni Malinen [Sun, 28 Feb 2021 18:47:37 +0000 (20:47 +0200)] 
tests: Additional coverage for hostapd GET_CONFIG key_mgmt values

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: Invalid COLOC_INTF_REQ parameters
Jouni Malinen [Sun, 28 Feb 2021 18:40:47 +0000 (20:40 +0200)] 
tests: Invalid COLOC_INTF_REQ parameters

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: WPS status "Timed-out" from hostapd
Jouni Malinen [Sun, 28 Feb 2021 18:37:09 +0000 (20:37 +0200)] 
tests: WPS status "Timed-out" from hostapd

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: WPS PBC overlap indication from hostapd
Jouni Malinen [Sun, 28 Feb 2021 18:34:42 +0000 (20:34 +0200)] 
tests: WPS PBC overlap indication from hostapd

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: Additional coverage for WPS_AP_PIN error case
Jouni Malinen [Sun, 28 Feb 2021 18:28:36 +0000 (20:28 +0200)] 
tests: Additional coverage for WPS_AP_PIN error case

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: Display unexpected stdout and stderr prints in parallel-vm.py
Jouni Malinen [Sun, 28 Feb 2021 18:20:38 +0000 (20:20 +0200)] 
tests: Display unexpected stdout and stderr prints in parallel-vm.py

Make it more difficult to miss issues that were previously only printed
out in /tmp/hwsim-test-logs/*-parallel.log. This covers things like
memory leaks and test script failures or forgotten development time
prints to stdout.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoFix a memory leak in WPS with ap_scan=2
Jouni Malinen [Sun, 28 Feb 2021 16:46:32 +0000 (18:46 +0200)] 
Fix a memory leak in WPS with ap_scan=2

The wpa_ie buffer is now allocated here and needs to be freed before
returning from the function.

Fixes: d2ba0d719e2a ("Move assoc param setting into a helper function")
Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoFILS: Simplify code paths
Jouni Malinen [Sun, 28 Feb 2021 16:42:06 +0000 (18:42 +0200)] 
FILS: Simplify code paths

Use a shared code path for freeing the wpa_ie buffer to avoid
unnecessary complexity with a separate return for the non-FILS case.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoSAE: Use more explicit IE payload validation steps
Jouni Malinen [Sun, 28 Feb 2021 16:39:49 +0000 (18:39 +0200)] 
SAE: Use more explicit IE payload validation steps

This is an attempt of making the code easier to understand for static
analyzers. The helper functions were already verifying that these IEs
are fully within the memory buffer, but that may not have been clear
enough for automated analysis.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoUse more consistent iface->conf checks
Jouni Malinen [Sun, 28 Feb 2021 09:51:16 +0000 (11:51 +0200)] 
Use more consistent iface->conf checks

Commit f1df4fbfc7ad ("mesh: Use setup completion callback to complete
mesh join") added a check for iface->conf being NULL into a debug print.
However, it is not clear how that could be NULL here. In any case,
setup_interface() could end up dereferencing iface->conf in the call to
hostapd_validate_bssid_configuration(), so better be consistent with the
checks and not get warnings from static analyzers regardless of whether
this can happen in practice.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoPASN: Avoid unreachable code with CONFIG_NO_RADIUS
Jouni Malinen [Sun, 28 Feb 2021 09:37:09 +0000 (11:37 +0200)] 
PASN: Avoid unreachable code with CONFIG_NO_RADIUS

There is no point in trying to build in rest of this function if in the
middle of it the CONFIG_NO_RADIUS case would unconditionally fail.
Simply make all of this be conditional on that build parameter not being
set to make things easier for static analyzers.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoFILS: Fix RSN info in FD frame for no-group-addressed
Jouni Malinen [Sun, 28 Feb 2021 09:27:42 +0000 (11:27 +0200)] 
FILS: Fix RSN info in FD frame for no-group-addressed

The value from the initial RSN_CIPHER_SUITE_NO_GROUP_ADDRESSED check
ended up getting overridden with the following if. This was supposed to
be a single if statement to avoid that.

Fixes: 9c02a0f5a672 ("FILS: Add generation of FILS Discovery frame template")
Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoFix dynamic EAP library building
Jouni Malinen [Sat, 27 Feb 2021 21:42:21 +0000 (23:42 +0200)] 
Fix dynamic EAP library building

Build eap_*.so into the wpa_supplicant similarly with the wpa_supplicant
binary and include the shared helper functions from additional files
into the builds. This got broken at some point with the build system
changes.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: Fix sigma_dut_ap_dpp_tcp_enrollee_init to stop hostapd
Jouni Malinen [Sat, 27 Feb 2021 19:07:54 +0000 (21:07 +0200)] 
tests: Fix sigma_dut_ap_dpp_tcp_enrollee_init to stop hostapd

This test case was missing an explicit CAPI ap_reset_default and that
could result in hostapd being left running at the end of the test case.
This could result in issues with following test cases if they used a new
radio interface from HWSimRadio().

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agowlantest: Fix broadcast EAPOL-Key frame handling
Jouni Malinen [Tue, 26 Jan 2021 22:09:49 +0000 (00:09 +0200)] 
wlantest: Fix broadcast EAPOL-Key frame handling

This resulted in an attempt to dereference a NULL pointer since sta_addr
is not known in this type of a case.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoIgnore group-addressed SA Query frames
Jouni Malinen [Tue, 16 Feb 2021 09:34:50 +0000 (11:34 +0200)] 
Ignore group-addressed SA Query frames

These frames are used for verifying that a specific SA and protected
link is in functional state between two devices. The IEEE 802.11
standard defines only a case that uses individual MAC address as the
destination. While there is no explicit rule on the receiver to ignore
other cases, it seems safer to make sure group-addressed frames do not
end up resulting in undesired behavior. As such, drop such frames
instead of interpreting them as valid SA Query Request/Response.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoP2P: Pick a 5 GHz channel from more possible channels
Jimmy Chen [Mon, 12 Oct 2020 02:23:40 +0000 (10:23 +0800)] 
P2P: Pick a 5 GHz channel from more possible channels

For an autonomous P2P group on the 5 GHz band, a channel was picked only
from the operating class 115 which is not available in the EU region
anymore. As a result, an autonomous group creation would always fail in
this generic 5 GHz channel case.

There are more possible available channels for the 5 GHz currently.
Especially in the EU region, the operating class 115 channels are no
longer available, but SRD channels (the operating class 124) are
available. Allow them to be used here if they are marked as allowed for
P2P GO use.

In addition, iterate through all the potential options instead of just
checking the first randomly picked channel. Start this iteration from
random position to maintain some randomness in this process.

Signed-off-by: Jimmy Chen <jimmycmchen@google.com>
4 years agotests: Work around exception handling issue in wpas_config_file
Jouni Malinen [Sat, 27 Feb 2021 16:10:41 +0000 (18:10 +0200)] 
tests: Work around exception handling issue in wpas_config_file

Raising an exception while the wlan5 interface was remove (i.e., between
wpas.interface_remove() and .interface_add() calls) would result in the
cleanup code failing and generating yet another exception while the
first one was being processed. Work around this by re-adding the wlan5
interface back temporarily if the interface is not available for the
cleanup operations.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agonl80211: Allow compilation with both vendor do_acs() handlers
Jouni Malinen [Sat, 27 Feb 2021 15:57:08 +0000 (17:57 +0200)] 
nl80211: Allow compilation with both vendor do_acs() handlers

Use a helper function as the do_acs() callback to allow builds to pull
in all the vendor specific operations into a single binary.

Signed-off-by: Jouni Malinen <j@w1.fi>