]> git.ipfire.org Git - thirdparty/hostap.git/log
thirdparty/hostap.git
3 years agowolfSSL: Speed up crypto_ec_point_compute_y_sqr()
Jouni Malinen [Sat, 23 Apr 2022 13:12:49 +0000 (16:12 +0300)] 
wolfSSL: Speed up crypto_ec_point_compute_y_sqr()

Optimize the calculation by computing (x^2 + a) first to get rid of one
separate multiplication by x.

Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agowolfSSL: Fix crypto_ec_point_compute_y_sqr() error case processing
Jouni Malinen [Sat, 23 Apr 2022 13:04:49 +0000 (16:04 +0300)] 
wolfSSL: Fix crypto_ec_point_compute_y_sqr() error case processing

The result (y2) was cleared and freed in error cases, but the pointer
itself was not cleared to NULL, so the error path would have returned a
pointer to freed memory. Fix this by properly clearing the return value
in error cases. In addition, simplify the function to avoid tracking
success case separately.

Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agowolfSSL: Fix the memory leak of crypto_ec_point_compute_y_sqr()
赵军涛 [Tue, 19 Apr 2022 09:31:35 +0000 (17:31 +0800)] 
wolfSSL: Fix the memory leak of crypto_ec_point_compute_y_sqr()

Local variable "t" needs to be cleared whether "calced" is 0 or 1.

Signed-off-by: 赵军涛 <d2014zjt@163.com>
3 years agowolfSSL: Use wc_HmacInit() to avoid potential use of uninitialized values
Jouni Malinen [Sat, 23 Apr 2022 12:45:31 +0000 (15:45 +0300)] 
wolfSSL: Use wc_HmacInit() to avoid potential use of uninitialized values

wc_HmacSetKey() seems to initialize everything that is needed for the
actual operation, but at least valgrind is reporting use of
uninitialized values when this was done on a data structure that was not
explicitly cleared.

Call wc_HmacInit() before wc_HmacSetKey() to avoid any unexpected
behavior from potentially uninitialized values.

Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agoOpenSSL: Fix build with BoringSSL
Jouni Malinen [Sat, 23 Apr 2022 10:05:49 +0000 (13:05 +0300)] 
OpenSSL: Fix build with BoringSSL

SSL_CTX_set_dh_auto() is not available in BoringSSL even though it
claims to be based on OpenSSL 1.1.1 in OPENSSL_VERSION_NUMBER.

Fixes: ebb3055e1302 ("OpenSSL: Generate DH parameters automatically if not set with dh_file")
Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agoOpenSSL: Remove compatibility options for older versions than 1.0.2
Jouni Malinen [Sat, 23 Apr 2022 10:02:37 +0000 (13:02 +0300)] 
OpenSSL: Remove compatibility options for older versions than 1.0.2

Anything older than OpenSSL 1.0.2 should not be used anymore, so drop
the build compatibility options for those old versions.

Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agoOpenSSL: Drop compatibility options for LibreSSL older than 2.7
Jouni Malinen [Sat, 23 Apr 2022 09:52:27 +0000 (12:52 +0300)] 
OpenSSL: Drop compatibility options for LibreSSL older than 2.7

Compilation was failing even with LibreSSL 2.7 versions, so there is no
point in maintaining these old compatibility options for older versions.

Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agoOpenSSL: Implement crypto_ecdh routines without EC_KEY for OpenSSL 3.0
Jouni Malinen [Sat, 23 Apr 2022 09:28:18 +0000 (12:28 +0300)] 
OpenSSL: Implement crypto_ecdh routines without EC_KEY for OpenSSL 3.0

OpenSSL 3.0 has deprecated the low-level EC_KEY functionality, so use
the EVP API (EVP_EC_gen() and EV_PKEY_derive()) for the crypto_ecdh
wrappers.

Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agoOpenSSL: Use new name for the EC_POINT set/get coordinate functions
Jouni Malinen [Sat, 23 Apr 2022 08:09:28 +0000 (11:09 +0300)] 
OpenSSL: Use new name for the EC_POINT set/get coordinate functions

OpenSSL 1.1.1 deprecated the function names with the _GFp postfix, so
move to the new function name. Add backwards compatibility wrappers for
older versions.

Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agoctrl: Print the source address of the received commands
xinpeng wang [Wed, 5 Jan 2022 08:54:59 +0000 (16:54 +0800)] 
ctrl: Print the source address of the received commands

Sometimes there is a program error to send a large number of commands to
wpa_supplicant, and the source address can help quickly find the program
that sends commands.

Signed-off-by: xinpeng wang <wangxinpeng@uniontech.com>
3 years agowpa_ctrl: Wait for a total of 10 seconds, not 10 seconds per iteration
Alan T. DeKok [Fri, 23 Jul 2021 09:57:43 +0000 (05:57 -0400)] 
wpa_ctrl: Wait for a total of 10 seconds, not 10 seconds per iteration

EINTR will cause the loop to restart, which means that the total
time could be significantly longer than 10 seconds.

Signed-off-by: Alan DeKok <aland@deployingradius.com>
3 years agowolfSSL: Fix certificate commonName checking
Jouni Malinen [Mon, 18 Apr 2022 13:45:42 +0000 (16:45 +0300)] 
wolfSSL: Fix certificate commonName checking

wolfSSL_X509_NAME_get_index_by_NID() uses NID_* to identify the entry.

Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agowolfSSL: Use wolfSSL_export_keying_material() when available
Jouni Malinen [Mon, 18 Apr 2022 13:27:47 +0000 (16:27 +0300)] 
wolfSSL: Use wolfSSL_export_keying_material() when available

This is needed to work with TLS 1.3 key derivation. It looks the needed
functionality was added in wolfSSL 4.7.0.

Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agotests: Fix SAE-PK capability checks for sigma_dut test cases
Jouni Malinen [Mon, 18 Apr 2022 08:20:33 +0000 (11:20 +0300)] 
tests: Fix SAE-PK capability checks for sigma_dut test cases

These were testing only of SAE, not SAE-PK capability, and needs to be
skipped in SAE-PK is not included in the build.

Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agotests: Check DPP in build for couple of missing cases
Jouni Malinen [Mon, 18 Apr 2022 08:11:29 +0000 (11:11 +0300)] 
tests: Check DPP in build for couple of missing cases

These test cases need to be skipped in DPP is not included in the build.

Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agowolfSSL: Fix crypto_dh_init() and dh5_init()
Jouni Malinen [Mon, 18 Apr 2022 08:01:23 +0000 (11:01 +0300)] 
wolfSSL: Fix crypto_dh_init() and dh5_init()

priv_sz and pub_sz needs to be initialized to the buffer size before the
wc_DhGenerateKeyPair() call. The previous version happened to work in
some cases where a separate handled prime length was used, but not for
the generic case.

Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agowolfSSL: Fix crypto_ecdh_* with ECC_TIMING_RESISTANT
Jouni Malinen [Sun, 17 Apr 2022 21:54:37 +0000 (00:54 +0300)] 
wolfSSL: Fix crypto_ecdh_* with ECC_TIMING_RESISTANT

It looks like crypto_ecdh_set_peerkey() had started failing at some
point with a wolfSSL update due to ECC_TIMING_RESISTANT from
--enable-harden requiring RNG to be set.

Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agoEAP-EKE server: Fix a memory leak on an error path
Jouni Malinen [Sun, 17 Apr 2022 20:37:50 +0000 (23:37 +0300)] 
EAP-EKE server: Fix a memory leak on an error path

The allocated Response/Commit message was not freed if DH initialization
failed.

Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agotests: Include additional tests for wolfSSL builds
Juliusz Sosinowicz [Thu, 26 Aug 2021 09:25:34 +0000 (11:25 +0200)] 
tests: Include additional tests for wolfSSL builds

Signed-off-by: Juliusz Sosinowicz <juliusz@wolfssl.com>
3 years agotests: Include EAP-pwd for wolfSSL builds
Juliusz Sosinowicz [Thu, 26 Aug 2021 09:25:34 +0000 (11:25 +0200)] 
tests: Include EAP-pwd for wolfSSL builds

Signed-off-by: Juliusz Sosinowicz <juliusz@wolfssl.com>
3 years agowolfSSL: TLS session caching
Juliusz Sosinowicz [Thu, 26 Aug 2021 09:25:34 +0000 (11:25 +0200)] 
wolfSSL: TLS session caching

Add support for EAP server to cache TLS sessions (see hostapd
configuration parameter tls_session_lifetime).

Signed-off-by: Juliusz Sosinowicz <juliusz@wolfssl.com>
3 years agowolfSSL: Add a debug logging callback
Juliusz Sosinowicz [Thu, 26 Aug 2021 09:25:34 +0000 (11:25 +0200)] 
wolfSSL: Add a debug logging callback

Signed-off-by: Juliusz Sosinowicz <juliusz@wolfssl.com>
3 years agowolfSSL: Implement tls_get_tls_unique()
Juliusz Sosinowicz [Thu, 26 Aug 2021 09:25:34 +0000 (11:25 +0200)] 
wolfSSL: Implement tls_get_tls_unique()

This is needed for EAP-TEAP. This needs wolfSSL 5.0.0 or newer.

Signed-off-by: Juliusz Sosinowicz <juliusz@wolfssl.com>
3 years agowolfSSL: Implement tls_connection_get_cipher_suite()
Juliusz Sosinowicz [Thu, 26 Aug 2021 09:25:34 +0000 (11:25 +0200)] 
wolfSSL: Implement tls_connection_get_cipher_suite()

This is needed for EAP-TEAP.

Signed-off-by: Juliusz Sosinowicz <juliusz@wolfssl.com>
3 years agowolfSSL: Implement tls_connection_get_peer_subject()
Juliusz Sosinowicz [Thu, 26 Aug 2021 09:25:34 +0000 (11:25 +0200)] 
wolfSSL: Implement tls_connection_get_peer_subject()

This is needed for EAP-TEAP server implementation.

Signed-off-by: Juliusz Sosinowicz <juliusz@wolfssl.com>
3 years agowolfSSL: Implement tls_connection_get_own_cert_used()
Juliusz Sosinowicz [Thu, 26 Aug 2021 09:25:34 +0000 (11:25 +0200)] 
wolfSSL: Implement tls_connection_get_own_cert_used()

This is needed for EAP-TEAP client implementation. This needs wolfSSL
5.0.0 or newer.

Signed-off-by: Juliusz Sosinowicz <juliusz@wolfssl.com>
3 years agowolfSSL: Conditional build for aes_wrap/aes_unwrap()
Juliusz Sosinowicz [Thu, 26 Aug 2021 09:25:34 +0000 (11:25 +0200)] 
wolfSSL: Conditional build for aes_wrap/aes_unwrap()

Signed-off-by: Juliusz Sosinowicz <juliusz@wolfssl.com>
3 years agoeapol_test: Update with src/ap/ieee802_1x.c changes
Jouni Malinen [Sun, 17 Apr 2022 09:04:14 +0000 (12:04 +0300)] 
eapol_test: Update with src/ap/ieee802_1x.c changes

eapol_test.c contains variants of couple of functions from the hostapd
implementation. Those had not been updated for a while and this commit
brings in the main changes to keep the implementations closer to
each other.

Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agoInclude MS_FUNCS=y for EAP-pwd peer build
Jouni Malinen [Sun, 17 Apr 2022 09:30:56 +0000 (12:30 +0300)] 
Include MS_FUNCS=y for EAP-pwd peer build

This is needed to allow wpa_supplicant to be built with EAP-pwd, but
without any other EAP method that pulled in MS_FUNCS.

Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agoInclude HMAC-SHA384/512 KDF for SAE if SHA384/512 is included
Jouni Malinen [Sun, 17 Apr 2022 09:28:41 +0000 (12:28 +0300)] 
Include HMAC-SHA384/512 KDF for SAE if SHA384/512 is included

It was possible to miss the HMAC functions if some other build
configuration parameters ended up setting NEED_SHA384/512=y.

Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agoACS: Honor acs_exclude_dfs with hostapd's ACS implementation
Nicolas Escande [Thu, 24 Mar 2022 12:46:00 +0000 (13:46 +0100)] 
ACS: Honor acs_exclude_dfs with hostapd's ACS implementation

The acs_exclude_dfs parameter is documented as a way to exclude DFS
channels when performing ACS without disabling DFS altogether. The
problem is this parameter is only enforced when ACS is offloaded to the
driver (WPA_DRIVER_FLAGS_ACS_OFFLOAD). So from now on, lets also check
acs_exclude_dfs in the internal ACS implementation to exclude channels
marked with radar detection.

Signed-off-by: Nicolas Escande <nico.escande@gmail.com>
3 years agoeapol_test: Print out names for additional known EAP types
Alan T. DeKok [Sat, 9 Apr 2022 17:47:05 +0000 (13:47 -0400)] 
eapol_test: Print out names for additional known EAP types

And order the names by number.

Signed-off-by: Alan DeKok <aland@freeradius.org>
3 years agoOpenSSL: Unload providers only at process exit
Jouni Malinen [Sat, 16 Apr 2022 15:48:29 +0000 (18:48 +0300)] 
OpenSSL: Unload providers only at process exit

The previous mechanism of unloaded the providers from tls_deinit() did
not work correctly for some cases. In particular, it was possible for
hostapd to end up unloading both providers and not being able to recover
from this if TLS server was not enabled.

Address this more cleanly by introducing a new crypto_unload() function
that will be called when the process is exiting.

Fixes: 097ca6bf0b6f ("OpenSSL: Unload providers on deinit")
Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agoBSS coloring: Handle the collision and CCA events coming from the kernel
John Crispin [Mon, 21 Mar 2022 11:10:34 +0000 (12:10 +0100)] 
BSS coloring: Handle the collision and CCA events coming from the kernel

This commit activates the functionality of the previous commits by
handling the actual events that will trigger the CCA process.

Tested-by: Peter Chiu <chui-hao.chiu@mediatek.com>
Co-developed-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: John Crispin <john@phrozen.org>
Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
3 years agonl80211: Handle driver events for BSS coloring
John Crispin [Mon, 21 Mar 2022 11:10:34 +0000 (12:10 +0100)] 
nl80211: Handle driver events for BSS coloring

Process the color collision and color change related events.

Tested-by: Peter Chiu <chui-hao.chiu@mediatek.com>
Co-developed-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: John Crispin <john@phrozen.org>
Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
3 years agonl80211: Add the switch_color() handler for BSS color changes
John Crispin [Mon, 21 Mar 2022 11:10:33 +0000 (12:10 +0100)] 
nl80211: Add the switch_color() handler for BSS color changes

To start the CCA process we need to send NL80211_CMD_COLOR_CHANGE to the
kernel. This commit adds the required code.

Tested-by: Peter Chiu <chui-hao.chiu@mediatek.com>
Co-developed-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: John Crispin <john@phrozen.org>
Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
3 years agoBSS coloring: Disable BSS color during CCA
John Crispin [Mon, 21 Mar 2022 11:10:32 +0000 (12:10 +0100)] 
BSS coloring: Disable BSS color during CCA

While we are doing CCA the BSS Color Disabled field inside the HE
Operation Parameters field needs to be set.

Tested-by: Peter Chiu <chui-hao.chiu@mediatek.com>
Co-developed-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: John Crispin <john@phrozen.org>
Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
3 years agoBSS coloring: BSS Color Change Announcement element generation
John Crispin [Mon, 21 Mar 2022 11:10:31 +0000 (12:10 +0100)] 
BSS coloring: BSS Color Change Announcement element generation

This information element is similar to the CSA one. It contains a
counter and the target color. Once the counter expired, the change to
the new color happens.

Just note the current implementation is based on CCA counter attributes
that only take Beacon and Probe Response framesinto account.
(Re)Association Response frames do not currently have kernel APIs to
decrement the CCA counter since mediatek mcu firmware does not support
it yet and it will be added in future firmware release.

Tested-by: Peter Chiu <chui-hao.chiu@mediatek.com>
Co-developed-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: John Crispin <john@phrozen.org>
Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
3 years agoBSS coloring: Handling of collision events and triggering CCA
John Crispin [Mon, 21 Mar 2022 11:10:30 +0000 (12:10 +0100)] 
BSS coloring: Handling of collision events and triggering CCA

Add the core code for handling BSS color collision events and triggering
CCA inside the kernel. The caller of hostapd_switch_color() will be
added in the following commits.

Tested-by: Peter Chiu <chui-hao.chiu@mediatek.com>
Co-developed-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: John Crispin <john@phrozen.org>
Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
3 years agotests: Pretend the RNG is initialized withinthe VM
Johannes Berg [Mon, 11 Apr 2022 09:41:20 +0000 (11:41 +0200)] 
tests: Pretend the RNG is initialized withinthe VM

We don't particularly care about the quality of random numbers
during the test. So far, there hasn't been an issue with the
RNG not being initialized completely, we only get a few prints
about uninitialized reads from urandom. However, if some tool
were to actually use /dev/random, it might get stuck. Call the
RNDADDTOENTCNT ioctl to unblock this.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
3 years agowpa_supplicant: Add the CONFIG_HE_OVERRIDES option to the defconfig
Yegor Yefremov [Tue, 12 Apr 2022 17:08:19 +0000 (19:08 +0200)] 
wpa_supplicant: Add the CONFIG_HE_OVERRIDES option to the defconfig

Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
3 years agotests: Update server and user certificates (2022)
Jouni Malinen [Sat, 16 Apr 2022 10:22:16 +0000 (13:22 +0300)] 
tests: Update server and user certificates (2022)

The previous versions are going to be expiring soon, so need to re-sign
these to avoid EAP test case failures. This contains updates from
running tests/hwsim/auth_server/update.sh.

Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agoOpenSSL: Do not use the deprecated RSAPrivateKey function
Jouni Malinen [Sat, 16 Apr 2022 09:45:32 +0000 (12:45 +0300)] 
OpenSSL: Do not use the deprecated RSAPrivateKey function

Comment out the call to SSL_use_RSAPrivateKey_ASN1() function when using
OpenSSL 3.0 since that function was deprecated and there does not seem
to be any significant use case for supporting DER encoded RSAPrivateKey
structure in the private key blob.

Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agoOpenSSL: Generate DH parameters automatically if not set with dh_file
Jouni Malinen [Sat, 16 Apr 2022 08:38:44 +0000 (11:38 +0300)] 
OpenSSL: Generate DH parameters automatically if not set with dh_file

This is the recommended way of using DH in OpenSSL TLS handshake.

Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agoOpenSSL: Convert DH/DSA parameter loading to new API
Jouni Malinen [Sat, 16 Apr 2022 08:32:21 +0000 (11:32 +0300)] 
OpenSSL: Convert DH/DSA parameter loading to new API

OpenSSL 3.0 has deprecated low-level DH/DSA functions. Convert this
loading of the dh_file parameter to use newer API.

Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agoRemove unused dh_blob parameter
Jouni Malinen [Sat, 16 Apr 2022 07:45:17 +0000 (10:45 +0300)] 
Remove unused dh_blob parameter

This was used earlier in the wpa_supplicant configuration, but there was
no real use for that, so remove the now completely unused parameter to
simplify implementation.

Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agoRemove useless DH file configuration from TLS library wrappers
Jouni Malinen [Fri, 15 Apr 2022 20:37:23 +0000 (23:37 +0300)] 
Remove useless DH file configuration from TLS library wrappers

These operations do not really have any effect since
tls_connection_set_params() is used only in the TLS client case and the
client receives the DH parameters from the server instead of local
configuration.

Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agotests: Remove unused DH file from TLS client fuzzer
Jouni Malinen [Fri, 15 Apr 2022 20:37:01 +0000 (23:37 +0300)] 
tests: Remove unused DH file from TLS client fuzzer

Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agoRemove DH file configuration from TLS client functionality
Jouni Malinen [Fri, 15 Apr 2022 20:30:10 +0000 (23:30 +0300)] 
Remove DH file configuration from TLS client functionality

The DH file parameters are applicable only for the TLS server, so this
parameter did not really have any impact to functionality. Remove it to
get rid of useless code and confusing documentation for the network
block configuration.

Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agotests: Remove test cases for wpa_supplicant dh_file parameter
Jouni Malinen [Fri, 15 Apr 2022 20:41:14 +0000 (23:41 +0300)] 
tests: Remove test cases for wpa_supplicant dh_file parameter

This parameter has no impact to TLS client functionality, so these is
not really any point to maintain these test cases.

Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agoRADIUS attributes for EAPOL-Key message details
Jouni Malinen [Fri, 15 Apr 2022 14:36:25 +0000 (17:36 +0300)] 
RADIUS attributes for EAPOL-Key message details

Use vendor specific RADIUS attributes for sending ANonce and EAPOL-Key
msg 2/4 for the wpa_psk_radius=3 case. The vendor specific attributes
for this are defined in FreeRADIUS as follows:

BEGIN-VENDOR    FreeRADIUS      format=Extended-Vendor-Specific-5
ATTRIBUTE       FreeRADIUS-802.1X-Anonce        1       octets[32]
ATTRIBUTE       FreeRADIUS-802.1X-EAPoL-Key-Msg 2       octets
END-VENDOR      FreeRADIUS

Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agoRADIUS: Attributes with Extended Types (RFC 6929)
Jouni Malinen [Fri, 15 Apr 2022 14:31:48 +0000 (17:31 +0300)] 
RADIUS: Attributes with Extended Types (RFC 6929)

Supported extended types for RADIUS attributes for the cases defined in
RFC 6929.

Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agotests: Fix ap_wpa2_eap_fast_eap_vendor to check EAP-FAST support in build
Jouni Malinen [Fri, 15 Apr 2022 10:49:19 +0000 (13:49 +0300)] 
tests: Fix ap_wpa2_eap_fast_eap_vendor to check EAP-FAST support in build

Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agotests: Use group 20 instead of 25 in some SAE test cases
Jouni Malinen [Fri, 15 Apr 2022 10:47:58 +0000 (13:47 +0300)] 
tests: Use group 20 instead of 25 in some SAE test cases

BoringSSL does not support group 25, so replace these cases with a
supported group 20 to meet the real testing need here.

Signed-off-by: Jouni Malinen <j@w1.fi>
3 years agotests: Skip sigma_dut_suite_b_rsa DHE case with BoringSSL
Jouni Malinen [Fri, 15 Apr 2022 10:43:30 +0000 (13:43 +0300)] 
tests: Skip sigma_dut_suite_b_rsa DHE case with BoringSSL

BoringSSL is known not to support this option, so skip it to allow rest
of the test case to be performed without known failures.

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