]> git.ipfire.org Git - thirdparty/hostap.git/log
thirdparty/hostap.git
4 years agoOpenSSL: Allow systemwide secpolicy overrides for TLS version
Jouni Malinen [Tue, 8 Sep 2020 14:55:36 +0000 (17:55 +0300)] 
OpenSSL: Allow systemwide secpolicy overrides for TLS version

Explicit configuration to enable TLS v1.0 and/or v1.1 did not work with
systemwide OpenSSL secpolicy=2 cases (e.g., Ubuntu 20.04). Allow such
systemwide configuration to be overridden if the older TLS versions have
been explicitly enabled in the network profile. The default behavior
follows the systemwide policy, but this allows compatibility with old
authentication servers without having to touch the systemwide policy.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoQCA vendor attributes for setting ANI level
Hu Wang [Thu, 9 Jul 2020 03:35:23 +0000 (11:35 +0800)] 
QCA vendor attributes for setting ANI level

Define QCA vendor attribute in SET(GET)_WIFI_CONFIGURATION to
dynamically configure ANI level.

Signed-off-by: Hu Wang <huw@codeaurora.org>
4 years agoUpdate QCA vendor interface for GPIO configuration
Chaoli Zhou [Fri, 28 Aug 2020 03:12:54 +0000 (11:12 +0800)] 
Update QCA vendor interface for GPIO configuration

Add a new vendor attribute for GPIO configuration. In addition, document
the previously defined attributes.

Signed-off-by: Chaoli Zhou <zchaoli@codeaurora.org>
4 years agotests: DPP Controller in hostapd
Jouni Malinen [Tue, 25 Aug 2020 12:54:19 +0000 (15:54 +0300)] 
tests: DPP Controller in hostapd

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoDPP2: Support QR mutual auth scan-during-auth-exchange (hostapd)
Jouni Malinen [Tue, 25 Aug 2020 13:10:41 +0000 (16:10 +0300)] 
DPP2: Support QR mutual auth scan-during-auth-exchange (hostapd)

Extend DPP authentication session search for the DPP_QR_CODE command to
cover the ongoing exchanges in Controller/Responder. This was previously
done for wpa_supplicant, but not for hostapd, so complete this support
on the hostapd side.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoDPP: Remove unnecessary dpp_global_config parameters
Jouni Malinen [Tue, 25 Aug 2020 13:00:56 +0000 (16:00 +0300)] 
DPP: Remove unnecessary dpp_global_config parameters

These were not really used anymore since the AP/Relay case did not set
msg_ctx or process_conf_obj in the global DPP context. Get the
appropriate pointers more directly from the more specific data
structures instead and remove these global values.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoDPP2: Controller support in hostapd
Jouni Malinen [Tue, 25 Aug 2020 12:53:08 +0000 (15:53 +0300)] 
DPP2: Controller support in hostapd

Extend hostapd support for DPP Controller to cover the DPP_CONTROLLER_*
cases that were previously implemented only in wpa_supplicant. This
allows hostapd/AP to be provisioned using DPP over TCP.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoAdd QCA vendor event for firmware statistics
Chaithanya Garrepalli [Tue, 18 Aug 2020 16:11:20 +0000 (21:41 +0530)] 
Add QCA vendor event for firmware statistics

Firmware statistics are received in the driver as opaque data. The host
target needs to send this opaque data to userspace wifistats
application. This new event is used to transfer this opaque data to the
application.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agodpp-nfc: Start listen operation more completely for NFC Tag write cases
Jouni Malinen [Mon, 24 Aug 2020 20:41:13 +0000 (23:41 +0300)] 
dpp-nfc: Start listen operation more completely for NFC Tag write cases

Share the same setup steps from the negotiated connection handover to
fix issues with NFC Tag write cases in AP mode. This addresses issues in
the AP mode DPP listen operation not actually receiving anything when
the write-a-tag code path was used.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoGAS: Fix memory leak on some DPP error paths
Jouni Malinen [Sat, 22 Aug 2020 20:47:44 +0000 (23:47 +0300)] 
GAS: Fix memory leak on some DPP error paths

One of the code paths left behind a response buffer. Free this properly
on this missed code path as well.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: Additional coverage for OWE PMKSA caching
Jouni Malinen [Sat, 22 Aug 2020 11:03:30 +0000 (14:03 +0300)] 
tests: Additional coverage for OWE PMKSA caching

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoFix EAPOL-Key msg 1/4 processing in a corner case
Jouni Malinen [Sat, 22 Aug 2020 11:00:34 +0000 (14:00 +0300)] 
Fix EAPOL-Key msg 1/4 processing in a corner case

If reassoc_same_bss_optim=1 is used to optimize reassociation back to
the same BSS, it was possible for sm->pmk_len to be 0 due to a
disconnection event getting processed after sending out the
reassociation request. This resulted in wpa_sm_rx_eapol() calling
wpa_mic_len() with incorrect PMK length when PMKSA caching was being
attempted. That resulted in incorrect mic_len getting determined and not
finding the correct Key Data Length field value. This could result in
failing to complete 4-way handshake successfully.

Fix this by updating the current PMK length based on the selected PMKSA
cache entry if sm->pmk_len is not set when processing EAPOL-Key msg 1/4.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoOWE: Do not add DH Params element in AssocResp with PMKSA caching
Chittur Subramanian Raman [Wed, 19 Aug 2020 09:06:39 +0000 (14:36 +0530)] 
OWE: Do not add DH Params element in AssocResp with PMKSA caching

As per RFC 8110 (Opportunistic Wireless Encryption), if the AP has the
PMK identified by the PMKID and wishes to perform PMK caching, it will
include the PMKID in the Association Response frame RSNE but does not
include the Diffie-Hellman Parameter element.

This was already addressed for most cases with owe_process_assoc_req()
not setting sta->owe_ecdh in case PMKSA caching is used. However, it was
possible to an old STA entry to maintain the initial sta->owe_ecdh value
if reassociation back to the same AP was used to initiate the PMKSA
caching attempt. Cover that case by adding an explicit check for the
time when the Association Response frame is being generated.

Signed-off-by: Chittur Subramanian Raman <craman@maxlinear.com>
4 years agogitignore: Ignore ctags tags file
Yegor Yefremov [Sun, 9 Aug 2020 16:28:52 +0000 (18:28 +0200)] 
gitignore: Ignore ctags tags file

Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
4 years agoDPP2: Fix build without IEEE8021X_EAPOL
Jouni Malinen [Sat, 22 Aug 2020 09:49:05 +0000 (12:49 +0300)] 
DPP2: Fix build without IEEE8021X_EAPOL

The local network profile parameters for EAP are not available without
IEEE8021X_EAPOL, so do not try to set these in builds that do not
include any EAP support.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agowlantest: Avoid heap-overflow on unexpected data
Brian Norris [Wed, 19 Aug 2020 19:44:46 +0000 (12:44 -0700)] 
wlantest: Avoid heap-overflow on unexpected data

We're doing a sort of bounds check, based on the previous loop, but only
after we've already tried to read off the end.

This squashes some ASAN errors I'm seeing when running the ap_ft hwsim
test module.

Signed-off-by: Brian Norris <briannorris@chromium.org>
4 years agoLibreSSL: Fix build with LibreSSL versions older than 2.9.1
Jouni Malinen [Sat, 22 Aug 2020 08:32:01 +0000 (11:32 +0300)] 
LibreSSL: Fix build with LibreSSL versions older than 2.9.1

SSL_add0_chain_cert() was not available in LibreSSL before version
2.9.1.

Fixes: 4b834df5e08a ("OpenSSL: Support PEM encoded chain from client_cert blob")
Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: Fix wnm fuzzer build regression
Jouni Malinen [Sat, 22 Aug 2020 08:12:17 +0000 (11:12 +0300)] 
tests: Fix wnm fuzzer build regression

Addition of MSCS support broke the test tool build due to references to
a functions from a new file. Fix this by bringing in that file to the
fuzzer build as well.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agodpp-nfc: Fix recv_octets() regression
Jouni Malinen [Fri, 14 Aug 2020 21:19:46 +0000 (00:19 +0300)] 
dpp-nfc: Fix recv_octets() regression

The updated socket.poll() loop did not terminate properly in cases where
no response is available. Fix that to check for both False and None.

Fixes: 1733e356e421 ("dpp-nfc: Fix handover client wait for receiving handover select")
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoAdd test configuration to ignore SA Query timeout
Veerendranath Jakkam [Fri, 14 Aug 2020 08:36:23 +0000 (14:06 +0530)] 
Add test configuration to ignore SA Query timeout

Add a new QCA vendor attribute to configure the driver/firmware to
ignore SA Query timeout. If this configuration is enabled the
driver/firmware shall not send Deauthentication frame when SA Query
times out. This is required to support STA testbed role.

Signed-off-by: Veerendranath Jakkam <vjakkam@codeaurora.org>
4 years agoFix documentation for the test configuration attributes of FT-SAE/OCV
Veerendranath Jakkam [Fri, 14 Aug 2020 13:05:29 +0000 (18:35 +0530)] 
Fix documentation for the test configuration attributes of FT-SAE/OCV

These vendor attributes for FT/OCV/SAE testing can be configured only
when the STA is in connected state. Update the documentation of the
attributes to reflect the same.

Fixes: 18f3f99ac467 ("Add vendor attributes to configure testing functionality for FT/OCV/SAE")
Signed-off-by: Veerendranath Jakkam <vjakkam@codeaurora.org>
4 years agoAdd get_sta_info vendor attrs to get BIP failure counters for STA mode
Veerendranath Jakkam [Fri, 14 Aug 2020 09:20:45 +0000 (14:50 +0530)] 
Add get_sta_info vendor attrs to get BIP failure counters for STA mode

Add support to get number of MIC errors, missing MME incidents, and
packet replay incidents observed while using IGTK/BIGTK keys when PMF
and/or beacon protection features are enabled.

These counters are applicable only for STA mode and can be fetched
through the QCA_NL80211_VENDOR_SUBCMD_GET_STA_INFO vendor command.

Signed-off-by: Veerendranath Jakkam <vjakkam@codeaurora.org>
4 years agotests: sigma_dut DPP AP as TCP Enrollee/initiator
Jouni Malinen [Fri, 14 Aug 2020 14:04:56 +0000 (17:04 +0300)] 
tests: sigma_dut DPP AP as TCP Enrollee/initiator

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoDPP: Add process_conf_obj into TCP connection data struct
Jouni Malinen [Fri, 14 Aug 2020 14:04:11 +0000 (17:04 +0300)] 
DPP: Add process_conf_obj into TCP connection data struct

This is needed to avoid issues with hostapd not having set this function
pointer in dpp_global.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoDPP: Add msg_ctx into TCP connection data struct
Jouni Malinen [Fri, 14 Aug 2020 13:53:42 +0000 (16:53 +0300)] 
DPP: Add msg_ctx into TCP connection data struct

This is needed to avoid issues with hostapd not having set msg_ctx in
dpp_global.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoDPP2: hostapd/AP as Enrollee/Initiator over TCP
Jouni Malinen [Fri, 14 Aug 2020 13:44:38 +0000 (16:44 +0300)] 
DPP2: hostapd/AP as Enrollee/Initiator over TCP

Extend DPP support in hostapd to allow AP Enrollee role when initiating
the exchange using TCP.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoMSCS: Send MSCS change/remove frames only if MSCS setup exists
Vinita S. Maloo [Tue, 4 Aug 2020 18:33:24 +0000 (00:03 +0530)] 
MSCS: Send MSCS change/remove frames only if MSCS setup exists

Allow MSCS change/remove request to be sent only after an initial setup,
i.e., after an add request has been accepted.

Signed-off-by: Vinita S. Maloo <vmaloo@codeaurora.org>
4 years agoMSCS: Parse result of MSCS setup in (Re)Association Response frames
Vinita S. Maloo [Wed, 5 Aug 2020 17:25:32 +0000 (22:55 +0530)] 
MSCS: Parse result of MSCS setup in (Re)Association Response frames

Add support to parse the (Re)Association Response frames to check if the
AP has accepted/declined the MSCS request in response to the
corresponding (Re)Association Request frame. AP indicates the result by
setting it in the optional MSCS Status subelement of MSCS Descriptor
element in (Re)Association Response frame.

This MSCS Status subelement is defined in the process of being added
into P802.11-REVmd/D4.0 (11-20-0516-17-000m-cr-mscs-and-cid4158).

Signed-off-by: Vinita S. Maloo <vmaloo@codeaurora.org>
4 years agoMSCS: Add support to populate MSCS Descriptor IE in (Re)AssocReq
Vinita S. Maloo [Tue, 16 Jun 2020 14:51:30 +0000 (20:21 +0530)] 
MSCS: Add support to populate MSCS Descriptor IE in (Re)AssocReq

Include the MSCS Descriptor IE in the (Re)Association Request frames to
setup MSCS between the AP and the STA during association.

Signed-off-by: Vinita S. Maloo <vmaloo@codeaurora.org>
4 years agoMSCS: Add support to process MSCS Response frames
Vinita S. Maloo [Wed, 3 Jun 2020 15:24:04 +0000 (20:54 +0530)] 
MSCS: Add support to process MSCS Response frames

Add support to receive and process MSCS Response frames from the AP and
indicate the status to upper layers.

Signed-off-by: Vinita S. Maloo <vmaloo@codeaurora.org>
4 years agoMSCS: Add support to send MSCS Request frames
Vinita S. Maloo [Tue, 4 Aug 2020 14:42:24 +0000 (20:12 +0530)] 
MSCS: Add support to send MSCS Request frames

Add support to send MSCS add/change/remove types of Action frames
to the connected AP.

Signed-off-by: Vinita S. Maloo <vmaloo@codeaurora.org>
4 years agodpp-nfc: Fix handover client wait for receiving handover select
Jouni Malinen [Thu, 13 Aug 2020 21:11:44 +0000 (00:11 +0300)] 
dpp-nfc: Fix handover client wait for receiving handover select

This was supposed to wait for up to 3.0 seconds for the handover select,
but the incorrect loop terminated ended up limiting this to a single
iteration of 0.1 second wait. This was too fast for some cases like the
AP mode operation where it may take significant time to enable the radio
for listening to DPP authentication messages.

Fix the loop to allow that full three second wait for the response to be
used. In addition, report the amount of time it takes to receive the
response.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoSME: Process channel switch event in SME only when supplicant's SME is used
Veerendranath Jakkam [Sun, 2 Aug 2020 11:25:05 +0000 (16:55 +0530)] 
SME: Process channel switch event in SME only when supplicant's SME is used

Do not process channel switch event in wpa_supplicant's SME when SME is
offloaded to the driver/firmware to avoid SA Query initiation from both
wpa_supplicant and the driver/firmware for the OCV case.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoDerive seg0_idx and seg1_idx for 6 GHz when processing channel switch
Rohan [Thu, 16 Jul 2020 14:05:14 +0000 (19:35 +0530)] 
Derive seg0_idx and seg1_idx for 6 GHz when processing channel switch

The function hostapd_event_ch_switch() derived the seg0_idx and seg1_idx
values only for the 5 GHz and 2.4 GHz bands and the 6 GHz case ended up
using incorrect calculation based on the 5 GHz channel definitions.

Fix this by adding support for 6 GHz frequencies.

Signed-off-by: Rohan <drohan@codeaurora.org>
4 years agoQCA vendor command to update SSID
Pooventhiran G [Wed, 8 Jul 2020 12:00:05 +0000 (17:30 +0530)] 
QCA vendor command to update SSID

Add a QCA vendor subcommand QCA_NL80211_VENDOR_SUBCMD_UPDATE_SSID
to update the new SSID in hostapd. NL80211_ATTR_SSID is used to encapsulate
the new SSID.

Signed-off-by: Pooventhiran G <pooventh@codeaurora.org>
4 years agoAdd a vendor command for medium assessment
Min Liu [Mon, 20 Jul 2020 11:27:11 +0000 (19:27 +0800)] 
Add a vendor command for medium assessment

Introduce a vendor command for medium assessment through
QCA_NL80211_VENDOR_SUBCMD_MEDIUM_ASSESS.

Signed-off-by: Min Liu <minliu@codeaurora.org>
4 years agoAdd AllPlay type to the QCA vendor element
Harshal Udas [Fri, 24 Jul 2020 19:39:32 +0000 (12:39 -0700)] 
Add AllPlay type to the QCA vendor element

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agotests: GAS/ANQP query without scan
Jouni Malinen [Thu, 13 Aug 2020 14:49:16 +0000 (17:49 +0300)] 
tests: GAS/ANQP query without scan

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoANQP: Add support to specify frequency in ANQP_GET command
Veerendranath Jakkam [Tue, 11 Aug 2020 12:23:17 +0000 (17:53 +0530)] 
ANQP: Add support to specify frequency in ANQP_GET command

Previously, wpa_supplicant fetched BSS channel info from scan results to
send ANQP Query frames. If the scan results for the specified BSS are
not available, the ANQP_GET command request was getting rejected.

Add support to send ANQP Query frame on the specified frequency without
requiring the scan results to be available.

The control interface command format:
- ANQP_GET <dst_addr> [freq=<freq in MHz>] <Query ID1>[,<Query ID2>,..]

Signed-off-by: Veerendranath Jakkam <vjakkam@codeaurora.org>
4 years agoGAS: Update source MAC address on preassoc_mac_addr randomization
Veerendranath Jakkam [Mon, 10 Aug 2020 20:01:49 +0000 (01:31 +0530)] 
GAS: Update source MAC address on preassoc_mac_addr randomization

The GAS query source MAC address was not getting updated correctly when
preassoc_mac_addr is enabled. Fix this by copying the current MAC
address to the GAS query source address.

Signed-off-by: Veerendranath Jakkam <vjakkam@codeaurora.org>
4 years agoGAS: Ignore preassoc_mac_addr when gas_rand_mac_addr enabled
Veerendranath Jakkam [Mon, 10 Aug 2020 19:49:49 +0000 (01:19 +0530)] 
GAS: Ignore preassoc_mac_addr when gas_rand_mac_addr enabled

Skip unnecessary random MAC generation due to preassoc_mac_addr
parameter when gas_rand_mac_addr parameter is enabled.

Signed-off-by: Veerendranath Jakkam <vjakkam@codeaurora.org>
4 years agoSAE-PK: Check psk param also to look for SAE-PK acceptable BSS
Veerendranath Jakkam [Sun, 9 Aug 2020 19:31:28 +0000 (01:01 +0530)] 
SAE-PK: Check psk param also to look for SAE-PK acceptable BSS

SAE-PK password can be set using psk parameter also in case of mixed
SAE+PSK networks, so look for acceptable SAE-PK BSS when SAE password
not set and psk parameter meets SAE-PK password criteria.

Signed-off-by: Veerendranath Jakkam <vjakkam@codeaurora.org>
4 years agoAdd channel TX/RX times to QCA vendor interface of LL stats
Vamsi Krishna [Mon, 3 Aug 2020 12:34:06 +0000 (18:04 +0530)] 
Add channel TX/RX times to QCA vendor interface of LL stats

Currently the driver/firmware indicates CCA busy time which includes own
TX and RX time and as such, does not allow the CCA busy time due to
other nodes to be computed. Add separate statistics to indicate own
radio TX time and own radio RX time to facilitate userspace applications
to compute CCA busy time because of traffic unintended to this device.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoFix QCA_WLAN_VENDOR_ATTR_LL_STATS_CH_INFO interface documentation
Vamsi Krishna [Fri, 7 Aug 2020 07:39:39 +0000 (13:09 +0530)] 
Fix QCA_WLAN_VENDOR_ATTR_LL_STATS_CH_INFO interface documentation

All QCA_WLAN_VENDOR_ATTR_LL_STATS_CHANNEL_* attributes are also nested
within QCA_WLAN_VENDOR_ATTR_LL_STATS_CH_INFO, not only
QCA_WLAN_VENDOR_ATTR_LL_STATS_CHANNEL_INFO* attributes in the current
implementation. Fix QCA_WLAN_VENDOR_ATTR_LL_STATS_CH_INFO documentation
accordingly.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoEnhancements to the TWT attributes/parameters (vendor command)
Sunil Dutt [Thu, 6 Aug 2020 14:57:14 +0000 (20:27 +0530)] 
Enhancements to the TWT attributes/parameters (vendor command)

This commit does the following enhancements to the TWT interface:

Corrects the documentation for QCA_WLAN_TWT_SUSPEND and
QCA_WLAN_TWT_TERMINATE. Specifies that these operations carry the
parameters obtained through QCA_WLAN_VENDOR_ATTR_CONFIG_TWT_PARAMS. This
interface is very recently introduced and missed to document the same.
There are no user space or driver components using this interface yet.
Hence, enhancing/modifying the interface.

Corrects the documentation for
QCA_WLAN_VENDOR_ATTR_TWT_SETUP_WAKE_DURATION. Mentions that the units it
represent is a multiple of 256 microseconds rather than a TU. The host
driver always interpreted this as an unit in 256 microseconds and there
are no user space implementations that are impacted with this change in
the unit. Hence, modifying the documentation.

Introduces QCA_WLAN_VENDOR_ATTR_TWT_RESUME_NEXT2_TWT_SIZE, which is
similar to that of QCA_WLAN_VENDOR_ATTR_TWT_RESUME_NEXT_TWT, but carries
an offset/data of u32 size.

Introduces MAC_ADDR attribute to represent the peer for the TWT setup
and resume operations.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoDPP2: Disconnect before starting reconfiguration
Jouni Malinen [Thu, 13 Aug 2020 14:05:49 +0000 (17:05 +0300)] 
DPP2: Disconnect before starting reconfiguration

The offchannel operations (scan, Public Action frame TX/RX) have
significantly more latency when performed while connected, so disconnect
when requested to initiate DPP reconfiguration to avoid this. The old
network profile (i.e., likely the current connection) is going to be
replaced in practice and as such, there is no need to try continue that
association any further.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agotests: sigma_dut and second DPP reconfiguration
Jouni Malinen [Thu, 13 Aug 2020 14:01:32 +0000 (17:01 +0300)] 
tests: sigma_dut and second DPP reconfiguration

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoDPP: Do not interpret unknown channel as missing channel list for NFC
Jouni Malinen [Wed, 12 Aug 2020 14:57:21 +0000 (17:57 +0300)] 
DPP: Do not interpret unknown channel as missing channel list for NFC

While the listed unknown operating class/channel number pairs need to be
ignored, that should be done in a manner than prevents the parsed
bootstrapping info from being used as if it had no channel list (i.e.,
allowing any channel) if there are no known operating class/channel
number pairs.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agotests: DPP over TCP (mutual)
Jouni Malinen [Wed, 12 Aug 2020 09:08:26 +0000 (12:08 +0300)] 
tests: DPP over TCP (mutual)

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoDPP2: Support mutual auth with QR in scan-during-auth-exchange case
Jouni Malinen [Wed, 12 Aug 2020 09:04:25 +0000 (12:04 +0300)] 
DPP2: Support mutual auth with QR in scan-during-auth-exchange case

Extend DPP authentication session search for the DPP_QR_CODE command to
cover the ongoing exchanges in Controller/Responder.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoDPP2: Do not close TCP socket when waiting for full Auth Resp
Jouni Malinen [Wed, 12 Aug 2020 08:52:25 +0000 (11:52 +0300)] 
DPP2: Do not close TCP socket when waiting for full Auth Resp

The case where mutual authentication with QR Code bootstrapping is used
with scanning of the QR Code during the exchange resulted in the
Controller closing the TCP socket too early. Fix this by leaving the
socket open while waiting for the full Authentication Response message.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoDPP2: Allow Controller to be configured to require QR mutual auth
Jouni Malinen [Wed, 12 Aug 2020 08:41:52 +0000 (11:41 +0300)] 
DPP2: Allow Controller to be configured to require QR mutual auth

Extend the DPP_CONTROLLER_START command to accept the optional qr=mutual
parameter similarly to the DPP_LISTEN case.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoAdd QCA vendor attribute to configure number of TX/RX chains
Vamsi Krishna [Thu, 6 Aug 2020 07:31:49 +0000 (13:01 +0530)] 
Add QCA vendor attribute to configure number of TX/RX chains

Add support to configure the number of TX chains and the number of RX
chains to be used during a connection.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agodpp-nfc: Use --altchan value in handover server
Jouni Malinen [Tue, 11 Aug 2020 20:44:48 +0000 (23:44 +0300)] 
dpp-nfc: Use --altchan value in handover server

Use the alternative channel list in the handover server role when
processing an alternative proposal. This was previously done only in the
handover client role, but with the updated design, both roles act in a
similar manner for the case where the alternative channel list is
specified.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agodpp-nfc: Update listen channel based on channel list when writing a tag
Jouni Malinen [Mon, 10 Aug 2020 20:52:11 +0000 (23:52 +0300)] 
dpp-nfc: Update listen channel based on channel list when writing a tag

Do not use the hardcoded channel 1 (2412 MHz) with DPP_LISTEN if a
channel list is specified when writing an NFC Tag. Instead, pick the
first channel from that list as the listen channel.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoDPP2: Update Reconfig Flags attribute format
Jouni Malinen [Mon, 10 Aug 2020 14:36:56 +0000 (17:36 +0300)] 
DPP2: Update Reconfig Flags attribute format

This was simplified by replacing the JSON encoded value with a single
octet.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agotests: DPP over TCP for enterprise provisioning (Controller initiating)
Jouni Malinen [Mon, 10 Aug 2020 07:42:49 +0000 (10:42 +0300)] 
tests: DPP over TCP for enterprise provisioning (Controller initiating)

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoDPP2: Support RA/CA functionality in Controller initiated case
Jouni Malinen [Mon, 10 Aug 2020 07:41:20 +0000 (10:41 +0300)] 
DPP2: Support RA/CA functionality in Controller initiated case

Extend dpp_control_get_auth() to find the ongoing session for enterprise
credential provisioning in cases where the Controller/Configurator
initiated the exchange. Only the other direction was supported
previously.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: DPP reconfiguration retries
Jouni Malinen [Fri, 7 Aug 2020 20:45:58 +0000 (23:45 +0300)] 
tests: DPP reconfiguration retries

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP2: Regenerate Reconfig Announcement for each transmission
Jouni Malinen [Fri, 7 Aug 2020 20:43:51 +0000 (23:43 +0300)] 
DPP2: Regenerate Reconfig Announcement for each transmission

This is needed to generate a new unique A-NONCE and E'-id values.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP2: Add DPP Status attribute into Reconfig Auth Confirm
Jouni Malinen [Fri, 7 Aug 2020 20:33:59 +0000 (23:33 +0300)] 
DPP2: Add DPP Status attribute into Reconfig Auth Confirm

Add and process DPP Status at the end of reconfig authentication.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP2: Allow iteration count to be configured for DPP_RECONFIG
Jouni Malinen [Fri, 7 Aug 2020 20:22:31 +0000 (23:22 +0300)] 
DPP2: Allow iteration count to be configured for DPP_RECONFIG

Add an optional iter=# parameter to DPP_RECONFIG similarly to the way
this was handled with DPP_CHIRP.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP2: Add E-id in Reconfig Announcement
Jouni Malinen [Thu, 6 Aug 2020 16:47:28 +0000 (19:47 +0300)] 
DPP2: Add E-id in Reconfig Announcement

Add an encrypted Enrollee identifier into Reconfig Announcement frames
and decrypt that on the Configurator side. The actual E-id value is
currently not used for anything, but it can be used in the future to
provide better control over reconfiguration.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: DPP reconfiguration connector with different groups
Jouni Malinen [Fri, 7 Aug 2020 12:26:15 +0000 (15:26 +0300)] 
tests: DPP reconfiguration connector with different groups

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP2: Add Enrollee netAccessKey group into Reconfig Announcement
Jouni Malinen [Thu, 6 Aug 2020 16:47:28 +0000 (19:47 +0300)] 
DPP2: Add Enrollee netAccessKey group into Reconfig Announcement

This was added to the protocol design to support cases where the
C-sign-key uses a different group than the netAccessKey. The Enrollee
now indicates its netAccessKey group in Reconfig Announcement and the
Configurator builds it own reconfig Connector using that group instead
of the group used for the C-sign-key.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: SAE-PK and PSK using invalid password combination
Jouni Malinen [Thu, 6 Aug 2020 22:09:06 +0000 (01:09 +0300)] 
tests: SAE-PK and PSK using invalid password combination

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: sigma_dut controlled AP using SAE-PK(disabled) and PSK
Jouni Malinen [Thu, 6 Aug 2020 21:10:26 +0000 (00:10 +0300)] 
tests: sigma_dut controlled AP using SAE-PK(disabled) and PSK

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: SAE-PK and PSK
Jouni Malinen [Thu, 6 Aug 2020 20:53:37 +0000 (23:53 +0300)] 
tests: SAE-PK and PSK

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoSAE-PK: Allow SAE-PK password to be set using the psk parameter
Jouni Malinen [Thu, 6 Aug 2020 21:47:15 +0000 (00:47 +0300)] 
SAE-PK: Allow SAE-PK password to be set using the psk parameter

Only the sae_password parameter was previously accepted for SAE-PK use.
That is not sufficient for covering mixed SAE+PSK cases. Extend this by
allowing the psk parameter to be used as well just like it can be used
for SAE without SAE-PK.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoSAE-PK: Allow SAE-PK style wpa_passphrase if SAE-PK is enabled with same
Jouni Malinen [Thu, 6 Aug 2020 20:49:19 +0000 (23:49 +0300)] 
SAE-PK: Allow SAE-PK style wpa_passphrase if SAE-PK is enabled with same

This prevents use of a SAE-PK style password as the WPA-PSK passphrase
only if the same password is not also enabled through sae_password for
use with SAE-PK.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoAdditional TWT attributes for response path and resume
Rajasekaran Kalidoss [Fri, 31 Jul 2020 16:38:35 +0000 (22:08 +0530)] 
Additional TWT attributes for response path and resume

Introduce additional attributes for the TWT response parameters from the
host driver. Also, add ATTR_TWT_RESUME_FLOW_ID for TWT Resume request.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoSAE-PK: Update design for fingerprint encoding into password
Jouni Malinen [Wed, 5 Aug 2020 14:44:32 +0000 (17:44 +0300)] 
SAE-PK: Update design for fingerprint encoding into password

Update the SAE-PK implementation to match the changes in the protocol
design:
- allow only Sec values 3 and 5 and encode this as a single bit field
  with multiple copies
- add a checksum character

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: SAE with OCV and fetching PMK
Jouni Malinen [Mon, 3 Aug 2020 12:39:45 +0000 (15:39 +0300)] 
tests: SAE with OCV and fetching PMK

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoExtend GET_PMK to check PMKSA cache on the AP
Jouni Malinen [Mon, 3 Aug 2020 12:38:30 +0000 (15:38 +0300)] 
Extend GET_PMK to check PMKSA cache on the AP

This allows the testing command GET_PMK to return a PMK in cases where
the association fails (e.g., when using SAE and getting a valid PMKSA
entry added before association) or after the association has been lost.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: sigma_dut and WPA3 frame inject
Jouni Malinen [Mon, 3 Aug 2020 08:44:53 +0000 (11:44 +0300)] 
tests: sigma_dut and WPA3 frame inject

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoOCV: OCI channel override support for testing (STA)
Veerendranath Jakkam [Fri, 26 Jun 2020 08:19:14 +0000 (13:49 +0530)] 
OCV: OCI channel override support for testing (STA)

Add override parameters to use the specified channel while populating
OCI element in EAPOL-Key group msg 2/2, FT reassoc request, FILS assoc
request and WNM sleep request frames.

Signed-off-by: Veerendranath Jakkam <vjakkam@codeaurora.org>
5 years agoFix the documentation for QCA_WLAN_VENDOR_ATTR_CONFIG_UDP_QOS_UPGRADE
Sunil Dutt [Fri, 31 Jul 2020 14:57:05 +0000 (20:27 +0530)] 
Fix the documentation for QCA_WLAN_VENDOR_ATTR_CONFIG_UDP_QOS_UPGRADE

The documentation for the QCA_WLAN_VENDOR_ATTR_CONFIG_UDP_QOS_UPGRADE
attribute had incorrectly specified the value of 0 (corresponding to BE)
to disable the QoS upgrade. BK (1) is a lower priority AC compared to BE
and if BE is used to disable the upgrade, there would be no possibility
for configured UDP AC upgrade to replace BK-from-DSCP with BE. Thus,
correct this by specifying that the value of BK (1) is used to disable
this UDP AC upgrade.

Fixes: ebd5e764f99b ("Vendor attribute to configure QoS/AC upgrade for UDP frames")
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: SAE-PK with immediate confirm on AP
Jouni Malinen [Fri, 31 Jul 2020 17:34:38 +0000 (20:34 +0300)] 
tests: SAE-PK with immediate confirm on AP

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoSAE-PK: Fix SAE confirm writing in some AP cases with transition mode
Jouni Malinen [Fri, 31 Jul 2020 17:32:35 +0000 (20:32 +0300)] 
SAE-PK: Fix SAE confirm writing in some AP cases with transition mode

sae_check_confirm_pk() and sae_write_confirm_pk() were using different
checks for determining whether SAE-PK was used. It was apparently
possible to miss the checks in sae_write_confirm_pk() in some AP cases
where SAE H2E is being used. Fix this by checking sae->pk in the
write-confirm case similarly to the way this was done in check-confirm.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoSAE-PK: Make no-KEK debug prints distinct
Jouni Malinen [Fri, 31 Jul 2020 16:59:52 +0000 (19:59 +0300)] 
SAE-PK: Make no-KEK debug prints distinct

Debug logs did not make it clear whether the failure happens when
checking a received SAE confirm or when writing own SAE confirm. Those
cases have different checks on when to go through SAE-PK processing, so
it is useful to make this part clear in the debug log.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: Skip sigma_dut_dpp_qr_resp_11 if dpp-ca.py does not exist
Jouni Malinen [Fri, 31 Jul 2020 07:09:33 +0000 (10:09 +0300)] 
tests: Skip sigma_dut_dpp_qr_resp_11 if dpp-ca.py does not exist

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agodpp-nfc: Report negotiated connection handover result
Jouni Malinen [Thu, 30 Jul 2020 22:23:39 +0000 (01:23 +0300)] 
dpp-nfc: Report negotiated connection handover result

Print out a summary of the result in yellow text.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agodpp-nfc: Stop only_one run after failed handover attempt
Jouni Malinen [Thu, 30 Jul 2020 22:09:31 +0000 (01:09 +0300)] 
dpp-nfc: Stop only_one run after failed handover attempt

Do not require connection handover to succeed before stopping the loop
in the only_one case.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agodpp-nfc: Do not indicate no initial HS as failure if alt HR will be sent
Jouni Malinen [Thu, 30 Jul 2020 21:48:46 +0000 (00:48 +0300)] 
dpp-nfc: Do not indicate no initial HS as failure if alt HR will be sent

Do not use red color for the "No response receive" message in case
another HR will be sent after this.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agodpp-nfc: Improved version of HandoverServer::serve()
Jouni Malinen [Thu, 30 Jul 2020 21:38:42 +0000 (00:38 +0300)] 
dpp-nfc: Improved version of HandoverServer::serve()

Fix processing of the case where no handover select is sent out and add
automatic (delayed) termination of the link on completing the handover
successfully.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agodpp-nfc: Stop process after successful handover client completion
Jouni Malinen [Thu, 30 Jul 2020 21:16:12 +0000 (00:16 +0300)] 
dpp-nfc: Stop process after successful handover client completion

terminate_now was not being set in the only_one case with connection
handover. Set it for that case as well as the tag cases to automatically
close down the link once it is not needed anymore.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agodpp-nfc: Optimize HandoverClient message receiving for alternative HR case
Jouni Malinen [Thu, 30 Jul 2020 20:51:30 +0000 (23:51 +0300)] 
dpp-nfc: Optimize HandoverClient message receiving for alternative HR case

Use a shorter polling interval in recv_octets() to be able to send out
the alternative HR more quickly when using a single thread and handover
client. In addition, fix recv_records() to handle normal exception cases
like not receiving anything.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agodpp-nfc: Use a single handover client thread
Jouni Malinen [Thu, 30 Jul 2020 20:29:18 +0000 (23:29 +0300)] 
dpp-nfc: Use a single handover client thread

Avoid extra complexity from use a separate thread to send out the
alternative proposal.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agodpp-nfc: Add a class for maintaining connection handover state
Jouni Malinen [Thu, 30 Jul 2020 17:58:08 +0000 (20:58 +0300)] 
dpp-nfc: Add a class for maintaining connection handover state

This cleans up the shared state between the handover server and client.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agodpp-nfc: Reuse the same handover client for alternative URI
Jouni Malinen [Thu, 30 Jul 2020 14:09:56 +0000 (17:09 +0300)] 
dpp-nfc: Reuse the same handover client for alternative URI

Postpone closing of the handover client to allow the same client to be
used for sending both handover request messages if an alternative URI
needs to be tried.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agodpp-nfc: Add peer URI into the HS in testing mode
Jouni Malinen [Thu, 30 Jul 2020 17:35:10 +0000 (20:35 +0300)] 
dpp-nfc: Add peer URI into the HS in testing mode

This makes it easier to confirm that the correct pair of the HR and the
HS were used.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agodpp-nfc: Enable more verbose nfcpy debugging
Jouni Malinen [Thu, 30 Jul 2020 13:49:40 +0000 (16:49 +0300)] 
dpp-nfc: Enable more verbose nfcpy debugging

Set logging level to various upper layer nfcpy modules to enable more
detailed debugging of the actual NFC operations when requested (-d on
the command line).

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: AES-CTR encrypt test vectors
Jouni Malinen [Thu, 30 Jul 2020 10:52:14 +0000 (13:52 +0300)] 
tests: AES-CTR encrypt test vectors

Verify AES-CTR encryption implementation against the test vectors in
NIST SP 800-38a. This implementations was already tested against AES SIV
and EAX mode test vectors, but this adds more explicit testing against
published CTR mode test vectors.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agodpp-nfc: Skip P2P management interfaces
Jouni Malinen [Thu, 30 Jul 2020 09:51:56 +0000 (12:51 +0300)] 
dpp-nfc: Skip P2P management interfaces

Do not try to perform DPP operations on the P2P management interface
when no specific interface has been identified.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: sigma_dut DPP Configurator reporting MUD URL
Jouni Malinen [Tue, 28 Jul 2020 13:44:41 +0000 (16:44 +0300)] 
tests: sigma_dut DPP Configurator reporting MUD URL

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agodpp-nfc: Ignore (no) response to initial handover request
Jouni Malinen [Fri, 24 Jul 2020 09:46:20 +0000 (12:46 +0300)] 
dpp-nfc: Ignore (no) response to initial handover request

If an alternative proposal (second handover request) is sent, the
response (or lack of it) to the initial handover request should be
ignored.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agodpp-nfc: Do not allow more than one alternative channel proposal
Jouni Malinen [Thu, 23 Jul 2020 21:51:49 +0000 (00:51 +0300)] 
dpp-nfc: Do not allow more than one alternative channel proposal

This avoids potential loops of endless alternative URI exchanges over
NFC negotiated connection handover. Only allow one such alternative
proposal and declarare the handover as a failure if another alternative
were needed.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agodpp-nfc: Add test mode for negotiated connection handover
Jouni Malinen [Thu, 23 Jul 2020 21:30:38 +0000 (00:30 +0300)] 
dpp-nfc: Add test mode for negotiated connection handover

Allow all actual DPP processing steps in wpa_supplicant to be skipped by
specifying hardcoded URI values. Also allow a hardcoded crn to be
specified to force specific handover requestor/selector roles.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoUpdate documentation for vendor attributes to ignore BSSIDs during roaming
Jouni Malinen [Fri, 24 Jul 2020 09:23:56 +0000 (12:23 +0300)] 
Update documentation for vendor attributes to ignore BSSIDs during roaming

Replace some of the "blacklist" term to reduce undesired connotations.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoRename driver op for temporarily disallowed BSSIDs
Jouni Malinen [Fri, 24 Jul 2020 09:13:19 +0000 (12:13 +0300)] 
Rename driver op for temporarily disallowed BSSIDs

Use the "tmp_disallow" name more consistently so that both the core
wpa_supplicant functionality (struct wpa_bss_tmp_disallowed) and the
wpa_driver_ops callback have more similar names.

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