]> git.ipfire.org Git - thirdparty/hostap.git/log
thirdparty/hostap.git
4 years agoSAE: H2E version of SAE commit message handling for AP
Jouni Malinen [Fri, 6 Sep 2019 12:51:37 +0000 (15:51 +0300)] 
SAE: H2E version of SAE commit message handling for AP

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoSAE: Derive H2E PT in AP when starting the AP
Jouni Malinen [Fri, 6 Sep 2019 12:51:37 +0000 (15:51 +0300)] 
SAE: Derive H2E PT in AP when starting the AP

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoSAE: Check that peer's rejected groups are not enabled
Jouni Malinen [Fri, 6 Sep 2019 12:40:39 +0000 (15:40 +0300)] 
SAE: Check that peer's rejected groups are not enabled

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoSAE: H2E version of SAE commit message handling for STA
Jouni Malinen [Fri, 6 Sep 2019 12:40:39 +0000 (15:40 +0300)] 
SAE: H2E version of SAE commit message handling for STA

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoSAE: Collect list of rejected groups for H2E in STA
Jouni Malinen [Fri, 6 Sep 2019 12:40:39 +0000 (15:40 +0300)] 
SAE: Collect list of rejected groups for H2E in STA

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoSAE: Derive H2E PT in STA before connection
Jouni Malinen [Fri, 6 Sep 2019 12:40:39 +0000 (15:40 +0300)] 
SAE: Derive H2E PT in STA before connection

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoRSN: Verify RSNXE match between Beacon/ProbeResp and EAPOL-Key msg 3/4
Jouni Malinen [Fri, 6 Sep 2019 11:51:31 +0000 (14:51 +0300)] 
RSN: Verify RSNXE match between Beacon/ProbeResp and EAPOL-Key msg 3/4

If the AP advertises RSN Extension element, it has to be advertised
consistently in the unprotected (Beacon and Probe Response) and
protected (EAPOL-Key msg 3/4) frames. Verify that this is the case.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoSAE: Advertise Extended RSN Capabilities when H2E is enabled
Jouni Malinen [Thu, 5 Sep 2019 09:05:58 +0000 (12:05 +0300)] 
SAE: Advertise Extended RSN Capabilities when H2E is enabled

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoSAE: Handle BSS membership selector indication for H2E-only in STA mode
Jouni Malinen [Sat, 7 Sep 2019 12:24:24 +0000 (15:24 +0300)] 
SAE: Handle BSS membership selector indication for H2E-only in STA mode

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoSAE: Advertise BSS membership selector for H2E-only case
Jouni Malinen [Thu, 5 Sep 2019 08:54:47 +0000 (11:54 +0300)] 
SAE: Advertise BSS membership selector for H2E-only case

If hostapd is configured to enable only the hash-to-element version of
SAE PWE derivation (sae_pwe=1), advertise BSS membership selector to
indicate this.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoSAE: Add sae_pwe configuration parameter for wpa_supplicant
Jouni Malinen [Thu, 5 Sep 2019 09:38:32 +0000 (12:38 +0300)] 
SAE: Add sae_pwe configuration parameter for wpa_supplicant

This parameter can be used to specify which PWE derivation mechanism(s)
is enabled. This commit is only introducing the new parameter; actual
use of it will be address in separate commits.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoSAE: Add sae_pwe configuration parameter for hostapd
Jouni Malinen [Thu, 5 Sep 2019 08:44:57 +0000 (11:44 +0300)] 
SAE: Add sae_pwe configuration parameter for hostapd

This parameter can be used to specify which PWE derivation mechanism(s)
is enabled. This commit is only introducing the new parameter; actual
use of it will be address in separate commits.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agotests: Module test for SAE hash-to-element crypto routines
Jouni Malinen [Tue, 27 Aug 2019 13:33:15 +0000 (16:33 +0300)] 
tests: Module test for SAE hash-to-element crypto routines

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoSAE: Add Rejected Groups element into H2E Commit
Jouni Malinen [Tue, 27 Aug 2019 13:33:15 +0000 (16:33 +0300)] 
SAE: Add Rejected Groups element into H2E Commit

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoSAE: Hash algorithm selection for H2E KCK/CN()
Jouni Malinen [Tue, 27 Aug 2019 13:33:15 +0000 (16:33 +0300)] 
SAE: Hash algorithm selection for H2E KCK/CN()

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoSAE: Implement hash-to-element PT/PWE crypto routines
Jouni Malinen [Tue, 27 Aug 2019 13:33:15 +0000 (16:33 +0300)] 
SAE: Implement hash-to-element PT/PWE crypto routines

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoSAE: Parse Rejected Groups element from H2E SAE commit
Jouni Malinen [Sat, 7 Sep 2019 15:38:29 +0000 (18:38 +0300)] 
SAE: Parse Rejected Groups element from H2E SAE commit

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoSAE: Tell sae_parse_commit() whether H2E is used
Jouni Malinen [Sat, 7 Sep 2019 15:33:02 +0000 (18:33 +0300)] 
SAE: Tell sae_parse_commit() whether H2E is used

This will be needed to help parsing the received SAE commit.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoSAE: H2E protocol defines
Jouni Malinen [Fri, 6 Sep 2019 12:46:10 +0000 (15:46 +0300)] 
SAE: H2E protocol defines

These are the defined values/identifiers for SAE hash-to-element
mechanism from IEEE P802.11-REVmd/D3.0.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agowolfSSL: Fix crypto_bignum_sub()
Jouni Malinen [Mon, 14 Oct 2019 16:27:47 +0000 (19:27 +0300)] 
wolfSSL: Fix crypto_bignum_sub()

The initial crypto wrapper implementation for wolfSSL seems to have
included a copy-paste error in crypto_bignum_sub() implementation that
was identical to crypto_bignum_add() while mp_sub() should have been
used instead of mp_add().

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agocrypto: Add more bignum/EC helper functions
Jouni Malinen [Tue, 27 Aug 2019 13:33:15 +0000 (16:33 +0300)] 
crypto: Add more bignum/EC helper functions

These are needed for implementing SAE hash-to-element.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agotests: PMF AP sending valid deauth/disassoc without dropping SA
Jouni Malinen [Fri, 11 Oct 2019 15:18:43 +0000 (18:18 +0300)] 
tests: PMF AP sending valid deauth/disassoc without dropping SA

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agotests: WPA2-PSK PMF AP dropping SA
Jouni Malinen [Fri, 11 Oct 2019 14:53:04 +0000 (17:53 +0300)] 
tests: WPA2-PSK PMF AP dropping SA

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agotests: sigma_dut DPP TCP Enrollee as initiator
Jouni Malinen [Fri, 11 Oct 2019 10:27:49 +0000 (13:27 +0300)] 
tests: sigma_dut DPP TCP Enrollee as initiator

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agotests: sigma_dut DPP TCP Configurator (Controller) as responder
Jouni Malinen [Fri, 11 Oct 2019 10:07:39 +0000 (13:07 +0300)] 
tests: sigma_dut DPP TCP Configurator (Controller) as responder

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoDPP: Fix confusing debug entry from Configurator
Jouni Malinen [Fri, 11 Oct 2019 10:04:42 +0000 (13:04 +0300)] 
DPP: Fix confusing debug entry from Configurator

The logic for displaying the message about no configuration being
available for the Enrollee was reversed when support for multiple Config
Objects was added. This was supposed to be shown only if the first
Config Object fails (i.e., when no configuration is available); not when
second attempt fails (since the first one had already been successful in
that case).

Fixes: 7eb06a33697f ("DPP2: Allow multiple Config Objects to be build on Configurator")
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agotests: sigma_dut controlled SAE association with PMKID
Jouni Malinen [Thu, 10 Oct 2019 13:21:10 +0000 (16:21 +0300)] 
tests: sigma_dut controlled SAE association with PMKID

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agotests: sigma_dut controlled AP with SAE Confirm immediate
Jouni Malinen [Thu, 10 Oct 2019 12:56:01 +0000 (15:56 +0300)] 
tests: sigma_dut controlled AP with SAE Confirm immediate

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agotests: SAE and AP sending Confirm message without waiting STA
Jouni Malinen [Thu, 10 Oct 2019 12:42:11 +0000 (15:42 +0300)] 
tests: SAE and AP sending Confirm message without waiting STA

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoSAE: Allow AP behavior for SAE Confirm to be configured
Jouni Malinen [Thu, 10 Oct 2019 12:38:26 +0000 (15:38 +0300)] 
SAE: Allow AP behavior for SAE Confirm to be configured

hostapd is by default waiting STA to send SAE Confirm before sending the
SAE Confirm. This can now be configured with sae_confirm_immediate=1
resulting in hostapd sending out SAE Confirm immediately after sending
SAE Commit.

These are the two different message sequences:

sae_confirm_immediate=0
STA->AP: SAE Commit
AP->STA: SAE Commit
STA->AP: SAE Confirm
AP->STA: SAE Confirm
STA->AP: Association Request
AP->STA: Association Response

sae_confirm_immediate=1
STA->AP: SAE Commit
AP->STA: SAE Commit
AP->STA: SAE Confirm
STA->AP: SAE Confirm
STA->AP: Association Request
AP->STA: Association Response

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agowpa_cli: Clean up unnecessarily complex CONFIG_MESH use
Jouni Malinen [Mon, 7 Oct 2019 12:23:38 +0000 (15:23 +0300)] 
wpa_cli: Clean up unnecessarily complex CONFIG_MESH use

There is no need for #ifdef/#else/#endif construction in
network_fields[] to cover "mode" (which is completely independent of
CONFIG_MESH) or two separate conditional blocks for mesh related network
fields, so move these into a single conditionally included block.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agowpa_supplicant: Pass AP mode EDMG config to hostapd struct
Alexei Avshalom Lazar [Wed, 11 Sep 2019 09:03:07 +0000 (12:03 +0300)] 
wpa_supplicant: Pass AP mode EDMG config to hostapd struct

Signed-off-by: Alexei Avshalom Lazar <ailizaro@codeaurora.org>
4 years agowpa_supplicant: Add support for EDMG channels
Alexei Avshalom Lazar [Wed, 11 Sep 2019 09:03:07 +0000 (12:03 +0300)] 
wpa_supplicant: Add support for EDMG channels

As part of a connection request, set EDMG parameters for the driver to
use in the association. The EDMG parameters are based on EDMG IE
received from the AP's Probe Response frames, the driver's EDMG
capability, and the EDMG configuration from the configuration.

As part of starting an AP, set EDMG parameters for the driver to use for
AP operation. The EDMG parameters are based on the driver's EDMG
capability and the EDMG configuration from the configuration.

This implementation is limited to CB2 (channel bonding of 2 channels)
and the bonded channels must be adjacent, i.e., the supported values for
edmg_channel are 9..13.

Signed-off-by: Alexei Avshalom Lazar <ailizaro@codeaurora.org>
4 years agoIndicate EDMG in scan results
Alexei Avshalom Lazar [Wed, 11 Sep 2019 09:03:07 +0000 (12:03 +0300)] 
Indicate EDMG in scan results

Add [EDMG] flag to scan results.

Signed-off-by: Alexei Avshalom Lazar <ailizaro@codeaurora.org>
4 years agoAP: Show EDMG channel info in STATUS output
Alexei Avshalom Lazar [Wed, 11 Sep 2019 09:03:07 +0000 (12:03 +0300)] 
AP: Show EDMG channel info in STATUS output

Signed-off-by: Alexei Avshalom Lazar <ailizaro@codeaurora.org>
4 years agohostapd: Check EDMG configuration against capability
Alexei Avshalom Lazar [Wed, 11 Sep 2019 09:03:07 +0000 (12:03 +0300)] 
hostapd: Check EDMG configuration against capability

Signed-off-by: Alexei Avshalom Lazar <ailizaro@codeaurora.org>
4 years agohostapd: Check usability of EDMG channel
Alexei Avshalom Lazar [Wed, 11 Sep 2019 09:03:07 +0000 (12:03 +0300)] 
hostapd: Check usability of EDMG channel

Signed-off-by: Alexei Avshalom Lazar <ailizaro@codeaurora.org>
4 years agoAdd EDMG parameters to set_freq functions
Alexei Avshalom Lazar [Wed, 11 Sep 2019 09:03:07 +0000 (12:03 +0300)] 
Add EDMG parameters to set_freq functions

This updates the frequency parameter setting functions to include
argument for EDMG.

Signed-off-by: Alexei Avshalom Lazar <ailizaro@codeaurora.org>
4 years agoEDMG: Helper functions for parameter encoding/checking
Alexei Avshalom Lazar [Wed, 11 Sep 2019 09:03:07 +0000 (12:03 +0300)] 
EDMG: Helper functions for parameter encoding/checking

Signed-off-by: Alexei Avshalom Lazar <ailizaro@codeaurora.org>
4 years agowpa_supplicant: Add EDMG channel configuration parameters
Alexei Avshalom Lazar [Wed, 11 Sep 2019 09:03:07 +0000 (12:03 +0300)] 
wpa_supplicant: Add EDMG channel configuration parameters

Add two new configuration parameters for wpa_supplicant:
enable_edmg: Enable EDMG capability for STA/AP mode
edmg_channel: Configure channel bonding. In AP mode it defines the EDMG
channel to start the AP on. In STA mode it defines the EDMG channel to
use for connection.

Signed-off-by: Alexei Avshalom Lazar <ailizaro@codeaurora.org>
4 years agohostapd: Add EDMG channel configuration parameters
Alexei Avshalom Lazar [Wed, 11 Sep 2019 09:03:07 +0000 (12:03 +0300)] 
hostapd: Add EDMG channel configuration parameters

Add two new configuration parameters for hostapd:
enable_edmg: Enable EDMG capability for AP mode in the 60 GHz band
edmg_channel: Configure channel bonding for AP mode in the 60 GHz band

Signed-off-by: Alexei Avshalom Lazar <ailizaro@codeaurora.org>
4 years agonl80211: Add support for EDMG channels
Alexei Avshalom Lazar [Tue, 10 Sep 2019 07:26:01 +0000 (10:26 +0300)] 
nl80211: Add support for EDMG channels

IEEE P802.11ay defines Enhanced Directional Multi-Gigabit (EDMG) STA and
AP which allow channel bonding of 2 channels and more.

nl80211 provides the driver's EDMG capabilities from the kernel
using two new attributes:
NL80211_BAND_ATTR_EDMG_CHANNELS - bitmap field that indicates the 2.16
GHz channel(s) that are supported by the driver.
NL80211_BAND_ATTR_EDMG_BW_CONFIG - represents the channel bandwidth
configurations supported by the driver.
The driver's EDMG capabilities are stored inside struct hostapd_hw_modes.

As part of the connect request and starting AP, EDMG parameters are
passed as part of struct hostapd_freq_params.

The EDMG parameters are sent to the kernel by using two new attributes:
NL80211_ATTR_WIPHY_EDMG_CHANNEL and NL80211_ATTR_WIPHY_EDMG_BW_CONFIG
which specify channel and bandwidth configuration for the driver to use.

This implementation is limited to CB2 (channel bonding of 2 channels)
and the bonded channels must be adjacent.

Signed-off-by: Alexei Avshalom Lazar <ailizaro@codeaurora.org>
4 years agoIEEE P802.11ay/D4.0 defines for EDMG
Alexei Avshalom Lazar [Tue, 10 Sep 2019 07:26:01 +0000 (10:26 +0300)] 
IEEE P802.11ay/D4.0 defines for EDMG

Signed-off-by: Alexei Avshalom Lazar <ailizaro@codeaurora.org>
4 years agotests: sigma_dut DPP/QR responder status query
Jouni Malinen [Fri, 4 Oct 2019 14:03:47 +0000 (17:03 +0300)] 
tests: sigma_dut DPP/QR responder status query

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agotests: sigma_dut DPP AP as Relay to Controller
Jouni Malinen [Fri, 4 Oct 2019 13:33:36 +0000 (16:33 +0300)] 
tests: sigma_dut DPP AP as Relay to Controller

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agotests: Update server and user certificates (2019)
Jouni Malinen [Fri, 4 Oct 2019 13:03:04 +0000 (16:03 +0300)] 
tests: Update server and user certificates (2019)

The previous versions expired, so need to re-sign these to fix number of
the EAP test cases. This contains updates from running
tests/hwsim/auth_server/update.sh.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoMBO/OCE: Update disable_mbo_oce flag after association
Ankita Bajaj [Fri, 27 Sep 2019 05:58:34 +0000 (11:28 +0530)] 
MBO/OCE: Update disable_mbo_oce flag after association

After roaming to an AP, update disable_mbo_oce flag based on the current
BSS capabilities. This flag is used to check whether STA should support
MBO/OCE features and process BTM request received from the current
connected AP.

When a STA roams from a WPA2 MBO/OCE AP with PMF enabled to a
misbehaving WPA2 MBO/OCE AP without PMF, or if the driver chooses a BSS
in which PMF is not enabled for the initial connection, BTM requests
from such APs should not be processed by STA.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agotests: sigma_dut with DPPConfIndex 9 and 10
Jouni Malinen [Wed, 25 Sep 2019 20:55:35 +0000 (23:55 +0300)] 
tests: sigma_dut with DPPConfIndex 9 and 10

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoDPP2: Parse AKM suite selector version of akm node
Jouni Malinen [Fri, 27 Sep 2019 00:09:09 +0000 (03:09 +0300)] 
DPP2: Parse AKM suite selector version of akm node

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoDPP2: Allow Configurator to use AKM suite selectors in Config Object
Jouni Malinen [Thu, 26 Sep 2019 23:30:33 +0000 (02:30 +0300)] 
DPP2: Allow Configurator to use AKM suite selectors in Config Object

The new use_akm_selector=1 value to Configurator parameters can now be
used to request a list of AKM suite selectors to be used in the
Configuration Object if the Enrollee supports version 2 or newer.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoDPP2: Support multiple Config Objects in Enrollee
Jouni Malinen [Thu, 26 Sep 2019 22:08:56 +0000 (01:08 +0300)] 
DPP2: Support multiple Config Objects in Enrollee

Process all received DPP Configuration Object attributes from
Configuration Result in Enrollee STA case. If wpa_supplicant is
configured to add networks automatically, this results in one network
being added for each included Configuration Object.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoDPP2: Allow multiple Config Objects to be build on Configurator
Jouni Malinen [Wed, 25 Sep 2019 00:49:41 +0000 (03:49 +0300)] 
DPP2: Allow multiple Config Objects to be build on Configurator

Special @CONF-OBJ-SEP@ string can now be used as a DPP configuration
string value to split the string into two different components to
configure two Config Objects for an Enrollee.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoDPP: Cleaned up netrole indication for config object building
Jouni Malinen [Mon, 17 Jun 2019 13:41:20 +0000 (16:41 +0300)] 
DPP: Cleaned up netrole indication for config object building

Include netrole as part of struct dpp_configuration to make config
object building more flexible.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoFILS+FT: Fix MFPR flag in RSNE during FILS exchange for FT
Jouni Malinen [Thu, 26 Sep 2019 22:49:36 +0000 (01:49 +0300)] 
FILS+FT: Fix MFPR flag in RSNE during FILS exchange for FT

Commit e820cf952f29 ("MFP: Add MFPR flag into station RSN IE if 802.11w
is mandatory") added indication of MFPR flag in non-FT cases and was
further extended to cover FT protocol in commit ded56f2fafb0 ("FT: Fix
MFPR flag in RSNE during FT protocol"). Similar fix is needed for
FILS+FT as well.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agotests: SAE in wpa_supplicant AP mode
Jouni Malinen [Thu, 19 Sep 2019 18:27:40 +0000 (21:27 +0300)] 
tests: SAE in wpa_supplicant AP mode

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoAllow SAE to be used in wpa_supplicant AP mode
Jouni Malinen [Thu, 19 Sep 2019 18:25:52 +0000 (21:25 +0300)] 
Allow SAE to be used in wpa_supplicant AP mode

SAE password configuration for AP mode requires additional steps
compared to PSK cases. Previous implementation allowed SAE to be
configured, but all authentication attempts would fail due to no
password being available. Now both psk and sae_password/sae_password_id
parameters are translated properly to the hostapd configuration
structures to fix this.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoNetBSD: Fix compile
Roy Marples [Thu, 19 Sep 2019 09:59:09 +0000 (10:59 +0100)] 
NetBSD: Fix compile

On NetBSD the ethernet header is net/if_ether.h

This also pulls in net/if.h which defines if_type, which in turn
conflicts with an enum in wpa_supplicant. As such we need to
include this at the bottom rather than at the top.

Signed-off-by: Roy Marples <roy@marples.name>
4 years agotests: MBO and WPA2 without PMF on misbehaving AP
Jouni Malinen [Fri, 20 Sep 2019 21:34:51 +0000 (00:34 +0300)] 
tests: MBO and WPA2 without PMF on misbehaving AP

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoMBO/OCE: Work around misbehaving MBO/OCE APs that use RSN without PMF
Vamsi Krishna [Wed, 11 Sep 2019 10:35:22 +0000 (16:05 +0530)] 
MBO/OCE: Work around misbehaving MBO/OCE APs that use RSN without PMF

The MBO and OCE specification require the station to mandate use of PMF
when connecting to an MBO/OCE AP that uses WPA2. The earlier
implementation prevented such misbehaving APs from being selected for
connection completely. This looks like the safest approach to take, but
unfortunately, there are deployed APs that are not compliant with the
MBO/OCE requirements and this strict interpretation of the station
requirements results in interoperability issues by preventing the
association completely.

Relax the approach by allowing noncompliant MBO/OCE APs to be selected
for RSN connection without PMF to avoid the main impact of this
interoperability issue. However, disable MBO/OCE functionality when PMF
cannot be negotiated to try to be as compliant as practical with the
MBO/OCE tech spec requirements (i.e., stop being an MBO/OCE STA for the
duration of such workaround association). Also disable support for BTM
in this workaround state since MBO would expect all BTM frames to be
protected.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agowlantest: Process VLAN tagged Data frames
Jouni Malinen [Fri, 20 Sep 2019 20:54:05 +0000 (23:54 +0300)] 
wlantest: Process VLAN tagged Data frames

This allows Data frames to be fully processed for the case where VLAN
tags are used on the wireless link.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agonl80211: Migrate to current netlink key message format
Alexander Wetzel [Sun, 15 Sep 2019 20:08:22 +0000 (22:08 +0200)] 
nl80211: Migrate to current netlink key message format

Linux 2.6.32 (December 2009) introduced alternate netlink messages
for setting and installing keys, deprecating the older ones.

To allow hostapd/wpa_supplicant to use new features only provided via
the new API this patch migrates all netlink messages to the current ones.

Since the nl80211 driver was sometimes already using the new format this
is only unifying the netlink API usage and not changing the minimal
kernel requirement.

The following netlink attributes have been retired for key installs:

  NL80211_ATTR_KEY_DATA
  NL80211_ATTR_KEY_TYPE
  NL80211_ATTR_KEY_SEQ
  NL80211_ATTR_KEY_IDX
  NL80211_ATTR_KEY_CIPHER
  NL80211_ATTR_KEY_DEFAULT
  NL80211_ATTR_KEY_DEFAULT_MGMT
  NL80211_ATTR_KEY_DEFAULT_TYPES

And replaced by the following attributes nested in NL80211_ATTR_KEY:

  NL80211_KEY_DATA
  NL80211_KEY_TYPE
  NL80211_KEY_SEQ
  NL80211_KEY_IDX
  NL80211_KEY_CIPHER
  NL80211_KEY_DEFAULT
  NL80211_KEY_DEFAULT_MGMT
  NL80211_KEY_DEFAULT_TYPES

When getting Michael MIC failure notifications or querying a key
sequence number the kernel continues to use the old attributes:
  NL80211_ATTR_KEY_TYPE
  NL80211_ATTR_KEY_SEQ
  NL80211_ATTR_KEY_IDX

Signed-off-by: Alexander Wetzel <alexander@wetzel-home.de>
4 years agoAP: Provide correct keyid to wpa_send_eapol() for EAPOL-Key msg 3/4
Alexander Wetzel [Sun, 15 Sep 2019 20:08:21 +0000 (22:08 +0200)] 
AP: Provide correct keyid to wpa_send_eapol() for EAPOL-Key msg 3/4

PTKINITNEGOTIATING in the WPA state machine calls wpa_send_eapol() and
hands over the GTK instead of the PTK keyid.

Besides a confusing debug message this does not have any negative side
effects: The variable is only set to a wrong value when using WPA2 but
then it's not used.

With this patch PTKINITNEGOTIATING sets the PTK keyid unconditionally to
zero for EAPOL-Key msg 3/4 and differentiates more obviously between GTK
and PTK keyids.

Signed-off-by: Alexander Wetzel <alexander@wetzel-home.de>
4 years agoBSD: Add support for route(4) message filtering
Roy Marples [Wed, 18 Sep 2019 11:50:36 +0000 (12:50 +0100)] 
BSD: Add support for route(4) message filtering

hostapd is only interested in RTM_IEEE80211.
wpa_supplicant is only interested in RTM_IEEE80211, RTM_IFINFO and
RTM_IFANNOUNCE.

This supports the NetBSD RO_MSGFILTER interface and the alternative
DragonFlyBSD/OpenBSD interface ROUTE_MSGFILTER.

Signed-off-by: Roy Marples <roy@marples.name>
4 years agotests: Automatic channel selection with invalid chanlist
Jouni Malinen [Thu, 19 Sep 2019 09:14:04 +0000 (12:14 +0300)] 
tests: Automatic channel selection with invalid chanlist

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoACS: Stop before scan if no channels in chanlist are available
Neo Jou [Wed, 18 Sep 2019 07:39:50 +0000 (15:39 +0800)] 
ACS: Stop before scan if no channels in chanlist are available

When we set "channel=0" in hostapd.conf to enable ACS function, and set
a wrong channel list, e.g., chanlist=222-999 on purpose, hostapd would
still start ACS process to compute the ideal channel, even when there
are no available channels with such configuration.

Though there is no problem since hostapd fails to initialize interface,
it spends time going through the scan and the debug log entries may make
it more difficult to tell what was behind the failure.

Thus, check if there are any available channels in acs_request_scan(),
and return -1 if no available channel, then it will fail at acs_init(),
without doing ACS computation. It will show the following in the log:
    Could not select hw_mode and channel. (-3)
    wlan0: interface state UNINITIALIZED->DISABLED

Then we can know the setting is incorrect already in
hostapd_select_hw_mode(), instead of waiting for scan callback function
to know if the setting is ok for ACS or not. This can save time and help
to tell if the setting is correct at the initial function at the first.
This will also allow the ENABLE control interface command to return FAIL
when adding an interface dynamically.

Signed-off-by: Neo Jou <neojou@gmail.com>
4 years agoDPP: Debug print configRequest bandSupport on Configurator
Jouni Malinen [Wed, 18 Sep 2019 21:12:27 +0000 (00:12 +0300)] 
DPP: Debug print configRequest bandSupport on Configurator

Go through the received bandSupport JSON array and print its contents in
the debug log. This information might be exposed to upper layer
configuration generation/use somehow in the future.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoDPP: Add bandSupport JSON array into config request
Jouni Malinen [Wed, 18 Sep 2019 21:00:46 +0000 (00:00 +0300)] 
DPP: Add bandSupport JSON array into config request

Indicate supported global operating classes when wpa_supplicant is
operating as an Enrollee.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agomka: Check OLPN for exhaustion on SAKuse decode
Thomas Winter [Tue, 27 Aug 2019 03:55:38 +0000 (15:55 +1200)] 
mka: Check OLPN for exhaustion on SAKuse decode

Most of the time is spent in the CP state machine RETIRE state where LKI
is not set and OKI is the currently used SAK so OLPN needs to be checked
for PN exhaustion.

hostapd/wpa_supplicant implemented an interpretation of the standard as
described in a proposed amendment titled "MKA pending PN exhastion"
which was deemed to be wrong. This amendment was included in IEEE Std
802.1Xck-2018.

Signed-off-by: Thomas Winter <Thomas.Winter@alliedtelesis.co.nz>
4 years agomka: Check OLPN for exhaustion on SAKuse encode
Thomas Winter [Tue, 27 Aug 2019 03:55:37 +0000 (15:55 +1200)] 
mka: Check OLPN for exhaustion on SAKuse encode

Most of the time is spent in the CP state machine RETIRE state where LKI
is not set and OKI is the currently used SAK, so OLPN needs to be
checked for PN exhaustion.

hostapd/wpa_supplicant implemented an interpretation of the standard as
described in a proposed amendment titled "MKA pending PN exhastion"
which was deemed to be wrong. This amendment was included in IEEE Std
802.1Xck-2018.

Signed-off-by: Thomas Winter <Thomas.Winter@alliedtelesis.co.nz>
4 years agomka: Clear out old/latest key values on CHANGE in CP state machine
Thomas Winter [Tue, 27 Aug 2019 03:55:36 +0000 (15:55 +1200)] 
mka: Clear out old/latest key values on CHANGE in CP state machine

The associated SAs have been deleted and the key server has changed so
there's no point in keeping the key values.

Note that this isn't specified in IEEE Std 802.1X-2010.

Signed-off-by: Thomas Winter <Thomas.Winter@alliedtelesis.co.nz>
4 years agomka: Don't set newSAK to FALSE on ABANDON in CP state machine
Thomas Winter [Tue, 27 Aug 2019 03:55:35 +0000 (15:55 +1200)] 
mka: Don't set newSAK to FALSE on ABANDON in CP state machine

Previously the ABANDON->RECEIVE state change was impossible and did not
match the CP state machine in IEEE Std 802.1X-2010 Figure 12-2.

Signed-off-by: Thomas Winter <Thomas.Winter@alliedtelesis.co.nz>
4 years agomka: Change RECEIVE and RETIRE states to match the standard
Thomas Winter [Tue, 27 Aug 2019 03:55:34 +0000 (15:55 +1200)] 
mka: Change RECEIVE and RETIRE states to match the standard

The RECEIVE and RETIRE states were incorrect which can result in
incorrect information being advertised in SAKuse MKPDUs. Change these to
match IEEE Std 802.1X-2010, Figure 12-2 (CP state machine).

hostapd/wpa_supplicant implemented an interpretation of the standard as
described in a proposed amendment titled "MKA pending PN exhastion"
which was deemed to be wrong. This amendment was included in IEEE Std
802.1Xck-2018.

Signed-off-by: Thomas Winter <Thomas.Winter@alliedtelesis.co.nz>
4 years agotests: Fix p2p_stop_find() calls in discovery
Jouni Malinen [Wed, 18 Sep 2019 16:07:13 +0000 (19:07 +0300)] 
tests: Fix p2p_stop_find() calls in discovery

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agotests: wpa_supplicant build for EAP-SIM and PC/SC
Jouni Malinen [Tue, 17 Sep 2019 15:07:03 +0000 (18:07 +0300)] 
tests: wpa_supplicant build for EAP-SIM and PC/SC

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoFix wpa_supplicant build with CONFIG_PCSC=y
Jouni Malinen [Tue, 17 Sep 2019 15:00:49 +0000 (18:00 +0300)] 
Fix wpa_supplicant build with CONFIG_PCSC=y

This code block with dependency on PCSC_FUNCS was missed when conf->pin
was moved to conf->cert.pin. Fix this to get rid of compilation issues
with CONFIG_PCSC=y builds.

Fixes: b99c4cadb7f8 ("EAP peer: Move certificate configuration params into shared struct")
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agotests: DPP MUD URL
Jouni Malinen [Tue, 17 Sep 2019 14:57:51 +0000 (17:57 +0300)] 
tests: DPP MUD URL

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoDPP: Allow name and mudurl to be configured for Config Request
Jouni Malinen [Tue, 17 Sep 2019 10:36:22 +0000 (13:36 +0300)] 
DPP: Allow name and mudurl to be configured for Config Request

The new hostapd and wpa_supplicant configuration parameters dpp_name and
dpp_mud_url can now be used to set a specific name and MUD URL for the
Enrollee to use in the Configuration Request. dpp_name replaces the
previously hardcoded "Test" string (which is still the default if an
explicit configuration entry is not included). dpp_mud_url can
optionally be used to add a MUD URL to describe the Enrollee device.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agotests: Layer 2 Update frame behavior in mac80211
Jouni Malinen [Wed, 11 Sep 2019 12:09:22 +0000 (15:09 +0300)] 
tests: Layer 2 Update frame behavior in mac80211

This verifies mac80211 behavior for Layer 2 Update frame use and other
unexpected frames from a not fully authentication station.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: PMF and Data frame injection
Jouni Malinen [Thu, 29 Aug 2019 08:52:32 +0000 (11:52 +0300)] 
tests: PMF and Data frame injection

Verify driver/mac80211 behavior for unexpected A2 in Data frames.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: Extend ap_pmf_inject_auth coverage for addresses/frames
Jouni Malinen [Thu, 29 Aug 2019 08:52:26 +0000 (11:52 +0300)] 
tests: Extend ap_pmf_inject_auth coverage for addresses/frames

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoMore consistent SA check for unexpected Data frames
Jouni Malinen [Wed, 11 Sep 2019 13:01:57 +0000 (16:01 +0300)] 
More consistent SA check for unexpected Data frames

Use the same rules for dropping driver notifications for Data frames
from unassociated stations as were added for Management frame reception.
This results in more consistent behavior in sending out Deauthentication
frames with Reason Code 6/7.

This case was already checking for unexpected multicast addresses, so
there was no issue for the PMF protections for unexpected disconnection.
Anyway, better avoid unnecessary Deauthentication frames consistently.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: Avoid race conditions in couple of Hotspot 2.0 test cases
Jouni Malinen [Mon, 16 Sep 2019 15:05:44 +0000 (18:05 +0300)] 
tests: Avoid race conditions in couple of Hotspot 2.0 test cases

Wait hostapd to complete key setup before asking it to send a frame that
may need PMF. This is needed especially with UML time-travel.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agotests: DPP2 connection status result
Jouni Malinen [Sun, 15 Sep 2019 13:19:45 +0000 (16:19 +0300)] 
tests: DPP2 connection status result

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoDPP2: Connection status result (Enrollee)
Jouni Malinen [Sun, 15 Sep 2019 13:19:45 +0000 (16:19 +0300)] 
DPP2: Connection status result (Enrollee)

Add support for reporting connection status after provisioning if the
Configurator requests this.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoDPP2: Connection status result (Configurator)
Jouni Malinen [Sun, 15 Sep 2019 13:19:45 +0000 (16:19 +0300)] 
DPP2: Connection status result (Configurator)

A new argument to the DPP_AUTH_INIT command (conn_status=1) can now be
used to set Configurator to request a station Enrollee to report
connection result after a successfully completed provisioning step. If
the peer supports this, the DPP-CONF-SENT event indicates this with a
new argument (wait_conn_status=1) and the Configurator remains waiting
for the connection result for up to 16 seconds.

Once the Enrollee reports the result, a new DPP-CONN-STATUS-RESULT event
is generated with arguments result, ssid, and channel_list indicating
what the Enrollee reported. result=0 means success while non-zero codes
are for various error cases as specified in the DPP tech spec. If no
report is received from the Enrollee, the event with "timeout" argument
is generated locally.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoDPP2: Connection status result defines
Jouni Malinen [Sun, 15 Sep 2019 13:19:45 +0000 (16:19 +0300)] 
DPP2: Connection status result defines

Add defines for the connection status result mechanism.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agotests: Fix DPP wait_auth_success() check for Configurator success
Jouni Malinen [Sun, 15 Sep 2019 14:01:59 +0000 (17:01 +0300)] 
tests: Fix DPP wait_auth_success() check for Configurator success

This looked like a copy-paste error in the event message check and once
that was fixed, couple of test cases needed fixes to expect a success
from the Configurator.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoDPP2: Move dpp_build_conf_result() to be within ifdef block
Jouni Malinen [Sun, 15 Sep 2019 13:40:23 +0000 (16:40 +0300)] 
DPP2: Move dpp_build_conf_result() to be within ifdef block

This is more consistent with the use of CONFIG_DPP2 since the
Configuration Result message is sent only when using version 2 or newer.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoDPP2: Fix a memory leak on error path for Config Result
Jouni Malinen [Sun, 15 Sep 2019 13:19:45 +0000 (16:19 +0300)] 
DPP2: Fix a memory leak on error path for Config Result

If only one of the allocations fails, the successful allocation needs to
be freed on the error path.

Fixes: 22f90b32f14e ("DPP2: Configuration Result message generation and processing")
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agowpa_supplicant: Don't return an error when successfully parsing WMM rules
Sujay Patwardhan [Mon, 26 Aug 2019 18:35:38 +0000 (11:35 -0700)] 
wpa_supplicant: Don't return an error when successfully parsing WMM rules

The config file parser previously would fall through into an error if
CONFIG_AP is defined and it hit a wmm_ac_* rule with a valid value. Add
a return to prevent incorrectly printing an error message and returning
a non-zero exit code.

Signed-off-by: Sujay Patwardhan <sujay@eero.com>
4 years agoP2P: Use latest BSS entry if multiple P2P Device Addr matches found
Hu Wang [Wed, 11 Sep 2019 03:04:40 +0000 (11:04 +0800)] 
P2P: Use latest BSS entry if multiple P2P Device Addr matches found

If an AP (P2P GO) has changed its operating channel or SSID recently,
the BSS table may have multiple entries for the same BSSID.

Commit 702621e6dd35 ('WPS: Use latest updated BSS entry if multiple
BSSID matches found') fetches latest updated BSS entry based on
BSSID. Do the same when fetching an entry based on the P2P Device
Address.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agowpa_supplicant: Add support for 60 GHz band channels 5 and 6
Alexei Avshalom Lazar [Thu, 8 Aug 2019 11:21:37 +0000 (14:21 +0300)] 
wpa_supplicant: Add support for 60 GHz band channels 5 and 6

The previous support in the 60 GHz band was for channels 1-4.
Add support for channels 5 and 6.

Signed-off-by: Alexei Avshalom Lazar <ailizaro@codeaurora.org>
4 years agoRemove IAPP functionality from hostapd
Jouni Malinen [Wed, 11 Sep 2019 09:34:28 +0000 (12:34 +0300)] 
Remove IAPP functionality from hostapd

IEEE Std 802.11F-2003 was withdrawn in 2006 and as such it has not been
maintained nor is there any expectation of the withdrawn trial-use
recommended practice to be maintained in the future. Furthermore,
implementation of IAPP in hostapd was not complete, i.e., only parts of
the recommended practice were included. The main item of some real use
long time ago was the Layer 2 Update frame to update bridges when a STA
roams within an ESS, but that functionality has, in practice, been moved
to kernel drivers to provide better integration with the networking
stack.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: Remove IAPP test case
Jouni Malinen [Wed, 11 Sep 2019 09:30:28 +0000 (12:30 +0300)] 
tests: Remove IAPP test case

This is in preparation for removal of the full IAPP functionality from
hostapd.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoAP: Silently ignore management frame from unexpected source address
Jouni Malinen [Thu, 29 Aug 2019 08:52:04 +0000 (11:52 +0300)] 
AP: Silently ignore management frame from unexpected source address

Do not process any received Management frames with unexpected/invalid SA
so that we do not add any state for unexpected STA addresses or end up
sending out frames to unexpected destination. This prevents unexpected
sequences where an unprotected frame might end up causing the AP to send
out a response to another device and that other device processing the
unexpected response.

In particular, this prevents some potential denial of service cases
where the unexpected response frame from the AP might result in a
connected station dropping its association.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoHE: Send the AP's OBSS PD settings to the kernel
John Crispin [Tue, 13 Aug 2019 14:16:25 +0000 (16:16 +0200)] 
HE: Send the AP's OBSS PD settings to the kernel

This allows us to send the OBSS PD settings to the kernel, such that the
driver can propagate them to the hardware/firmware.

Signed-off-by: John Crispin <john@phrozen.org>
4 years agoSync with mac80211-next.git include/uapi/linux/nl80211.h
Jouni Malinen [Tue, 10 Sep 2019 10:42:14 +0000 (13:42 +0300)] 
Sync with mac80211-next.git include/uapi/linux/nl80211.h

This brings in nl80211 definitions as of 2019-08-30.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: WPS MAC address change
Mikael Kanstrup [Fri, 16 Aug 2019 06:50:55 +0000 (08:50 +0200)] 
tests: WPS MAC address change

Verify that MAC address of WPS M1 message use correct address
after address change.

Signed-off-by: Mikael Kanstrup <mikael.kanstrup@sony.com>
4 years agoWPS: Update MAC address on address changes
Mikael Kanstrup [Fri, 16 Aug 2019 06:50:54 +0000 (08:50 +0200)] 
WPS: Update MAC address on address changes

The WPS component keeps a copy of the network interface MAC address.
When MAC address is changed the WPS copy was not updated so WPS M1
message contained the old address. Some devices check this field
and fail connection attempts.

Update the WPS MAC address on interface MAC address changes.

Signed-off-by: Mikael Kanstrup <mikael.kanstrup@sony.com>
4 years agoos_sleep: Use nanosleep for POSIX versions 2008 and higher
Rosen Penev [Sat, 24 Aug 2019 22:01:16 +0000 (15:01 -0700)] 
os_sleep: Use nanosleep for POSIX versions 2008 and higher

uClibc-ng optionally disabled deprecated POSIX functions like usleep,
causing compilation failures. This switches to nanosleep while retaining
support for older libcs that do not support nanosleep.

Signed-off-by: Rosen Penev <rosenp@gmail.com>