]> git.ipfire.org Git - thirdparty/hostap.git/log
thirdparty/hostap.git
5 years agonl80211: Do not send FILS ERP sequence number without rRK
Vinita S. Maloo [Tue, 19 May 2020 12:13:22 +0000 (17:43 +0530)] 
nl80211: Do not send FILS ERP sequence number without rRK

FILS ERP cannot be used without rRK, so include these attributes only
together.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years ago6 GHz: Change 6 GHz channels per IEEE P802.11ax/D6.1
Wu Gao [Mon, 8 Jun 2020 06:27:12 +0000 (14:27 +0800)] 
6 GHz: Change 6 GHz channels per IEEE P802.11ax/D6.1

The channel numbering/center frequencies was changed in IEEE
P802.11ax/D6.1. The center frequencies of the channels were shifted by
10 MHz. Also, a new operating class 136 was defined with a single
channel 2. Add required support to change the channelization as per IEEE
P802.11ax/D6.1.

Signed-off-by: Wu Gao<wugao@codeaurora.org>
Signed-off-by: Vamsi Krishna <vamsin@codeaurora.org>
5 years agodpp-nfc: Support channel list negotiation
Jouni Malinen [Tue, 23 Jun 2020 10:24:38 +0000 (13:24 +0300)] 
dpp-nfc: Support channel list negotiation

If the peer's channel list in negotiated handover does not have any
common channels and the local end is configured with an alternative
channel list, try to initiate another negotiation handover with the
alternative channels.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agodpp-nfc: Update debug print for tag-read-only operation
Jouni Malinen [Mon, 22 Jun 2020 21:57:18 +0000 (00:57 +0300)] 
dpp-nfc: Update debug print for tag-read-only operation

Be clearer about only a tag read being allowed when dpp-nfc is
configured to not allow connection handover.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: sigma_dut sta_scan WaitCompletion,1
Jouni Malinen [Mon, 22 Jun 2020 20:38:36 +0000 (23:38 +0300)] 
tests: sigma_dut sta_scan WaitCompletion,1

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: sigma_dut DPP Configurator for dot1x
Jouni Malinen [Mon, 22 Jun 2020 18:45:57 +0000 (21:45 +0300)] 
tests: sigma_dut DPP Configurator for dot1x

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP2: Fix DPP_CA_SET processing with authentication not having peer BI
Jouni Malinen [Mon, 22 Jun 2020 18:45:10 +0000 (21:45 +0300)] 
DPP2: Fix DPP_CA_SET processing with authentication not having peer BI

Need to check for auth->peer_bi being set before using it here.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP: Clear bootstrap entries only after clearing authentication state
Jouni Malinen [Mon, 22 Jun 2020 17:00:31 +0000 (20:00 +0300)] 
DPP: Clear bootstrap entries only after clearing authentication state

This fixes an issue where the pending authentication might have held a
reference to auth->tmp_peer_bi and dpp_auth_deinit() would try to free
that bootstrapping entry. This needs to happen before the call to
dpp_global_clear() to avoid double-removal of the bootstrapping entry
from the list.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: nl80211 control port in AP mode disabled/enabled
Jouni Malinen [Sun, 21 Jun 2020 14:32:00 +0000 (17:32 +0300)] 
tests: nl80211 control port in AP mode disabled/enabled

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agonl80211: Use control port TX (status) in AP mode if possible
Markus Theil [Wed, 10 Jun 2020 08:32:58 +0000 (10:32 +0200)] 
nl80211: Use control port TX (status) in AP mode if possible

Check if nl80211 control port TX status is available in the kernel and
enable control port TX if so. With this feature, nl80211 control path is
able to provide the same feature set as nl80211 (management) + AF_PACKET
socket (control) before.

For debugging and testing, this can explicitly be disabled with
the driver parameter control_port_ap=0.

Signed-off-by: Markus Theil <markus.theil@tu-ilmenau.de>
5 years agonl80211: Work around misdelivered control port TX status
Jouni Malinen [Sun, 21 Jun 2020 14:32:00 +0000 (17:32 +0300)] 
nl80211: Work around misdelivered control port TX status

The kernel commit "mac80211: support control port TX status reporting"
seems to be delivering the TX status events for EAPOL frames over
control port using NL80211_CMD_FRAME_TX_STATUS due to incorrect check on
whether the frame is a Management or Data frame. Use the pending cookie
value from EAPOL TX operation to detect this incorrect behavior and
redirect the event internally to allow it to be used to get full TX
control port functionality available for AP mode.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agonl80211: Use ext ack handler for TX control port
Markus Theil [Wed, 10 Jun 2020 08:32:59 +0000 (10:32 +0200)] 
nl80211: Use ext ack handler for TX control port

Allow custom ack handler to be registered and use the ext ack handler
for TX control port to fetch the cookie information. If these cookies
are not supported by the current kernel, a value of 0 is returned.

Signed-off-by: Markus Theil <markus.theil@tu-ilmenau.de>
5 years agonl80211: Handle control port TX status events over nl80211
Markus Theil [Wed, 10 Jun 2020 08:32:57 +0000 (10:32 +0200)] 
nl80211: Handle control port TX status events over nl80211

In order to retransmit faster in AP mode, hostapd can handle TX status
notifications. When using nl80211, this is currently only possible with
socket control messages. Add support for receiving such events directly
over nl80211 and detecting, if this feature is supported.

This finally allows for a clean separation between management/control
path (over nl80211) and in-kernel data path.

A follow up commit enables the feature in AP mode.

Control port TX status contains the original frame content for matching
with the current hostapd code. Furthermore, a cookie is included, which
allows for matching against outstanding cookies in the future. This
commit only prints the cookie value for debugging purposes on TX status
receive.

Signed-off-by: Markus Theil <markus.theil@tu-ilmenau.de>
5 years agonl80211: Add custom ack handler arguments to send_and_recv()
Markus Theil [Wed, 10 Jun 2020 08:32:56 +0000 (10:32 +0200)] 
nl80211: Add custom ack handler arguments to send_and_recv()

This is a preliminary patch for using extack cookies for TX control port
handling. Custom ack handler arguments for send_and_recv() and friends
is introduced therefore. This commit does not actually use the provided
values, i.e., that will be added in a separate commit.

Signed-off-by: Markus Theil <markus.theil@tu-ilmenau.de>
5 years agonl80211: Clean up SO_WIFI_STATUS error reporting
Jouni Malinen [Sun, 21 Jun 2020 13:44:51 +0000 (16:44 +0300)] 
nl80211: Clean up SO_WIFI_STATUS error reporting

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: EAP-TEAP with client certificate in Phase 1
Jouni Malinen [Sat, 20 Jun 2020 15:08:12 +0000 (18:08 +0300)] 
tests: EAP-TEAP with client certificate in Phase 1

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoEAP-TEAP (server): Allow Phase 2 skip based on client certificate
Jouni Malinen [Sat, 20 Jun 2020 15:07:04 +0000 (18:07 +0300)] 
EAP-TEAP (server): Allow Phase 2 skip based on client certificate

eap_teap_auth=2 can now be used to configure hostapd to skip Phase 2 if
the peer can be authenticated based on client certificate during Phase
1.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoEAP-TEAP (client): Allow Phase 2 to be skipped if certificate is used
Jouni Malinen [Sat, 20 Jun 2020 15:05:46 +0000 (18:05 +0300)] 
EAP-TEAP (client): Allow Phase 2 to be skipped if certificate is used

The EAP-TEAP server may skip Phase 2 if the client authentication could
be completed during Phase 1 based on client certificate. Handle this
similarly to the case of PAC use.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoOpenSSL: Provide access to peer subject and own certificate use
Jouni Malinen [Sat, 20 Jun 2020 15:04:51 +0000 (18:04 +0300)] 
OpenSSL: Provide access to peer subject and own certificate use

These are needed for EAP-TEAP server and client side implementation to
allow Phase 2 to be skipped based on client certificate use during Phase
1.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoConvert int to bool for throughput estimate tables
Jouni Malinen [Fri, 19 Jun 2020 14:28:25 +0000 (17:28 +0300)] 
Convert int to bool for throughput estimate tables

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoAdd WPA_EVENT_{DO,SKIP}_ROAM events
Matthew Wang [Tue, 2 Jun 2020 00:10:18 +0000 (17:10 -0700)] 
Add WPA_EVENT_{DO,SKIP}_ROAM events

Add events for within-ESS reassociation. This allows us to monitor roam
events, both skipped and allowed, in tests.

Signed-off-by: Matthew Wang <matthewmwang@chromium.org>
5 years agoRefactor wpa_supplicant_need_to_roam()
Matthew Wang [Tue, 2 Jun 2020 00:10:15 +0000 (17:10 -0700)] 
Refactor wpa_supplicant_need_to_roam()

Pull all the within-ESS roam code out of wpa_supplicant_need_to_roam()
and into its own function, wpa_supplicant_need_to_roam_within_ess().
This way, we avoid interleaving several #ifndef's in the original
function and wrap the new function in one big #ifndef. This also
modularizes the within-ESS roam code and makes it easier to test.

Signed-off-by: Matthew Wang <matthewmwang@chromium.org>
5 years agoUse lookup-table instead of macro for TX rate estimates
Matthew Wang [Tue, 2 Jun 2020 00:10:13 +0000 (17:10 -0700)] 
Use lookup-table instead of macro for TX rate estimates

Change INTERPOLATE_RATE() macro to a lookup-table instead for the sake
of readability.

Signed-off-by: Matthew Wang <matthewmwang@chromium.org>
5 years agoDPP2: Remove forgetten development time debug prints
Jouni Malinen [Thu, 18 Jun 2020 21:37:40 +0000 (00:37 +0300)] 
DPP2: Remove forgetten development time debug prints

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: Copy subject from CSR to certificate
Jouni Malinen [Thu, 18 Jun 2020 21:36:44 +0000 (00:36 +0300)] 
tests: Copy subject from CSR to certificate

Instead of overriding the subject field with something arbitrary, use
the value that is included in the CSR now that there is something there.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: DPP over TCP for enterprise provisioning
Jouni Malinen [Thu, 18 Jun 2020 21:12:56 +0000 (00:12 +0300)] 
tests: DPP over TCP for enterprise provisioning

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP2: Fix dot1x config object parsing without trustedEapServerName
Jouni Malinen [Thu, 18 Jun 2020 21:10:51 +0000 (00:10 +0300)] 
DPP2: Fix dot1x config object parsing without trustedEapServerName

Need to check that the JSON node was found before using its value.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP2: Add an automatic peer_bi entry for CSR matching if needed
Jouni Malinen [Thu, 18 Jun 2020 21:08:33 +0000 (00:08 +0300)] 
DPP2: Add an automatic peer_bi entry for CSR matching if needed

This allows the DPP_CA_SET command to be targeting a specific DPP-CST
event in cases where the Configurator did not receive the bootstrapping
information for the peer.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP2: Add Enrollee name into CSR as the commonName
Jouni Malinen [Thu, 18 Jun 2020 18:06:10 +0000 (21:06 +0300)] 
DPP2: Add Enrollee name into CSR as the commonName

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP2: GAS comeback response processing for Enrollee over TCP
Jouni Malinen [Thu, 18 Jun 2020 10:39:53 +0000 (13:39 +0300)] 
DPP2: GAS comeback response processing for Enrollee over TCP

This is almost identical to processing of the GAS initial response.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP2: GAS comeback request processing for Configurator over TCP
Jouni Malinen [Thu, 18 Jun 2020 10:38:37 +0000 (13:38 +0300)] 
DPP2: GAS comeback request processing for Configurator over TCP

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP2: GAS Comeback Request for the TCP case
Jouni Malinen [Thu, 18 Jun 2020 10:14:25 +0000 (13:14 +0300)] 
DPP2: GAS Comeback Request for the TCP case

Make the Enrollee handle GAS comeback delay when performing DPP over
TCP.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP2: Comeback delay response for certificate in over TCP case
Jouni Malinen [Thu, 18 Jun 2020 10:03:29 +0000 (13:03 +0300)] 
DPP2: Comeback delay response for certificate in over TCP case

Send out the GAS Initial Response with comeback delay when Configurator
is operating over TCP.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP2: CSR wait in Configurator when using TCP
Jouni Malinen [Thu, 18 Jun 2020 09:56:51 +0000 (12:56 +0300)] 
DPP2: CSR wait in Configurator when using TCP

Make Configurator wait for CSR (i.e., another Config Request) when using
DPP over TCP similarly to the over Public Action frame case.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP2: CSR generation in TCP Client/Enrollee
Jouni Malinen [Thu, 18 Jun 2020 09:10:23 +0000 (12:10 +0300)] 
DPP2: CSR generation in TCP Client/Enrollee

This was previously covered for the DPP over Public Action frames, but
the DPP over TCP case was missed.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP2: Do not try to proceed with GAS client if CSR building fails
Jouni Malinen [Thu, 18 Jun 2020 09:09:00 +0000 (12:09 +0300)] 
DPP2: Do not try to proceed with GAS client if CSR building fails

This error path was supposed to stop instead of continuing to
wpas_dpp_start_gas_client().

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDefine a new QCA vendor attribute for Optimized Power Management
Alan Chen [Tue, 16 Jun 2020 22:33:18 +0000 (15:33 -0700)] 
Define a new QCA vendor attribute for Optimized Power Management

Define a new attribute configuring Optimized Power Management.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: DPP and enterprise provisioning and CSR getting rejected
Jouni Malinen [Wed, 17 Jun 2020 18:42:35 +0000 (21:42 +0300)] 
tests: DPP and enterprise provisioning and CSR getting rejected

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP2: Allow CSR processing by CA/RA to reject configuration
Jouni Malinen [Wed, 17 Jun 2020 18:39:47 +0000 (21:39 +0300)] 
DPP2: Allow CSR processing by CA/RA to reject configuration

"DPP_CA_SET name=status value=<int>" can now be used to explicitly
indicate that CSR was rejected by CA/RA.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP2: Validate CSR on Configurator before forwarding to CA/RA
Jouni Malinen [Wed, 17 Jun 2020 17:33:07 +0000 (20:33 +0300)] 
DPP2: Validate CSR on Configurator before forwarding to CA/RA

Parse the received CSR, verify that it has been signed correctly, and
verify that the challengePassword is present and matches the derived cp.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP2: Add challengePassword into CSR
Jouni Malinen [Wed, 17 Jun 2020 09:22:08 +0000 (12:22 +0300)] 
DPP2: Add challengePassword into CSR

Derive challengePassword from bk and add it into the CSR.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoOpenSSL: Use EVP-based interface for ECDSA sign/verify
Jouni Malinen [Tue, 16 Jun 2020 10:16:39 +0000 (13:16 +0300)] 
OpenSSL: Use EVP-based interface for ECDSA sign/verify

The low level ECDSA interface is not available in BoringSSL and has been
deprecetated in OpenSSL 3.0, so move to using a higher layer EVP-based
interface for performing the ECDSA sign/verify operations.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: DPP enterprise provisioning
Jouni Malinen [Mon, 15 Jun 2020 17:20:50 +0000 (20:20 +0300)] 
tests: DPP enterprise provisioning

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP2: Enterprise provisioning (Enrollee)
Jouni Malinen [Mon, 15 Jun 2020 17:20:50 +0000 (20:20 +0300)] 
DPP2: Enterprise provisioning (Enrollee)

Add initial Enrollee functionality for provisioning enterprise (EAP-TLS)
configuration object. This commit is handling only the most basic case
and a number of TODO items remains to handle more complete CSR
generation and config object processing.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP2: Enterprise provisioning (Configurator)
Jouni Malinen [Mon, 15 Jun 2020 17:20:50 +0000 (20:20 +0300)] 
DPP2: Enterprise provisioning (Configurator)

Add Configurator functionality for provisioning enterprise (EAP-TLS)
configuration object.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP2: Enterprise provisioning definitions for dot1x AKM
Jouni Malinen [Mon, 15 Jun 2020 17:20:50 +0000 (20:20 +0300)] 
DPP2: Enterprise provisioning definitions for dot1x AKM

Add shared AKM definitions for provisioning enterprise (EAP-TLS)
credentials.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoOpenSSL: Support EC key from private_key blob
Jouni Malinen [Tue, 16 Jun 2020 14:48:47 +0000 (17:48 +0300)] 
OpenSSL: Support EC key from private_key blob

Try to parse the private_key blob as an ECPrivateKey in addition to the
previously supported RSA and DSA.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoOpenSSL: Support PEM encoded chain from client_cert blob
Jouni Malinen [Tue, 16 Jun 2020 14:47:50 +0000 (17:47 +0300)] 
OpenSSL: Support PEM encoded chain from client_cert blob

Allow a chain of certificates to be configured through a client_cert
blob.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoGAS server: Support comeback delay from the request handler
Jouni Malinen [Mon, 15 Jun 2020 18:20:44 +0000 (21:20 +0300)] 
GAS server: Support comeback delay from the request handler

Allow GAS request handler function to request comeback delay before
providing the response.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoJSON: Add base64 helper functions
Jouni Malinen [Mon, 15 Jun 2020 17:19:19 +0000 (20:19 +0300)] 
JSON: Add base64 helper functions

These functions are similar to the base64url helpers but with the base64
(not url) alphabet.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agobase64: Add no-LF variant for encoding
Jouni Malinen [Mon, 15 Jun 2020 17:18:12 +0000 (20:18 +0300)] 
base64: Add no-LF variant for encoding

base64_encode_no_lf() is otherwise identical to base64_encode(), but it
does not add line-feeds to split the output.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoUpdate DFS terminology in attribute value documentation
Jouni Malinen [Thu, 11 Jun 2020 18:53:24 +0000 (21:53 +0300)] 
Update DFS terminology in attribute value documentation

Use "client device" as the term for the device that operates under a
guidance of the device responsible for enforcing DFS rules.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoAllow HE-without-VHT to add the Channel Switch Wrapper element
Muna Sinada [Mon, 18 May 2020 13:57:16 +0000 (06:57 -0700)] 
Allow HE-without-VHT to add the Channel Switch Wrapper element

Modify the check for VHT to include an option for HE in
hostapd_eid_wb_chsw_wrapper() and its callers to allow the Channel
Switch Wrapper element with the Wide Bandwidth Channel Switch subelement
to be included in Beacon and Probe Response frames when AP is operating
in HE mode without VHT.

Signed-off-by: Muna Sinada <msinada@codeaurora.org>
5 years agoMove hostapd_eid_wb_chsw_wrapper() to non-VHT-specific file
Muna Sinada [Mon, 18 May 2020 13:57:15 +0000 (06:57 -0700)] 
Move hostapd_eid_wb_chsw_wrapper() to non-VHT-specific file

Move hostapd_eid_wb_chsw_wrapper() from VHT specific ieee802_11_vht.c to
ieee802_11.c since this can be used for both HE and VHT. This commit
does not change any functionality to enable the HE use case, i.e., the
function is just moved as-is.

Signed-off-by: Muna Sinada <msinada@codeaurora.org>
5 years agoAP: Reject association request upon invalid HE capabilities
Rajkumar Manoharan [Tue, 2 Jun 2020 06:14:28 +0000 (23:14 -0700)] 
AP: Reject association request upon invalid HE capabilities

Operation in the 6 GHz band mandates valid HE capabilities element in
station negotiation. Reject association request upon receiving invalid
or missing HE elements.

Signed-off-by: Rajkumar Manoharan <rmanohar@codeaurora.org>
5 years agoAP: Restrict Vendor VHT to 2.4 GHz only
Rajkumar Manoharan [Tue, 2 Jun 2020 06:14:27 +0000 (23:14 -0700)] 
AP: Restrict Vendor VHT to 2.4 GHz only

Vendor VHT IE is used only on the 2.4 GHz band. Restrict the use of
vendor VHT element to 2.4 GHz. This will ensure that invalid/wrong user
configuration will not impact beacon data in other than the 2.4 GHz
band.

Signed-off-by: Rajkumar Manoharan <rmanohar@codeaurora.org>
5 years agoHE: Use device HE capability instead of HT/VHT for 6 GHz IEs
Rajkumar Manoharan [Tue, 2 Jun 2020 06:14:25 +0000 (23:14 -0700)] 
HE: Use device HE capability instead of HT/VHT for 6 GHz IEs

Previously, 6 GHz Band Capability element was derived from HT and VHT
capabilities of the device. Removes such unnecessary dependency by
relying directly on the HE capability.

In addition, clean up the struct ieee80211_he_6ghz_band_cap definition
to use a 16-bit little endian field instead of two 8-bit fields to match
the definition in P802.11ax.

Signed-off-by: Rajkumar Manoharan <rmanohar@codeaurora.org>
5 years agonl80211: Fetch HE 6 GHz capability from the driver
Rajkumar Manoharan [Tue, 2 Jun 2020 06:14:24 +0000 (23:14 -0700)] 
nl80211: Fetch HE 6 GHz capability from the driver

Read mode specific HE 6 GHz capability from phy info. This is needed
for futher user config validation and IE construction.

Signed-off-by: Rajkumar Manoharan <rmanohar@codeaurora.org>
5 years agoSync with mac80211-next.git include/uapi/linux/nl80211.h
Jouni Malinen [Wed, 10 Jun 2020 15:29:03 +0000 (18:29 +0300)] 
Sync with mac80211-next.git include/uapi/linux/nl80211.h

This brings in nl80211 definitions as of 2020-05-31.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: Add all-blacklist test
Brian Norris [Mon, 8 Jun 2020 23:47:54 +0000 (16:47 -0700)] 
tests: Add all-blacklist test

Signed-off-by: Brian Norris <briannorris@chromium.org>
5 years agotests: Skip malformed SAE authentication frames
Brian Norris [Mon, 8 Jun 2020 23:47:53 +0000 (16:47 -0700)] 
tests: Skip malformed SAE authentication frames

The parsed 'length' field might pointsbeyond the end of the frame, for
some malformed frames. I haven't figured the source of said packets (I'm
using kernel 4.14.177, FWIW), but we can at least be safer about our
handling of them here.

Signed-off-by: Brian Norris <briannorris@chromium.org>
5 years agotests: Check for mac80211_hwsim module before loading it
Johannes Berg [Sun, 31 May 2020 09:40:32 +0000 (11:40 +0200)] 
tests: Check for mac80211_hwsim module before loading it

Instead of checking if the kernel allows modules (via the presence of
/proc/modules), check if mac80211_hwsim is already there and load it
only if not. This gets rid of some ugly prints from modprobe in case
code isn't even a module and cannot be found, etc.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 years agotests: Use bytes in a few places
Johannes Berg [Thu, 28 May 2020 17:52:39 +0000 (19:52 +0200)] 
tests: Use bytes in a few places

With python3 bytes are returned for stdout, so need to use b''
strings instead of normal strings. These are just a few places
I ran into, almost certainly more places need it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 years agotests: Set VHT160 or VHT160-80PLUS80 capability
Johannes Berg [Thu, 28 May 2020 17:52:30 +0000 (19:52 +0200)] 
tests: Set VHT160 or VHT160-80PLUS80 capability

If we want the test to actually use 160/80+80 we need to explicitly
advertise that we support it ourselves, since the kernel is going to be
a bit more strict about this.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 years agoSAE-PK: Advertise RSNXE capability bit in STA mode
Jouni Malinen [Wed, 10 Jun 2020 09:22:59 +0000 (12:22 +0300)] 
SAE-PK: Advertise RSNXE capability bit in STA mode

Set the SAE-PK capability bit in RSNXE when sending out (Re)Association
Request frame for a network profile that allows use of SAE-PK.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: SAE-PK with group 21
Jouni Malinen [Tue, 9 Jun 2020 22:04:11 +0000 (01:04 +0300)] 
tests: SAE-PK with group 21

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoSAE-PK: Update SAE confirm IE design
Jouni Malinen [Tue, 9 Jun 2020 21:59:09 +0000 (00:59 +0300)] 
SAE-PK: Update SAE confirm IE design

Move the FILS Public Key element and the FILS Key Confirmation element
to be separate IEs instead of being encapsulated within the SAE-PK
element. This is also removing the unnecessary length field for the
fixed-length EncryptedModifier.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: Clean up SAE-PK parameter use
Jouni Malinen [Tue, 9 Jun 2020 19:54:35 +0000 (22:54 +0300)] 
tests: Clean up SAE-PK parameter use

Use the global variables instead of copies of same values.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: SAE-PK with different SAE group combinations
Jouni Malinen [Tue, 9 Jun 2020 19:45:57 +0000 (22:45 +0300)] 
tests: SAE-PK with different SAE group combinations

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoSAE-PK: Remove requirement of SAE group matching SAE-PK (K_AP) group
Jouni Malinen [Tue, 9 Jun 2020 19:32:38 +0000 (22:32 +0300)] 
SAE-PK: Remove requirement of SAE group matching SAE-PK (K_AP) group

This was clarified in the draft specification to not be a mandatory
requirement for the AP and STA to enforce, i.e., matching security level
is a recommendation for AP configuration rather than a protocol
requirement.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoWPS UPnP: Support build on OS X
Jouni Malinen [Tue, 9 Jun 2020 09:48:13 +0000 (12:48 +0300)] 
WPS UPnP: Support build on OS X

Define MAC address fetching for OS X (by reusing the existing FreeBSD
implementation) to allow full compile testing of the WPS implementation
on a more BSD-like platform.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoWPS UPnP: Fix FreeBSD build
Jouni Malinen [Tue, 9 Jun 2020 09:43:53 +0000 (12:43 +0300)] 
WPS UPnP: Fix FreeBSD build

struct ifreq does not include the ifr_netmask alternative on FreeBSD, so
replace that more specific name with ifr_addr that works with both Linux
and FreeBSD.

Fixes: 5b78c8f961f2 ("WPS UPnP: Do not allow event subscriptions with URLs to other networks")
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: wpa_supplicant global pmf parameter
Jouni Malinen [Mon, 8 Jun 2020 21:59:26 +0000 (00:59 +0300)] 
tests: wpa_supplicant global pmf parameter

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoHS 2.0: Use global pmf=2 for the created network block
Jouni Malinen [Mon, 8 Jun 2020 21:55:13 +0000 (00:55 +0300)] 
HS 2.0: Use global pmf=2 for the created network block

Previously, PMF support was enabled in optional mode (ieee80211w=1) for
Hotspot 2.0 network blocks automatically. This did not consider the
global PMF parameter and unconditionally changed that value to optional.
Since the newly added network block had an explicit ieee80211w
parameter, this overrode the global parameter. To make this less
surprising, use the global pmf parameter value to select whether to add
network blocks for Hotspot 2.0 with PMF being optionally enabled (pmf=0
or pmf=1) or required (pmf=2).

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoAllow TX queue parameters to be configured for wpa_supplicant AP/P2P GO
Subrat Dash [Sat, 6 Jun 2020 07:50:34 +0000 (13:20 +0530)] 
Allow TX queue parameters to be configured for wpa_supplicant AP/P2P GO

Allow user to configure the TX queue parameters through the
wpa_supplicant configuration file similarly to the way these can be set
in hostapd.

Parse the tx_queue_* parameters in the wpa_supplicant configuration file
and update the TX queue configuration to the AP/P2P GO interface in the
function wpa_supplicant_create_ap().

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoRemove unused enum values
Jouni Malinen [Mon, 8 Jun 2020 21:21:06 +0000 (00:21 +0300)] 
Remove unused enum values

The last user of these was removed in commit 17fbb751e174 ("Remove user
space client MLME") and there is no need to maintain these unused values
anymore.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoMove local TX queue parameter parser into a common file
Subrat Dash [Thu, 21 May 2020 05:03:39 +0000 (10:33 +0530)] 
Move local TX queue parameter parser into a common file

This allows the same implementation to be used for wpa_supplicant as
well.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: OWE transition mode BSSID mismatches
Jouni Malinen [Mon, 8 Jun 2020 18:43:41 +0000 (21:43 +0300)] 
tests: OWE transition mode BSSID mismatches

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDo not try to connect with zero-length SSID
Jouni Malinen [Mon, 8 Jun 2020 18:40:56 +0000 (21:40 +0300)] 
Do not try to connect with zero-length SSID

It was possible to find a BSS to local network profile match for a BSS
entry that has no known SSID when going through some of the SSID
wildcard cases. At leas the OWE transition mode case without BSSID match
could result in hitting this. Zero-length SSID (i.e., wildcard SSID) is
not valid in (Re)Association Request frame, so such an association will
fail. Skip such a BSS to avoid known-to-be-failing association attempts.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: sigma_dut controlled AP using SAE-PK misbehavior
Jouni Malinen [Mon, 8 Jun 2020 16:17:53 +0000 (19:17 +0300)] 
tests: sigma_dut controlled AP using SAE-PK misbehavior

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: Make SAE-PK test cases more robust
Jouni Malinen [Mon, 8 Jun 2020 14:48:57 +0000 (17:48 +0300)] 
tests: Make SAE-PK test cases more robust

Clear scan results explicitly in test cases that check BSS entry flags
to avoid incorrect failures based on results from earlier test cases.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoWPS UPnP: Handle HTTP initiation failures for events more properly
Jouni Malinen [Thu, 4 Jun 2020 18:24:04 +0000 (21:24 +0300)] 
WPS UPnP: Handle HTTP initiation failures for events more properly

While it is appropriate to try to retransmit the event to another
callback URL on a failure to initiate the HTTP client connection, there
is no point in trying the exact same operation multiple times in a row.
Replve the event_retry() calls with event_addr_failure() for these cases
to avoid busy loops trying to repeat the same failing operation.

These potential busy loops would go through eloop callbacks, so the
process is not completely stuck on handling them, but unnecessary CPU
would be used to process the continues retries that will keep failing
for the same reason.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoWPS UPnP: Fix event message generation using a long URL path
Jouni Malinen [Wed, 3 Jun 2020 19:41:02 +0000 (22:41 +0300)] 
WPS UPnP: Fix event message generation using a long URL path

More than about 700 character URL ended up overflowing the wpabuf used
for building the event notification and this resulted in the wpabuf
buffer overflow checks terminating the hostapd process. Fix this by
allocating the buffer to be large enough to contain the full URL path.
However, since that around 700 character limit has been the practical
limit for more than ten years, start explicitly enforcing that as the
limit or the callback URLs since any longer ones had not worked before
and there is no need to enable them now either.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoWPS UPnP: Do not allow event subscriptions with URLs to other networks
Jouni Malinen [Wed, 3 Jun 2020 20:17:35 +0000 (23:17 +0300)] 
WPS UPnP: Do not allow event subscriptions with URLs to other networks

The UPnP Device Architecture 2.0 specification errata ("UDA errata
16-04-2020.docx") addresses a problem with notifications being allowed
to go out to other domains by disallowing such cases. Do such filtering
for the notification callback URLs to avoid undesired connections to
external networks based on subscriptions that any device in the local
network could request when WPS support for external registrars is
enabled (the upnp_iface parameter in hostapd configuration).

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoSAE-PK: Fix FILS Public Key element Key Type for ECDSA
Jouni Malinen [Mon, 8 Jun 2020 11:59:49 +0000 (14:59 +0300)] 
SAE-PK: Fix FILS Public Key element Key Type for ECDSA

Use value 2 to point to RFC 5480 which describes the explicit
indicatiotion of the public key being in compressed form.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoSAE-PK: Check minimum password length more accurate
Jouni Malinen [Mon, 8 Jun 2020 11:49:31 +0000 (14:49 +0300)] 
SAE-PK: Check minimum password length more accurate

Get the Sec value from the password to check the minimum length based on
the used Sec.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: Remove too short SAE-PK passwords
Jouni Malinen [Mon, 8 Jun 2020 14:09:56 +0000 (17:09 +0300)] 
tests: Remove too short SAE-PK passwords

This is in preparation of implementation changes to check SAE-PK
password length more accurately based on the Sec value.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: SAE-PK AP misbehavior
Jouni Malinen [Mon, 8 Jun 2020 11:13:14 +0000 (14:13 +0300)] 
tests: SAE-PK AP misbehavior

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoSAE-PK: Testing functionality to allow behavior overrides
Jouni Malinen [Mon, 8 Jun 2020 11:00:28 +0000 (14:00 +0300)] 
SAE-PK: Testing functionality to allow behavior overrides

The new sae_commit_status and sae_pk_omit configuration parameters and
an extra key at the end of sae_password pk argument can be used to
override SAE-PK behavior for testing purposes.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: sigma_dut controlled AP and transition disabled indication change
Jouni Malinen [Sun, 7 Jun 2020 14:07:57 +0000 (17:07 +0300)] 
tests: sigma_dut controlled AP and transition disabled indication change

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoAllow transition_disable updates during the lifetime of a BSS
Jouni Malinen [Sun, 7 Jun 2020 14:06:52 +0000 (17:06 +0300)] 
Allow transition_disable updates during the lifetime of a BSS

This is mainly for testing purposes to allow more convenient checking of
station behavior when a transition mode is disabled.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: SAE-PK mixed deployment
Jouni Malinen [Sun, 7 Jun 2020 13:50:09 +0000 (16:50 +0300)] 
tests: SAE-PK mixed deployment

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoSAE-PK: Select SAE-PK network over SAE without PK
Jouni Malinen [Sun, 7 Jun 2020 13:49:07 +0000 (16:49 +0300)] 
SAE-PK: Select SAE-PK network over SAE without PK

If there is an acceptable BSS with SAE-PK enabled in the same ESS,
select that over a BSS that does not enable SAE-PK when the network
profile uses automatic SAE-PK selection.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoClean up wpa_scan_res_match()
Jouni Malinen [Sun, 7 Jun 2020 13:30:32 +0000 (16:30 +0300)] 
Clean up wpa_scan_res_match()

Move the BSS-against-SSID matching into a separate helper function to
make this overly long function a bit more readable and to allow that
helper function to be used for other purposes.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: SAE-PK password, but no PK on AP
Jouni Malinen [Sun, 7 Jun 2020 09:04:14 +0000 (12:04 +0300)] 
tests: SAE-PK password, but no PK on AP

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: Share a single definition of SAE-PK Sec=2 values
Jouni Malinen [Sun, 7 Jun 2020 09:01:52 +0000 (12:01 +0300)] 
tests: Share a single definition of SAE-PK Sec=2 values

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: Replace sae_pk_only with sae_pk to match implementation
Jouni Malinen [Sun, 7 Jun 2020 08:53:00 +0000 (11:53 +0300)] 
tests: Replace sae_pk_only with sae_pk to match implementation

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoSAE-PK: Allow automatic SAE-PK to be disabled
Jouni Malinen [Sun, 7 Jun 2020 08:53:26 +0000 (11:53 +0300)] 
SAE-PK: Allow automatic SAE-PK to be disabled

This replaces the previously used sae_pk_only configuration parameter
with a more generic sae_pk that can be used to specify how SAE-PK is
negotiated. The default behavior (sae_pk=0) is to automatically
negotiate SAE-PK whenever the AP supports it and the password is in
appropriate format. sae_pk=1 allows only SAE-PK to be used and sae_pk=2
disables SAE-PK completely.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agowpa_cli: Add all_bss command to print all scan results (BSS entries)
Purushottam Kushwaha [Thu, 28 May 2020 06:37:37 +0000 (12:07 +0530)] 
wpa_cli: Add all_bss command to print all scan results (BSS entries)

The wpa_supplicant control interface returns maximum of 4 kB of response
data and, thus, limits maximum number of scan entries as part of
SCAN_RESULTS to approximately 60. Add a new all_bss command to use a
more robust iteration of the BSS table entries with the BSS command to
to get all scan entries and print them in the same format as the
scan_results command.

Signed-off-by: Purushottam Kushwaha <pkushwah@codeaurora.org>
5 years agotests: PMKSA cache control interface for external management (FT)
Jouni Malinen [Sat, 6 Jun 2020 13:46:03 +0000 (16:46 +0300)] 
tests: PMKSA cache control interface for external management (FT)

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>