]> git.ipfire.org Git - thirdparty/hostap.git/log
thirdparty/hostap.git
3 years agotests: Skip sae_pwe_group_25 with BoringSSL
Jouni Malinen [Fri, 15 Apr 2022 10:36:35 +0000 (13:36 +0300)] 
tests: Skip sae_pwe_group_25 with BoringSSL

BoringSSL does not support this 192-bit EC group, so do not try to run
the test case that is known to fail.

Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agoBoringSSL: Use accessor functions for X509 key usage flags
Jouni Malinen [Fri, 15 Apr 2022 09:58:03 +0000 (12:58 +0300)] 
BoringSSL: Use accessor functions for X509 key usage flags

BoringSSL commit dddb60eb9700110835ff6e2b429de40a17006429 ("Make most of
crypto/x509 opaque.") broke the direct access to these variables, so use
the accessor functions instead.

Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agoBoringSSL: Replace stack-allocated X509_STORE_CTX with heap one
Jouni Malinen [Fri, 15 Apr 2022 09:50:51 +0000 (12:50 +0300)] 
BoringSSL: Replace stack-allocated X509_STORE_CTX with heap one

BoringSSL commit dddb60eb9700110835ff6e2b429de40a17006429 ("Make most of
crypto/x509 opaque.") broke the stack-allocated version, so move to
using X509_STORE_CTX_new() to get an opaque pointer to X509_STORE_CTX
instead.

Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agotests: Build with LibreSSL 3.4
Jouni Malinen [Fri, 15 Apr 2022 09:34:05 +0000 (12:34 +0300)] 
tests: Build with LibreSSL 3.4

Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agoOpenSSL: Fix build with BoringSSL and LibreSSL 3.3.x and older
Jouni Malinen [Fri, 15 Apr 2022 09:19:52 +0000 (12:19 +0300)] 
OpenSSL: Fix build with BoringSSL and LibreSSL 3.3.x and older

Define the EC_GROUP_get_curve() wrapper for the older versions.

Fixes: 3c61f4db4c3b ("OpenSSL: Replace EC_GROUP_get_curve_GFp() calls with EC_GROUP_get_curve()")
Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agoOpenSSL: CMAC using the OpenSSL library for non-FIPS cases as well
Jouni Malinen [Fri, 15 Apr 2022 08:14:51 +0000 (11:14 +0300)] 
OpenSSL: CMAC using the OpenSSL library for non-FIPS cases as well

Commit 0b5e98557eca ("FIPS: Use OpenSSL CMAC implementation instead of
aes-omac1.c") added this implementation initially only for the FIPS
builds. However, there does not seem to be any remaining need to avoid
depending on the OpenSSL library implementation for builds, so move to
that implementation unconditionally to reduce the binary size a bit.

Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agoOpenSSL: Implement CMAC using the EVP_MAC API
Jouni Malinen [Fri, 15 Apr 2022 08:02:54 +0000 (11:02 +0300)] 
OpenSSL: Implement CMAC using the EVP_MAC API

OpenSSL 3.0 deprecated the low-level CMAC functions, so use the new
EVP_MAC API for this. Maintain the CMAC API variant for older versions.

Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agoOpenSSL: Extend CMAC to support 192-bit AES
Jouni Malinen [Fri, 15 Apr 2022 08:59:01 +0000 (11:59 +0300)] 
OpenSSL: Extend CMAC to support 192-bit AES

This is used with DPP and SAE when using P-384, so prepare the OpenSSL
implementation to support these cases to allow the internal CMAC
implementation in aes-omac1.c to be replaced.

Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agoOpenSSL: Remove now unused compatibility wrapper for RSA_bits()
Jouni Malinen [Fri, 15 Apr 2022 08:26:26 +0000 (11:26 +0300)] 
OpenSSL: Remove now unused compatibility wrapper for RSA_bits()

This function is not used anymore, but the compatibility wrapper for
older OpenSSL versions was forgotten to be removed.

Fixes: 09c62aaf11a7 ("OpenSSL: Determine RSA key size without low-level routines")
Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agoAndroid: Compile hs20-osu-client to /vendor/bin in test builds
Chenming Huang [Sun, 10 Apr 2022 01:02:08 +0000 (09:02 +0800)] 
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 agotests: sigma_dut DPP URI curves list override
Jouni Malinen [Thu, 14 Apr 2022 14:06:02 +0000 (17:06 +0300)] 
tests: sigma_dut DPP URI curves list override

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agotests: DPP URI supported curves
Jouni Malinen [Thu, 14 Apr 2022 13:59:15 +0000 (16:59 +0300)] 
tests: DPP URI supported curves

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agoDPP: Allow a list of supported curves to be used in bootstrapping URI
Jouni Malinen [Thu, 14 Apr 2022 13:57:11 +0000 (16:57 +0300)] 
DPP: Allow a list of supported curves to be used in bootstrapping URI

The new DPP_BOOTSTRAP_GEN command parameter supported_curves can be used
to specify a colon separated list of supported curves. Information from
a parsed URI shows this information with a new supp_curves line in the
DPP_BOOTSTRAP_INFO output.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agotests: Fetch commitid on the host when running tests in a VM
Jouni Malinen [Thu, 14 Apr 2022 08:59:22 +0000 (11:59 +0300)] 
tests: Fetch commitid on the host when running tests in a VM

git has started rejecting repositories owned by other users and refusing
to run the "git rev-parse HEAD" command in this type of cases. That
resulted in issues with the VM testing model where the VM is practically
running everything as root while the host is a normal development
environment and likely a non-root user owned files.

Fix this by fetching the commitid on the host and pass it to the VM so
that no git operations need to be run within the VM itself.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agotests: Handle git rev-parse failures more robustly
Jouni Malinen [Thu, 14 Apr 2022 08:50:41 +0000 (11:50 +0300)] 
tests: Handle git rev-parse failures more robustly

Do not add the --commit argument if the current git commitid cannot be
determined. This prevents complete failure to run the tests if the git
command cannot be used for some reason (like a recent change that
stopped allowing root user within the VM from running the git operation
for the case where the host system uses non-root account).

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agoQCA vendor command support to reset configuration for eLNA bypass
Sumit Agre [Mon, 28 Mar 2022 12:42:17 +0000 (18:12 +0530)] 
QCA vendor command support to reset configuration for eLNA bypass

Add support to reset eLNA bypass configuration to default behavior.
If value of 2 is configured, the driver can choose either to
disable/enable eLNA bypass control and there is no enforcement
from userspace.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agoOpenSSL: Implement DH using the EVP API
Jouni Malinen [Sun, 10 Apr 2022 15:14:10 +0000 (18:14 +0300)] 
OpenSSL: Implement DH using the EVP API

OpenSSL 3.0 deprecated the low-level DH functions, so use the EVP API
for this. Maintain the DH API variant for older versions.

Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agoOpenSSL: Implement HMAC using the EVP_MAC API
Jouni Malinen [Sat, 9 Apr 2022 21:07:39 +0000 (00:07 +0300)] 
OpenSSL: Implement HMAC using the EVP_MAC API

OpenSSL 3.0 deprecated the low-level HMAC functions, so use the EVP_MAC
API for this. Maintain the HMAC API variant for older versions.

Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agoOpenSSL: Unload providers on deinit
Jouni Malinen [Sat, 9 Apr 2022 21:19:02 +0000 (00:19 +0300)] 
OpenSSL: Unload providers on deinit

This frees up the allocated resources and makes memory leak detection
more convenient without the known allocations being left behind.

Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agoOpenSSL: Implement AES keywrap using the EVP API
Jouni Malinen [Sat, 9 Apr 2022 18:11:10 +0000 (21:11 +0300)] 
OpenSSL: Implement AES keywrap using the EVP API

OpenSSL 3.0 deprecated the low-level encryption functions, so use the
EVP API for this. Maintain the previous version for BoringSSL and
LibreSSL since not all versions seem to have the EVP_aes_*_wrap()
functions needed for the EVP API.

Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agoOpenSSL: Use a correct EVP_CIPHER_CTX freeing function on an error path
Jouni Malinen [Sat, 9 Apr 2022 17:42:36 +0000 (20:42 +0300)] 
OpenSSL: Use a correct EVP_CIPHER_CTX freeing function on an error path

aes_encrypt_init() used incorrect function to free the EVP_CIPHER_CTX
allocated within this function. Fix that to use the OpenSSL function for
freeing the context.

Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agotests: Use build_beacon_request() to make beacon request more readable
Jouni Malinen [Sat, 9 Apr 2022 16:37:58 +0000 (19:37 +0300)] 
tests: Use build_beacon_request() to make beacon request more readable

Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agotests: Beacon request - active scan mode and NO_IR channel
Jouni Malinen [Sat, 9 Apr 2022 16:17:00 +0000 (19:17 +0300)] 
tests: Beacon request - active scan mode and NO_IR channel

Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agoRRM: Include passive channels in active beacon report scan
Avraham Stern [Thu, 3 Mar 2022 23:39:03 +0000 (01:39 +0200)] 
RRM: Include passive channels in active beacon report scan

When receiving a beacon report request with the mode set to active,
channels that are marked as NO_IR were not added to the scan request.
However, active mode just mean that active scan is allowed, but not
that it is a must, so these channels should not be omitted.
Include channels that are marked as NO_IR in the scan request even
if the mode is set to active.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
3 years agowpa_supplicant: Use unique IDs for networks and credentials
Naïm Favier [Mon, 7 Feb 2022 20:01:39 +0000 (21:01 +0100)] 
wpa_supplicant: Use unique IDs for networks and credentials

The id and cred_id variables are reset to 0 every time the
wpa_config_read() function is called, which is fine as long as it is
only called once. However, this is not the case when using both the -c
and -I options to specify two config files.

This is a problem because the GUI, since commit eadfeb0e9374 ("wpa_gui:
Show entire list of networks"), relies on the network IDs being unique
(and increasing), and might get into an infinite loop otherwise.

This is solved by simply making the variables static.

Signed-off-by: Naïm Favier <n@monade.li>
3 years agoUpdate IEEE P802.11ax draft references to published amendment
Jouni Malinen [Fri, 8 Apr 2022 16:36:22 +0000 (19:36 +0300)] 
Update IEEE P802.11ax draft references to published amendment

Get rid of the old references to drafts since the amendment has been
published.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agoAdd Transmit Power Envelope element in 6 GHz
Pradeep Kumar Chitrapu [Thu, 7 Apr 2022 23:56:54 +0000 (16:56 -0700)] 
Add Transmit Power Envelope element in 6 GHz

Add Transmit Power Envelope element for 6 GHz per IEEE Std
802.11ax-2021.

Currently, this uses hard coded EIRP/PSD limits which are applicable to
6 GHz operation in United states, Japan, and Korea. Support to extract
power limits from kernel data will be added after complete regulatory
support is added for the 6 GHz band.

Signed-off-by: Pradeep Kumar Chitrapu <quic_pradeepc@quicinc.com>
3 years agoExtend 6 GHz Operation Info field in HE Operation element
Pradeep Kumar Chitrapu [Thu, 7 Apr 2022 23:56:52 +0000 (16:56 -0700)] 
Extend 6 GHz Operation Info field in HE Operation element

Add new field definitions for the 6 GHz Operation Information field in
the HE Operation element per IEEE Std 802.11ax-2021, 9.4.2.249. These
will be used for TPC operation in the 6 GHz band.

Signed-off-by: Pradeep Kumar Chitrapu <quic_pradeepc@quicinc.com>
3 years agohostapd: Add config option to specify 6 GHz regulatory AP type
Pradeep Kumar Chitrapu [Thu, 7 Apr 2022 23:56:53 +0000 (16:56 -0700)] 
hostapd: Add config option to specify 6 GHz regulatory AP type

IEEE Std 802.11ax-2021 introduces Regulatory Info subfield to specify
the 6 GHz access point type per regulatory. Add a user config option for
specifying this.

When not specified, Indoor AP type is selected for the 6 GHz AP by
default.

Signed-off-by: Pradeep Kumar Chitrapu <quic_pradeepc@quicinc.com>
3 years agohostapd: Extend Country element to support 6 GHz band
Pradeep Kumar Chitrapu [Thu, 7 Apr 2022 23:56:51 +0000 (16:56 -0700)] 
hostapd: Extend Country element to support 6 GHz band

Add support for the Country element for the 6 GHz band per IEEE Std
802.11ax-2021, 9.4.2.8 (Country element).

Signed-off-by: Pradeep Kumar Chitrapu <quic_pradeepc@quicinc.com>
3 years agoPASN: Fix build without CONFIG_TESTING_OPTIONS=y
Jouni Malinen [Wed, 6 Apr 2022 21:44:46 +0000 (00:44 +0300)] 
PASN: Fix build without CONFIG_TESTING_OPTIONS=y

force_kdk_derivation is defined within CONFIG_TESTING_OPTIONS, so need
to use matching condition when accessing it.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agowpa_supplicant: Do not associate on 6 GHz with forbidden configurations
Ilan Peer [Sun, 6 Mar 2022 15:49:34 +0000 (17:49 +0200)] 
wpa_supplicant: Do not associate on 6 GHz with forbidden configurations

On the 6 GHz band the following is not allowed (see IEEE Std
802.11ax-2021, 12.12.2), so do not allow association with an AP using
these configurations:

- WEP/TKIP pairwise or group ciphers
- WPA PSK AKMs
- SAE AKM without H2E

In addition, do not allow association if the AP does not advertise a
matching RSNE or does not declare that it is MFP capable.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
3 years agoSAE-PK: Add the option to the defconfigs
Yegor Yefremov [Sun, 3 Apr 2022 06:19:05 +0000 (08:19 +0200)] 
SAE-PK: Add the option to the defconfigs

So far, this option was only present in the Makefiles. Document it as
being available for configuration since the WFA program has already been
launched.

Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
3 years agotests: EAP-TLSv1.3 with OCSP stapling
Jouni Malinen [Wed, 6 Apr 2022 17:22:45 +0000 (20:22 +0300)] 
tests: EAP-TLSv1.3 with OCSP stapling

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agotests: EAP-TLSv1.3 and fragmentation
Jouni Malinen [Wed, 6 Apr 2022 17:06:23 +0000 (20:06 +0300)] 
tests: EAP-TLSv1.3 and fragmentation

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agoEAP-TLS: Allow TLSv1.3 support to be enabled with build config
Jouni Malinen [Wed, 6 Apr 2022 13:13:22 +0000 (16:13 +0300)] 
EAP-TLS: Allow TLSv1.3 support to be enabled with build config

The default behavior in wpa_supplicant is to disable use of TLSv1.3 in
EAP-TLS unless explicitly enabled in network configuration. The new
CONFIG_EAP_TLSV1_3=y build parameter can be used to change this to
enable TLSv1.3 by default (if supported by the TLS library).

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agotests: EAP-TLSv1.3 and missing protected success indication
Jouni Malinen [Tue, 5 Apr 2022 20:50:56 +0000 (23:50 +0300)] 
tests: EAP-TLSv1.3 and missing protected success indication

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agoEAP-TLS: Testing functionality to skip protected success indication
Jouni Malinen [Tue, 5 Apr 2022 20:51:13 +0000 (23:51 +0300)] 
EAP-TLS: Testing functionality to skip protected success indication

This server side testing functionality can be used to test EAP-TLSv1.3
peer behavior.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agoDisconnect STA on continuous EAP reauth without 4-way handshake completion
Jouni Malinen [Wed, 6 Apr 2022 12:26:36 +0000 (15:26 +0300)] 
Disconnect STA on continuous EAP reauth without 4-way handshake completion

It could have been possible to get into an endless loop of retried EAP
authentication followed by failing or not completed 4-way handshake if
there was a different interpretation of EAP authentication result
(success on AP, failure on STA). Avoid this by limiting the number of
consecutive EAPOL reauth attempts without completing the following 4-way
handshake.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agoEAP-TLS: Do not allow TLSv1.3 success without protected result indication
Jouni Malinen [Wed, 6 Apr 2022 12:14:18 +0000 (15:14 +0300)] 
EAP-TLS: Do not allow TLSv1.3 success without protected result indication

RFC 9190 requires protected result indication to be used with TLSv1.3,
so do not allow EAP-TLS to complete successfully if the server does not
send that indication.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agoStop authentication attemps if AP does not disconnect us
Jouni Malinen [Wed, 6 Apr 2022 12:12:06 +0000 (15:12 +0300)] 
Stop authentication attemps if AP does not disconnect us

It would have been possible for the authentication attemps to go into a
loop if the AP/Authenticator/authentication server were to believe EAP
authentication succeeded when the local conclusion in Supplicant was
failure. Avoid this by timing out authentication immediately on the
second consecutive EAP authentication failure.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agoEAP-TLS: Replace the Commitment Message term with RFC 9190 language
Jouni Malinen [Tue, 5 Apr 2022 20:05:45 +0000 (23:05 +0300)] 
EAP-TLS: Replace the Commitment Message term with RFC 9190 language

While the drafts for RFC 9190 used a separate Commitment Message term,
that term was removed from the published RFC. Update the debug prints to
match that final language.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agoEAP-TLS: Update specification references to RFC 5216 and 9190
Jouni Malinen [Tue, 5 Apr 2022 19:56:13 +0000 (22:56 +0300)] 
EAP-TLS: Update specification references to RFC 5216 and 9190

The previously used references were pointing to an obsoleted RFC and
draft versions. Replace these with current versions.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agoAndroid: Avoid LOCAL_PATH conflicts in builds
Chenming Huang [Tue, 5 Apr 2022 02:40:21 +0000 (10:40 +0800)] 
Android: Avoid LOCAL_PATH conflicts in builds

Change the top level Android.mk's LOCAL_PATH to S_LOCAL_PATH to
avoid potential LOCAL_PATH conflict in subdirectory's LOCAL_PATH.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agoRevert "Android: Compile hs20-osu-client to /vendor/bin in test builds"
Jouni Malinen [Tue, 5 Apr 2022 16:31:40 +0000 (19:31 +0300)] 
Revert "Android: Compile hs20-osu-client to /vendor/bin in test builds"

This reverts commit 1192d5721b49a77579abf469d150b9e18e32be16. That
commit disabled hostapd and wpa_supplicant build in user build variants.
Furthermore, it used duplicated TARGET_BUILD_VARIANT checks between the
Android.mk files.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agotests: WPA2-PSK AP and GTK rekey failing with one STA
Jouni Malinen [Tue, 5 Apr 2022 14:25:24 +0000 (17:25 +0300)] 
tests: WPA2-PSK AP and GTK rekey failing with one STA

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agoAdd support for not transmitting EAPOL-Key group msg 2/2
Veerendranath Jakkam [Mon, 28 Feb 2022 11:27:37 +0000 (16:57 +0530)] 
Add support for not transmitting EAPOL-Key group msg 2/2

To support the STA testbed role, the STA has to disable transmitting
EAPOL-Key group msg 2/2 of Group Key Handshake. Add test parameter to
disable sending EAPOL-Key group msg 2/2 of Group Key Handshake.

Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
3 years agoFILS: Fix config check to allow unsolicited broadcast Probe Response
Karthikeyan Kathirvel [Thu, 31 Mar 2022 06:04:51 +0000 (11:34 +0530)] 
FILS: Fix config check to allow unsolicited broadcast Probe Response

Unsolicited broadcast Probe Response frame configuration did not work in
hostapd due fils_discovery_min_int being used by mistake where
fils_discovery_max_int should have been used in checking for conflicting
configuration. The latter is the one used to decide whether FILS
discovery is enabled or not.

Signed-off-by: Karthikeyan Kathirvel <quic_kathirve@quicinc.com>
3 years agotests: Opportunistic Wireless Encryption - duplicated association attempt
Jouni Malinen [Sat, 2 Apr 2022 14:16:51 +0000 (17:16 +0300)] 
tests: Opportunistic Wireless Encryption - duplicated association attempt

Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agoOWE: Reuse own DH private key in AP if STA tries OWE association again
Jouni Malinen [Sat, 2 Apr 2022 14:15:41 +0000 (17:15 +0300)] 
OWE: Reuse own DH private key in AP if STA tries OWE association again

This is a workaround for mac80211 behavior of retransmitting the
Association Request frames multiple times if the link layer retries
(i.e., seq# remains same) fail. The mac80211 initiated retransmission
will use a different seq# and as such, will go through duplicate
detection. If we were to change our DH key for that attempt, there would
be two different DH shared secrets and the STA would likely select the
wrong one.

Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agohostapd: Add the missing CONFIG_SAE option to the defconfig
Yegor Yefremov [Wed, 30 Mar 2022 08:11:16 +0000 (10:11 +0200)] 
hostapd: Add the missing CONFIG_SAE option to the defconfig

CONFIG_SAE was added to wpa_supplicant's defconfig but wasn't
added to the hostapd's defconfig file.

Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
3 years agoFix SIGSEGV of eapol_test
Masashi Honma [Fri, 1 Apr 2022 23:13:49 +0000 (08:13 +0900)] 
Fix SIGSEGV of eapol_test

Running eapol_test to FreeRADIUS 3.0.25 causes trailing SIGSEGV.

WPA_TRACE: eloop SIGSEGV - START
[1]: ./eapol_test(+0x67de6) [0x55b84fa4ade6]
     eloop_sigsegv_handler() ../src/utils/eloop.c:123
[2]: /lib/x86_64-linux-gnu/libc.so.6(+0x430c0) [0x7fec94ad20c0]
[3]: ./eapol_test(dpp_tcp_conn_status_requested+0x4) [0x55b84fa7e674]
     dpp_tcp_conn_status_requested() ../src/common/dpp_tcp.c:2246
[4]: ./eapol_test(wpas_dpp_connected+0x3c) [0x55b84fa816dc]
     wpas_dpp_connected() dpp_supplicant.c:437
[5]: ./eapol_test(wpa_supplicant_set_state+0x48d) [0x55b84fc12c9d]
     wpa_supplicant_set_state() wpa_supplicant.c:1067
[6]: ./eapol_test(eapol_sm_step+0x4b4) [0x55b84fb3b994]
     sm_SUPP_PAE_Step() ../src/eapol_supp/eapol_supp_sm.c:419
     eapol_sm_step() ../src/eapol_supp/eapol_supp_sm.c:989
[7]: ./eapol_test(eapol_sm_rx_eapol+0x190) [0x55b84fb3c060]
     eapol_sm_rx_eapol() ../src/eapol_supp/eapol_supp_sm.c:1293
[8]: ./eapol_test(+0x24760f) [0x55b84fc2a60f]
     ieee802_1x_decapsulate_radius() eapol_test.c:834
     ieee802_1x_receive_auth() eapol_test.c:945
[9]: ./eapol_test(+0x248d46) [0x55b84fc2bd46]
     radius_client_receive() ../src/radius/radius_client.c:937
[10]: ./eapol_test(+0x68323) [0x55b84fa4b323]
     eloop_sock_table_dispatch() ../src/utils/eloop.c:606
[11]: ./eapol_test(eloop_run+0x251) [0x55b84fa4be51]
     eloop_sock_table_dispatch() ../src/utils/eloop.c:597
     eloop_run() ../src/utils/eloop.c:1234
[12]: ./eapol_test(main+0x8cf) [0x55b84fa30d6f]
     main() eapol_test.c:1517
WPA_TRACE: eloop SIGSEGV - END
Aborted (core dumped)

Fixes: 33cb47cf0191 ("DPP: Fix connection result reporting when using TCP")
Reported-by: Alexander Clouter <alex+hostapd@coremem.com>
Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
3 years agoieee802_11_auth: Coding style cleanup - NULL comparison
Jouni Malinen [Sat, 2 Apr 2022 13:29:31 +0000 (16:29 +0300)] 
ieee802_11_auth: Coding style cleanup - NULL comparison

Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agoieee802_11_auth: Coding style cleanup - no string constant splitting
Jouni Malinen [Sat, 2 Apr 2022 13:28:12 +0000 (16:28 +0300)] 
ieee802_11_auth: Coding style cleanup - no string constant splitting

Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agotests: wpa_psk_radius=3
Jouni Malinen [Sat, 2 Apr 2022 10:12:34 +0000 (13:12 +0300)] 
tests: wpa_psk_radius=3

Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agoRADIUS ACL/PSK check during 4-way handshake
Jouni Malinen [Sat, 2 Apr 2022 10:12:43 +0000 (13:12 +0300)] 
RADIUS ACL/PSK check during 4-way handshake

Add an alternative sequence for performing the RADIUS ACL check and PSK
fetch. The previously used (macaddr_acl=2, wpa_psk_radius=2) combination
does this during IEEE 802.11 Authentication frame exchange while the new
option (wpa_psk_radius=3) does this during the 4-way handshake. This
allows some more information to be provided to the RADIUS authentication
server.

Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agoFix AP config check to recognize all PSK AKMs
Jouni Malinen [Sat, 2 Apr 2022 10:16:18 +0000 (13:16 +0300)] 
Fix AP config check to recognize all PSK AKMs

The check for PSK/passphrase not being present was considering only the
WPA-PSK AKM, but the same check should be applied for all other AKMs
that can use a PSK.

Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agoQCA vendor attribute to indicate NDP interface managemtn using nl80211
Kiran Kumar Lokere [Thu, 24 Mar 2022 23:57:22 +0000 (16:57 -0700)] 
QCA vendor attribute to indicate NDP interface managemtn using nl80211

Add a QCA_WLAN_VENDOR_FEATURE_USE_ADD_DEL_VIRTUAL_INTF_FOR_NDI
flag to indicate that the driver requires add/del virtual interface
path using the generic nl80211 commands for NDP interface create/delete
and to register/unregister of netdev instead of creating/deleting
the NDP interface using vendor commands.

With the latest Linux kernel (5.12 version onward), interface
creation/deletion is not allowed using vendor commands as it leads to a
deadlock while acquiring the RTNL_LOCK during the register/unregister of
netdev. Create and delete NDP interface using NL80211_CMD_NEW_INTERFACE
and NL80211_CMD_DEL_INTERFACE commands respectively if the driver
advertises this capability.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agoFT: Update current_bss to target AP before check for SME-in-driver
Xin Deng [Thu, 10 Feb 2022 08:29:19 +0000 (16:29 +0800)] 
FT: Update current_bss to target AP before check for SME-in-driver

STA needs to check AP's information after receive reassociation
response. STA uses connected AP's Beacon/Probe Response frame to compare
with Reassociation Response frame of the target AP currently. However,
if one AP supports OCV and the other AP doesn't support OCV, STA will
fail to verify RSN capability, then disconnect. Update current_bss to
the target AP before check, so that STA can compare correct AP's RSN
information in Reassociation Response frame.

Signed-off-by: Xin Deng <quic_deng@quicinc.com>
3 years agoDebug print on CONFIG_NO_TKIP=y prevent RSNE with TKIP as group cipher
Jouni Malinen [Fri, 1 Apr 2022 08:12:09 +0000 (11:12 +0300)] 
Debug print on CONFIG_NO_TKIP=y prevent RSNE with TKIP as group cipher

This makes the debug log clearer for one of the more likely cases of
"invalid group cipher" preventing RSNE parsing.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agoP2P: Copy only valid opclasses while filtering out 6 GHz channels
Sreeramya Soratkal [Fri, 11 Feb 2022 13:44:04 +0000 (19:14 +0530)] 
P2P: Copy only valid opclasses while filtering out 6 GHz channels

Copy channels from only valid operating classes in the source channel
list while preparing a non-6 GHz channel/op-classes list when the 6 GHz
band is not used for P2P GO negotiation.

Earlier, during preparation of P2P channels for GO negotiation, a union
of the GO channels and the P2P Client channels is used. While generating
the union in p2p_channels_union_inplace() as the first list itself has
P2P_MAX_REG_CLASSES number of entries, the operating classes from the
second list which are not in the first list were not getting considered.

Fix this by not setting the dst->reg_classes to too large a value.

Fixes: f7d4f1cbec34 ("P2P: Add a mechanism for allowing 6 GHz channels in channel lists")
Signed-off-by: Sreeramya Soratkal <quic_ssramya@quicinc.com>
3 years agoSync with wireless-next.git include/uapi/linux/nl80211.h
Jouni Malinen [Mon, 28 Mar 2022 14:18:08 +0000 (17:18 +0300)] 
Sync with wireless-next.git include/uapi/linux/nl80211.h

This brings in nl80211 definitions as of 2022-03-11.

Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agotests: wpa_supplicant AP mode - ACL management
Jouni Malinen [Thu, 24 Mar 2022 21:22:42 +0000 (23:22 +0200)] 
tests: wpa_supplicant AP mode - ACL management

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agowpa_cli: Add ACL and BTM control commands
Chaoli Zhou [Thu, 24 Feb 2022 08:27:58 +0000 (16:27 +0800)] 
wpa_cli: Add ACL and BTM control commands

Add AP mode commands for ACL and BTM into wpa_cli similarly to the way
these were already available in hostapd_cli.

Signed-off-by: Chaoli Zhou <quic_zchaoli@quicinc.com>
3 years agoExtend ACL to install allow/deny list to the driver dynamically
Chaoli Zhou [Thu, 24 Mar 2022 07:19:25 +0000 (15:19 +0800)] 
Extend ACL to install allow/deny list to the driver dynamically

Support installing the updated allow/deny list to the driver if it
supports ACL offload. Previously, only the not-offloaded cases were
updated dynamically.

Signed-off-by: Chaoli Zhou <quic_zchaoli@quicinc.com>
3 years agoSet drv_max_acl_mac_addrs in wpa_supplicant AP mode
Chaoli Zhou [Thu, 24 Mar 2022 07:19:25 +0000 (15:19 +0800)] 
Set drv_max_acl_mac_addrs in wpa_supplicant AP mode

hostapd code will need this for offloading ACL to the driver.

Signed-off-by: Chaoli Zhou <quic_zchaoli@quicinc.com>
3 years agoSupport ACL operations in wpa_supplicant AP mode
Chaoli Zhou [Thu, 24 Mar 2022 06:34:18 +0000 (14:34 +0800)] 
Support ACL operations in wpa_supplicant AP mode

Extend AP mode ACL control interface commands to work from
wpa_supplicant in addition to the previously supported hostapd case.

Signed-off-by: Chaoli Zhou <quic_zchaoli@quicinc.com>
3 years agoAdd return value to ACL functions
Chaoli Zhou [Thu, 24 Mar 2022 07:19:25 +0000 (15:19 +0800)] 
Add return value to ACL functions

While these do not return error code within the current hostapd
implementation, matching functions in wpa_supplicant AP functionality
will have an error case and using consistent return type will make the
control interface code more consistent.

In addition, export hostapd_set_acl() in preparation for the
wpa_supplicant control interface implementation extension.

Signed-off-by: Chaoli Zhou <quic_zchaoli@quicinc.com>
3 years agoMove ACL control interface commands into shared files
Chaoli Zhou [Thu, 24 Mar 2022 05:48:57 +0000 (13:48 +0800)] 
Move ACL control interface commands into shared files

This is a step towards allowing these commands to be used from
wpa_supplicant.

Signed-off-by: Chaoli Zhou <quic_zchaoli@quicinc.com>
3 years agoAdd BSS-TM-QUERY event to indicate reception of BSS TM Query
Chaoli Zhou [Tue, 22 Mar 2022 20:47:12 +0000 (22:47 +0200)] 
Add BSS-TM-QUERY event to indicate reception of BSS TM Query

This allows upper layers to learn about associated stations requesting
BSS transition management from the AP.

Signed-off-by: Chaoli Zhou <quic_zchaoli@quicinc.com>
3 years agoSupport BTM operations in wpa_supplicant AP mode
Chaoli Zhou [Tue, 22 Mar 2022 20:47:12 +0000 (22:47 +0200)] 
Support BTM operations in wpa_supplicant AP mode

Extend AP mode BTM control interface commands to work from
wpa_supplicant in additiona to the previously support hostapd case.

Signed-off-by: Chaoli Zhou <quic_zchaoli@quicinc.com>
3 years agoMove BTM control interface commands into shared file
Chaoli Zhou [Tue, 22 Mar 2022 20:47:12 +0000 (22:47 +0200)] 
Move BTM control interface commands into shared file

This is a step towards allowing these commands to be used from
wpa_supplicant.

Signed-off-by: Chaoli Zhou <quic_zchaoli@quicinc.com>
3 years agoUpdate the Extended Capability element to struct sta_info
Chaoli Zhou [Tue, 22 Mar 2022 09:53:21 +0000 (11:53 +0200)] 
Update the Extended Capability element to struct sta_info

Only the SME-in-hostapd case updated sta->ext_capability while the
SME-in-the-driver case updated sta->qos_map_enabled, but not other items
related to the extended capabilities. This resulted in reduced
information being available through the control interface.

Use the shared helper function for both cases to get matching
information available regardless of the SME architecture.

Signed-off-by: Chaoli Zhou <quic_zchaoli@quicinc.com>
3 years agoEnable BSS Transition Management in wpa_supplicant AP mode
Chaoli Zhou [Mon, 21 Mar 2022 05:38:45 +0000 (13:38 +0800)] 
Enable BSS Transition Management in wpa_supplicant AP mode

Enable BTM capability for AP mode only and do not affect P2P GO mode.
This can be used for AP band steering when using wpa_supplicant to
control AP mode operations.

Signed-off-by: Chaoli Zhou <quic_zchaoli@quicinc.com>
3 years agoDPP: Update Controller parameters when it was already started
Jouni Malinen [Tue, 15 Mar 2022 19:10:31 +0000 (21:10 +0200)] 
DPP: Update Controller parameters when it was already started

dpp_configurator_params changes were taken into use in the
non-TCP/Controller case immediately on change, but that was not the case
for the Controller where this was updated only when explicitly starting
it. Change this to update dpp_configurator_params for the Controller as
well even if it is already running.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agoDPP: Fix msg_ctx for PKEX over TCP as Controller/Responder
Jouni Malinen [Tue, 15 Mar 2022 08:39:09 +0000 (10:39 +0200)] 
DPP: Fix msg_ctx for PKEX over TCP as Controller/Responder

PKEX Exchange Request handling in Controller used incorrect msg_ctx
pointer and that could result in event messages causing unexpected
behavior. Fix this by registering the correct msg_ctx pointer for these
cases.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agohs20-osu-client: dNSName values from OSU server certificate for PPS MO
Jouni Malinen [Mon, 14 Mar 2022 08:42:11 +0000 (10:42 +0200)] 
hs20-osu-client: dNSName values from OSU server certificate for PPS MO

The previous change to allow EST server to use a different host name
ended up overriding the OSU server certificate information and the
incorrect server certificate was used when comparing the SP FQDN from
the PPS MO if the OSU and EST servers where different. Fix this by
keeping the dNSName from the SPP interaction and not storing the values
from the EST interaction.

Fixes: 0ce8d55a2e1b ("hs20-osu-client: Allow EST server to use different host name")
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
3 years agoDFS: Remove unnecessary variable
Jouni Malinen [Sun, 13 Mar 2022 19:23:54 +0000 (21:23 +0200)] 
DFS: Remove unnecessary variable

This was not used for anything else than checking the value returned by
the called function.

Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agoDFS: Switch to background radar channel if available
Lorenzo Bianconi [Sun, 6 Mar 2022 19:34:14 +0000 (20:34 +0100)] 
DFS: Switch to background radar channel if available

On radar detection on the main chain switch to the channel monitored
by the background chain if we have already performed the CAC there.
If a radar pattern is reported on the background chain, just select a
new random channel according to the regulations for monitoring.

Tested-by: Owen Peng <owen.peng@mediatek.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
3 years agoDFS: Enable CSA for background radar detection
Lorenzo Bianconi [Sun, 6 Mar 2022 19:34:13 +0000 (20:34 +0100)] 
DFS: Enable CSA for background radar detection

Rely on hostapd_dfs_request_channel_switch() to enable CSA for
background radar detection switching back to the selected channel.

Tested-by: Owen Peng <owen.peng@mediatek.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
3 years agoDFS: Introduce hostapd_dfs_request_channel_switch()
Lorenzo Bianconi [Sun, 6 Mar 2022 19:34:12 +0000 (20:34 +0100)] 
DFS: Introduce hostapd_dfs_request_channel_switch()

This is a preliminary patch to add Channel Switch Announcement for
background radar detection.

Tested-by: Owen Peng <owen.peng@mediatek.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
3 years agoDFS: Configure background radar/CAC detection
Lorenzo Bianconi [Sun, 6 Mar 2022 19:34:11 +0000 (20:34 +0100)] 
DFS: Configure background radar/CAC detection

Introduce the capability to perform radar/CAC detection on an offchannel
radar chain available on some hardware (e.g., mt7915). This feature
allows to avoid CAC downtime switching on a different channel during CAC
detection on the selected radar channel.

Tested-by: Owen Peng <owen.peng@mediatek.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
3 years agonl80211: Radar background flag setting
Lorenzo Bianconi [Sun, 6 Mar 2022 19:34:11 +0000 (20:34 +0100)] 
nl80211: Radar background flag setting

Allow background radar detection flag to be set when specifying a
channel. 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 agoDFS: Rely on channel_type in dfs_downgrade_bandwidth()
Lorenzo Bianconi [Sun, 6 Mar 2022 19:34:10 +0000 (20:34 +0100)] 
DFS: Rely on channel_type in dfs_downgrade_bandwidth()

Add the capability to specify all 3 channel type possibilities in
dfs_downgrade_bandwidth(). This is a preliminary change to introduce
radar/CAC background detection support.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
3 years agotests: Clear country configuration at the end of wpas_ap_async_fail
Jouni Malinen [Sun, 13 Mar 2022 16:26:08 +0000 (18:26 +0200)] 
tests: Clear country configuration at the end of wpas_ap_async_fail

This was causing a failure in the following sequence:
wpas_ap_async_fail wpas_ctrl_country

Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agotests: Make DPP relay tests more robust
Jouni Malinen [Sun, 13 Mar 2022 16:18:28 +0000 (18:18 +0200)] 
tests: Make DPP relay tests more robust

Flush scan results to avoid failure caused by incorrect channel
selection based on an old result for the same BSSID. This was found with
the following test sequence:
ap_track_sta_no_auth dpp_network_intro_version_missing_req dpp_controller_relay_pkex

Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agoOpenSSL 3.0: Set SSL groups using SSL_set1_groups()
Jouni Malinen [Sun, 13 Mar 2022 09:25:04 +0000 (11:25 +0200)] 
OpenSSL 3.0: Set SSL groups using SSL_set1_groups()

The mechanism using SSL_set_tmp_ecdh() has been obsoleted and
SSL_set1_groups() takes care of it instead.

Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agoOpenSSL: Determine RSA key size without low-level routines
Jouni Malinen [Sun, 13 Mar 2022 09:21:00 +0000 (11:21 +0200)] 
OpenSSL: Determine RSA key size without low-level routines

RSA low-level routines were deprecated in OpenSSL 3.0.
EVP_PKEY_get_bits(), or its older and more backwards compatible name
EVP_PKEY_bits() can be used here instead.

Signed-off-by: Jouni Malinen <j@w1.fi>
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>