]> git.ipfire.org Git - thirdparty/hostap.git/log
thirdparty/hostap.git
2 years agoOpenSSL: Load OpenSSL 3.0 legacy provider but let default be loaded
Norman Hamer [Mon, 31 Oct 2022 23:06:22 +0000 (23:06 +0000)] 
OpenSSL: Load OpenSSL 3.0 legacy provider but let default be loaded

The default provider is being loaded here explicitly only because
OSSL_PROVIDER_load() disables the fallback provider loading (on either
success or failure). If the legacy provider fails to load, which it may
in some configurations, it will never load the default provider.

Just use the formulation which attempts to load without changing the
fallback behavior.

"default" will still be/only be loaded if no other provider (notably
FIPS) is loaded to provide algorithms.

Signed-off-by: Norman Hamer <nhamer@absolute.com>
2 years agoOpenSSL: Don't provide implementation of DES/RC4 for FIPS builds
Norman Hamer [Fri, 14 Oct 2022 18:37:34 +0000 (18:37 +0000)] 
OpenSSL: Don't provide implementation of DES/RC4 for FIPS builds

DES and RC4 are not allowed in such builds, so comment out des_encrypt()
and rc4_skip() from the build to force compile time failures for cases
that cannot be supported instead of failing the operations at runtime.
This makes it easier to detect and fix accidental cases where DES/RC4
could still be used in some older protocols.

Signed-off-by: Norman Hamer <nhamer@absolute.com>
2 years agoRSN: Do not include RC4 use in FIPS builds
Jouni Malinen [Sat, 26 Nov 2022 09:29:28 +0000 (11:29 +0200)] 
RSN: Do not include RC4 use in FIPS builds

CONFIG_NO_RC4=y could have been used to remove this functionality, but
it might as well be done automatically based on CONFIG_FIPS=y as well.

Signed-off-by: Jouni Malinen <j@w1.fi>
2 years agoAdd more detailed description of RADIUS attributes in EAP user file
Morten Brørup [Tue, 25 Oct 2022 11:17:27 +0000 (13:17 +0200)] 
Add more detailed description of RADIUS attributes in EAP user file

The description of how to use radius_accept_attr did not provide the
details on how the value is set. Extend it to cover the more complete
syntax.

Signed-off-by: Morten Brørup <mb@smartsharesystems.com>
2 years agodbus: Add virtual interface create/remove logic to be inline with ctrl_iface
Jintao Lin [Mon, 7 Nov 2022 19:25:26 +0000 (19:25 +0000)] 
dbus: Add virtual interface create/remove logic to be inline with ctrl_iface

There is no way to create or remove a virtual interface with
wpa_supplicant dbus methods. The platform has to use out-of-band methods
to manage the virtual interfaces.

This change adds virtual interface create/remove logic to the dbus
methods CreateInterface and RemoveInterface to achieve similar
functionalities as wpa_cli commands interface_add and interface_remove.

Signed-off-by: Jintao Lin <jintaolin@chromium.org>
2 years agowpa_passphrase: Disable terminal echo when reading from stdin
Abhiram V [Mon, 21 Nov 2022 16:30:27 +0000 (22:00 +0530)] 
wpa_passphrase: Disable terminal echo when reading from stdin

Disable terminal echo using tcgetattr() and tcsetattr() when reading a
passphrase from stdin.

Signed-off-by: Abhiram V <abhi.raa.man.v@gmail.com>
2 years agoPASN: Fix passing own address and peer address to pasn_deauthenticate()
Vinay Gannevaram [Fri, 11 Nov 2022 18:45:36 +0000 (00:15 +0530)] 
PASN: Fix passing own address and peer address to pasn_deauthenticate()

Need to copy own address and peer address locally and pass them to
pasn_deauthenticate(), because this pointer data will be flushed from
the PTKSA cache before sending the Deauthentication frame and these
pointers to then-freed memory would be dereferenced.

Fixes: 24929543 ("PASN: Deauthenticate on PTKSA cache entry expiration")
Signed-off-by: Vinay Gannevaram <quic_vganneva@quicinc.com>
2 years agowpa_cli: Fix PASN control interface commands
Veerendranath Jakkam [Mon, 5 Sep 2022 19:20:20 +0000 (00:50 +0530)] 
wpa_cli: Fix PASN control interface commands

Map to correct control interface commands for PASN start and stop.

Fixes: ad338cfe586c ("ctrl_iface: Add support for PASN authentication")
Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
2 years agoFT: Use SHA256 to derive PMKID for AKM 00-0F-AC:3 (FT-EAP)
Jouni Malinen [Fri, 25 Nov 2022 07:37:17 +0000 (09:37 +0200)] 
FT: Use SHA256 to derive PMKID for AKM 00-0F-AC:3 (FT-EAP)

PMKSA caching for the FT initial mobility domain association was fully
defined in IEEE Std 802.11-2020. The state before that was unclear and
there has been interoperability issues in this area, so use of PMKSA
caching with FT-EAP has been disabled in wpa_supplicant by default.

The wpa_supplicant and hostapd implementation of PMKSA caching for FT
ended up using an earlier default mechanism (SHA-1) for deriving the
PMKID when using the FT-EAP. This does not match what got defined in
IEEE Std 802.11-2020, 12.11.2.5.2 (SHA256). It is not really desirable
to use SHA-1 for anything with FT since the initial design of FT was
based on SHA256. Furthermore, it is obviously not good to differ in
behavior against the updated standard. As such, there is sufficient
justification to change the implementation to use SHA256 here even
though this ends up breaking backwards compatibility for PMKSA caching
with FT-EAP.

As noted above, this is still disabled in wpa_supplicant by default and
this change results in PMKSA caching not working only in cases where it
has been enabled explicitly with ft_eap_pmksa_caching=1. Those cases
recover by falling back to full EAP authentication.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2 years agoAdd a new QCA vendor attribute to configure wifi calling (wfc) state
Mukul Sharma [Tue, 22 Nov 2022 09:28:09 +0000 (14:58 +0530)] 
Add a new QCA vendor attribute to configure wifi calling (wfc) state

Add QCA_WLAN_VENDOR_ATTR_CONFIG_WFC_STATE vendor attribute. Userspace
uses this attribute to configure wfc state to the driver/firmware. The
driver/firmware uses this information to optimize power savings, rate
adaption, roaming, etc.

Signed-off-by: Mukul Sharma <quic_mukul@quicinc.com>
2 years agotests: WPS PBC provisioning with configured AP and passive scanning
Jouni Malinen [Thu, 24 Nov 2022 16:54:33 +0000 (18:54 +0200)] 
tests: WPS PBC provisioning with configured AP and passive scanning

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2 years agoWPS: Pick WPS AP based on latest received WPS IE
Sai Pratyusha Magam [Sun, 21 Aug 2022 15:05:50 +0000 (20:35 +0530)] 
WPS: Pick WPS AP based on latest received WPS IE

wpa_supplicant used the WPS IE from a Probe Response frame, if one was
received, even if there might have been a more recent Beacon frame with
an updated WPS IE. This could result in using stale information about
active WPS registrar, e.g., when operating on the 6 GHz band.

Prefer WPS IE from a Beacon frame over the default selection of Probe
Response frame (if one has been received) in cases where the Beacon
frame is received more recently than the Probe Response frame and active
WPS Registrar information is being checked. Skip this for the case where
UUID-E is needed since that is not available in the Beacon frame.

Signed-off-by: Sai Pratyusha Magam <quic_smagam@quicinc.com>
2 years agotests: OCV on 2.4 GHz with PMF getting enabled automatically on STA
Jouni Malinen [Thu, 24 Nov 2022 15:21:08 +0000 (17:21 +0200)] 
tests: OCV on 2.4 GHz with PMF getting enabled automatically on STA

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2 years agoEnable PMF automatically if OCV is enabled
Jouni Malinen [Thu, 24 Nov 2022 15:16:26 +0000 (17:16 +0200)] 
Enable PMF automatically if OCV is enabled

OCV cannot be used without PMF and such a configuration were to be used
with wpa_supplicant, the AP would reject the association. hostapd is
already enabling PMF automatically whenever OCV is being enabled, so do
the same with wpa_supplicant.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2 years agoSAE: Use Challenge Failure status code in confirm message failure cases
Mert Ekren [Wed, 23 Nov 2022 12:15:16 +0000 (12:15 +0000)] 
SAE: Use Challenge Failure status code in confirm message failure cases

IEEE Std 802.11-2020, 12.4.7.6 says that status code CHALLENGE_FAILURE,
needs to be sent in case the verification action fails for SAE Confirm
message frame from a STA: "An SAE Confirm message, with a status code
not equal to SUCCESS, shall indicate that a peer rejects a previously
sent SAE Confirm message. An SAE Confirm message that was not
successfully verified is indicated with a status code of
CHALLENGE_FAILURE."

hostapd, however, did not use this status code for this case. In
ieee802_11.c the function sae_check_confirm() is called and in case of
verification failure (-1 is returned), the response is set to
WLAN_STATUS_UNSPECIFIED_FAILURE (status code = 1). Fix this to use
CHALLENGE_FAILURE.

Signed-off-by: Koen Van Oost <koen.vanoost@airties.com>
Signed-off-by: Mert Ekren <mert.ekren@airties.com>
2 years agotests: SAE and preferred AP using wrong password
Jouni Malinen [Thu, 24 Nov 2022 10:06:59 +0000 (12:06 +0200)] 
tests: SAE and preferred AP using wrong password

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2 years agoAllow a lower priority BSS to be tried after network disabling
Jouni Malinen [Thu, 24 Nov 2022 10:03:01 +0000 (12:03 +0200)] 
Allow a lower priority BSS to be tried after network disabling

If a higher priority BSS has invalid security parameters, e.g., an
invalid SAE password, and a lower priority BSS is discovered only after
the local network profile has been temporarily disabled, the BSSID
ignoring mechanism is not sufficient to allow the lower priority BSS to
be tried and all consecutive attempts will continue to use the higher
priority BSS. This might prevent connection in some unexpected cases
with invalid network configuration.

Extend BSSID ignoring mechanism to work in this type of a case by
ignoring the BSSID that resulted in disabling the SSID temporarily
during the first connection attempt after having re-enabled the SSID.
This allows a lower priority BSS, if any is available in scan results,
to be tried next to see if it might have working security parameters.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2 years agoDFS: Do not allow channel checks to go beyond the channel list
Jouni Malinen [Wed, 23 Nov 2022 20:51:50 +0000 (22:51 +0200)] 
DFS: Do not allow channel checks to go beyond the channel list

Explicitly check for invalid cases where the configured channel and
bandwidth might result in the full channel number range going beyond the
list of supported channels to avoid reading beyond the end of the
channel buffer.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2 years agoPASN: Fix missing libraries for libpasn.so on Android
Vinay Gannevaram [Tue, 22 Nov 2022 08:08:31 +0000 (13:38 +0530)] 
PASN: Fix missing libraries for libpasn.so on Android

Fixes: 08abcdf4 ("PASN: Makefile and Android.mk changes for libpasn.so")
Signed-off-by: Vinay Gannevaram <quic_vganneva@quicinc.com>
2 years agoPASN: Fix is_pasn_auth_frame() for mgmt tx status frames
Vinay Gannevaram [Sun, 20 Nov 2022 17:35:40 +0000 (23:05 +0530)] 
PASN: Fix is_pasn_auth_frame() for mgmt tx status frames

The SA/DA checks needs to be reversed for the TX case.

Fixes: 8481c750 ("PASN: Fix Authentication frame checks")
Signed-off-by: Vinay Gannevaram <quic_vganneva@quicinc.com>
2 years agoSkip CAC if the driver switches channel to non-DFS
Qiwei Cai [Wed, 9 Nov 2022 11:46:04 +0000 (19:46 +0800)] 
Skip CAC if the driver switches channel to non-DFS

If an AP is started on a DFS channel (or any channels within its
bandwidth require DFS) and DFS is offloaded to the driver, hostapd needs
to wait for CAC to complete. But the driver may not do CAC and just
switches to a non-DFS channel instead. This would result in a failure to
start the AP because hostapd fails to receive a CAC complete event and
cannot finish interface setup.

Skip CAC and complete AP setup in the channel switch event handler for
this case.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2 years agoAdd hostapd control interface command to stop logging to file
Sai Pratyusha Magam [Fri, 11 Nov 2022 12:44:10 +0000 (18:14 +0530)] 
Add hostapd control interface command to stop logging to file

Add CLOSE_LOG command to stop hostapd logging to file. This can be
followed with RELOG to restart logging to the same file path.

Signed-off-by: Sai Pratyusha Magam <quic_smagam@quicinc.com>
2 years agoAdd QCA vendor interface for AP doze mode configuration
Purushottam Kushwaha [Fri, 14 Oct 2022 04:44:41 +0000 (10:14 +0530)] 
Add QCA vendor interface for AP doze mode configuration

Add a new subcommand QCA_NL80211_VENDOR_SUBCMD_DOZED_AP to configure
doze mode state on an AP interface. This is also used as an event to
indicate the updated configuration. In doze mode, AP transmits
beacons at higher beacon intervals and RX is disabled.

Uses attributes defined in enum qca_wlan_vendor_attr_dozed_ap.

Signed-off-by: Purushottam Kushwaha <quic_pkushwah@quicinc.com>
2 years agoRoam control configuration for 6 GHz in full scan only on prior discovery
Sunil Dutt [Tue, 22 Nov 2022 11:12:54 +0000 (16:42 +0530)] 
Roam control configuration for 6 GHz in full scan only on prior discovery

During the roam scan, if there are no desired APs found in the partial
frequency list, an immediate full scan on all the supported frequencies
is initiated as a fallback. This would include the 6 GHz PSC
frequencies. Define an attribute to allow that behavior to be modified
to include PSCs only if 6 GHz use has been detected.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2 years agotests: HS 2.0 deauthentication imminent with and without URL timing
Jouni Malinen [Mon, 21 Nov 2022 20:57:51 +0000 (22:57 +0200)] 
tests: HS 2.0 deauthentication imminent with and without URL timing

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2 years agoHS 2.0: Deauthenticate STA on deauth-imminent more quickly if no URL
Jouni Malinen [Mon, 21 Nov 2022 20:53:07 +0000 (22:53 +0200)] 
HS 2.0: Deauthenticate STA on deauth-imminent more quickly if no URL

When the RADIUS server requests a STA to be deauthenticated imminently
without providing a reason URL, there is no need to allow the STA spend
any additional time associated. Deauthenticate the STA immediately after
it has ACK'ed the WNM-Notification frame indicating imminent
deauthentication or at latest two seconds after having processes the
Access-Accept message.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2 years agonl80211: Fix wrong requested links bitmap in sta_mlo_info.req_links
Veerendranath Jakkam [Mon, 21 Nov 2022 06:33:14 +0000 (12:03 +0530)] 
nl80211: Fix wrong requested links bitmap in sta_mlo_info.req_links

Currently sta_mlo_info.req_links is not getting cleared before
populating the requested links information for a new connection/roam
event. This is causing wrong requested links bitmap in
sta_mlo_info.req_links if there is a change in requested link IDs
between the previous and the new connection. To avoid such issues fully
clear MLO connection information after disconnection and before
populating MLO connection information during (re)association event.

Fixes: cc2236299f99 ("nl80211: Get all requested MLO links information from (re)association events")
Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
2 years agoMLD STA: Fix IGTK and BIGTK MLO KDEs validation
Veerendranath Jakkam [Fri, 11 Nov 2022 11:45:52 +0000 (17:15 +0530)] 
MLD STA: Fix IGTK and BIGTK MLO KDEs validation

IGTK and BIGTK MLO KDEs should be validated only when the AP sends them
in EAPOL-Key msg 3/4. Though IEEE P802.11be/D2.2 mandates MLO AP to
enable PMF and Beacon Protection features there is no text to mandate a
STA to discard connection when the MLO AP doesn't send IGTK and BIGTK
MLO KDEs in EAPOL-Key msg 3/4 for a link. Also, fix
wpa_sm->mgmt_group_cipher checks before processing MLO IGTK and BIGTK
MLO KDEs.

Fixes: f15cc834cb77 ("MLD STA: Processing of EAPOL-Key msg 3/4 frame when using MLO")
Fixes: 8f2e493bec99 ("MLD STA: Validation of MLO KDEs for 4-way handshake EAPOL-Key frames")
Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
2 years agoAdd a vendor attribute for roam control configuration for full scan
Sunil Dutt [Mon, 7 Nov 2022 12:09:11 +0000 (17:39 +0530)] 
Add a vendor attribute for roam control configuration for full scan

During the roam scan, if there are no desired APs found in the partial
frequency list, an immediate full scan on all the supported frequencies
is initiated as a fallback. This flag controls the frequency list
creation for full scan on the following lines.
1 - Full scan to exclude the frequencies that were already scanned by
    the previous partial scan.
0 - Full scan to include all the supported frequencies irrespective of
    the ones already scanned by partial scan.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2 years agoTLS: Fix unsigned int underflow in internal TLS 1.0/1.1 implementation
Glenn Strauss [Tue, 8 Nov 2022 05:05:54 +0000 (00:05 -0500)] 
TLS: Fix unsigned int underflow in internal TLS 1.0/1.1 implementation

Taking sizeof(ptr) is incorrect to determine size of passed in hash and
results in hlen getting set to a very large value since MD5_MAC_LEN >
sizeof(ptr). Provide the actual size of the hash buffer from the caller
to fix this.

tls_key_x_server_params_hash() callers src/tls/tlsv1_client_read.c and
src/tls/tlsv1_server_write.c both pass in a large enough hash (hash[64]
or hash[100]) that this does not appear to have an impact, though it is
still wrong.

Signed-off-by: Glenn Strauss <gstrauss@gluelogic.com>
2 years agoUpdate tls_connection_set_verify() documentation to verify_peer=2
Glenn Strauss [Tue, 8 Nov 2022 05:05:53 +0000 (00:05 -0500)] 
Update tls_connection_set_verify() documentation to verify_peer=2

This new value was added to verify peer certificate if it is provided,
but not reject the TLS handshake if no peer certificate is provided.

Signed-off-by: Glenn Strauss <gstrauss@gluelogic.com>
2 years agoDPP: Fix memory leak of intro.peer_key in station handling
Glenn Strauss [Tue, 8 Nov 2022 05:05:52 +0000 (00:05 -0500)] 
DPP: Fix memory leak of intro.peer_key in station handling

Fix memory leak of intro.peer_key in wpas_dpp_rx_peer_disc_resp(). The
other code paths were updated to use dpp_peer_intro_deinit(), but this
non-privacy-protection version of the station implementation was missed.

Fixes: 148de3e0dc2a ("DPP3: Private Peer Introduction protocol")
Signed-off-by: Glenn Strauss <gstrauss@gluelogic.com>
2 years agotests: Check IMSI privacy support using a helper function
Glenn Strauss [Tue, 8 Nov 2022 05:05:49 +0000 (00:05 -0500)] 
tests: Check IMSI privacy support using a helper function

Signed-off-by: Glenn Strauss <gstrauss@gluelogic.com>
2 years agoP2P: Check dev pointer consistently when building PD Response
Jouni Malinen [Sun, 20 Nov 2022 10:22:08 +0000 (12:22 +0200)] 
P2P: Check dev pointer consistently when building PD Response

The dev pointer could potentially be NULL here in some P2PS cases, so
check it explicitly before dereferencing it when checking for 6 GHz
capability.

Fixes: b9e2826b9d76 ("P2P: Filter 6 GHz channels if peer doesn't support them")
Signed-off-by: Jouni Malinen <j@w1.fi>
2 years agoWPS: Check NDEF record length fields separately
Jouni Malinen [Sun, 20 Nov 2022 10:08:47 +0000 (12:08 +0200)] 
WPS: Check NDEF record length fields separately

Try to make the bounds checking easier for static analyzers by checking
each length field separately in addition to checking them all in the end
against the total buffer length.

Signed-off-by: Jouni Malinen <j@w1.fi>
2 years agoTDLS: Use stored FTE length in MIC calculation
Jouni Malinen [Sun, 20 Nov 2022 11:07:21 +0000 (13:07 +0200)] 
TDLS: Use stored FTE length in MIC calculation

Try to avoid static analyzer warnings due to use of the FTE length
field instead of the separately stored and validated length field value
when deriving FTE MIC.

Signed-off-by: Jouni Malinen <j@w1.fi>
2 years agoTDLS: Use stored peer RSNE length in MIC calculation
Jouni Malinen [Sun, 20 Nov 2022 10:01:36 +0000 (12:01 +0200)] 
TDLS: Use stored peer RSNE length in MIC calculation

Try to avoid static analyzer warnings due to use of the RSNE length
field instead of the separately stored and validated length field value
when deriving FTE MIC.

Signed-off-by: Jouni Malinen <j@w1.fi>
2 years agoFT: Simplify FTE parsing for FT-SAE-EXT-KEY using MIC Length subfield
Jouni Malinen [Sun, 20 Nov 2022 09:43:53 +0000 (11:43 +0200)] 
FT: Simplify FTE parsing for FT-SAE-EXT-KEY using MIC Length subfield

Commit 25b52e5f83f1 ("FT: Extend FTE parsing for FT-SAE-EXT-KEY") used
possible MIC length iteration to try to figure out the length of the MIC
field in FTE. That was the only option available at the time, but FTE is
now being extended in IEEE 802.11-REVme to explicitly indicate the
length of the MIC field for the new FT-SAE-EXT-KEY AKM to make this
easier.

Use the new design from the approved comment resolution (*) in
REVme/D2.0 ballot CID 3135 to simplify implementation. This gets rid of
the need to pass in key length and the somewhat strange need_{r0kh,r1kh}
parameters to wpa_ft_parse_ies().

(*)
https://mentor.ieee.org/802.11/dcn/22/11-22-1991-02-000m-proposed-resolutions-to-some-lb270-comments.docx

Signed-off-by: Jouni Malinen <j@w1.fi>
2 years agotests: DPP network introduction with PMKSA cleared on AP
Jouni Malinen [Sun, 20 Nov 2022 06:04:33 +0000 (08:04 +0200)] 
tests: DPP network introduction with PMKSA cleared on AP

Signed-off-by: Jouni Malinen <j@w1.fi>
2 years agoDPP: Drop PMKSA entry if AP reject association due to invalid PMKID
Jouni Malinen [Sun, 20 Nov 2022 06:00:36 +0000 (08:00 +0200)] 
DPP: Drop PMKSA entry if AP reject association due to invalid PMKID

This is needed to avoid trying the subsequent connections with the old
PMKID that the AP claims not to hold and continues connection failures.
This was already handled for the SME-in-the-driver case in commit commit
50b77f50e80f ("DPP: Flush PMKSA if an assoc reject without timeout is
received"), but the wpa_supplicant SME case did not have matching
processing.

Add the needed check to avoid recover from cases where the AP has
dropped its PMKSA cache entry. Do this only based on the specific status
code value (53 = invalid PMKID) and only for the PMKSA entry that
triggered this failure to minimize actions taken based on an unprotected
(Re)Association Response frame.

Signed-off-by: Jouni Malinen <j@w1.fi>
2 years agotests: Add PMKSA cache entry again in dpp_akm_sha*
Jouni Malinen [Sun, 20 Nov 2022 09:07:32 +0000 (11:07 +0200)] 
tests: Add PMKSA cache entry again in dpp_akm_sha*

This is going to be needed once wpa_supplicant starts dropping the PMKSA
cache entry on status code 53 (invalid PMKID) rejection of association.

Signed-off-by: Jouni Malinen <j@w1.fi>
2 years agotests: Fix pasn-init fuzz tester build
Jouni Malinen [Sat, 19 Nov 2022 15:21:45 +0000 (17:21 +0200)] 
tests: Fix pasn-init fuzz tester build

Change of the wpas_pasn_start() prototype did not update the fuzzer
tool.

Fixes: 309765eb660d ("PASN: Use separate variables for BSSID and peer address")
Signed-off-by: Jouni Malinen <j@w1.fi>
2 years agoFix empty pmksa_cache_get()
Jouni Malinen [Sat, 19 Nov 2022 15:19:49 +0000 (17:19 +0200)] 
Fix empty pmksa_cache_get()

The addition of the "spa" argument was missed in the empty inline
function.

Fixes: 9ff778fa4bd6 ("Check for own address (SPA) match when finding PMKSA entries")
Signed-off-by: Jouni Malinen <j@w1.fi>
2 years agoSAE: Print rejection of peer element clearly in debug log
Jouni Malinen [Thu, 10 Nov 2022 18:43:22 +0000 (20:43 +0200)] 
SAE: Print rejection of peer element clearly in debug log

Depending on the crypto library, crypto_ec_point_from_bin() can fail if
the element is not on curve, i.e., that error may show up before getting
to the explicit crypto_ec_point_is_on_curve() check. Add a debug print
for that earlier call so that the debug log is clearly identifying
reason for rejecting the SAE commit message.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2 years agotests: SAE-EXT-KEY, H2E, and rejected groups indication
Jouni Malinen [Thu, 10 Nov 2022 16:22:51 +0000 (18:22 +0200)] 
tests: SAE-EXT-KEY, H2E, and rejected groups indication

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2 years agotests: Random MAC address with PMKSA caching
Jouni Malinen [Thu, 10 Nov 2022 12:24:43 +0000 (14:24 +0200)] 
tests: Random MAC address with PMKSA caching

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2 years agoCheck for own address (SPA) match when finding PMKSA entries
Jouni Malinen [Thu, 10 Nov 2022 12:10:55 +0000 (14:10 +0200)] 
Check for own address (SPA) match when finding PMKSA entries

This prevents attempts of trying to use PMKSA caching when the existing
entry was created using a different MAC address than the one that is
currently being used. This avoids exposing the longer term PMKID value
when using random MAC addresses for connections.

In practice, similar restriction was already done by flushing the PMKSA
cache entries whenever wpas_update_random_addr() changed the local
address or when the interface was marked down (e.g., for an external
operation to change the MAC address).

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2 years agoStore own MAC address (SPA) in supplicant PMKSA cache entries
Jouni Malinen [Thu, 10 Nov 2022 12:09:29 +0000 (14:09 +0200)] 
Store own MAC address (SPA) in supplicant PMKSA cache entries

This is needed to be able to determine whether a PMKSA cache entry is
valid when using changing MAC addresses. This could also be used to
implement a mechanism to restore a previously used MAC address instead
of a new random MAC address.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2 years agotests: hostapd dump_msk_file
Jouni Malinen [Thu, 10 Nov 2022 11:22:39 +0000 (13:22 +0200)] 
tests: hostapd dump_msk_file

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2 years agoPASN: Use separate variables for BSSID and peer address
Vinay Gannevaram [Fri, 4 Nov 2022 10:45:31 +0000 (16:15 +0530)] 
PASN: Use separate variables for BSSID and peer address

Using separate variables for BSSID and peer address is needed to support
Wi-Fi Aware (NAN) use cases where the group address is used as the BSSID
and that could be different from any other peer address. The
infrastructure BSS cases will continue to use the AP's BSSID as both the
peer address and BSSID for the PASN exchanges.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2 years agoPASN: Use peer address instead of BSSID as the destination for initiator
Vinay Gannevaram [Sun, 30 Oct 2022 16:17:28 +0000 (21:47 +0530)] 
PASN: Use peer address instead of BSSID as the destination for initiator

Rename struct pasn_data::bssid to peer_addr to be better aligned with
different use cases of PASN and its extensions. This is a step towards
having option to use different peer address and BSSID values for NAN use
cases.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2 years agowlantest: Clone new PTK to all potentially matching STA entries for MLO
Jouni Malinen [Wed, 9 Nov 2022 20:39:01 +0000 (22:39 +0200)] 
wlantest: Clone new PTK to all potentially matching STA entries for MLO

It is possible for there to be multiple STA entries (e.g., one for each
BSS) when a sniffer capture contains multiple associations using MLO.
For such cases, the new PTK information needs to be updated to all
existing STA entries to be able to find the latest TK when decrypting
following frames since the other STA entries might be located first when
trying to figure out how to decrypt a frame.

In addition to the PTK, copy the MLD MAC addresses to the other STA and
BSS entries to make sure the latest values are used when trying to
decrypt frames.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2 years agonl80211: Allow up to 64-byte PMK in NL80211_CMD_SET_PMKSA
Veerendranath Jakkam [Tue, 8 Nov 2022 13:11:41 +0000 (18:41 +0530)] 
nl80211: Allow up to 64-byte PMK in NL80211_CMD_SET_PMKSA

Kernel commit 22e76844c566 - ("ieee80211: Increase PMK maximum length to
 64 bytes") increased the maximum allowed length for NL80211_ATTR_PMK to
64 bytes. Thus, allow sending 64 bytes PMK in NL80211_CMD_SET_PMKSA and
if NL80211_CMD_SET_PMKSA fails with ERANGE try NL80211_CMD_SET_PMKSA
again without PMK. Also, skip sending PMK when PMK length is greater
than 64 bytes.

This is needed for some newer cases like DPP with NIST P-521 and
SAE-EXT-KEY with group 21. The kernel change from 48 to 64 octets is
from February 2018, so the new limit should be available in most cases
that might want to use these new mechanisms. Maintain a backwards
compatible fallback option for now to cover some earlier needs for DPP.

Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
2 years agotests: FT with mobility domain changes
Jouni Malinen [Tue, 8 Nov 2022 21:47:32 +0000 (23:47 +0200)] 
tests: FT with mobility domain changes

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2 years agoFT: Do not try to use FT protocol between mobility domains
Jouni Malinen [Tue, 8 Nov 2022 21:43:43 +0000 (23:43 +0200)] 
FT: Do not try to use FT protocol between mobility domains

wpa_supplicant has support for only a single FT key hierarchy and as
such, cannot use more than a single mobility domain at a time. Do not
allow FT protocol to be started if there is a request to reassociate to
a different BSS within the same ESS if that BSS is in a different
mobility domain. This results in the initial mobility domain association
being used whenever moving to another mobility domain.

While it would be possible to add support for multiple FT key hierachies
and multiple mobility domains in theory, there does not yet seem to be
sufficient justification to add the complexity needed for that due to
limited, if any, deployment of such networks. As such, it is simplest to
just prevent these attempts for now and start with a clean initial
mobility domain association.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2 years agoDon't use default RSNE/RSNXE when the driver indicates cross SSID roaming
Utkarsh Soni [Thu, 20 Oct 2022 09:15:18 +0000 (14:45 +0530)] 
Don't use default RSNE/RSNXE when the driver indicates cross SSID roaming

During cross SSID roaming wpa_supplicant ended up using the default
RSNE/RSNXE in EAPOL-Key msg 2/4 though the driver indicated
(Re)Association Request frame elements without RSNE/RSNXE. This causes
RSNE/RSNXE mismatch between (Re)Association Request frame and EAPOL-Key
msg 2/4.

To avoid this skip copying the default RSNE/RSNXE if the driver
indicates the actually used (Re)Association Request frame elements in
the association event.

Signed-off-by: Utkarsh Soni <quic_usoni@quicinc.com>
2 years agoMLO: Remove unnecessary debug prints about clearing AP RSNE/RSNXE
Jouni Malinen [Tue, 8 Nov 2022 12:35:35 +0000 (14:35 +0200)] 
MLO: Remove unnecessary debug prints about clearing AP RSNE/RSNXE

There is no help from seeing 32 lines of debug prints about clearing
AP's RSNE/RSNXE information for each potential link when such
information has not been set in the first place. These were printed even
when there is no use of MLO whatsoever, so get rid of the prints for any
case where the value has not yet been set.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2 years agoDefine AFC vendor commands and events
Rhythm Patwa [Fri, 16 Sep 2022 00:43:19 +0000 (17:43 -0700)] 
Define AFC vendor commands and events

Wi-Fi Alliance specification for Automated Frequency Coordination (AFC)
system ensures that the Standard Power Wi-Fi devices can operate in 6
GHz spectrum under favorable conditions, without any interference with
the incumbent devices.

Add support for vendor command/events and corresponding
attributes to define the interface for exchanging AFC requests and
responses between the driver and a userspace application.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2 years agoOpenSSL: Fix additional HPKE corner cases
Jouni Malinen [Mon, 7 Nov 2022 16:01:33 +0000 (18:01 +0200)] 
OpenSSL: Fix additional HPKE corner cases

Commit 820211245bf0 ("OpenSSL: Fix HPKE in some corner cases") increased
the buffer size for EVP_PKEY_derive() by 16 octets, but it turns out
that OpenSSL might need significantly more room in some cases. Replace a
fixed length buffer with dynamic query for the maximum size and
allocated buffer to cover that need.

This showed up using the following test case sequence:
dbus_pkcs11 module_wpa_supplicant

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2 years agotests: External password storage for SAE
Jouni Malinen [Mon, 7 Nov 2022 11:23:14 +0000 (13:23 +0200)] 
tests: External password storage for SAE

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2 years agoSAE: Allow loading of the password from an external database
Ben Wolsieffer [Sat, 17 Sep 2022 04:21:02 +0000 (00:21 -0400)] 
SAE: Allow loading of the password from an external database

There was no support for loading SAE passwords from an external password
database.

Signed-off-by: Ben Wolsieffer <benwolsieffer@gmail.com>
2 years agoFix external passwords with 4-way handshake offloading
Ben Wolsieffer [Sat, 17 Sep 2022 04:21:01 +0000 (00:21 -0400)] 
Fix external passwords with 4-way handshake offloading

Passphrases/PSKs from external password databases were ignored if 4-way
handshake offloading was supported by the driver. Split the PSK loading
functionality into a separate function and calls if to get the PSK for
handshake offloading.

I tested connecting to a WPA2-PSK network with both inline and external
passphrases, using the iwlwifi and brcmfmac drivers.

Signed-off-by: Ben Wolsieffer <benwolsieffer@gmail.com>
2 years agosystemd: Use interface name in description of interface-specific units
Gioele Barabucci [Mon, 26 Sep 2022 21:50:30 +0000 (23:50 +0200)] 
systemd: Use interface name in description of interface-specific units

In a system with multiple interfaces, the boot messages as well as the
status information provided by `systemctl` can be confusing without
an immediate way to differentiate between the different interfaces.

Fix this by adding the interface name to the unit description.

Signed-off-by: Gioele Barabucci <gioele@svario.it>
2 years agoOpenSSL: Remove unused assignment from HPKE expand
Jouni Malinen [Mon, 7 Nov 2022 10:31:18 +0000 (12:31 +0200)] 
OpenSSL: Remove unused assignment from HPKE expand

The length of labeled_info is determined separately, so there is no need
to increment the pos pointer after the final entry has been added.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2 years agonl80211: Check that attribute addition succeeds in offloaded PASN case
Jouni Malinen [Mon, 7 Nov 2022 10:27:25 +0000 (12:27 +0200)] 
nl80211: Check that attribute addition succeeds in offloaded PASN case

Check nla_put_flag() return value to be consistent with other nla_put*()
uses.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2 years agoGAS: Try to make buffer length determination easier for static analyzers
Jouni Malinen [Mon, 7 Nov 2022 10:19:28 +0000 (12:19 +0200)] 
GAS: Try to make buffer length determination easier for static analyzers

The received frame buffer was already verified to be long enough to
include the Advertisement Protocol element and that element was verified
to have a valid length value, but use of adv_proto[1] in another
function may have been too difficult to figure out for analyzers.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2 years agoFT: Fix PMK-R0 derivation for FT-SAE-EXT-KEY with SHA512
Jouni Malinen [Sun, 6 Nov 2022 22:29:39 +0000 (00:29 +0200)] 
FT: Fix PMK-R0 derivation for FT-SAE-EXT-KEY with SHA512

Not only the hash[] array, but also the r0_key_data[] array needs to be
extended in size to fit the longer key and salt.

Fixes: a76a314c1535 ("FT: Extend PMK-R0 derivation for FT-SAE-EXT-KEY")
Signed-off-by: Jouni Malinen <j@w1.fi>
2 years agoMLD STA: Group key handshake processing for GTK/IGTK/BIGTK rekeying
Rohan Dutta [Thu, 3 Nov 2022 08:08:53 +0000 (13:38 +0530)] 
MLD STA: Group key handshake processing for GTK/IGTK/BIGTK rekeying

Add support for group rekeying in MLO connection. Parse per link MLO
GTK/IGTK/BIGTK KDEs from Group Key msg 1/2 and configure to the driver.

Signed-off-by: Rohan Dutta <quic_drohan@quicinc.com>
Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
2 years agoMLD STA: Use AP MLD address as destination for 4-way handshake EAPOL-Key frames
Rohan Dutta [Thu, 3 Nov 2022 08:08:52 +0000 (13:38 +0530)] 
MLD STA: Use AP MLD address as destination for 4-way handshake EAPOL-Key frames

Use AP MLD address as the destination address for EAPOL-Key 4-way
handshake frames since authenticator/supplicant operates above MLD. The
driver/firmware will use RA/TA based on the link used for transmitting
the EAPOL frames.

Signed-off-by: Rohan Dutta <quic_drohan@quicinc.com>
Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
2 years agoMLD STA: Validation of MLO KDEs for 4-way handshake EAPOL-Key frames
Veerendranath Jakkam [Thu, 3 Nov 2022 08:08:51 +0000 (13:38 +0530)] 
MLD STA: Validation of MLO KDEs for 4-way handshake EAPOL-Key frames

Validate new KDEs defined for MLO connection in EAPOL-Key msg 1/4 and
3/4 and reject the 4-way handshake frames if any of the new KDE data is
not matching expected key data.

Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
2 years agoMLD STA: Processing of EAPOL-Key msg 3/4 frame when using MLO
Veerendranath Jakkam [Thu, 3 Nov 2022 08:08:50 +0000 (13:38 +0530)] 
MLD STA: Processing of EAPOL-Key msg 3/4 frame when using MLO

Process EAPOL-Key msg 3/4 and configure PTK and per-link GTK/IGTK/BIGTK
keys to the driver when MLO is used.

Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
2 years agoMLD STA: Extend key configuration functions to support Link ID
Veerendranath Jakkam [Thu, 3 Nov 2022 08:08:49 +0000 (13:38 +0530)] 
MLD STA: Extend key configuration functions to support Link ID

Add support to specify a Link ID for set key operation for MLO
connection. This does not change the existing uses and only provides the
mechanism for extension in following commits.

Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
2 years agoMLD STA: Configure TK to the driver using AP MLD address
Rohan Dutta [Thu, 3 Nov 2022 08:08:48 +0000 (13:38 +0530)] 
MLD STA: Configure TK to the driver using AP MLD address

Configure TK to the driver with AP MLD address with MLO is used. Current
changes are handling only EAPOL-Key 4-way handshake and FILS
authentication cases, i.e., FT protocol case needs to be addressed
separately.

Signed-off-by: Rohan Dutta <quic_drohan@quicinc.com>
Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
2 years agoMLD STA: Use AP MLD address in PMKSA entry
Veerendranath Jakkam [Thu, 3 Nov 2022 08:08:50 +0000 (13:38 +0530)] 
MLD STA: Use AP MLD address in PMKSA entry

Use the AP MLD address instead of the BSSID of a link as the
authenticator address in the PMKSA entry.

Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
2 years agoMLD STA: Use AP MLD address to derive pairwise keys
Rohan Dutta [Thu, 3 Nov 2022 08:08:47 +0000 (13:38 +0530)] 
MLD STA: Use AP MLD address to derive pairwise keys

Use AP MLD address to derive pairwise keys for MLO connection. Current
changes are handling only PTK derivation during EAPOL-Key 4-way
handshake and FILS authentication, i.e., FT protocol case needs to be
addressed separately.

Signed-off-by: Rohan Dutta <quic_drohan@quicinc.com>
Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
2 years agoMLD STA: Add MLO KDEs for EAPOL-Key msg 2/4 and 4/4
Veerendranath Jakkam [Thu, 3 Nov 2022 08:08:46 +0000 (13:38 +0530)] 
MLD STA: Add MLO KDEs for EAPOL-Key msg 2/4 and 4/4

Add new KDEs introduced for MLO connection as specified in
12.7.2 EAPOL-Key frames, IEEE P802.11be/D2.2.
- Add MAC and MLO Link KDE for each own affliated link (other than the
  link on which association happened) in EAPOL-Key msg 2/4.
- Add MAC KDE in 4/4 EAPOL frame.

Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
2 years agoMLD STA: Set MLO connection info to wpa_sm
Veerendranath Jakkam [Thu, 3 Nov 2022 08:08:45 +0000 (13:38 +0530)] 
MLD STA: Set MLO connection info to wpa_sm

Update the following MLO connection information to wpa_sm:
- AP MLD address and link ID of the (re)association link.
- Bitmap of requested links and accepted links
- Own link address for each requested link
- AP link address, RSNE and RSNXE for each requested link

Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
2 years agonl80211: Get all requested MLO links information from (re)association events
Veerendranath Jakkam [Thu, 3 Nov 2022 08:08:44 +0000 (13:38 +0530)] 
nl80211: Get all requested MLO links information from (re)association events

Currently only accepted MLO links information is getting parsed from
(re)association events. Add support to parse all the requested MLO links
information including rejected links. Get the rejected MLO links
information from netlink attributes if the kernel supports indicating
per link status. Otherwise get the rejected MLO links information by
parsing (Re)association Request and Response frame elements.

Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
2 years agotests: Fuzz testing for PASN
Jouni Malinen [Sun, 6 Nov 2022 15:12:21 +0000 (17:12 +0200)] 
tests: Fuzz testing for PASN

Add test tools for fuzzing PASN initiator and responder handling of
received PASN Authentication frames.

Signed-off-by: Jouni Malinen <j@w1.fi>
2 years agotests: Fix CC and CFLAGS default processing for fuzzing
Jouni Malinen [Sun, 6 Nov 2022 14:50:28 +0000 (16:50 +0200)] 
tests: Fix CC and CFLAGS default processing for fuzzing

"make LIBFUZZER=y" was supposed to set CC and CFLAGS to working values
by default if not overridden by something external. That did not seem to
work since the defaults from the other build system components ended up
setting these variables before the checks here. Fix this by replacing
the known default values for non-fuzzing builds.

Signed-off-by: Jouni Malinen <j@w1.fi>
2 years agoPASN: Fix spelling of RSNE in debug messages
Jouni Malinen [Sun, 6 Nov 2022 15:11:35 +0000 (17:11 +0200)] 
PASN: Fix spelling of RSNE in debug messages

Signed-off-by: Jouni Malinen <j@w1.fi>
2 years agoPASN: Verify explicitly that elements are present before parsing
Jouni Malinen [Sun, 6 Nov 2022 11:29:34 +0000 (13:29 +0200)] 
PASN: Verify explicitly that elements are present before parsing

Make sure the elements were present before trying to parse them. This
was already done for most cases, but be consistent and check each item
explicitly before use.

Signed-off-by: Jouni Malinen <j@w1.fi>
2 years agoPASN: Fix MIC check not to modify const data
Jouni Malinen [Sun, 6 Nov 2022 11:26:42 +0000 (13:26 +0200)] 
PASN: Fix MIC check not to modify const data

The previous version was using typecasting to ignore const marking for
the input buffer to be able to clear the MIC field for MIC calculation.
That is not really appropriate and could result in issues in the future
if the input data cannot be modified. Fix this by using an allocated
copy of the buffer.

Signed-off-by: Jouni Malinen <j@w1.fi>
2 years agoPASN: Fix Authentication frame checks
Jouni Malinen [Sun, 6 Nov 2022 09:42:58 +0000 (11:42 +0200)] 
PASN: Fix Authentication frame checks

The way type and subtype of the FC field was checked does not really
work correctly. Fix those to check all bits of the subfields. This does
not really make any practical difference, though, since the caller was
already checking this.

Furthermore, use a helper function to avoid having to maintain two
copies of this same functionality.

Signed-off-by: Jouni Malinen <j@w1.fi>
2 years agodbus: Apply PMK properties immediately
Beniamino Galvani [Mon, 3 Oct 2022 07:09:28 +0000 (09:09 +0200)] 
dbus: Apply PMK properties immediately

Currently, PMK parameters in the WPA state machine are set from
configuration only when the interface is initialized. If those
parameters are changed later via D-Bus, the new values don't have any
effect.

Call wpa_sm_set_param() when PMK-related D-Bus properties are changed
to immediately apply the new value; the control interface also does
something similar.

Signed-off-by: Beniamino Galvani <bgalvani@redhat.com>
2 years agoAdd option to disable SAE key_mgmt without PMF
Jeffery Miller [Tue, 25 Oct 2022 19:35:10 +0000 (19:35 +0000)] 
Add option to disable SAE key_mgmt without PMF

Add the `sae_check_mfp` global option to limit SAE when PMF will
not be selected for the connection.
With this option SAE is avoided when the hardware is not capable
of PMF due to missing ciphers.
With this option SAE is avoided on capable hardware when the AP
does not enable PMF.

Allows falling back to PSK on drivers with the
WPA_DRIVER_FLAGS_SAE capability but do not support the BIP cipher
necessary for PMF. This enables configurations that can fall back
to WPA-PSK and avoid problems associating with APs configured
with `sae_require_mfp=1`.

Useful when `pmf=1` and `sae_check_mfp=1` are enabled and networks
are configured with ieee80211w=3 (default) and key_mgmt="WPA-PSK SAE".
In this configuration if the device is unable to use PMF due to
lacking BIP group ciphers it will avoid SAE and fallback to
WPA-PSK for that connection.

Signed-off-by: Jeffery Miller <jefferymiller@google.com>
2 years agoDocument crypto_ec_key_get_subject_public_key() to use compressed format
Glenn Strauss [Mon, 3 Oct 2022 07:31:22 +0000 (03:31 -0400)] 
Document crypto_ec_key_get_subject_public_key() to use compressed format

Document in src/crypto/crypto.h that compressed point format is expected
in DER produced by crypto_ec_key_get_subject_public_key(). This is the
format needed for both SAE-PK and DPP use cases that are the current
users of this function.

Signed-off-by: Glenn Strauss <gstrauss@gluelogic.com>
2 years agoDPP: Stop listen mode for chirp-initiated Authentication exchange
Jouni Malinen [Sat, 5 Nov 2022 15:25:15 +0000 (17:25 +0200)] 
DPP: Stop listen mode for chirp-initiated Authentication exchange

Stop listen mode if there is not sufficient time remaining to complete
the Authentication exchange within the current remain-on-channel
operation. This speeds up the operation and avoids some timeouts that
could prevent the provisioning step from completing. This addresses an
issue that was found in the following test case sequence:
dpp_controller_relay_discover dpp_chirp_ap_5g

Similar mechanism was already used for Reconfig Announcement frames, so
reuse that for this case with Presence Announcement frames.

Signed-off-by: Jouni Malinen <j@w1.fi>
2 years agoP2P: Discount current operating frequency when scanning new connection
Matthew Wang [Fri, 4 Nov 2022 21:18:02 +0000 (14:18 -0700)] 
P2P: Discount current operating frequency when scanning new connection

When scanning for a new connection, we currently optimize by scanning
all frequencies only when our MCC capabilities will allow an additional
operating frequency, and scan only the existing operating frequencies
otherwise. This is problematic when there the current operating
frequency singularly accounts for one of the shared radio frequencies
because we should be able to switch operating frequencies without adding
to the channel count. Fix this.

Signed-off-by: Matthew Wang <matthewmwang@chromium.org>
2 years agotests: Allow more time for sigma_dut sta_reassoc commands
Jouni Malinen [Sat, 5 Nov 2022 11:41:02 +0000 (13:41 +0200)] 
tests: Allow more time for sigma_dut sta_reassoc commands

When these are issued while associated, scanning all channels can take a
significant amount of time. That happened to work for existing test
cases somewhat by accident since the scan was sometimes limited to only
the current operating channel. However, that is now changing and the
following two test cases started failing with the change, so make them
wait longer:
sigma_dut_sae_pw_id_ft sigma_dut_ft_rsnxe_used_mismatch

Signed-off-by: Jouni Malinen <j@w1.fi>
2 years agoDo not drop connection attempt when reconnecting to the same ESS
김우용 [Fri, 4 Nov 2022 07:54:20 +0000 (07:54 +0000)] 
Do not drop connection attempt when reconnecting to the same ESS

Connection attempt could have been intermittently drop when reconnecting
to the same ESS due the current BSS entry getting removed immediately
after the disconnection for the purpose of reconnecting to the same ESS.

Avoid this by not removing a BSS entry for the same ESS when in this
special state of trying to reconnect to the same ESS.

Signed-off-by : WooYong Kim <wykim@newratek.com>

2 years agotests: P2P persistent group formation with extended listen
Shivani Baranwal [Thu, 20 Oct 2022 07:13:03 +0000 (12:43 +0530)] 
tests: P2P persistent group formation with extended listen

Add a new P2P persistent group formation, re-invocation, and cancel test
to verify that P2P_EXT_LISTEN is avoided and the scan is performed in
the P2P Client role to find the P2P GO for the ongoing P2P persistent
group formation on the current interface.

Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
2 years agoP2P: Skip Extended Listen timeout to allow scans during group formation
Shivani Baranwal [Thu, 20 Oct 2022 12:46:28 +0000 (18:16 +0530)] 
P2P: Skip Extended Listen timeout to allow scans during group formation

Scans are allowed on the current interface for group formation only when
in the P2P_SEARCH, P2P_IDLE, or P2P_PROVISIONING state. But Extended
Listen timeout being enabled moves to the P2P_LISTEN_ONLY state. Due to
this P2P connection fails if the GO is not found with scans triggerred
before Extended Listen timeout. To avoid this skip Extended Listen
timeout to allow scans during group formation on the current interface.

Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
2 years agoP2P: Clone sae_pwe config to new group interface config
Veerendranath Jakkam [Wed, 2 Nov 2022 10:25:19 +0000 (15:55 +0530)] 
P2P: Clone sae_pwe config to new group interface config

Clone sae_pwe configuration value when creating a new P2P group
interface. This is needed to avoid P2P connection failure at the P2P
Client side due to SAE H2E being disabled in the 6 GHz band operation
when a new group interface is created for the connection.

Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
2 years agoP2P: Allow PSC channel to be used for 6 GHz BW40
Hu Wang [Wed, 12 Oct 2022 06:52:12 +0000 (23:52 -0700)] 
P2P: Allow PSC channel to be used for 6 GHz BW40

For the 6 GHz opclass 132, ch for loop only allows non-PSC channels { 1,
9, 17, 25, 33, 41, 49,... } to be used. This does not match the IEEE Std
802.11ax-2021 expectation of a 6 GHz-only AP "should set up the BSS with
a primary 20 MHz channel that coincides with a preferred scanning
channel".

Increase ch by 4 to allow PSC channel to be used for 6 GHz BW40.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2 years agoP2P: Track peer 6 GHz capability more robustly
Qiwei Cai [Thu, 3 Nov 2022 02:33:09 +0000 (10:33 +0800)] 
P2P: Track peer 6 GHz capability more robustly

It's necessary to maintain knowledge of the 6 GHz capability of the
peer. Since the Device Capability field migth change between frames
depending on the context in which they are used, loooking at the last
received message might not always provide accurate information.

Add supports_6ghz bool variable in struct p2p_device, initialize it to
false and set to true if the P2P_DEV_CAPAB_6GHZ_BAND_CAPABLE bit is set
to 1 in any P2P frame that includes the P2P Capability attribute. This
boolean would not be cleared to false at any point in time so that the
info doesn't disappear dynamically.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2 years agoAdd QCA vendor subcommand to notify about primary netdev
Krunalsinh Padhar [Thu, 3 Nov 2022 23:35:10 +0000 (16:35 -0700)] 
Add QCA vendor subcommand to notify about primary netdev

Add a new vendor subcommand
QCA_NL80211_VENDOR_SUBCMD_MLO_PEER_PRIM_NETDEV_EVENT to send notification
to application layer about primary netdev of an MLO peer association.

Also define the attributes present in this subcommand.

Signed-off-by: Krunalsinh Padhar <quic_kpadhar@quicinc.com>
2 years agoA vendor roam control configuration for delaying hand off for RX
Sunil Dutt [Thu, 20 Oct 2022 06:35:13 +0000 (12:05 +0530)] 
A vendor roam control configuration for delaying hand off for RX

Introduce a run time roam configuration for "hand off delay for RX".
This value, in milliseconds, will delay the hand off for the specified
time to receive pending RX frames from the current BSS.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2 years agoPASN: Change pasn_use_384() to be a non-static function
Vinay Gannevaram [Mon, 10 Oct 2022 04:39:51 +0000 (10:09 +0530)] 
PASN: Change pasn_use_384() to be a non-static function

libpasn.so users, e.g., Wi-Fi Aware module, could use this function
while deriving protocol specific keys using KDK. Move this function to
global scope to allow that.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2 years agoPASN: Rename struct wpas_pasn to pasn_data
Vinay Gannevaram [Thu, 3 Nov 2022 08:02:06 +0000 (13:32 +0530)] 
PASN: Rename struct wpas_pasn to pasn_data

struct wpas_pasn is common to both initiator and responder, so rename it
to pasn_data to avoid the "wpas_" prefix that could be seen as a
reference to wpa_supplicant (PASN initiator).

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