]> git.ipfire.org Git - thirdparty/hostap.git/log
thirdparty/hostap.git
4 years agoPASN: Derive KDK only when required
Ilan Peer [Thu, 8 Apr 2021 09:06:20 +0000 (12:06 +0300)] 
PASN: Derive KDK only when required

When a PTK derivation is done as part of PASN authentication flow, a KDK
derivation should be done if and only if the higher layer protocol is
supported by both parties.

Fix the code accordingly, so KDK would be derived if and only if both
sides support Secure LTF.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
4 years agoVendor attributes to configure broadcast TWT parameters
Kiran Kumar Lokere [Thu, 25 Mar 2021 05:28:30 +0000 (22:28 -0700)] 
Vendor attributes to configure broadcast TWT parameters

Define the new TWT attributes for configuring the broadcast TWT
parameters in enum qca_wlan_vendor_attr_twt_setup.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoAdd vendor reason codes for TWT setup reject on roaming/channel switch
Mohammad Asaad Akram [Wed, 24 Mar 2021 14:33:02 +0000 (20:03 +0530)] 
Add vendor reason codes for TWT setup reject on roaming/channel switch

The firmware rejects the TWT setup request when roaming and channel
switch is in progress. Extend enum qca_wlan_vendor_twt_status to
represent new reason codes for these cases.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoSet last_eapol_matches_bssid=1 on a roam+auth indication from driver
Sunil Dutt [Thu, 25 Mar 2021 14:17:13 +0000 (07:17 -0700)] 
Set last_eapol_matches_bssid=1 on a roam+auth indication from driver

Commit 3ab35a660364 ("Extend EAPOL frames processing workaround for
roaming cases") added a work around to address the issue of EAPOL frame
reception after reassociation replied to with an incorrect destination
address (the BSSID of the old AP). This is due to association events and
EAPOL RX events being reordered for the roaming cases with drivers that
perform BSS selection internally.

This mechanism relies on the fact that the driver always forwards the
EAPOL handshake to wpa_supplicant after the roaming (sets
last_eapol_matches_bssid during the EAPOL processing and resets on the
assoc/reassoc indication).

The above approach does not address the case where the driver does the
EAPOL handshake on the roam, indicating the authorized status to
wpa_supplicant but also forwards the EAPOL handshake to wpa_supplicant
for few other roam attempts. This is because the flag
last_eapol_matches_bssid is not set with the roam+authorized event from
the driver. Thus, the next reorder of roam and EAPOL RX events would
miss this workaround.

Address this by setting last_eapol_matches_bssid=1 on a roam+authorized
event from the driver.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoSAE: Increment the Sc counter before generating each Confirm
Jouni Malinen [Thu, 8 Apr 2021 20:55:03 +0000 (23:55 +0300)] 
SAE: Increment the Sc counter before generating each Confirm

This changes the Send-Confirm value for the first SAE Confirm message to
be 1 instead of 0 for all cases to match the design shown in IEEE Std
802.11-2020, Figure 12-4 (SAE finite state machine).

Sc is defined to be "the number of SAE Confirm messages that have been
sent" which is a bit vague on whether the current frame is included in
the count or not. However, the state machine is showing inc(Sc)
operation in all cases before the "2" event to build the Confirm.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agotests: Update SAE test vector to IEEE Std 802.11-2020
Jouni Malinen [Fri, 9 Apr 2021 18:49:25 +0000 (21:49 +0300)] 
tests: Update SAE test vector to IEEE Std 802.11-2020

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agonl80211: Support larger number of MAC ACL entries
Yu Wang [Tue, 19 Jan 2021 08:28:28 +0000 (16:28 +0800)] 
nl80211: Support larger number of MAC ACL entries

If the maximum size of MAC ACL entries is large enough, the
configuration message may exceed the default buffer size of a netlink
message which is allocated with nlmsg_alloc(), and result in a failure
when putting the attributes into the message.

To fix this, calculate the required buffer size of the netlink message
according to MAC ACL size and allocate a sufficiently large buffer with
nlmsg_alloc_size().

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agonl80211: Fix the size of the maximum MAC ACL size
Yu Wang [Tue, 19 Jan 2021 08:28:28 +0000 (16:28 +0800)] 
nl80211: Fix the size of the maximum MAC ACL size

NL80211_ATTR_MAC_ACL_MAX is a u32 attribute to advertise the maximum
number of MAC addresses that a device can support for MAC ACL. This was
incorrectly used as a u8 attribute which would not work with any values
larger than 255 or on big endian CPUs. Fix this by moving from
nla_get_u8() to nla_get_u32().

Fixes: 3c4ca36330c0 ("hostapd: Support MAC address based access control list")
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agotests: Multi-AP and WPS parameter update
Jouni Malinen [Sun, 28 Mar 2021 15:43:47 +0000 (18:43 +0300)] 
tests: Multi-AP and WPS parameter update

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: WPS Registrar init errors
Jouni Malinen [Sun, 28 Mar 2021 15:35:46 +0000 (18:35 +0300)] 
tests: WPS Registrar init errors

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoWPS: Share a single error handling path in wps_set_ie()
Jouni Malinen [Sun, 28 Mar 2021 15:26:19 +0000 (18:26 +0300)] 
WPS: Share a single error handling path in wps_set_ie()

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: WPS PBC session overlap workaround
Jouni Malinen [Sun, 28 Mar 2021 15:23:41 +0000 (18:23 +0300)] 
tests: WPS PBC session overlap workaround

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: WPS ER and UNSUBSCRIBE errors
Jouni Malinen [Sun, 28 Mar 2021 15:15:25 +0000 (18:15 +0300)] 
tests: WPS ER and UNSUBSCRIBE errors

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: WPS ER and HTTP client timeout
Jouni Malinen [Sun, 28 Mar 2021 15:05:47 +0000 (18:05 +0300)] 
tests: WPS ER and HTTP client timeout

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: assoc+auth driver event
Jouni Malinen [Sun, 28 Mar 2021 10:33:40 +0000 (13:33 +0300)] 
tests: assoc+auth driver event

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: IEEE 802.1X and FORCE_UNAUTH state
Jouni Malinen [Sun, 28 Mar 2021 09:36:18 +0000 (12:36 +0300)] 
tests: IEEE 802.1X and FORCE_UNAUTH state

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agohostapd: Enable WMM automatically when HE is configured
Lavanya Suresh [Tue, 16 Mar 2021 16:01:19 +0000 (21:31 +0530)] 
hostapd: Enable WMM automatically when HE is configured

If WMM is not set explicitly in the configuration, it can be set based
on HT/HE config. As HE can be used without HT/VHT (which was introduced
as a special behavior for the 6 GHz band), add a similar automatic
enabling of WMM for HE without HT.

Signed-off-by: Lavanya Suresh <lavaks@codeaurora.org>
4 years agotests: P2P peer table limit
Jouni Malinen [Tue, 8 Dec 2020 21:56:46 +0000 (23:56 +0200)] 
tests: P2P peer table limit

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agotests: INTERFACE_ADD behavior on driver init failure
Jouni Malinen [Thu, 4 Feb 2021 22:27:22 +0000 (00:27 +0200)] 
tests: INTERFACE_ADD behavior on driver init failure

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoFlush pending control interface message for an interface to be removed
Jouni Malinen [Thu, 4 Feb 2021 22:28:17 +0000 (00:28 +0200)] 
Flush pending control interface message for an interface to be removed

wpa_supplicant_ctrl_iface_deinit() was executed only if the
per-interface control interface initialization had been completed. This
is not the case if driver initialization fails and that could result in
leaving behind references to the freed wpa_s instance in a corner case
where control interface messages ended up getting queued.

Fix this by calling wpa_supplicant_ctrl_iface_deinit() in all cases to
cancel the potential eloop timeout for wpas_ctrl_msg_queue_timeout with
the reference to the wpa_s pointer. In addition, flush any pending
message from the global queue for this interface since such a message
cannot be of use after this and there is no need to leave them in the
queue until the global control interface gets deinitialized.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agotests: FT with beacon protection
Jouni Malinen [Wed, 24 Mar 2021 23:06:34 +0000 (01:06 +0200)] 
tests: FT with beacon protection

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: OCV testing with AP special functionality set after ENABLE
Jouni Malinen [Wed, 24 Mar 2021 23:03:04 +0000 (01:03 +0200)] 
tests: OCV testing with AP special functionality set after ENABLE

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: WPA2-PSK AP and GTK rekey failure
Jouni Malinen [Wed, 24 Mar 2021 22:49:02 +0000 (00:49 +0200)] 
tests: WPA2-PSK AP and GTK rekey failure

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: WNM-Sleep Mode exit with PMF and beacon protection
Jouni Malinen [Wed, 24 Mar 2021 22:37:58 +0000 (00:37 +0200)] 
tests: WNM-Sleep Mode exit with PMF and beacon protection

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoFix WNM-Sleep Mode exit debug print of BIGTK
Jouni Malinen [Wed, 24 Mar 2021 22:30:04 +0000 (00:30 +0200)] 
Fix WNM-Sleep Mode exit debug print of BIGTK

Previous debug print used IGTK instead of BIGTK, so fix that to use the
correct key. Actual generation of the BIGTK subelement itself was using
the correct key, though, so this is only needed to fix the debug print.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: Re-enable op class 118-120 tests with new regdb
Jouni Malinen [Tue, 23 Mar 2021 22:51:10 +0000 (00:51 +0200)] 
tests: Re-enable op class 118-120 tests with new regdb

Move from RS to PA country code to allow these test cases to work since
regdb was updated to require DFS for these operating classes in RS.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: hostapd configuration with op_class
Jouni Malinen [Tue, 23 Mar 2021 22:46:57 +0000 (00:46 +0200)] 
tests: hostapd configuration with op_class

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: DPP PFS error cases
Jouni Malinen [Tue, 23 Mar 2021 22:05:05 +0000 (00:05 +0200)] 
tests: DPP PFS error cases

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: MSCS
Jouni Malinen [Mon, 22 Mar 2021 22:38:45 +0000 (00:38 +0200)] 
tests: MSCS

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoMSCS: Fix MSCS Response frame Status field parsing
Jouni Malinen [Mon, 22 Mar 2021 22:30:49 +0000 (00:30 +0200)] 
MSCS: Fix MSCS Response frame Status field parsing

This is a 2 octet field, so need to use WPA_GET_LE16() here instead of
using only the first octet of the value.

Fixes: bbd3178af45b ("MSCS: Add support to process MSCS Response frames")
Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoAdd REGISTER_FRAME hostapd control interface command for testing purposes
Jouni Malinen [Mon, 22 Mar 2021 10:32:16 +0000 (12:32 +0200)] 
Add REGISTER_FRAME hostapd control interface command for testing purposes

This can be used to register reception of new types of Management frames
through nl80211.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoAllow AP mode extended capabilities to be overridden
Jouni Malinen [Mon, 22 Mar 2021 09:29:31 +0000 (11:29 +0200)] 
Allow AP mode extended capabilities to be overridden

The new hostapd configuration parameters ext_capa_mask and ext_capa can
now be used to mask out or add extended capability bits. While this is
not without CONFIG_TESTING_OPTIONS, the main use case for this is for
testing purposes.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoMake hostapd_config_fill() easier to auto indent
Jouni Malinen [Mon, 22 Mar 2021 09:33:16 +0000 (11:33 +0200)] 
Make hostapd_config_fill() easier to auto indent

The conditional compilation block with only the opening brace included
in two variants was messing up auto indentation in emacs. Work around
this by defining the maximum value conditionally while leave the if
block outside any conditional building rules.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoSimplify extended capability determination in AP mode
Jouni Malinen [Mon, 22 Mar 2021 09:12:39 +0000 (11:12 +0200)] 
Simplify extended capability determination in AP mode

There is no need to determine the exact length of the element before
filling in the octets since this function is already capable of
truncated the fields based on what the actual values are.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoPASN: Use a helper function to free radio work data
Jouni Malinen [Sun, 21 Mar 2021 16:33:17 +0000 (18:33 +0200)] 
PASN: Use a helper function to free radio work data

This is safer in avoiding memory leaks now that there is a dynamically
allocated member within the data struct.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoPASN: Mark pubkey/comeback arguments constant for frame construction
Jouni Malinen [Sun, 21 Mar 2021 16:30:52 +0000 (18:30 +0200)] 
PASN: Mark pubkey/comeback arguments constant for frame construction

These parameters are only copied to the frame, so mark them as constant.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: Add PASN tests with comeback flow
Ilan Peer [Sun, 21 Mar 2021 11:55:10 +0000 (13:55 +0200)] 
tests: Add PASN tests with comeback flow

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
4 years agoPASN: Add support for comeback flow to wpa_supplicant
Ilan Peer [Sun, 21 Mar 2021 11:55:09 +0000 (13:55 +0200)] 
PASN: Add support for comeback flow to wpa_supplicant

Process the received comeback cookie and retry automatically if the AP
allows this. Otherwise, provide the cookie to upper layers to allow a
later attempt with the cookie.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
4 years agoPASN: Add support for comeback flow in AP mode
Ilan Peer [Sun, 21 Mar 2021 11:55:08 +0000 (13:55 +0200)] 
PASN: Add support for comeback flow in AP mode

Reuse the SAE anti-clogging token implementation to support similar
design with the PASN comeback cookie.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
4 years agotests: DPP NFC operation failures in hostapd
Jouni Malinen [Sun, 21 Mar 2021 14:55:44 +0000 (16:55 +0200)] 
tests: DPP NFC operation failures in hostapd

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: DPP bootstrapping via NFC URI record (hostapd reading tag)
Jouni Malinen [Sun, 21 Mar 2021 14:39:46 +0000 (16:39 +0200)] 
tests: DPP bootstrapping via NFC URI record (hostapd reading tag)

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: DPP GAS Query error cases with hostapd
Jouni Malinen [Sun, 21 Mar 2021 11:18:00 +0000 (13:18 +0200)] 
tests: DPP GAS Query error cases with hostapd

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoDPP: Fix GAS client error case handling in hostapd
Jouni Malinen [Sun, 21 Mar 2021 09:47:39 +0000 (11:47 +0200)] 
DPP: Fix GAS client error case handling in hostapd

The GAS client processing of the response callback for DPP did not
properly check for GAS query success. This could result in trying to
check the Advertisement Protocol information in failure cases where that
information is not available and that would have resulted in
dereferencing a NULL pointer. Fix this by checking the GAS query result
before processing with processing of the response.

This is similar to the earlier wpa_supplicant fix in commit 931f7ff65609
("DPP: Fix GAS client error case handling").

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoEAP-SIM/AKA: Fix check for anonymous decorated identity
Jouni Malinen [Sat, 20 Mar 2021 14:25:50 +0000 (16:25 +0200)] 
EAP-SIM/AKA: Fix check for anonymous decorated identity

eap_sim_anonymous_username() gets called with an argument that is not a
null terminated C string and as such, os_strrchr() and os_strlen()
cannot be used with it. The previous implementation resulted in use of
uninitialized values and a potential read beyond the end of the buffer.

Credit to OSS-Fuzz: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=32277
Fixes: 73d9891bd722 ("EAP-SIM/AKA peer: Support decorated anonymous identity prefix")
Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoDPP: Indicate authentication success on ConfReqRX if needed (hostapd)
Jouni Malinen [Sat, 20 Mar 2021 14:09:19 +0000 (16:09 +0200)] 
DPP: Indicate authentication success on ConfReqRX if needed (hostapd)

It is possible to receive the Configuration Request frame before having
seen TX status for the Authentication Confirm. In that sequence, the
DPP-AUTH-SUCCESS event would not be indicated before processing the
configuration step and that could confuse upper layers that follow the
details of the DPP exchange. As a workaround, indicate DPP-AUTH-SUCCESS
when receiving the Configuration Request since the Enrollee/Responser
has clearly receive the Authentication Confirm even if the TX status for
it has not been received.

This was already done in wpa_supplicant in commit 422e73d623b4 ("DPP:
Indicate authentication success on ConfReqRX if needed") and matching
changes are now added to hostapd.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: PMKSA cache add failure
Jouni Malinen [Sat, 20 Mar 2021 11:38:49 +0000 (13:38 +0200)] 
tests: PMKSA cache add failure

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoFix full EAP authentication after PMKSA cache add failure
Jouni Malinen [Sat, 20 Mar 2021 11:36:55 +0000 (13:36 +0200)] 
Fix full EAP authentication after PMKSA cache add failure

Need to get EAP state machine into a state where it is willing to
proceed with a new EAP-Request/Identity if PMKSA cache addition fails
after a successful EAP authentication before the initial 4-way handshake
can be completed.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: hostapd ctrl_iface SET_NEIGHBOR failures
Jouni Malinen [Sat, 20 Mar 2021 11:13:24 +0000 (13:13 +0200)] 
tests: hostapd ctrl_iface SET_NEIGHBOR failures

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: DPP and hostapd as Enrollee with GAS fragmentation/timeout
Jouni Malinen [Sat, 20 Mar 2021 10:24:50 +0000 (12:24 +0200)] 
tests: DPP and hostapd as Enrollee with GAS fragmentation/timeout

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: DPP connection status - success with hostapd as Configurator
Jouni Malinen [Sat, 20 Mar 2021 10:19:12 +0000 (12:19 +0200)] 
tests: DPP connection status - success with hostapd as Configurator

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoDPP2: Fix connection status result wait in hostapd
Jouni Malinen [Sat, 20 Mar 2021 10:17:58 +0000 (12:17 +0200)] 
DPP2: Fix connection status result wait in hostapd

The waiting_conn_status_result flag was not set which made hostapd
discard the Connection Status Result. Fix this to match the
wpa_supplicant implementation.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: hostapd airtime policy configuration
Jouni Malinen [Fri, 19 Mar 2021 22:22:28 +0000 (00:22 +0200)] 
tests: hostapd airtime policy configuration

Add minimal testing for airtime policy configuration. mac80211_hwsim
does not actually support this functionality, so this is just for
testing coverage of src/ap/airtime_policy.c.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoTesting functionality for airtime policy
Jouni Malinen [Sat, 20 Mar 2021 10:02:18 +0000 (12:02 +0200)] 
Testing functionality for airtime policy

Add a new testing parameter to allow airtime policy implementation to be
tested for more coverage even without kernel driver support.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: DPP with hostapd as configurator/initiator with v1 enrollee
Jouni Malinen [Sat, 20 Mar 2021 09:09:25 +0000 (11:09 +0200)] 
tests: DPP with hostapd as configurator/initiator with v1 enrollee

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: DPP chirp by an AP on 5 GHz
Jouni Malinen [Sat, 20 Mar 2021 09:03:09 +0000 (11:03 +0200)] 
tests: DPP chirp by an AP on 5 GHz

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: AP tracking STA taxonomy (5 GHz)
Jouni Malinen [Fri, 19 Mar 2021 22:44:05 +0000 (00:44 +0200)] 
tests: AP tracking STA taxonomy (5 GHz)

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agonl80211: Debug print error from airtime weight configuration
Jouni Malinen [Fri, 19 Mar 2021 22:15:53 +0000 (00:15 +0200)] 
nl80211: Debug print error from airtime weight configuration

It is better to be able to determine whether the airtime weight
configuration for a STA actually was accepted by the driver or not.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: HE AP spatial reuse parameters
Jouni Malinen [Fri, 19 Mar 2021 21:58:39 +0000 (23:58 +0200)] 
tests: HE AP spatial reuse parameters

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: Fix error messages for HE config missing
Jouni Malinen [Fri, 19 Mar 2021 21:34:58 +0000 (23:34 +0200)] 
tests: Fix error messages for HE config missing

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoMore documentation for HE Spatial Reuse Parameter Set configuration
Jouni Malinen [Fri, 19 Mar 2021 21:33:16 +0000 (23:33 +0200)] 
More documentation for HE Spatial Reuse Parameter Set configuration

Add a bit more complete documentation on how he_spr_sr_control parameter
is supposed to be used.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: EAP-SIM with decorated anonymous identity
Jouni Malinen [Fri, 19 Mar 2021 19:12:43 +0000 (21:12 +0200)] 
tests: EAP-SIM with decorated anonymous identity

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoEAP-SIM/AKA peer: Support decorated anonymous identity prefix
Hai Shalom [Fri, 12 Mar 2021 02:42:10 +0000 (18:42 -0800)] 
EAP-SIM/AKA peer: Support decorated anonymous identity prefix

Support decorated anonymous identity prefix as per RFC 7542,
for SIM-based EAP networks.

Signed-off-by: Hai Shalom <haishalom@google.com>
4 years agoIntroduce reason code for TWT teardown due to concurrency
Mohammad Asaad Akram [Wed, 17 Mar 2021 04:12:35 +0000 (09:42 +0530)] 
Introduce reason code for TWT teardown due to concurrency

The firmware sends new reason codes to indicate TWT teardown due to
single channel and multi channel concurrency. Update the enum
qca_wlan_vendor_twt_status to represent new reason code.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agotests: Make FT roaming and data connectivity checks more robust
Jouni Malinen [Fri, 19 Mar 2021 18:54:16 +0000 (20:54 +0200)] 
tests: Make FT roaming and data connectivity checks more robust

Dump pending monitor interface messages between each roaming step to
make the test log easier to understand and hostapd wait for the new
connection more robust by ensuring that the processed event if for the
very last reassociation. It looks like at least ap_ft_vlan_over_ds_many
could fail due to the connectivity check being started before the final
roam had been completed on the AP side even though there was an explicit
hapd2ap.wait_sta() wait before the test.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agotests: Check update misbehaving MBO AP test to include roam
Matthew Wang [Tue, 16 Mar 2021 20:19:55 +0000 (13:19 -0700)] 
tests: Check update misbehaving MBO AP test to include roam

APs PMF capabilities can differ. wpa_supplicant should be able to
disable and enable MBO when roaming to and from a misbehaving MBO AP
that doesn't support PMF. Verify that this is indeed happening.

Signed-off-by: Matthew Wang <matthewmwang@chromium.org>
4 years agotests: Fix eap_proto_eke_errors with gcc-10
Jouni Malinen [Wed, 17 Mar 2021 21:38:26 +0000 (23:38 +0200)] 
tests: Fix eap_proto_eke_errors with gcc-10

gcc-10 seems to be inlining eap_eke_prf() and eap_eke_prfplus() which
breaks this test case due to a different backtrace being generated for
triggering the local failures. Point to the functions called by those
instead of these two functions to get this working with both gcc-9 and
gcc-10.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agotests: Speed up tshark operations
Jouni Malinen [Wed, 17 Mar 2021 21:36:52 +0000 (23:36 +0200)] 
tests: Speed up tshark operations

Hide /usr/share/wireshark from hostfs to prevent tshark from loading all
the data from there since that can take significant amount of time and
is not really needed for the test cases. In addition, set HOME to point
to local tmpfs to avoid unnecessary references through hostfs.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agotests: Add coverage for PASN deauthentication
Ilan Peer [Tue, 16 Mar 2021 09:43:23 +0000 (11:43 +0200)] 
tests: Add coverage for PASN deauthentication

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
4 years agoPASN: Add support for deauthentication flow in station
Ilan Peer [Mon, 15 Mar 2021 12:57:12 +0000 (14:57 +0200)] 
PASN: Add support for deauthentication flow in station

The new wpa_supplicant control interface command "PASN_DEAUTH
bssid=<BSSID>" can now be used to flush the local PTKSA cache for the
specified BSS and to notify the AP to request it to drop its PTKSA as
well.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
4 years agonl80211: Allow sending Deauthentication frame with off channel for PASN
Ilan Peer [Mon, 15 Mar 2021 12:57:11 +0000 (14:57 +0200)] 
nl80211: Allow sending Deauthentication frame with off channel for PASN

To allow for a PASN station to deauthenticate from an AP to clear any
PTKSA cache entry for it, extend the nl80211 interface to allow sending
a Deauthentication frame with off channel enabled.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
4 years agoAP: Handle deauthentication frame from PASN station
Ilan Peer [Mon, 15 Mar 2021 12:57:10 +0000 (14:57 +0200)] 
AP: Handle deauthentication frame from PASN station

When a Deauthentication frame is received, clear the corresponding PTKSA
cache entry for the given station, to invalidate previous PTK
information.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
4 years agoAP: Enable anti clogging handling code in PASN builds without SAE
Ilan Peer [Mon, 15 Mar 2021 12:57:06 +0000 (14:57 +0200)] 
AP: Enable anti clogging handling code in PASN builds without SAE

The anti-clogging code was under CONFIG_SAE. Change this so it can be
used both with CONFIG_SAE and CONFIG_PASN.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
4 years agoAP: Rename SAE anti clogging variables and functions
Ilan Peer [Mon, 15 Mar 2021 12:57:05 +0000 (14:57 +0200)] 
AP: Rename SAE anti clogging variables and functions

PASN authentication mandates support for comeback flow, which
among others can be used for anti-clogging purposes.

As the SAE support for anti clogging can also be used for PASN,
start modifying the source code so the anti clogging support
can be used for both SAE and PASN.

As a start, rename some variables/functions etc. so that they would not
be SAE specific. The configuration variable is also renamed, but the old
version remains available for backwards compatibility.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
4 years agotests: Add test coverage for PASN with MIC errors
Ilan Peer [Mon, 15 Mar 2021 12:57:04 +0000 (14:57 +0200)] 
tests: Add test coverage for PASN with MIC errors

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
4 years agoPASN: For testing purposes allow to corrupt MIC
Ilan Peer [Mon, 15 Mar 2021 12:57:03 +0000 (14:57 +0200)] 
PASN: For testing purposes allow to corrupt MIC

For testing purposes, add support for corrupting the MIC in PASN
Authentication frames for both wpa_supplicant and hostapd.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
4 years agotests: PASN: configure the nid before sending the command
Ilan Peer [Mon, 15 Mar 2021 12:57:02 +0000 (14:57 +0200)] 
tests: PASN: configure the nid before sending the command

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
4 years agoPASN: Encode the public key properly
Ilan Peer [Mon, 15 Mar 2021 12:57:01 +0000 (14:57 +0200)] 
PASN: Encode the public key properly

When a public key is included in the PASN Parameters element, it should
be encoded using the RFC 5480 conventions, and thus the first octet of
the Ephemeral Public Key field should indicate whether the public key is
compressed and the actual key part starts from the second octet.

Fix the implementation to properly adhere to the convention
requirements for both wpa_supplicant and hostapd.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
4 years agoPASN: Include PMKID in RSNE in PASN response from AP
Ilan Peer [Mon, 15 Mar 2021 12:57:00 +0000 (14:57 +0200)] 
PASN: Include PMKID in RSNE in PASN response from AP

As defined in IEEE P802.11az/D3.0, 12.12.3.2 for the second PASN frame.
This was previously covered only for the case when the explicit PMKSA
was provided to the helper function. Extend that to cover the PMKID from
SAE/FILS authentication cases.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
4 years agoPASN: Fix setting frame and data lengths in AP mode PASN response
Ilan Peer [Mon, 15 Mar 2021 12:56:59 +0000 (14:56 +0200)] 
PASN: Fix setting frame and data lengths in AP mode PASN response

Frame length and data length can exceed 256 so need to use size_t
instead of u8.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
4 years agoEAP peer: Make EAP-Success handling more robust against race conditions
Jouni Malinen [Sun, 14 Mar 2021 22:45:20 +0000 (00:45 +0200)] 
EAP peer: Make EAP-Success handling more robust against race conditions

When ERP initialization was moved from the METHOD state to the SUCCESS
state, the conditions for checking against EAP state being cleared was
missed. The METHOD state verified that sm->m is not NULL while the
SUCCESS state did not have such a check. This opened a window for a race
condition where processing of deauthentication event and EAPOL RX events
could end up delivering an EAP-Success to the EAP peer state machine
after the state had been cleared. This issue has now been worked around
in another manner, but the root cause for this regression should be
fixed as well.

Check that the EAP state machine is properly configured before trying to
initialize ERP in the SUCCESS state.

Fixes: 2a71673e27e9 ("ERP: Derive ERP key only after successful EAP authentication")
Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: Enable HE overrides in wpa_supplicant build
Jouni Malinen [Sun, 14 Mar 2021 17:12:07 +0000 (19:12 +0200)] 
tests: Enable HE overrides in wpa_supplicant build

This is needed for the recently added he_disabled_on_sta test case.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: DPP Authentication Confirm timeout in hostapd
Jouni Malinen [Sun, 14 Mar 2021 16:52:54 +0000 (18:52 +0200)] 
tests: DPP Authentication Confirm timeout in hostapd

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoDPP: Add init/respond retries parameter configuration to hostapd
Jouni Malinen [Sun, 14 Mar 2021 16:51:43 +0000 (18:51 +0200)] 
DPP: Add init/respond retries parameter configuration to hostapd

These parameters were already defined in struct hostapd_data, but there
was no way of setting them. Add these to hostapd control interface
similarly to the wpa_supplicant implementation.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: OCV without PMF
Jouni Malinen [Sun, 14 Mar 2021 16:27:47 +0000 (18:27 +0200)] 
tests: OCV without PMF

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: WEP and HE
Jouni Malinen [Sun, 14 Mar 2021 16:21:47 +0000 (18:21 +0200)] 
tests: WEP and HE

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: HE AP and 6 GHz security parameter validation
Jouni Malinen [Sun, 14 Mar 2021 16:17:33 +0000 (18:17 +0200)] 
tests: HE AP and 6 GHz security parameter validation

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: Automatic channel selection for VHT 80+80
Jouni Malinen [Sun, 14 Mar 2021 16:07:19 +0000 (18:07 +0200)] 
tests: Automatic channel selection for VHT 80+80

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: RADIUS Accounting and interim updates failing
Jouni Malinen [Sun, 14 Mar 2021 15:59:52 +0000 (17:59 +0200)] 
tests: RADIUS Accounting and interim updates failing

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: Fix ap_wpa2_eap_tls_ocsp_multi_revoked
Jouni Malinen [Sun, 14 Mar 2021 11:46:03 +0000 (13:46 +0200)] 
tests: Fix ap_wpa2_eap_tls_ocsp_multi_revoked

The index-revoked.txt file had not been updated when the server
certificate was updated.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoTLS: Fix highest TLS version disabling with internal TLS client
Jouni Malinen [Sun, 14 Mar 2021 10:48:19 +0000 (12:48 +0200)] 
TLS: Fix highest TLS version disabling with internal TLS client

The highest supported TLS version for pre_master_secret needs to be
limited based on the local configuration for the case where the highest
version number is being explicitly disabled. Without this, the server
would likely detect a downgrade attack.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: Check SAE capability for couple of forgotten sigma_dut cases
Jouni Malinen [Sat, 13 Mar 2021 23:23:32 +0000 (01:23 +0200)] 
tests: Check SAE capability for couple of forgotten sigma_dut cases

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: Check DPP capability in couple of forgotten cases
Jouni Malinen [Sat, 13 Mar 2021 23:05:08 +0000 (01:05 +0200)] 
tests: Check DPP capability in couple of forgotten cases

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: Skip ap_cipher_wpa_sae without SAE support
Jouni Malinen [Sat, 13 Mar 2021 22:55:06 +0000 (00:55 +0200)] 
tests: Skip ap_cipher_wpa_sae without SAE support

Even though the STA in this test case does not actually use SAE, it
needs to recognize the "SAE H2E only "BSS membership selector.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: Fix check_sae_pk_capab() with non-SAE builds
Jouni Malinen [Sat, 13 Mar 2021 22:51:23 +0000 (00:51 +0200)] 
tests: Fix check_sae_pk_capab() with non-SAE builds

dev.get_capability() returns None in such a case.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoDPP2: Use ASN.1 helper functions
Jouni Malinen [Fri, 12 Mar 2021 21:24:54 +0000 (23:24 +0200)] 
DPP2: Use ASN.1 helper functions

Simplify ASN.1 parser operations by using the shared helper functions.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoTLS: Use ASN.1 helper functions
Jouni Malinen [Fri, 12 Mar 2021 21:24:54 +0000 (23:24 +0200)] 
TLS: Use ASN.1 helper functions

Simplify ASN.1 parser operations by using the shared helper functions.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoX509: Use ASN.1 helper functions
Jouni Malinen [Fri, 12 Mar 2021 21:24:54 +0000 (23:24 +0200)] 
X509: Use ASN.1 helper functions

Simplify ASN.1 parser operations by using the shared helper functions.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoRSA: Use ASN.1 helper functions
Jouni Malinen [Fri, 12 Mar 2021 21:24:54 +0000 (23:24 +0200)] 
RSA: Use ASN.1 helper functions

Simplify ASN.1 parser operations by using the shared helper functions.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoPKCS: Use ASN.1 helper functions
Jouni Malinen [Fri, 12 Mar 2021 21:24:54 +0000 (23:24 +0200)] 
PKCS: Use ASN.1 helper functions

Simplify ASN.1 parser operations by using the shared helper functions.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoASN.1: Validate DigestAlgorithmIdentifier parameters
Jouni Malinen [Sat, 13 Mar 2021 16:19:31 +0000 (18:19 +0200)] 
ASN.1: Validate DigestAlgorithmIdentifier parameters

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

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

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