]> git.ipfire.org Git - thirdparty/hostap.git/log
thirdparty/hostap.git
3 years agoOpenSSL 3.0: Determine the prime length for an EC key group using EVP_PKEY
Jouni Malinen [Sun, 13 Mar 2022 08:40:06 +0000 (10:40 +0200)] 
OpenSSL 3.0: Determine the prime length for an EC key group using EVP_PKEY

EVP_PKEY_get0_EC_KEY() and EC_KEY_get0_group() were deprecated in
OpenSSL 3.0. Add a version of this by determining the group without
fetching the EC_KEY itself from an EVP_PKEY.

Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agoOpenSSL: Replace EC_GROUP_get_curve_GFp() calls with EC_GROUP_get_curve()
Jouni Malinen [Sat, 12 Mar 2022 20:35:32 +0000 (22:35 +0200)] 
OpenSSL: Replace EC_GROUP_get_curve_GFp() calls with EC_GROUP_get_curve()

EC_GROUP_get_curve_GFp() was deprecated in OpenSSL 3.0.
EC_GROUP_get_curve() can be used to do the exact same thing. Add a
backwards compatibility wrapper for older OpenSSL versions to be able to
use this newer function.

Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agoOpenSSL 3.0: Implement crypto_ec_key_group() with new API
Jouni Malinen [Sat, 12 Mar 2022 20:27:16 +0000 (22:27 +0200)] 
OpenSSL 3.0: Implement crypto_ec_key_group() with new API

Get rid of the now deprecated EVP_PKEY_get0_EC_KEY() and
EC_KEY_get0_group() calls.

Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agotests: Fix sigma_dut_cmd() processing for the return value
Jouni Malinen [Sat, 12 Mar 2022 17:00:36 +0000 (19:00 +0200)] 
tests: Fix sigma_dut_cmd() processing for the return value

The first sock.recv() may return both the status,RUNNING and the
following status line if the sigma_dut process ends up being faster in
writing the result than the test script is in reading the result. This
resulted in unexpected behavior and odd error messages when parsing the
result in the test cases. Fix this by dropping the status,RUNNING line
from the result in case the buffer includes multiple lines.

Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agoOpenSSL: Replace EVP_PKEY_cmp() with EVP_PKEY_eq() when available
Jouni Malinen [Sat, 12 Mar 2022 08:54:48 +0000 (10:54 +0200)] 
OpenSSL: Replace EVP_PKEY_cmp() with EVP_PKEY_eq() when available

OpenSSL 3.0 deprecated EVP_PKEY_cmp() and replaced it with EVP_PKEY_eq()
which is not available in older versions.

Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agoD-Bus: Add 'wep_disabled' capability
Lubomir Rintel [Mon, 7 Mar 2022 08:54:46 +0000 (09:54 +0100)] 
D-Bus: Add 'wep_disabled' capability

Since commit 200c7693c9a1 ('Make WEP functionality an optional build
parameter'), WEP support is optional and, indeed, off by default.

The distributions are now catching up and disabling WEP in their builds.
Unfortunately, there's no indication prior to an attempt to connect to a
WEP network that it's not going to work. Add a capability to communicate
that.

Unlike other capabilities, this one is negative. That is, it indicates
lack of a WEP support as opposed to its presence. This is necessary
because historically there has been no capability to indicate presence
of WEP support and therefore NetworkManager (and probably others) just
assumes it's there.

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
Acked-by: Davide Caratti <davide.caratti@gmail.com>
3 years agoDFS: Don't let cac_time_left_seconds overflow
Nicolas Escande [Tue, 8 Mar 2022 10:22:18 +0000 (11:22 +0100)] 
DFS: Don't let cac_time_left_seconds overflow

There can be some discrepancy between the theorical dfs cac end (as
computed with the cac duration and cac start) and the actual cac end as
reported by the driver. During that window, the value of remaining time
outputed by the status command on the socket control interface will
display an overflowed, invalid value.
To mitigate this lets compute the remaining time as signed and display
it only when positive, otherwise defaulting it to 0.

Status command shows something like that when polling every seconds:

state=DFS
cac_time_seconds=60
cac_time_left_seconds=1
...
state=DFS
cac_time_seconds=60
cac_time_left_seconds=0
...
state=DFS
cac_time_seconds=60
cac_time_left_seconds=4294967294
...
state=DFS
cac_time_seconds=60
cac_time_left_seconds=4294967293
...
state=DFS
cac_time_seconds=60
cac_time_left_seconds=4294967292
...
state=ENABLED
cac_time_seconds=60
cac_time_left_seconds=N/A

Signed-off-by: Nicolas Escande <nico.escande@gmail.com>
3 years agoDPP: Fix uninitialised variable on error path
Alasdair Mackintosh [Wed, 9 Mar 2022 21:24:49 +0000 (13:24 -0800)] 
DPP: Fix uninitialised variable on error path

The current code generates a warning when compiled by Clang, because if
we goto 'fail:', password_len can be uninitialised when we pass it in to
bin_clear_free().

Note that the actual usage is safe, because bin_clear_free() ignores
the second argument if the first argument is NULL, but it still seems
worth cleaning up.

Signed-off-by: Alasdair Mackintosh <alasdair at google.com>
3 years agodbus: Set CurrentAuthMode to INACTIVE only if network is not selected
ArisAachen [Fri, 11 Mar 2022 07:02:58 +0000 (15:02 +0800)] 
dbus: Set CurrentAuthMode to INACTIVE only if network is not selected

CurrentAuthMode should be set as a real auth type when authentication is
in progress. wpa_supplicant has a property "State" which indicates the
authentication stage already. I think setting auth mode as "INACTIVE" in
all auth progress stages is not a good idea, because sometimes we need
to handle this connection according to the auth type even when
authentication is not complete. For example, NetworkManager may recall
ask-password-dialog when auth mode is "wpa-psk" and "sae", try next
access point when auth mode is "EAP-xx" when password is incorrect.
Since "CurrentAuthMode" is set as "INACTIVE" in all not fully completed
situations, we do not know how to handle it.

Signed-off-by: Aris Aachen <chenyunxiong@unionitech.com>
Signed-off-by: ArisAachen <chenyunxiong@uniontech.com>
3 years agohs20-osu-client: Allow EST server to use different host name
Jouni Malinen [Fri, 11 Mar 2022 17:47:30 +0000 (19:47 +0200)] 
hs20-osu-client: Allow EST server to use different host name

The EST server does not have to be sharing the same host name with the
OSU server. Use the host name from the EST URL instead of the SPP server
URL when validating the EST server certificate.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agoHTTP: Make URL available to the cert_cb
Jouni Malinen [Fri, 11 Mar 2022 17:46:23 +0000 (19:46 +0200)] 
HTTP: Make URL available to the cert_cb

This makes it easier for non-SOAP cases to validate HTTP server name
(from the URL) match against the certificate.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agoHS 2.0 server: Event log entry on missing configuration for the realm
Jouni Malinen [Fri, 11 Mar 2022 17:44:58 +0000 (19:44 +0200)] 
HS 2.0 server: Event log entry on missing configuration for the realm

Make the error reason clearer in the event log for the case where the
requested realm has not been configured.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agoAndroid: Compile hs20-osu-client to /vendor/bin in test builds
Purushottam Kushwaha [Fri, 18 Jan 2019 12:48:33 +0000 (18:18 +0530)] 
Android: Compile hs20-osu-client to /vendor/bin in test builds

hs20-osu-client compilation fails on Android O onwards because of
undefined reference for __android_log_print/__android_log_vprint.

Modify hs20-osu-client's Android.mk to include liblog library and use
tag 'hs20-osu-client' in logcat logs. Additionally, compile
hs20-osu-client to /vendor/bin in non-production builds.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agoEnhance QCA vendor interface to indicate TWT required capability of AP
Sumit Agre [Tue, 8 Mar 2022 05:05:37 +0000 (10:35 +0530)] 
Enhance QCA vendor interface to indicate TWT required capability of AP

Add QCA_WLAN_TWT_NOTIFY command type to send event to userspace when AP
changes TWT required bit field in its capabilities.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agoAdd QCA vendor attributes for AFC support in external ACS
Jhalak Naik [Mon, 28 Feb 2022 08:06:36 +0000 (13:36 +0530)] 
Add QCA vendor attributes for AFC support in external ACS

Add support for new QCA nested attributes to pass the AFC channel
information as part of the external ACS request command,
EXTERNAL_ACS_EVENT_CHAN_INFO.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agotests: sigma_dut DPP Configurator (MUD URL, NAK change)
Jouni Malinen [Thu, 10 Mar 2022 16:29:34 +0000 (18:29 +0200)] 
tests: sigma_dut DPP Configurator (MUD URL, NAK change)

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agotests: DPP PKEX with netAccessKey curve change
Jouni Malinen [Wed, 9 Mar 2022 21:10:02 +0000 (23:10 +0200)] 
tests: DPP PKEX with netAccessKey curve change

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agotests: Fix dpp_own_config_curve_mismatch to match implementation
Jouni Malinen [Wed, 9 Mar 2022 23:28:51 +0000 (01:28 +0200)] 
tests: Fix dpp_own_config_curve_mismatch to match implementation

This test case was assuming the Configurator would change the
netAccessKey curve every time based on the protocol keys, but that is
not the case anymore, so force that change here for a negative test.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agotests: Fix dpp_intro_mismatch to match implementation
Jouni Malinen [Wed, 9 Mar 2022 23:16:29 +0000 (01:16 +0200)] 
tests: Fix dpp_intro_mismatch to match implementation

This test case was assuming the Configurator would change the
netAccessKey curve every time based on the protocol keys, but that is
not the case anymore, so force that change here for a negative test.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agoDPP: Allow Configurator net_access_key_curve to be changed
Jouni Malinen [Wed, 9 Mar 2022 22:55:05 +0000 (00:55 +0200)] 
DPP: Allow Configurator net_access_key_curve to be changed

This is mainly for testing purposes to allow a Configurator to the curve
between provisioning cases. This would not work for real deployement
cases unless every Enrollee were reconfigured.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agoDPP: Update Configurator to require same netAccessKey curve to be used
Jouni Malinen [Wed, 9 Mar 2022 21:08:06 +0000 (23:08 +0200)] 
DPP: Update Configurator to require same netAccessKey curve to be used

DPP network introduction requires all devices to use the same curve for
netAccessKey. Enforce that this happens based on hardcoding the curve
based on the first successful configuration object generation if no
explicit configuration of the curve was used.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agotests: Check DPP3 support in the build for netAccessKey curve changes
Jouni Malinen [Wed, 9 Mar 2022 19:26:28 +0000 (21:26 +0200)] 
tests: Check DPP3 support in the build for netAccessKey curve changes

These test cases need to be skipped if CONFIG_DPP3=y is not defined in
the build.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agoDPP: Update Auth-I derivation operations
Jouni Malinen [Wed, 9 Mar 2022 18:49:17 +0000 (20:49 +0200)] 
DPP: Update Auth-I derivation operations

This is not properly defined in the technical specification and will
need to be clarified there. Change the implementation to use a design
that is more likely to be used in the cleaned up tech spec.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agotests: sigma_dut and DPP netAccessKey curve change
Jouni Malinen [Tue, 8 Mar 2022 23:20:49 +0000 (01:20 +0200)] 
tests: sigma_dut and DPP netAccessKey curve change

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agotests: DPP curve change for netAccessKey
Jouni Malinen [Tue, 8 Mar 2022 23:05:17 +0000 (01:05 +0200)] 
tests: DPP curve change for netAccessKey

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agoDPP: Curve change for netAccessKey
Jouni Malinen [Tue, 8 Mar 2022 23:06:01 +0000 (01:06 +0200)] 
DPP: Curve change for netAccessKey

Allow the Configurator to be configured to use a specific curve for the
netAccessKey so that it can request the Enrollee to generate a new key
during the configuration exchange to allow a compatible Connector to be
generated when the network uses a different curve than the protocol keys
used during the authentication exchange.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agoDPP: Fix a memory leak on error path
Jouni Malinen [Mon, 7 Mar 2022 22:28:10 +0000 (00:28 +0200)] 
DPP: Fix a memory leak on error path

The encoded CSR could have been leaked if another memory allocation were
to fail in this function. Use a shared return path to free the allocated
temporary buffers to avoid this.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agotests: sigma_dut and DPP Reconfig Auth Req error cases
Jouni Malinen [Mon, 7 Mar 2022 22:06:00 +0000 (00:06 +0200)] 
tests: sigma_dut and DPP Reconfig Auth Req error cases

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agoDPP: Missing/invalid Protocol Version in Reconfig Auth Req
Jouni Malinen [Mon, 7 Mar 2022 21:40:27 +0000 (23:40 +0200)] 
DPP: Missing/invalid Protocol Version in Reconfig Auth Req

Extend dpp_test testing functionality to allow the Protocol Version
attribute to be removed or modified to invalid value in Reconfig
Authentication Request.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agotests: sigma_dut and DPP PKEXv1 responder
Jouni Malinen [Mon, 7 Mar 2022 19:38:25 +0000 (21:38 +0200)] 
tests: sigma_dut and DPP PKEXv1 responder

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agoDPP: Extend DPP_PKEX_ADD ver=<1/2> to cover Responder role
Jouni Malinen [Mon, 7 Mar 2022 19:37:40 +0000 (21:37 +0200)] 
DPP: Extend DPP_PKEX_ADD ver=<1/2> to cover Responder role

Allow PKEX v1-only or v2-only behavior to be specific for the Responder
role. This is mainly for testing purposes.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agoAdd QCA vendor attribute to enable Spectral FFT recapture
Jhalak Naik [Mon, 28 Feb 2022 07:41:59 +0000 (13:11 +0530)] 
Add QCA vendor attribute to enable Spectral FFT recapture

Add a QCA vendor attribute to enable FFT recapture on user trigger.
Enable FFT recapture only when spectral scan period is greater than 52
us.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agotests: WPA3 with SAE password from RADIUS
Jouni Malinen [Fri, 4 Mar 2022 10:25:47 +0000 (12:25 +0200)] 
tests: WPA3 with SAE password from RADIUS

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agoSAE: Add support for RADIUS passphrase as the SAE password
Mario Hros [Sat, 19 Feb 2022 20:25:30 +0000 (21:25 +0100)] 
SAE: Add support for RADIUS passphrase as the SAE password

Allow the first Tunnel-Password RADIUS entry to be used for SAE in
addition to the sae_password entries and wpa_passphrase parameters from
the static configuration file.

Signed-off-by: Mario Hros <git@reversity.org>
3 years agocleanup: Remove unreachable code
Baligh Gasmi [Fri, 18 Feb 2022 16:22:23 +0000 (17:22 +0100)] 
cleanup: Remove unreachable code

There is no need for unreachable code in these places, so remove it.

Signed-off-by: Baligh Gasmi <gasmibal@gmail.com>
3 years agoqca-vendor: Fix typos
Yegor Yefremov [Tue, 1 Feb 2022 10:33:29 +0000 (11:33 +0100)] 
qca-vendor: Fix typos

Fix typos found with codespell utility.

Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
3 years agobrcm_vendor: Fix typos
Yegor Yefremov [Tue, 1 Feb 2022 10:33:29 +0000 (11:33 +0100)] 
brcm_vendor: Fix typos

Fix typos found with codespell utility.

Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
3 years agosrc/drivers: Fix typos
Yegor Yefremov [Tue, 1 Feb 2022 08:31:44 +0000 (09:31 +0100)] 
src/drivers: Fix typos

Fix typos found with codespell utility.

Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
3 years agonl80211: Report background radar/CAC detection capability
Lorenzo Bianconi [Mon, 20 Dec 2021 15:48:19 +0000 (16:48 +0100)] 
nl80211: Report background radar/CAC detection capability

Report background radar/CAC detection capability if supported
by the underlying driver/hardware.

Tested-by: Owen Peng <owen.peng@mediatek.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
3 years agoDFS: Add capability to select radar-only channels
Lorenzo Bianconi [Mon, 20 Dec 2021 15:48:18 +0000 (16:48 +0100)] 
DFS: Add capability to select radar-only channels

Introduce type parameter to dfs_get_valid_channel() routine to allow
selection of a radar-only channel where the CAC detection has not been
performed yet. This is a preliminary patch to enable background
radar/CAC detection.

Tested-by: Owen Peng <owen.peng@mediatek.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
3 years agoDFS: Introduce dfs_set_valid_channel() utility routine
Lorenzo Bianconi [Mon, 20 Dec 2021 15:48:17 +0000 (16:48 +0100)] 
DFS: Introduce dfs_set_valid_channel() utility routine

This is a preliminary change to introduce radar/CAC background detection
support.

Tested-by: Owen Peng <owen.peng@mediatek.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
3 years agoFix removal of wpa_passphrase on 'make clean'
Jouni Malinen [Thu, 3 Mar 2022 11:26:42 +0000 (13:26 +0200)] 
Fix removal of wpa_passphrase on 'make clean'

Fixes: 0430bc8267b4 ("build: Add a common-clean target")
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agobuild: Re-enable options for libwpa_client.so and wpa_passphrase
Sergey Matyukevich [Tue, 22 Feb 2022 08:52:19 +0000 (11:52 +0300)] 
build: Re-enable options for libwpa_client.so and wpa_passphrase

Commit a41a29192e5d ("build: Pull common fragments into a build.rules
file") introduced a regression into wpa_supplicant build process. The
build target libwpa_client.so is not built regardless of whether the
option CONFIG_BUILD_WPA_CLIENT_SO is set or not. This happens because
this config option is used before it is imported from the configuration
file. Moving its use after including build.rules does not help: the
variable ALL is processed by build.rules and further changes are not
applied. Similarly, option CONFIG_NO_WPA_PASSPHRASE also does not work
as expected: wpa_passphrase is always built regardless of whether the
option is set or not.

Re-enable these options by adding both build targets to _all
dependencies.

Fixes: a41a29192e5d ("build: Pull common fragments into a build.rules file")
Signed-off-by: Sergey Matyukevich <geomatsi@gmail.com>
3 years agotests: HE AP and capability parsing
Jouni Malinen [Wed, 2 Mar 2022 23:22:44 +0000 (01:22 +0200)] 
tests: HE AP and capability parsing

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agoHE: Fix invalid length checking for HE Capability element
Jouni Malinen [Wed, 2 Mar 2022 23:24:02 +0000 (01:24 +0200)] 
HE: Fix invalid length checking for HE Capability element

Do not use the first octet of the PPE Thresholds field without
explicitly confirming that that octet was included in the element.
Furthermore, allow the received element to have additional octets in the
end since IEEE Std 802.11ax-2021 defines this to be an extensible
element and new fields could be added to the end of it in the future.

Fixes: 0497e4148197 ("HE: Fix HE Capabilities element size")
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agoHE: Fix calculation of the PPE Threshold field length
Shiva Sankar Gajula [Fri, 4 Feb 2022 17:43:30 +0000 (23:13 +0530)] 
HE: Fix calculation of the PPE Threshold field length

The previously used calculation was not correct for the cases where the
extra padding field was needed. Fix this by properly calculating the
number of full octets in the field.

Fixes: 0497e4148197 ("HE: Fix HE Capabilities element size")
Signed-off-by: Shiva Sankar Gajula <quic_sgajula@quicinc.com>
3 years agotests: Fetch all event messages in wpas_ctrl_many_networks
Jouni Malinen [Sat, 26 Feb 2022 17:07:10 +0000 (19:07 +0200)] 
tests: Fetch all event messages in wpas_ctrl_many_networks

Do not leave a large number of network added/removed events remaining
for the following test case to handle. This removes some possible
failure test case sequences like the following one:
wpas_ctrl_many_networks dbus_ap_scan_2_ap_mode_scan

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agotests: wpa_supplicant AP mode and PSK/PTK lifetime in memory"
Jouni Malinen [Fri, 25 Feb 2022 23:15:16 +0000 (01:15 +0200)] 
tests: wpa_supplicant AP mode and PSK/PTK lifetime in memory"

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agoClear PSK explicitly from memory in couple more cases on deinit
Jouni Malinen [Sat, 26 Feb 2022 11:39:35 +0000 (13:39 +0200)] 
Clear PSK explicitly from memory in couple more cases on deinit

Couple of the WPS/P2P/RADIUS-PSK cases were freeing heap memory
allocations without explicitly clearing the PSK value. Add such clearing
for these to avoid leaving the PSK in memory after it is not needed
anymore.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agoClear PMK explicitly even without FT support in AP build
Jouni Malinen [Sat, 26 Feb 2022 11:38:34 +0000 (13:38 +0200)] 
Clear PMK explicitly even without FT support in AP build

Unlike the other keys that were cleared here, the PMK is available
without FT support built into hostapd and as such, should be cleared in
all cases.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agoRemove duplicated pointer check
Jouni Malinen [Sat, 26 Feb 2022 09:22:04 +0000 (11:22 +0200)] 
Remove duplicated pointer check

The following if statement verifies the exact same thing here.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agoClear temporary results from stack in PBKDF2-SHA1
Jouni Malinen [Sat, 26 Feb 2022 08:58:15 +0000 (10:58 +0200)] 
Clear temporary results from stack in PBKDF2-SHA1

Force stack memory to be cleared of temporary values that might contain
keying material.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agoRemove GTK/IGTK/BIGTK from memory explicitly in AP mode
Jouni Malinen [Fri, 25 Feb 2022 23:14:25 +0000 (01:14 +0200)] 
Remove GTK/IGTK/BIGTK from memory explicitly in AP mode

Make sure these keys do not remain in memory beyond the time they are
needed.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agoClear last set keys (for testing purposes) from memory explicitly
Jouni Malinen [Fri, 25 Feb 2022 23:10:32 +0000 (01:10 +0200)] 
Clear last set keys (for testing purposes) from memory explicitly

This makes it easier to scan process memory for key information that is
not supposed to remain there after the last use.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agonl80211: Clear bss->freq when stopping AP mode
Jouni Malinen [Fri, 25 Feb 2022 20:39:54 +0000 (22:39 +0200)] 
nl80211: Clear bss->freq when stopping AP mode

The current operating frequency information was already cleared when
stopping other modes, but the cases for stopping AP mode were not
covered. Clear bss->freq in wpa_driver_nl80211_del_beacon() to cover
these cases. In addition, move clearing of bss->beacon_set there to
avoid having to clear that in all callers separately.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agotests: Make test cases more robust by clearing scan cache explicitly
Jouni Malinen [Fri, 25 Feb 2022 18:04:50 +0000 (20:04 +0200)] 
tests: Make test cases more robust by clearing scan cache explicitly

This test cases can fail if previously executed tests leave older scan
results in cfg80211 scan table. Clear that scan table explicitly to
avoid such issues.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agoDefine a vendor specific NDP attribute for NAN service id
Ajit Vaishya [Tue, 15 Feb 2022 16:24:31 +0000 (21:54 +0530)] 
Define a vendor specific NDP attribute for NAN service id

Add a NAN NDP attribute QCA_WLAN_VENDOR_ATTR_NDP_SERVICE_ID which
indicates service id with 6 bytes of length and it's derived from the
SHA-256 hash of the NAN service name. As per Wi-Fi Aware Specfication
version 3.2, this service ID is used to calculate the NAN PMK.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agotests: Make OCV test cases more robust by clearing scan results on AP
Jouni Malinen [Wed, 23 Feb 2022 22:13:52 +0000 (00:13 +0200)] 
tests: Make OCV test cases more robust by clearing scan results on AP

This is needed to avoid pri/sec channel switching based on potential
scan results from the previous test cases.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agoDPP: Clear SCANNING state when starting network introduction
Jouni Malinen [Wed, 23 Feb 2022 22:07:07 +0000 (00:07 +0200)] 
DPP: Clear SCANNING state when starting network introduction

This is needed to avoid leaving wpa_state to SCANNING if network
introduction fails and a new association is not started.

This was found with the following test case sequence:
dpp_conn_status_connector_mismatch scan_trigger_failure

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
3 years agoDPP: Clear netrole on starting chirping or reconfiguration
Jouni Malinen [Wed, 23 Feb 2022 19:58:07 +0000 (21:58 +0200)] 
DPP: Clear netrole on starting chirping or reconfiguration

A previously set netrole (e.g., from DPP_LISTEN or DPP_AUTH_INIT) could
have been used in a following DPP_CHIRP or DPP_RECONFIG operation. This
could result in trying to request incorrect configuration and likely
rejection from the Configurator. Fix this by clearing the netrole when
starting these operations.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
3 years agoClear wpa_s->last/current_ssid in more cases
Jouni Malinen [Wed, 23 Feb 2022 19:47:10 +0000 (21:47 +0200)] 
Clear wpa_s->last/current_ssid in more cases

It was possible for at least the wpa_s->last_ssid to be left pointing to
a removed network which could result in processing the following
association as a reassociation-within-an-ESS even when it was moving to
a different ESS. This could result in unexpected behavior. This was
found with the following test case sequence:
sigma_dut_ap_psk_sae_ft sae_h2e_password_id ap_wps_pk_oom sigma_dut_client_privacy

Move clearing of wpa_s->last_ssid and wpa_s->current_ssid into
wpas_notify_network_removed() to catch all cases similarily to the way
wpa_s->next_ssid was already cleared.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agotests: Add a script for find a minimal failing test sequence
Jouni Malinen [Wed, 23 Feb 2022 09:16:40 +0000 (11:16 +0200)] 
tests: Add a script for find a minimal failing test sequence

min-seq.py can be used to find a minimal test sequence that can be used
to reproduce test failures. This is meant for being able to process the
recently added "Failure sequence:" entries from parallel-vm.log to
reduce manual work needed to debug commonly failing test case sequences.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agotests: Clear sae_groups in sigma_dut_ap_ft_rsnxe_used_mismatch
Jouni Malinen [Wed, 23 Feb 2022 09:15:31 +0000 (11:15 +0200)] 
tests: Clear sae_groups in sigma_dut_ap_ft_rsnxe_used_mismatch

This is needed to avoid test failures when a previous test case might
have restricted the set of allowed SAE groups.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agoDPP: Stop offchannel frame TX wait on DPP_STOP_LISTEN in a corner case
Jouni Malinen [Mon, 21 Feb 2022 22:24:56 +0000 (00:24 +0200)] 
DPP: Stop offchannel frame TX wait on DPP_STOP_LISTEN in a corner case

The offchannel frame TX wait was stopped whenever processing
DPP_STOP_LISTEN in most cases. However, there was a corner case on the
Responder side where this operation was skipped after PKEX was completed
successful and the Authentication Request frame had not yet been
received from the Initiator.

While this does not normally cause any significant issue, this could
result in unexpected behavior especially in test cases that run multiple
DPP PKEX operations in a row since the start of a new TX operation might
get delayed while waiting for the previous TX-wait to complete.

This was found with the following test case sequence:
dpp_reconfig_retries dpp_pkex_alloc_fail

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agotests: Make rrm_beacon_req_frame_body_fragmentation more robust
Jouni Malinen [Mon, 21 Feb 2022 22:05:56 +0000 (00:05 +0200)] 
tests: Make rrm_beacon_req_frame_body_fragmentation more robust

Flush scan results to avoid unexpected behavior due to scan results
remaining available from previous test cases.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agotests: Make WNM BSS TM tests more robust
Jouni Malinen [Mon, 21 Feb 2022 21:58:45 +0000 (23:58 +0200)] 
tests: Make WNM BSS TM tests more robust

Flush scan results to avoid unexpected behavior due to scan results
remaining available from previous test cases.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agotests: Fix a test case name
Jouni Malinen [Mon, 21 Feb 2022 16:34:42 +0000 (18:34 +0200)] 
tests: Fix a test case name

The test case name ap_ft_pmf_over_ds was used for two different test
cases which resulted in only one of those being used. Fix this by using
unique test case names.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agotests: Make FT-over-DS test cases more robust
Jouni Malinen [Mon, 21 Feb 2022 16:11:25 +0000 (18:11 +0200)] 
tests: Make FT-over-DS test cases more robust

Clear scan cache to avoid issues with old scan results from earlier test
cases. This caused issues like the following test case sequence failing:
rrm_beacon_req_active_ap_channels ap_ft_eap_dis_over_ds

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agotests: Make wpas_mesh_mode_scan more robust
Jouni Malinen [Fri, 18 Feb 2022 14:47:29 +0000 (16:47 +0200)] 
tests: Make wpas_mesh_mode_scan more robust

Clear scan results to avoid issues with get_bss() finding an entry from
an earlier test case when checking for mesh information.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agotests: MACsec with GCM-AES-256
Jouni Malinen [Wed, 16 Feb 2022 20:45:10 +0000 (22:45 +0200)] 
tests: MACsec with GCM-AES-256

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agomacsec_linux: Support cipher suite configuration
leiwei [Mon, 15 Nov 2021 10:43:33 +0000 (18:43 +0800)] 
macsec_linux: Support cipher suite configuration

Set the cipher suite for the link. Unlike the other parameters, this
needs to be done with the first rtnl_link_add() call (NLM_F_CREATE))
instead of the update in try_commit() since the kernel is rejecting
changes to the cipher suite after the link is first added.

Signed-off-by: leiwei <quic_leiwei@quicinc.com>
3 years agoMACsec: Support GCM-AES-256 cipher suite
leiwei [Mon, 15 Nov 2021 10:22:19 +0000 (18:22 +0800)] 
MACsec: Support GCM-AES-256 cipher suite

Allow macsec_csindex to be configured and select the cipher suite when
the participant acts as a key server.

Signed-off-by: leiwei <quic_leiwei@quicinc.com>
3 years agotests: Make wpa2_ocv_ap_ht_mismatch more robust
Jouni Malinen [Wed, 16 Feb 2022 19:29:54 +0000 (21:29 +0200)] 
tests: Make wpa2_ocv_ap_ht_mismatch more robust

Clear the scan cache on the AP before running this test since the HT40
operation on the 2.4 GHz band might get disallowed based on scan results
from earlier test cases. This was found with the following hwsim test
case sequence failing:
ap_acs_with_fallback_to_20 wpa2_ocv_ap_ht_mismatch

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agonl80211: Do not store no-wait TX frame cookies to be cancelled
Jouni Malinen [Wed, 16 Feb 2022 19:09:57 +0000 (21:09 +0200)] 
nl80211: Do not store no-wait TX frame cookies to be cancelled

If the TX frame operation does not request any wait time, there is not
going to be any pending wait that could be cancelled later. As such,
there is no need to store the cookie value for these cases. This removes
unnecessary cancel-TX-wait operations that would result in some extra
latency and confusing debug log entries.

This was found with the following hwsim test case sequence where the
second test was failing due to the extra latency and this commit gets
rid of that failure:
rrm_ftm_range_req_timeout dpp_qr_code_auth_neg_chan

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agotests: Make SAE roaming test cases more reliable
Jouni Malinen [Wed, 16 Feb 2022 17:56:24 +0000 (19:56 +0200)] 
tests: Make SAE roaming test cases more reliable

Flush the scan table explicitly to avoid issues with the ROAM command if
the new AP is not found and an entry from a previous test case is used
instead. This was happening in a number of cases where a SAE test case
was run after sigma_dut_ap_cipher_gcmp_256 which used the second AP
instance and allowed that to show up in the scan results in the next
text case.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agotests: Write full failure sequences into parallel-vm.log
Jouni Malinen [Tue, 15 Feb 2022 18:54:24 +0000 (20:54 +0200)] 
tests: Write full failure sequences into parallel-vm.log

This can be helpful in discovering test case sequences that result in
failures frequently.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agotests: DPP session clearing on failure during GAS request handling
Jouni Malinen [Tue, 15 Feb 2022 14:41:25 +0000 (16:41 +0200)] 
tests: DPP session clearing on failure during GAS request handling

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agoDPP: Clear state on configuration failure in GAS server hander
Jouni Malinen [Tue, 15 Feb 2022 14:18:12 +0000 (16:18 +0200)] 
DPP: Clear state on configuration failure in GAS server hander

There is no need to maintain the DPP authentication state if config
request processing fails, so clear state also in the GAS server request
handler similarly to the other failure cases.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agonl80211: Clear the last saved TX frame cookie on wait expiration
Jouni Malinen [Tue, 15 Feb 2022 14:15:41 +0000 (16:15 +0200)] 
nl80211: Clear the last saved TX frame cookie on wait expiration

drv->send_frame_cookies[] was already cleared, but
dev->send_frame_cookie was not. This resulted in unnecessary attempts of
canceling the TX wait for a wait that had already expired. While this
does not really result in real issues, it is cleaner to get rid of the
error messages from the debug log by skipping the unnecessary
operations.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agotests: Make FILS BSS result checks more robust
Jouni Malinen [Tue, 15 Feb 2022 11:06:36 +0000 (13:06 +0200)] 
tests: Make FILS BSS result checks more robust

These can fail if the scan results from the previous test case remain,
e.g., when run immediately after scan_bss_limit.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agotests: Additional wpa_supplicant AP mode testing
Jouni Malinen [Tue, 15 Feb 2022 10:45:09 +0000 (12:45 +0200)] 
tests: Additional wpa_supplicant AP mode testing

Add a couple of more channel configuration cases and log the channel
parameters with more details in the test log.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agotests: Clear AP scan cache after primary BSS on channel 40
Jouni Malinen [Mon, 14 Feb 2022 22:34:55 +0000 (00:34 +0200)] 
tests: Clear AP scan cache after primary BSS on channel 40

A number of test cases using 40 MHz or wider channels with the primary
channel 36 were failing when executed after dpp_chirp_ap_5g since that
test case was running an AP on the channel 40 and resulting in need to
swap the primary and the secondary channels in the following test case.
Fix this by clearing the AP scan cache explicitly for such cases.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agotests: Make GAS/ANQP test cases more robust
Jouni Malinen [Mon, 14 Feb 2022 22:18:07 +0000 (00:18 +0200)] 
tests: Make GAS/ANQP test cases more robust

Flush the scan cache for all test cases that used get_bss() to check for
particular ANQP information. This was already done for one such case
based on commit dd900637b2d0 ("tests: Make gas_anqp_extra_elements more
robust"), but other test cases need this as well.

This was showing with frequent errors in test cases sequences like this
one:
dfs_radar_no_ht gas_fragment_with_comeback_delay gas_unknown_adv_proto gas_anqp_venue_url

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agotests: Clear scan cache at the end of ap_wps_cancel
Jouni Malinen [Mon, 14 Feb 2022 22:02:34 +0000 (00:02 +0200)] 
tests: Clear scan cache at the end of ap_wps_cancel

This is needed to avoid leaving behind a BSS entry with WPS enabled for
the next text case in some cases. In particular, this was causing issues
in the following sequence of test cases:
ap_wps_conf_chan14 ap_wps_cancel ap_wps_pin_request_file

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agoUpdate QCA vendor attribute to indicate maximum PCL attributes
Sreeramya Soratkal [Tue, 14 Dec 2021 12:10:46 +0000 (17:40 +0530)] 
Update QCA vendor attribute to indicate maximum PCL attributes

Add the enum qca_wlan_vendor_attr_pcl elements to mark the maximum value
of the defined attributes for the preferred channel list. This is
helpful for nla_parse().

Signed-off-by: Sreeramya Soratkal <quic_ssramya@quicinc.com>
3 years agoatheros: Do not include p2p.h
Jouni Malinen [Thu, 10 Feb 2022 15:52:40 +0000 (17:52 +0200)] 
atheros: Do not include p2p.h

That wpa_supplicant header file is not needed for driver_atheros.c and
maybe was never really needed, so do not include it here to avoid
potentially conflicting C preprocessor defines.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agonl80211: Debug print association comeback event data
Jouni Malinen [Wed, 9 Feb 2022 18:43:53 +0000 (20:43 +0200)] 
nl80211: Debug print association comeback event data

This is helpful for understanding why an assocation attempt takes
unexpectedly long time to complete.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agoOCV: Don't start SA Query timer on CSA when SA Query is offloaded
Narasimha Rao PVS [Thu, 3 Feb 2022 08:03:45 +0000 (08:03 +0000)] 
OCV: Don't start SA Query timer on CSA when SA Query is offloaded

Check driver support for SA Query offload in AP mode and skip starting
SA Query timer on CSA for OCV enabled STAs when the driver indicates
support for offloading SA Query procedures.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agoSync with mac80211-next.git include/uapi/linux/nl80211.h
Jouni Malinen [Wed, 9 Feb 2022 18:15:30 +0000 (20:15 +0200)] 
Sync with mac80211-next.git include/uapi/linux/nl80211.h

This brings in nl80211 definitions as of 2022-01-04. In addition, update
nl80211_command_to_string() to cover the new defined commands.

Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agotests: WPA2-PSK-FT and different OCV capability between APs
Jouni Malinen [Wed, 9 Feb 2022 15:30:02 +0000 (17:30 +0200)] 
tests: WPA2-PSK-FT and different OCV capability between APs

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agotests: Remove ignore_old_scan_res clearing from the test scripts
Jouni Malinen [Fri, 4 Feb 2022 19:29:52 +0000 (21:29 +0200)] 
tests: Remove ignore_old_scan_res clearing from the test scripts

Now that wpa_supplicant does this internally as a part of the FLUSH
command, there is no need for the test scripts to try to clear the
parameter between test cases.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agoClear ignore_old_scan_res on FLUSH command
Jouni Malinen [Fri, 4 Feb 2022 19:26:24 +0000 (21:26 +0200)] 
Clear ignore_old_scan_res on FLUSH command

The hwsim test cases are trying to clear this parameter between test
cases, but that was not really done correctly for many of the sigma_dut
test cases. Instead of fixing the text scripts to do this more
carefully, it seems to be simpler to just force the FLUSH command to
clear this.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agotests: Use a more reasonable age for a scan result in scan_parsing
Jouni Malinen [Fri, 4 Feb 2022 19:24:19 +0000 (21:24 +0200)] 
tests: Use a more reasonable age for a scan result in scan_parsing

This test case could fail in some sequences like "sigma_dut_sae
scan_parsing" due to the ignore_old_scan_res parameter accidentally
being left to 1 by the former test case and the simulated scan result
being older than the previous scan trigger. Reduce the age of that scan
entry to make this less likely to happen.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agoAdd QCA vendor MCC channel quota command and event
Liangwei Dong [Tue, 28 Dec 2021 06:42:02 +0000 (14:42 +0800)] 
Add QCA vendor MCC channel quota command and event

Add QCA_NL80211_VENDOR_SUBCMD_MCC_QUOTA. When two or more interfaces are
active on the same band and two different home channels (MCC), the
target may allocate quota of "on channel" time for each home channel.
The target will indicate the quota information to application layer with
this event. Application may do TX bitrate control based on the
information. The user may also set the MCC quota for an interface by
using this command.

Signed-off-by: Liangwei Dong <quic_liangwei@quicinc.com>
Signed-off-by: Madhvapathi Sriram <quic_msriram@quicinc.com>
3 years agoWhitespace/coding style cleanup for QCA vendor attribute definitions
Jouni Malinen [Fri, 4 Feb 2022 16:22:17 +0000 (18:22 +0200)] 
Whitespace/coding style cleanup for QCA vendor attribute definitions

Use more consistent style with whitespace around enums.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agoVendor command to configure rate mask
Jayachandran Sreekumaran [Wed, 22 Dec 2021 05:42:30 +0000 (11:12 +0530)] 
Vendor command to configure rate mask

Introduce a new vendor command
QCA_NL80211_VENDOR_SUBCMD_RATEMASK_CONFIG. This is used to set the rate
mask config to be used in MCS rate selection per PHY type.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agoRename moderate latency level to XR latency level in vendor attributes
Nirav Shah [Tue, 25 Jan 2022 04:56:52 +0000 (10:26 +0530)] 
Rename moderate latency level to XR latency level in vendor attributes

Currently the moderate latency level is not used. Rename the moderate
latency level to XR latency level to be used in XR (extended reality)
applications.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agonl80211: Clear frequency information on leaving mesh
Jouni Malinen [Thu, 3 Feb 2022 22:31:20 +0000 (00:31 +0200)] 
nl80211: Clear frequency information on leaving mesh

Not doing this was resulting in test failures with many sequences of a
mesh test case (e.g., wpas_mesh_peer_connected) followed by
ap_csa_1_switch which was checking the driver wrapper frequency
information at the beginning.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agoDPP: Use a 120 second timeout for GAS query
Jouni Malinen [Thu, 3 Feb 2022 15:14:16 +0000 (17:14 +0200)] 
DPP: Use a 120 second timeout for GAS query

This is needed since the gas_query_req() operation could remain waiting
indefinitely for the response if the Configurator keeps sending out
comeback responses with additional delay. The DPP technical
specification expects the Enrollee to continue sending out new Config
Requests for 60 seconds, so this gives an extra 60 second time after the
last expected new Config Request for the Configurator to determine what
kind of configuration to provide.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agoGAS server: Increase query timeout to 60 seconds for DPP
Jouni Malinen [Thu, 3 Feb 2022 09:36:43 +0000 (11:36 +0200)] 
GAS server: Increase query timeout to 60 seconds for DPP

DPP Enrollee might wait for the configuration for 60 seconds, so
increase the DPP Configurator timeout for the GAS server operation to 60
seconds to cover that full wait time. This is needed for cases where
user interaction can take significant amount of time before the
configuration response can be generated.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>