]> git.ipfire.org Git - thirdparty/hostap.git/log
thirdparty/hostap.git
6 years agodbus: Expose connected stations on D-Bus
Andrej Shadura [Sun, 7 Oct 2018 12:31:51 +0000 (14:31 +0200)] 
dbus: Expose connected stations on D-Bus

Make it possible to list connected stations in AP mode over D-Bus, along
with some of their properties: rx/tx packets, bytes, capabilities, etc.

Signed-off-by: Mathieu Trudel-Lapierre <mathieu.trudel-lapierre@canonical.com>
Rebased by Julian Andres Klode <juliank@ubuntu.com> and updated to use
the new getter API.

Further modified by Andrej Shadura to not error out when not in AP mode
and to send separate StationAdded/StationRemoved signals instead of
changing signatures of existing StaAuthorized/StaDeauthorized signals.

Signed-off-by: Andrej Shadura <andrew.shadura@collabora.co.uk>
6 years agodbus: Use dbus_bool_t, not int for boolean function arguments
Andrej Shadura [Sun, 7 Oct 2018 12:31:50 +0000 (14:31 +0200)] 
dbus: Use dbus_bool_t, not int for boolean function arguments

Properties argument specifies whether to add object's properties
or not, hence it doesn't need to be int.

Signed-off-by: Andrej Shadura <andrew.shadura@collabora.co.uk>
6 years agotests: Validate that AP doesn't reflect station frames
Johannes Berg [Thu, 11 Oct 2018 13:38:26 +0000 (15:38 +0200)] 
tests: Validate that AP doesn't reflect station frames

Add a new test to check that the AP won't send frames to the client if
it tries to talk to itself.

Note that this fails until the relevant mac80211 patch is merged.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agotests: Fix AP wait in ap_require_ht and ap_require_ht_limited_rates
Jouni Malinen [Sun, 23 Dec 2018 10:13:04 +0000 (12:13 +0200)] 
tests: Fix AP wait in ap_require_ht and ap_require_ht_limited_rates

These test cases seemed to have copy-paste errors where
wait_enabled=False was forgotten even though there was no additional
steps checking the AP mode startup results. This did not break the
tests, but could have resulted in slowing them down if the STAs did not
find the AP in the first scan.

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agotests: HT STBC overrides
Jouni Malinen [Sun, 23 Dec 2018 10:11:53 +0000 (12:11 +0200)] 
tests: HT STBC overrides

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agotests: Allow overriding HT STBC capabilities
Sergey Matyukevich [Tue, 30 Oct 2018 13:16:47 +0000 (13:16 +0000)] 
tests: Allow overriding HT STBC capabilities

Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com>
6 years agowpa_supplicant: Allow overriding HT STBC capabilities
Sergey Matyukevich [Tue, 30 Oct 2018 13:16:47 +0000 (13:16 +0000)] 
wpa_supplicant: Allow overriding HT STBC capabilities

Allow user to override STBC configuration for Rx and Tx spatial streams.
Add new configuration options to test for HT capability overrides.

Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com>
6 years agotests: Automatic channel selection, HT scan, and DFS
Jouni Malinen [Sun, 23 Dec 2018 09:05:54 +0000 (11:05 +0200)] 
tests: Automatic channel selection, HT scan, and DFS

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agotests: Work around cfg80211 reg.c intersection (country 98) issues
Jouni Malinen [Sat, 22 Dec 2018 13:55:19 +0000 (15:55 +0200)] 
tests: Work around cfg80211 reg.c intersection (country 98) issues

The Linux kernel commit 113f3aaa81bd ("cfg80211: Prevent regulatory
restore during STA disconnect in concurrent interfaces") broke the
regulatory clearing attempt in many test cases since
cfg80211_is_all_idle() is now returning false due to the AP interface
being up and that results in the Country IE -based regulatory
information not getting cleared back to defaults.

Work around this by stopping the AP interface first so that when the
station interface receives the disconnection, there are no other active
interfaces in the system. In addition, wait for REGDOM event for the
Country IE hint after association to avoid disconnection before the
regulatory events have been fully processed.

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agotests: Fix mbo_supp_oper_classes after cfg80211 change
Jouni Malinen [Fri, 21 Dec 2018 22:55:26 +0000 (00:55 +0200)] 
tests: Fix mbo_supp_oper_classes after cfg80211 change

The Linux kernel commit 113f3aaa81bd ("cfg80211: Prevent regulatory
restore during STA disconnect in concurrent interfaces") broke the
regulatory clearing attempt in this test case since
cfg80211_is_all_idle() is now returning false due to the AP interface
being up and that results in the Country IE -based regulatory
information not getting cleared back to defaults.

Work around this by stopping the AP interface first so that when the
station interface receives the disconnection, there are no other active
interfaces in the system. In addition, wait for REGDOM event for the
Country IE hint after association to avoid disconnection before the
regulatory events have been fully processed.

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agotests: Enable dynamic debug from cfg80211/mac80211
Jouni Malinen [Fri, 21 Dec 2018 22:18:33 +0000 (00:18 +0200)] 
tests: Enable dynamic debug from cfg80211/mac80211

These debug logs were lost due to CONFIG_DYNAMIC_DEBUG=y.

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agoAdd SAE to GET_CAPABILITY key_mgmt
Jouni Malinen [Fri, 21 Dec 2018 19:27:59 +0000 (21:27 +0200)] 
Add SAE to GET_CAPABILITY key_mgmt

Provide information about SAE AKM support in "GET_CAPABILITY key_mgmt"
for completeness. The "GET_CAPABILITY auth_alg" case is already
providing information about SAE support through user space SME.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agonl80211: Fetch supported AKM list from the driver
Veerendranath Jakkam [Fri, 21 Dec 2018 10:32:24 +0000 (16:02 +0530)] 
nl80211: Fetch supported AKM list from the driver

Try to fetch the list of supported AKM suite selectors from the driver
through the vendor interface
QCA_NL80211_VENDOR_SUBCMD_GET_SUPPORTED_AKMS. If that command is
available and succeeds, use the returned list to populate the
wpa_driver_capa key_mgmt information instead of assuming all
cfg80211-based drivers support all AKMs. If the driver does not support
this command, the previous behavior is maintained.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoVendor command to query the supported AKMs from the driver
Veerendranath Jakkam [Fri, 21 Dec 2018 10:14:25 +0000 (15:44 +0530)] 
Vendor command to query the supported AKMs from the driver

This new QCA vendor command is used to query the supported AKM suite
selectors from the driver. There has been no such capability indication
from the driver and thus the current user space has to assume the driver
to support all the AKMs. This may be the case with some drivers (e.g.,
mac80211-based ones) but there are cfg80211-based drivers that implement
SME and have constraints on which AKMs can be supported (e.g., such
drivers may need an update to support SAE AKM using
NL80211_CMD_EXTERNAL_AUTH). Allow such drivers to specify the exact set
of supported AKMs so that user space tools can determine what network
profile options should be allowed to be configured. This command returns
the list of supported AKM suite selectors in the attribute
NL80211_ATTR_AKM_SUITES.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoDPP: Fix build with LibreSSL 2.8.3
Jouni Malinen [Fri, 21 Dec 2018 10:21:03 +0000 (12:21 +0200)] 
DPP: Fix build with LibreSSL 2.8.3

Looks like LibreSSL 2.8 pulled in the OpenSSL API change to mark the
first argument to X509_ALGOR_get0() const.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoFix build with LibreSSL
Andrey Utkin [Tue, 11 Dec 2018 17:41:10 +0000 (17:41 +0000)] 
Fix build with LibreSSL

When using LibreSSL instead of OpenSSL, linkage of hostapd executable
fails with the following error when using some LibreSSL versions

    ../src/crypto/tls_openssl.o: In function `tls_verify_cb':
    tls_openssl.c:(.text+0x1273): undefined reference to `ASN1_STRING_get0_data'
    ../src/crypto/tls_openssl.o: In function `tls_connection_peer_serial_num':
    tls_openssl.c:(.text+0x3023): undefined reference to `ASN1_STRING_get0_data'
    collect2: error: ld returned 1 exit status
    make: *** [Makefile:1278: hostapd] Error 1

ASN1_STRING_get0_data is present in recent OpenSSL, but absent in some
versions of LibreSSL (confirmed for version 2.6.5), so fallback needs to
be defined in this case, just like for old OpenSSL.

This patch was inspired by similar patches to other projects, such as
spice-gtk, pjsip.

Link: https://bugs.gentoo.org/672834
Signed-off-by: Andrey Utkin <andrey_utkin@gentoo.org>
6 years agotests: hostapd.vlan with bridge ifname
Jouni Malinen [Fri, 21 Dec 2018 09:58:51 +0000 (11:58 +0200)] 
tests: hostapd.vlan with bridge ifname

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agohostapd: Support for overriding the bridge name per VLAN via vlan_file
Felix Fietkau [Wed, 14 Nov 2018 16:50:23 +0000 (17:50 +0100)] 
hostapd: Support for overriding the bridge name per VLAN via vlan_file

This makes it easier to integrate dynamic VLANs in custom network
configurations. The bridge name is added after the interface name in the
vlan_file line, also separated by whitespace.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
6 years agoDPP: Add self configuration command in hostapd_cli and wpa_cli
Prasad, Jagadeesh (Contractor) [Mon, 10 Dec 2018 10:32:41 +0000 (10:32 +0000)] 
DPP: Add self configuration command in hostapd_cli and wpa_cli

The back-end support for DPP self configuration was already present in
hostapd and wpa_supplicant. However, the command to invoke DPP self
configuration was not available in hostapd_cli and wpa_cli. Add the
command "dpp_configurator_sign" in them.

Signed-off-by: Prasad, Jagadeesh <Jagadeesh_Prasad@comcast.com>
6 years agotests: DPP_CONFIGURATOR_SIGN without double space
Jouni Malinen [Fri, 21 Dec 2018 09:43:09 +0000 (11:43 +0200)] 
tests: DPP_CONFIGURATOR_SIGN without double space

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoDPP: Accept DPP_CONFIGURATION_SIGN without double space before parameters
Jouni Malinen [Fri, 21 Dec 2018 09:42:01 +0000 (11:42 +0200)] 
DPP: Accept DPP_CONFIGURATION_SIGN without double space before parameters

Make this command more convenient to use by not requiring two space
characters between the command and the first parameter.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agonl80211: Add support for starting FTM responder
Johannes Berg [Mon, 3 Dec 2018 17:06:22 +0000 (19:06 +0200)] 
nl80211: Add support for starting FTM responder

Add support for starting FTM responder when in AP mode. This just sends
the appropriate NEW/SET_BEACON command to the driver with the LCI/civic
location data.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
6 years agoAP: Configure FTM responder parameters
Andrei Otcheretianski [Mon, 3 Dec 2018 17:06:21 +0000 (19:06 +0200)] 
AP: Configure FTM responder parameters

Enable FTM responder and configure LCI and civic if ftm_responder
configuration option is set. Since ftm_responder configuration existed
before and was used to set extended capability bits, don't fail AP setup
flow if ftm_responder is set, but the driver doesn't advertise FTM
responder support.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
6 years agodriver: Add FTM responder configuration APIs
Andrei Otcheretianski [Mon, 3 Dec 2018 17:06:20 +0000 (19:06 +0200)] 
driver: Add FTM responder configuration APIs

Add configuration options to enable FTM responder and configure LCI and
civic parameters. In addition, introduce WPA_DRIVER_FLAGS_FTM_RESPONDER
flag, which can be used to indicate FTM responder support in AP mode.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
6 years agoSync with mac80211-next.git include/uapi/linux/nl80211.h
Jouni Malinen [Fri, 21 Dec 2018 09:12:39 +0000 (11:12 +0200)] 
Sync with mac80211-next.git include/uapi/linux/nl80211.h

This brings in nl80211 definitions as of 2018-12-15.

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agotests: Be more careful in clearing REGDOM state
Jouni Malinen [Thu, 20 Dec 2018 22:55:31 +0000 (00:55 +0200)] 
tests: Be more careful in clearing REGDOM state

cfg80211 regulatory code gets into pretty inconvenient state if it needs
to intersect regulatory domain information from multiple regulations
(country=98). The existing mechanisms in the hwsim test cases are not
able to clear that up for the following test case and this can result in
large number of failures.

It looks like country=98 case is hit frequently in WNM test cases where
a station associates with an AP that advertises a specific country code
and that station is then asked to disconnect before the REGDOM events
have been received. Avoid this by waiting for the REGDOM events for the
init=COUNTRY_IE case before disconnecting.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agotests: Connect attempt with transmitting/nontransmitting BSS
Jouni Malinen [Thu, 20 Dec 2018 19:34:24 +0000 (21:34 +0200)] 
tests: Connect attempt with transmitting/nontransmitting BSS

This adds some minimal testing for Multi-BSS connection attempts. The
part for nontransmitted BSS is limited since hostapd/mac80211 does not
yet have sufficient support for Multi-BSS in AP mode.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agotests: Additional Multiple BSSID IE parsing tests
Peng Xu [Thu, 15 Nov 2018 19:28:24 +0000 (11:28 -0800)] 
tests: Additional Multiple BSSID IE parsing tests

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agotests: Multiple BSSID element in scan results
Jouni Malinen [Mon, 27 Nov 2017 21:43:10 +0000 (23:43 +0200)] 
tests: Multiple BSSID element in scan results

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoExpose Multi-BSS STA capability through wpa_supplicant control interface
Jouni Malinen [Thu, 20 Dec 2018 19:24:48 +0000 (21:24 +0200)] 
Expose Multi-BSS STA capability through wpa_supplicant control interface

Indicate whether the driver advertises support for Multi-BSS STA
functionality with "GET_CAPABILITY multibss" (returns "MULTIBSS-STA" if
supported).

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agotests: Multi-AP association
Jouni Malinen [Thu, 20 Dec 2018 10:41:00 +0000 (12:41 +0200)] 
tests: Multi-AP association

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agowpa_supplicant: Add Multi-AP backhaul STA support
Venkateswara Naralasetty [Wed, 5 Dec 2018 10:23:53 +0000 (11:23 +0100)] 
wpa_supplicant: Add Multi-AP backhaul STA support

Advertise vendor specific Multi-AP IE in (Re)Association Request frames
and process Multi-AP IE from (Re)Association Response frames if the user
enables Multi-AP fuctionality. If the (Re)Association Response frame
does not contain the Multi-AP IE, disassociate.

This adds a new configuration parameter 'multi_ap_backhaul_sta' to
enable/disable Multi-AP functionality.

Enable 4-address mode after association (if the Association Response
frame contains the Multi-AP IE). Also enable the bridge in that case.
This is necessary because wpa_supplicant only enables the bridge in
wpa_drv_if_add(), which only gets called when an interface is added
through the control interface, not when it is configured from the
command line.

Signed-off-by: Venkateswara Naralasetty <vnaralas@codeaurora.org>
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
6 years agohostapd: Add Multi-AP protocol support
Venkateswara Naralasetty [Wed, 5 Dec 2018 10:23:51 +0000 (11:23 +0100)] 
hostapd: Add Multi-AP protocol support

The purpose of Multi-AP specification is to enable inter-operability
across Wi-Fi access points (APs) from different vendors.

This patch introduces one new configuration parameter 'multi_ap' to
enable Multi-AP functionality and to configure the BSS as a backhaul
and/or fronthaul BSS.

Advertise vendor specific Multi-AP capabilities in (Re)Association
Response frame, if Multi-AP functionality is enabled through the
configuration parameter.

A backhaul AP must support receiving both 3addr and 4addr frames from a
backhaul STA, so create a VLAN for it just like is done for WDS, i.e.,
by calling hostapd_set_wds_sta(). Since Multi-AP requires WPA2 (never
WEP), we can safely call hostapd_set_wds_encryption() as well and we can
reuse the entire WDS condition.

To parse the Multi-AP Extension subelement, we use get_ie(): even though
that function is meant for parsing IEs, it works for subelements.

Signed-off-by: Venkateswara Naralasetty <vnaralas@codeaurora.org>
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
6 years agotests: OCI validation in WNM-Sleep Exit frames (OCV)
Mathy Vanhoef [Mon, 6 Aug 2018 19:46:42 +0000 (15:46 -0400)] 
tests: OCI validation in WNM-Sleep Exit frames (OCV)

Signed-off-by: Mathy Vanhoef <Mathy.Vanhoef@cs.kuleuven.be>
6 years agoOCV: Include and verify OCI in WNM-Sleep Exit frames
Mathy Vanhoef [Mon, 6 Aug 2018 19:46:33 +0000 (15:46 -0400)] 
OCV: Include and verify OCI in WNM-Sleep Exit frames

Include and verify the OCI element in WNM-Sleep Exit Request and
Response frames. In case verification fails, the frame is silently
ignored.

Signed-off-by: Mathy Vanhoef <Mathy.Vanhoef@cs.kuleuven.be>
6 years agotests: OCI validation in the AMPE handshake (OCV)
Mathy Vanhoef [Mon, 6 Aug 2018 19:46:43 +0000 (15:46 -0400)] 
tests: OCI validation in the AMPE handshake (OCV)

Signed-off-by: Mathy Vanhoef <Mathy.Vanhoef@cs.kuleuven.be>
6 years agoOCV: Include and verify OCI in the AMPE handshake
Mathy Vanhoef [Mon, 6 Aug 2018 19:46:37 +0000 (15:46 -0400)] 
OCV: Include and verify OCI in the AMPE handshake

Include and verify the OCI element in AMPE Open and Confirm frames. Note
that the OCI element is included even if the other STA didn't advertise
support of OCV. The OCI element is only required and verified if both
peers support OCV.

Signed-off-by: Mathy Vanhoef <Mathy.Vanhoef@cs.kuleuven.be>
6 years agoOCV: Pass ocv parameter to mesh configuration
Mathy Vanhoef [Mon, 6 Aug 2018 19:46:25 +0000 (15:46 -0400)] 
OCV: Pass ocv parameter to mesh configuration

Signed-off-by: Mathy Vanhoef <Mathy.Vanhoef@cs.kuleuven.be>
6 years agotests: OCI validation in the FILS handshake (OCV)
Mathy Vanhoef [Mon, 6 Aug 2018 19:46:40 +0000 (15:46 -0400)] 
tests: OCI validation in the FILS handshake (OCV)

Signed-off-by: Mathy Vanhoef <Mathy.Vanhoef@cs.kuleuven.be>
6 years agoOCV: Include and verify OCI in the FILS handshake
Mathy Vanhoef [Mon, 6 Aug 2018 19:46:36 +0000 (15:46 -0400)] 
OCV: Include and verify OCI in the FILS handshake

Include and verify the OCI element in FILS (Re)Association Request and
Response frames.

Signed-off-by: Mathy Vanhoef <Mathy.Vanhoef@cs.kuleuven.be>
6 years agotests: OCI validation in SA Query frames (OCV)
Mathy Vanhoef [Mon, 6 Aug 2018 19:46:41 +0000 (15:46 -0400)] 
tests: OCI validation in SA Query frames (OCV)

Signed-off-by: Mathy Vanhoef <Mathy.Vanhoef@cs.kuleuven.be>
6 years agoAdd UNPROT_DEAUTH command for testing OCV
Mathy Vanhoef [Mon, 6 Aug 2018 19:46:41 +0000 (15:46 -0400)] 
Add UNPROT_DEAUTH command for testing OCV

This new wpa_supplicant control interface command can be used to
simplify testing SA Query with OCV.

Signed-off-by: Mathy Vanhoef <Mathy.Vanhoef@cs.kuleuven.be>
6 years agoOCV: Perform an SA Query after a channel switch
Mathy Vanhoef [Mon, 6 Aug 2018 19:46:35 +0000 (15:46 -0400)] 
OCV: Perform an SA Query after a channel switch

After the network changed to a new channel, perform an SA Query with the
AP after a random delay if OCV was negotiated for the association. This
is used to confirm that we are still operating on the real operating
channel of the network. This commit is adding only the station side
functionality for this, i.e., the AP behavior is not changed to
disconnect stations with OCV that do not go through SA Query.

Signed-off-by: Mathy Vanhoef <Mathy.Vanhoef@cs.kuleuven.be>
6 years agoOCV: Include and verify OCI in SA Query frames
Mathy Vanhoef [Mon, 6 Aug 2018 19:46:34 +0000 (15:46 -0400)] 
OCV: Include and verify OCI in SA Query frames

Include an OCI element in SA Query Request and Response frames if OCV
has been negotiated.

On Linux, a kernel patch is needed to let clients correctly handle SA
Query Requests that contain an OCI element. Without this patch, the
kernel will reply to the SA Query Request itself, without verifying the
included OCI. Additionally, the SA Query Response sent by the kernel
will not include an OCI element. The correct operation of the AP does
not require a kernel patch.

Without the corresponding kernel patch, SA Query Requests sent by the
client are still valid, meaning they do include an OCI element.
Note that an AP does not require any kernel patches. In other words, SA
Query frames sent and received by the AP are properly handled, even
without a kernel patch.

As a result, the kernel patch is only required to make the client properly
process and respond to a SA Query Request from the AP. Without this
patch, the client will send a SA Query Response without an OCI element,
causing the AP to silently ignore the response and eventually disconnect
the client from the network if OCV has been negotiated to be used.

Signed-off-by: Mathy Vanhoef <Mathy.Vanhoef@cs.kuleuven.be>
6 years agotests: OCI validation in the FT handshake (OCV)
Mathy Vanhoef [Mon, 6 Aug 2018 19:46:39 +0000 (15:46 -0400)] 
tests: OCI validation in the FT handshake (OCV)

Signed-off-by: Mathy Vanhoef <Mathy.Vanhoef@cs.kuleuven.be>
6 years agoOCV: Include and verify OCI in the FT handshake
Mathy Vanhoef [Mon, 6 Aug 2018 19:46:32 +0000 (15:46 -0400)] 
OCV: Include and verify OCI in the FT handshake

Include and verify the the OCI element in (Re)Association Request and
Response frames of the FT handshake. In case verification fails, the
handshake message is silently ignored.

Signed-off-by: Mathy Vanhoef <Mathy.Vanhoef@cs.kuleuven.be>
6 years agotests: OCI validation in the 4-way and group key handshakes (OCV)
Mathy Vanhoef [Mon, 6 Aug 2018 19:46:38 +0000 (15:46 -0400)] 
tests: OCI validation in the 4-way and group key handshakes (OCV)

Perform detailed tests with OCV enabled, for both the 4-way and group
key handshakes. These tests include establishing a working connection
with OCV enabled, assuring that a STA without OCV enabled can still
connect to a STA with OCV enabled (and vice versa), verifying that
invalid OCI elements get silently ignored, verifying that missing OCI
elements are reported, and so on.

Signed-off-by: Mathy Vanhoef <Mathy.Vanhoef@cs.kuleuven.be>
6 years agotests: Enable OCV in the testing builds
Mathy Vanhoef [Mon, 6 Aug 2018 19:46:25 +0000 (15:46 -0400)] 
tests: Enable OCV in the testing builds

Signed-off-by: Mathy Vanhoef <Mathy.Vanhoef@cs.kuleuven.be>
6 years agoOCV: Verify OCI in 4-way and group key handshake
Mathy Vanhoef [Mon, 6 Aug 2018 19:46:31 +0000 (15:46 -0400)] 
OCV: Verify OCI in 4-way and group key handshake

Verify the received OCI element in the 4-way and group key handshakes.
If verification fails, the handshake message is silently dropped.

Signed-off-by: Mathy Vanhoef <Mathy.Vanhoef@cs.kuleuven.be>
6 years agoOCV: Add function to derive Tx parameters to a specific STA
Mathy Vanhoef [Mon, 6 Aug 2018 19:46:30 +0000 (15:46 -0400)] 
OCV: Add function to derive Tx parameters to a specific STA

Use the information elements that were present in the (Re)Association
Request frame to derive the maximum bandwidth the AP will use to
transmit frames to a specific STA. By using this approach, we don't need
to query the kernel for this information, and avoid having to add a
driver API for that.

Signed-off-by: Mathy Vanhoef <Mathy.Vanhoef@cs.kuleuven.be>
6 years agoOCV: Add function to verify a received OCI element
Mathy Vanhoef [Mon, 6 Aug 2018 19:46:29 +0000 (15:46 -0400)] 
OCV: Add function to verify a received OCI element

ocv_verify_tx_params() verifies that the receive OCI element includes
field values that are compatible with the local channel configuration.

Signed-off-by: Mathy Vanhoef <Mathy.Vanhoef@cs.kuleuven.be>
6 years agoOCV: Parse all types of OCI information elements
Mathy Vanhoef [Mon, 6 Aug 2018 19:46:28 +0000 (15:46 -0400)] 
OCV: Parse all types of OCI information elements

Add functionality to parse all variations of the OCI element.

Signed-off-by: Mathy Vanhoef <Mathy.Vanhoef@cs.kuleuven.be>
6 years agoOCV: Insert OCI in 4-way and group key handshake
Mathy Vanhoef [Mon, 6 Aug 2018 19:46:27 +0000 (15:46 -0400)] 
OCV: Insert OCI in 4-way and group key handshake

If Operating Channel Verification is negotiated, include the OCI KDE
element in EAPOL-Key msg 2/4 and 3/4 of the 4-way handshake and both
messages of the group key handshake.

Signed-off-by: Mathy Vanhoef <Mathy.Vanhoef@cs.kuleuven.be>
6 years agoOCV: Add utility functions to insert OCI elements
Mathy Vanhoef [Mon, 6 Aug 2018 19:46:26 +0000 (15:46 -0400)] 
OCV: Add utility functions to insert OCI elements

This commit adds utility functions to insert various encoding of the OCI
element.

Signed-off-by: Mathy Vanhoef <Mathy.Vanhoef@cs.kuleuven.be>
6 years agoOCV: Add wlantest support for indicating OCV
Mathy Vanhoef [Mon, 6 Aug 2018 19:46:25 +0000 (15:46 -0400)] 
OCV: Add wlantest support for indicating OCV

Add wlantest parsing of the OCV RSN cpability flag.

Signed-off-by: Mathy Vanhoef <Mathy.Vanhoef@cs.kuleuven.be>
6 years agoOCV: Advertise OCV capability in RSN capabilities (STA)
Mathy Vanhoef [Mon, 6 Aug 2018 19:46:25 +0000 (15:46 -0400)] 
OCV: Advertise OCV capability in RSN capabilities (STA)

Set the OCV bit in RSN capabilities (RSNE) based on station mode
configuration.

Signed-off-by: Mathy Vanhoef <Mathy.Vanhoef@cs.kuleuven.be>
6 years agoOCV: Track STA OCV capability in AP mode
Mathy Vanhoef [Mon, 6 Aug 2018 19:46:25 +0000 (15:46 -0400)] 
OCV: Track STA OCV capability in AP mode

Check and store OCV capability indication for each STA.

Signed-off-by: Mathy Vanhoef <Mathy.Vanhoef@cs.kuleuven.be>
6 years agoOCV: Advertise OCV capability in RSN capabilities (AP)
Mathy Vanhoef [Mon, 6 Aug 2018 19:46:25 +0000 (15:46 -0400)] 
OCV: Advertise OCV capability in RSN capabilities (AP)

Set the OCV bit in RSN capabilities (RSNE) based on AP mode
configuration. Do the same for OSEN since it follows the RSNE field
definitions.

Signed-off-by: Mathy Vanhoef <Mathy.Vanhoef@cs.kuleuven.be>
6 years agoOCV: Add wpa_supplicant config parameter
Mathy Vanhoef [Mon, 6 Aug 2018 19:46:25 +0000 (15:46 -0400)] 
OCV: Add wpa_supplicant config parameter

Add wpa_supplicant network profile parameter ocv to disable or enable
Operating Channel Verification (OCV) support.

Signed-off-by: Mathy Vanhoef <Mathy.Vanhoef@cs.kuleuven.be>
6 years agoOCV: Add hostapd config parameter
Mathy Vanhoef [Mon, 6 Aug 2018 19:46:25 +0000 (15:46 -0400)] 
OCV: Add hostapd config parameter

Add hostapd.conf parameter ocv to disable or enable Operating Channel
Verification (OCV) support.

Signed-off-by: Mathy Vanhoef <Mathy.Vanhoef@cs.kuleuven.be>
6 years agoOCV: Add build configuration for channel validation support
Mathy Vanhoef [Mon, 6 Aug 2018 19:46:25 +0000 (15:46 -0400)] 
OCV: Add build configuration for channel validation support

Add compilation flags for Operating Channel Verification (OCV) support.

Signed-off-by: Mathy Vanhoef <Mathy.Vanhoef@cs.kuleuven.be>
6 years agoOCV: Protocol definitions
Mathy Vanhoef [Mon, 6 Aug 2018 19:46:25 +0000 (15:46 -0400)] 
OCV: Protocol definitions

Define protocol identifiers for Operating Channel Verification (OCV)
based on IEEE P802.11-REVmd/D2.0.

Signed-off-by: Mathy Vanhoef <Mathy.Vanhoef@cs.kuleuven.be>
6 years agoStore the VHT Operation element of an associated STA
Mathy Vanhoef [Mon, 6 Aug 2018 19:46:24 +0000 (15:46 -0400)] 
Store the VHT Operation element of an associated STA

APs and mesh peers use the VHT Operation element to advertise certain
channel properties (e.g., the bandwidth of the channel). Save this
information element so we can later access this information.

Signed-off-by: Mathy Vanhoef <Mathy.Vanhoef@cs.kuleuven.be>
6 years agoAdd functions to convert channel bandwidth to an integer
Mathy Vanhoef [Mon, 6 Aug 2018 19:46:23 +0000 (15:46 -0400)] 
Add functions to convert channel bandwidth to an integer

This adds two utility functions to convert both operating classes and
and the chan_width enum to an integer representing the channel
bandwidth. This can then be used to compare bandwidth parameters in an
uniform manner.

Signed-off-by: Mathy Vanhoef <Mathy.Vanhoef@cs.kuleuven.be>
6 years agoAdd utility function to derive operating class and channel
Mathy Vanhoef [Mon, 6 Aug 2018 19:46:22 +0000 (15:46 -0400)] 
Add utility function to derive operating class and channel

This function can be used to easily convert the parameters returned
by the channel_info driver API, into their corresponding operating
class and channel number.

Signed-off-by: Mathy Vanhoef <Mathy.Vanhoef@cs.kuleuven.be>
6 years agoMake channel_info available to authenticator
Mathy Vanhoef [Mon, 6 Aug 2018 19:46:21 +0000 (15:46 -0400)] 
Make channel_info available to authenticator

This adds the necessary functions and callbacks to make the channel_info
driver API available to the authenticator state machine that implements
the 4-way and group key handshake. This is needed for OCV.

Signed-off-by: Mathy Vanhoef <Mathy.Vanhoef@cs.kuleuven.be>
6 years agoMake channel_info available to the supplicant state machine
Mathy Vanhoef [Mon, 6 Aug 2018 19:46:20 +0000 (15:46 -0400)] 
Make channel_info available to the supplicant state machine

This adds the necessary functions and callbacks to make the channel_info
driver API available to the supplicant state machine that implements the
4-way and group key handshake. This is needed for OCV.

Signed-off-by: Mathy Vanhoef <Mathy.Vanhoef@cs.kuleuven.be>
6 years agoAdd driver API to get current channel parameters
Mathy Vanhoef [Mon, 6 Aug 2018 19:46:19 +0000 (15:46 -0400)] 
Add driver API to get current channel parameters

This adds driver API functions to get the current operating channel
parameters. This encompasses the center frequency, channel bandwidth,
frequency segment 1 index (for 80+80 channels), and so on.

Signed-off-by: Mathy Vanhoef <Mathy.Vanhoef@cs.kuleuven.be>
6 years agoHS 2.0 server: Allow policy to be set for SIM provisioning
Jouni Malinen [Sun, 16 Dec 2018 16:33:11 +0000 (18:33 +0200)] 
HS 2.0 server: Allow policy to be set for SIM provisioning

A new osu_config field "sim_policy" can now be used to specify the
policy template for SIM provisioning.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoHS 2.0 server: SIM provisioning exchange
Jouni Malinen [Sat, 15 Dec 2018 16:00:12 +0000 (18:00 +0200)] 
HS 2.0 server: SIM provisioning exchange

Support SIM provisioning exchange with SPP. This uses the
hotspot2dot0-mobile-identifier-hash value from the AAA server to allow
subscription registration through subscription remediation exchange.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agotests: Hotspot 2.0 AAA server behavior for SIM provisioning
Jouni Malinen [Fri, 14 Dec 2018 13:57:51 +0000 (15:57 +0200)] 
tests: Hotspot 2.0 AAA server behavior for SIM provisioning

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoHS 2.0 server: RADIUS server support for SIM provisioning
Jouni Malinen [Fri, 14 Dec 2018 13:58:13 +0000 (15:58 +0200)] 
HS 2.0 server: RADIUS server support for SIM provisioning

This adds support for hostapd-as-RADIUS-authentication-server to request
subscription remediation for SIM-based credentials. The new hostapd.conf
parameter hs20_sim_provisioning_url is used to set the URL prefix for
the remediation server for SIM provisioning. The random
hotspot2dot0-mobile-identifier-hash value will be added to the end of
this URL prefix and the same value is stored in a new SQLite database
table sim_provisioning for the subscription server implementation to
use.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoEAP: Make method and IMSI available from server structures
Jouni Malinen [Fri, 14 Dec 2018 13:56:16 +0000 (15:56 +0200)] 
EAP: Make method and IMSI available from server structures

Expose EAP method and IMSI from the completed (or ongoing) EAP
authentication session. These are needed for implementing Hotspot 2.0
SIM provisioning.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoWMM AC: Fix a typo in a comment
Jouni Malinen [Sat, 8 Dec 2018 14:50:42 +0000 (16:50 +0200)] 
WMM AC: Fix a typo in a comment

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agoWMM AC: Do not write ERROR level log entries when WMM AC is not in use
Jouni Malinen [Sat, 8 Dec 2018 14:48:33 +0000 (16:48 +0200)] 
WMM AC: Do not write ERROR level log entries when WMM AC is not in use

These two wpa_printf() calls with MSG_ERROR level could be reached when
connecting without (Re)Association Response frame elements being
available. That would be the case for wired connections and IBSS. Those
cases are not supposed to use WMM AC in the first place, so do not
confuse logs with ERROR messages in them for normal conditions.

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agotests: wpa_supplicant config file writing and key_mgmt values
Jouni Malinen [Sat, 8 Dec 2018 14:14:42 +0000 (16:14 +0200)] 
tests: wpa_supplicant config file writing and key_mgmt values

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agoOWE: Fix OWE network profile saving
Jouni Malinen [Sat, 8 Dec 2018 14:26:17 +0000 (16:26 +0200)] 
OWE: Fix OWE network profile saving

key_mgmt=OWE did not have a config parameter writer and wpa_supplicant
was unable to save such a network profile correctly. Fix this by adding
the needed parameter writer.

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agoDPP: Support DPP key_mgmt saving to wpa_supplicant configuration
Damodaran, Rohit (Contractor) [Wed, 5 Dec 2018 11:20:43 +0000 (11:20 +0000)] 
DPP: Support DPP key_mgmt saving to wpa_supplicant configuration

In the existing code, there was no "DPP" string available to the DPP key
management type for configuration parser of wpa supplicant. When the
configuration is saved, the key management string was left out from the
config file. Fix this by adding support for writing key_mgmt=DPP option.

Signed-off-by: Rohit Damodaran <Rohit_Damodaran@comcast.com>
6 years agotests: Remove parallel-vm.sh
Jouni Malinen [Sat, 8 Dec 2018 13:35:47 +0000 (15:35 +0200)] 
tests: Remove parallel-vm.sh

parallel-vm.py has obsoleted this a long time ago and there is no need
to maintain two scripts for doing more or less the same thing.

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agotests: Add dfs_etsi to the long_tests list
Jouni Malinen [Sat, 8 Dec 2018 13:33:31 +0000 (15:33 +0200)] 
tests: Add dfs_etsi to the long_tests list

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agoHS 2.0: Fix PMF-in-use check for ANQP Venue URL processing
Jouni Malinen [Sat, 8 Dec 2018 11:57:51 +0000 (13:57 +0200)] 
HS 2.0: Fix PMF-in-use check for ANQP Venue URL processing

The previous implementation did not check that we are associated with
the sender of the GAS response before checking for PMF status. This
could have accepted Venue URL when not in associated state. Fix this by
explicitly checking for association with the responder first.

This fixes an issue that was detected, e.g., with these hwsim test case
sequences:
gas_anqp_venue_url_pmf gas_anqp_venue_url
gas_prot_vs_not_prot gas_anqp_venue_url

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agotests: Hotspot 2.0 connection attempt without PMF
Jouni Malinen [Sat, 8 Dec 2018 11:41:50 +0000 (13:41 +0200)] 
tests: Hotspot 2.0 connection attempt without PMF

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoHS 2.0: Enable PMF automatically for Hotspot 2.0 network profiles
Jouni Malinen [Sat, 8 Dec 2018 10:46:56 +0000 (12:46 +0200)] 
HS 2.0: Enable PMF automatically for Hotspot 2.0 network profiles

Hotspot 2.0 Release 2 requires PMF to be negotiated, so enable this by
default in the network profiles created from cred blocks.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoHS 2.0: Reject Hotspot 2.0 Rel 2 or newer association without PMF
Jouni Malinen [Sat, 8 Dec 2018 10:20:33 +0000 (12:20 +0200)] 
HS 2.0: Reject Hotspot 2.0 Rel 2 or newer association without PMF

Hotspot 2.0 Rel 2 requires PMF to be enabled.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agotests: Fix ap_hs20_deauth_req_without_pmf
Jouni Malinen [Sat, 8 Dec 2018 11:08:04 +0000 (13:08 +0200)] 
tests: Fix ap_hs20_deauth_req_without_pmf

Now that hostapd starts mandating PMF for Hotspot 2.0 Release 2
association, this test case needs some more tweaks to work. Hardcode
Hotspot 2.0 Release 1 to be used and disable PMF explicitly.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agotests: Fix ap_hs20_ft with PMF enabled
Jouni Malinen [Sat, 8 Dec 2018 11:26:50 +0000 (13:26 +0200)] 
tests: Fix ap_hs20_ft with PMF enabled

The Beacon loss event was not reported anymore, so remove that as an
unnecessary step in the test case. In addition, check the key_mgmt
values explicitly.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agotests: Enable PMF in ap_hs20_unexpected configuration
Jouni Malinen [Sat, 8 Dec 2018 11:14:11 +0000 (13:14 +0200)] 
tests: Enable PMF in ap_hs20_unexpected configuration

This is needed to meet the Hotspot 2.0 Release 2 requirement for the
third station that is actually using RSN.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agotests: Enable PMF in ap_hs20_external_selection network profile
Jouni Malinen [Sat, 8 Dec 2018 11:01:47 +0000 (13:01 +0200)] 
tests: Enable PMF in ap_hs20_external_selection network profile

This is required for Hotspot 2.0 Release 2.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoHS 2.0: Allocate enough buffer for HS 2.0 Indication element for scan
Jouni Malinen [Fri, 7 Dec 2018 23:11:44 +0000 (01:11 +0200)] 
HS 2.0: Allocate enough buffer for HS 2.0 Indication element for scan

The HS 2.0 Indication element can be up to 9 octets in length, so add
two more octets to the minimum extra_ie buffer size for scanning.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agotests: Hotspot 2.0 release number indication
Jouni Malinen [Fri, 7 Dec 2018 23:09:44 +0000 (01:09 +0200)] 
tests: Hotspot 2.0 release number indication

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agotests: Update Hotspot 2.0 release number expectation to 3
Jouni Malinen [Sat, 8 Dec 2018 10:59:25 +0000 (12:59 +0200)] 
tests: Update Hotspot 2.0 release number expectation to 3

Match the implementation change to fix the test cases that verified a
specific Hotspot 2.0 release number indication.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoHS 2.0: Update supported release number to 3
Jouni Malinen [Fri, 7 Dec 2018 22:55:01 +0000 (00:55 +0200)] 
HS 2.0: Update supported release number to 3

Release 3 functionality is included, so start advertising support for
that release.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoHS 2.0: As a STA, do not indicate release number greater than the AP
Jouni Malinen [Fri, 7 Dec 2018 22:51:04 +0000 (00:51 +0200)] 
HS 2.0: As a STA, do not indicate release number greater than the AP

Hotspot 2.0 tech spec mandates mobile device to not indicate a release
number that is greater than the release number advertised by the AP. Add
this constraint to the HS 2.0 Indication element when adding this into
(Re)Association Request frame. The element in the Probe Request frame
continues to show the station's latest supported release number.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoHS 2.0: Allow Hotspot 2.0 release number to be configured
Jouni Malinen [Fri, 7 Dec 2018 22:39:00 +0000 (00:39 +0200)] 
HS 2.0: Allow Hotspot 2.0 release number to be configured

The new hostapd configuration parameter hs20_release can be used to
configure the AP to advertise a specific Hotspot 2.0 release number
instead of the latest supported release. This is mainly for testing
purposes.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoFILS: Do not process FILS HLP request again while previous one is pending
Jouni Malinen [Fri, 7 Dec 2018 14:03:40 +0000 (16:03 +0200)] 
FILS: Do not process FILS HLP request again while previous one is pending

It is better not to process a new (most likely repeated) FILS HLP
request if a station retransmits (Re)Association Request frame before
the previous HLP response has either been received or timed out. The
previous implementation ended up doing this and also ended up
rescheduling the fils_hlp_timeout timer in a manner that prevented the
initial timeout from being reached if the STA continued retransmitting
the frame. This could result in failed association due to a timeout on
the station side.

Make this more robust by processing (and relaying to the server) the HLP
request once and then ignoring any new HLP request while the response
for the relayed request is still pending. The new (Re)Association
Request frames are otherwise processed, but they do not result in actual
state change on the AP side before the HLP process from the first
pending request is completed.

This fixes hwsim test case fils_sk_hlp_oom failures with unmodified
mac80211 implementation (i.e., with a relatively short retransmission
timeout for (Re)Association Request frame).

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agohostapd: Update HE Capabilities and Operation element definition
Peng Xu [Wed, 28 Nov 2018 18:50:34 +0000 (10:50 -0800)] 
hostapd: Update HE Capabilities and Operation element definition

Update HE Capabilities/Operation element definition based on IEEE
P802.11ax/D3.0.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoMove send_probe_response parameter to BSS specific items
Jouni Malinen [Fri, 7 Dec 2018 11:07:36 +0000 (13:07 +0200)] 
Move send_probe_response parameter to BSS specific items

This can be more convenient for testing Multiple BSSID functionality.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoDefine spectral scaling parameters as QCA vendor specific attributes
Edayilliam Jayadev [Mon, 5 Nov 2018 10:19:34 +0000 (15:49 +0530)] 
Define spectral scaling parameters as QCA vendor specific attributes

Add spectral scaling parameters as vendor attributes to the
QCA_NL80211_VENDOR_SUBCMD_SPECTRAL_SCAN_GET_CAP_INFO vendor subcommand.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agotests: Connect to WPS AP with NFC connection handover (local failure)
Jouni Malinen [Tue, 4 Dec 2018 18:55:20 +0000 (20:55 +0200)] 
tests: Connect to WPS AP with NFC connection handover (local failure)

This is a regression test case for a potential NULL pointer
dereferencing fixed in the previous commit.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoWPS NFC: Fix potential NULL pointer dereference on an error path
Yu Ouyang [Mon, 3 Dec 2018 06:18:53 +0000 (14:18 +0800)] 
WPS NFC: Fix potential NULL pointer dereference on an error path

The NFC connection handover specific case of WPS public key generation
did not verify whether the two wpabuf_dup() calls succeed. Those may
return NULL due to an allocation failure and that would result in a NULL
pointer dereference in dh5_init_fixed().

Fix this by checking memory allocation results explicitly. If either of
the allocations fail, do not try to initialize wps->dh_ctx and instead,
report the failure through the existing error case handler below.

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