thirdparty/hostap.git
2 days agotests: SAE/PMF roam master pending
Jouni Malinen [Sat, 4 Apr 2020 20:57:18 +0000 (23:57 +0300)] 
tests: SAE/PMF roam

Signed-off-by: Jouni Malinen <j@w1.fi>
2 days agoFT RRB: Remove confusing debug print about extra data
Jouni Malinen [Sat, 4 Apr 2020 20:42:05 +0000 (23:42 +0300)] 
FT RRB: Remove confusing debug print about extra data

The "FT: Ignore extra data in end" hexdump is quite confusing since it
shows all the IEs that were actually either processed or forwarded.
There is no code path that could reach this debug print with actual real
extra data. Remove it and the dead increment of pos to avoid warnings
from static analyzers.

Signed-off-by: Jouni Malinen <j@w1.fi>
2 days agotests: FT+PMF roaming with skip_prune
Jouni Malinen [Sat, 4 Apr 2020 18:49:31 +0000 (21:49 +0300)] 
tests: FT+PMF roaming with skip_prune

Verify hostapd behavior during FT protocol processing when a STA entry
is still present in the AP and that association has PMF negotiated.

Signed-off-by: Jouni Malinen <j@w1.fi>
2 days agoFT: Remove and re-add STA entry after FT protocol success with PMF
Jouni Malinen [Sat, 4 Apr 2020 18:50:37 +0000 (21:50 +0300)] 
FT: Remove and re-add STA entry after FT protocol success with PMF

Allow STA entry to be removed and re-added to the driver with PMF is
used with FT. Previously, this case resulted in cfg80211 rejecting STA
entry update after successful FT protocol use if the association had not
been dropped and it could not be dropped for the PMF case in
handle_auth().

Signed-off-by: Jouni Malinen <j@w1.fi>
2 days agotests: New style fuzzing tool for DPP URI parsing
Jouni Malinen [Sat, 4 Apr 2020 17:07:38 +0000 (20:07 +0300)] 
tests: New style fuzzing tool for DPP URI parsing

Signed-off-by: Jouni Malinen <j@w1.fi>
2 days agotests: New style fuzzing tool for SAE commit parsing
Jouni Malinen [Sat, 4 Apr 2020 15:28:06 +0000 (18:28 +0300)] 
tests: New style fuzzing tool for SAE commit parsing

Signed-off-by: Jouni Malinen <j@w1.fi>
2 days agoSAE: Fix build without DPP/OWE/ERP
Jouni Malinen [Sat, 4 Apr 2020 15:08:14 +0000 (18:08 +0300)] 
SAE: Fix build without DPP/OWE/ERP

SAE needs sha256-kdf.c to be included in the build.

Signed-off-by: Jouni Malinen <j@w1.fi>
2 days agotests: Enable MACsec testing by default in the VM kernel
Thomas Pedersen [Tue, 31 Mar 2020 18:09:00 +0000 (11:09 -0700)] 
tests: Enable MACsec testing by default in the VM kernel

Include support for MACsec testing in the (vm) kernel by default.

Don't include support in the example hostapd or wpa_supplicant configs
yet since that would potentially break the build on older distributions
like Ubuntu 16.04, which is supported until April 2021.

Signed-off-by: Thomas Pedersen <thomas@adapt-ip.com>
3 days agowlantest: Add frame number fo replay detected messages
Jouni Malinen [Fri, 3 Apr 2020 21:06:59 +0000 (00:06 +0300)] 
wlantest: Add frame number fo replay detected messages

This makes it easier to find the relevant frames.

Signed-off-by: Jouni Malinen <j@w1.fi>
3 days agowlantest: Remove duplicate PN/RSC prints from replay cases
Jouni Malinen [Fri, 3 Apr 2020 21:04:32 +0000 (00:04 +0300)] 
wlantest: Remove duplicate PN/RSC prints from replay cases

The PN and RSC are already printed in the "replay detected" debug
message so there is no point in having separate hexdumps of the same
values immediately after that.

Signed-off-by: Jouni Malinen <j@w1.fi>
3 days agowlantest: Add debug print with frame number for decryption failures
Jouni Malinen [Fri, 3 Apr 2020 21:00:17 +0000 (00:00 +0300)] 
wlantest: Add debug print with frame number for decryption failures

This makes it more convenient to find the frames that could not be
decrypted.

Signed-off-by: Jouni Malinen <j@w1.fi>
3 days agowlantest: Do not report decryption failures for WEP keys if no keys
Jouni Malinen [Fri, 3 Apr 2020 20:56:10 +0000 (23:56 +0300)] 
wlantest: Do not report decryption failures for WEP keys if no keys

If no WEP keys are available, there is not going to be an attempt to
decrypt the frame, so don't claim decryption failed.

Signed-off-by: Jouni Malinen <j@w1.fi>
3 days agotests: Make ap_vht_csa_vht40_disable more robust
Jouni Malinen [Fri, 3 Apr 2020 18:16:06 +0000 (21:16 +0300)] 
tests: Make ap_vht_csa_vht40_disable more robust

Wait for disconnection and reconnection after CSA since mac80211 does
not support clean CSA to disable VHT.

Signed-off-by: Jouni Malinen <j@w1.fi>
3 days agoP2P: Start group with user configured params after accepting invitation
Vamsi Krishna [Fri, 3 Apr 2020 11:52:03 +0000 (17:22 +0530)] 
P2P: Start group with user configured params after accepting invitation

Use global configuration parameters while invoking a persistent P2P
group after accepting P2P Invitation Request from a peer.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
3 days agotests: sigma_dut and DPP with NFC
Jouni Malinen [Fri, 3 Apr 2020 13:21:30 +0000 (16:21 +0300)] 
tests: sigma_dut and DPP with NFC

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
3 days agoDPP: Mandate mutual auth with NFC negotiated connection handover
Jouni Malinen [Fri, 3 Apr 2020 12:47:18 +0000 (15:47 +0300)] 
DPP: Mandate mutual auth with NFC negotiated connection handover

Mark own bootstrap information as having been used in NFC negotiated
connection handover and do not accept non-mutual authentication when
processing Authentication Response from the peer when such bootstrapping
information is used.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
3 days agotests: Use a helper function for starting DPP AP in sigma_dut tests
Jouni Malinen [Fri, 3 Apr 2020 09:59:47 +0000 (12:59 +0300)] 
tests: Use a helper function for starting DPP AP in sigma_dut tests

Remove unnecessary code duplication.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
3 days agotests: Remove duplicate definitions of csign/connector in sigma_dut
Jouni Malinen [Fri, 3 Apr 2020 09:54:44 +0000 (12:54 +0300)] 
tests: Remove duplicate definitions of csign/connector in sigma_dut

There is no need to duplicate the definitions of the exact same values
within each test function.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
3 days agotests: DPP netAccessKey for reconfig
Jouni Malinen [Fri, 3 Apr 2020 09:45:03 +0000 (12:45 +0300)] 
tests: DPP netAccessKey for reconfig

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
3 days agoDPP2: Store netAccessKey in psk/sae credentials for reconfig
Jouni Malinen [Fri, 3 Apr 2020 09:43:48 +0000 (12:43 +0300)] 
DPP2: Store netAccessKey in psk/sae credentials for reconfig

Connector alone is not sufficient for authentication during
reconfiguration, so store the netAccessKey as well.

Fixes: e4eb009d9863 ("DPP2: Add Connector and C-sign-key in psk/sae credentials for reconfig")
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
3 days agoOWE: Remove check for unexpected DH Parameter IE use with other AKMs
Jouni Malinen [Fri, 3 Apr 2020 09:18:11 +0000 (12:18 +0300)] 
OWE: Remove check for unexpected DH Parameter IE use with other AKMs

While the Diffie-Hellman Parameter element is defined in RFC 8110
explicitly for use witht he OWE AKM, it has now been proposed to be used
with another AKM (DPP). Should any other AKM be extended in similar
manner in the future, the check against unexpected use could result in
additional interoperability issues. Remove that and instead, ignore the
unexpected Diffie-Hellman Parameter element if it is included in
(Re)Association Request frame when any other AKM is negotiated.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 days agotests: DPP reconfiguration connector
Jouni Malinen [Thu, 2 Apr 2020 12:38:20 +0000 (15:38 +0300)] 
tests: DPP reconfiguration connector

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 days agoDPP2: Add Connector and C-sign-key in psk/sae credentials for reconfig
Jouni Malinen [Thu, 2 Apr 2020 12:35:56 +0000 (15:35 +0300)] 
DPP2: Add Connector and C-sign-key in psk/sae credentials for reconfig

If the Enrollee indicates support for DPP R2 or newer, add Connector and
C-sign-key in psk/sae credentials (i.e., cases where DPP AKM is not
enabled) for reconfiguration. Extend processing of such credentials in
wpa_supplicant network profile addition to handle this new case
correctly by not setting key_mgmt=DPP based on Connector being present,
but by looking at the actual akm value in the config object.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 days agowlantest: Update PTK after rekeying even if EAPOL-Key msg 4/4 is missing
Jouni Malinen [Wed, 1 Apr 2020 15:46:14 +0000 (18:46 +0300)] 
wlantest: Update PTK after rekeying even if EAPOL-Key msg 4/4 is missing

Update TPTK to PTK if a valid EAPOL-Key msg 2/4 and 3/4 are available,
but 4/4 is missing. This avoids certain cases where the new TK could be
derived, but it was not being used to try to decrypt following encrypted
frames.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 days agowlantest: Do not report decryption keys when checking only zero TK
Jouni Malinen [Wed, 1 Apr 2020 15:30:33 +0000 (18:30 +0300)] 
wlantest: Do not report decryption keys when checking only zero TK

All the "Failed to decrypt frame" debug prints were confusing since
those were not supposed to be shown unless there were one or more real
TKs available. The recently added check for zero TK added these notes
for that case which is not really correct, so get rid of them.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 days agoDPP2: Clear requirement for QR Code mutual authentication for chirping
Jouni Malinen [Wed, 1 Apr 2020 14:16:55 +0000 (17:16 +0300)] 
DPP2: Clear requirement for QR Code mutual authentication for chirping

The chirping cases are not really targeting interactive operations, so
clear the requirement for mutual authentication when DPP_CHIRP command
is used. This avoids testing isues where an earlier DPP_LISTEN command
has used qr=mutual parameter and that seting not getting cleared before
the next DPP_CHIRP command is used.

This fixes a test case failure in the following test sequence:
dpp_auth_resp_status_failure dpp_controller_relay_chirp

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 days agoProcess received WNM Notification Request for beacon protection failures
Jouni Malinen [Wed, 1 Apr 2020 13:29:24 +0000 (16:29 +0300)] 
Process received WNM Notification Request for beacon protection failures

Report received notifications for beacon protection failures in syslog
and control interface.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 days agoBeacon frame protection event for incorrect protection
Jouni Malinen [Wed, 1 Apr 2020 13:07:25 +0000 (16:07 +0300)] 
Beacon frame protection event for incorrect protection

Define a driver interface event for Beacon frame protection failures.
Report such events over the control interface and send a
WNM-Notification Request frame to the AP as well.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 days agowpa_supplicant: Add HE override support
P Praneesh [Mon, 9 Mar 2020 10:53:50 +0000 (16:23 +0530)] 
wpa_supplicant: Add HE override support

Add HE override support under the build parameter CONFIG_HE_OVERRIDES=y.
The disable_he=1 network profile parameter can be used to disable HE.
This requires a fallback to VHT on the 5 GHz band and to HT on the 2.4
GHz band.

There is no nl80211 support for configuring the driver to disable HE, so
for now, this applies only to IBSS and mesh cases.

Signed-off-by: P Praneesh <ppranees@codeaurora.org>
7 days agohostapd: Validate the country_code parameter value
Sriram R [Thu, 26 Mar 2020 03:12:19 +0000 (08:42 +0530)] 
hostapd: Validate the country_code parameter value

cfg80211/regulatory supports only ISO 3166-1 alpha2 country code and
that's what this parameter is supposed to use, so validate the country
code input before accepting the value. Only characters A..Z are
accepted.

Signed-off-by: Sriram R <srirrama@codeaurora.org>
8 days agoDPP: Add some more details on how to use DPP
Jouni Malinen [Sun, 29 Mar 2020 20:24:45 +0000 (23:24 +0300)] 
DPP: Add some more details on how to use DPP

Signed-off-by: Jouni Malinen <j@w1.fi>
8 days agoFix the dpp_configurator_sign example command
Jouni Malinen [Sun, 29 Mar 2020 20:07:42 +0000 (23:07 +0300)] 
Fix the dpp_configurator_sign example command

The mandatory ssid parameter was forgotten from this command when it was
added to the dpp_auth_init examples.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 days agotests: DFS channel switch
Jouni Malinen [Sun, 29 Mar 2020 17:49:27 +0000 (20:49 +0300)] 
tests: DFS channel switch

Signed-off-by: Jouni Malinen <j@w1.fi>
8 days agohostapd: DFS for channel switch in repeater mode
Sergey Matyukevich [Tue, 28 Jan 2020 15:09:54 +0000 (15:09 +0000)] 
hostapd: DFS for channel switch in repeater mode

In repeater mode remote AP may request channel switch to a new channel.
Check if DFS is required for the new channel before proceeding with
normal AP operations. Start CAC procedure if radar detection is required
and channel is not yet marked as available.

Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com>
8 days agohostapd: Add support for DFS channels in CHAN_SWITCH
Sergey Matyukevich [Tue, 28 Jan 2020 15:09:53 +0000 (15:09 +0000)] 
hostapd: Add support for DFS channels in CHAN_SWITCH

Enable support for DFS channels in the CHAN_SWITCH command. Perform CAC
instead of CSA if DFS channel is selected. Then restart normal AP
operations.

Note that the current implementation provides a simplified approach. It
does not check if the selected DFS channel block is already in the
HOSTAPD_CHAN_DFS_AVAILABLE state. CAC procedure is restarted anyway.

Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com>
8 days agoDFS: Add new hostapd_is_dfs_overlap() helper
Sergey Matyukevich [Tue, 28 Jan 2020 15:09:52 +0000 (15:09 +0000)] 
DFS: Add new hostapd_is_dfs_overlap() helper

Add a new hostapd_is_dfs_overlap() helper function to DFS module. This
function tells whether the selected frequency range overlaps with DFS
channels in the current hostapd configuration. Selected frequency reange
is specified by its center frequency and bandwidth.

Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com>
8 days agoDFS: Rename and export hostapd_config_dfs_chan_available helper
Sergey Matyukevich [Tue, 28 Jan 2020 15:09:51 +0000 (15:09 +0000)] 
DFS: Rename and export hostapd_config_dfs_chan_available helper

Rename DFS helper hostapd_config_dfs_chan_available() to
hostapd_is_dfs_chan_available(). Enable access to this helper function
from other hostapd components.

Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com>
8 days agohostapd: Basic channel check for CHAN_SWITCH parameters
Sergey Matyukevich [Tue, 28 Jan 2020 15:09:49 +0000 (15:09 +0000)] 
hostapd: Basic channel check for CHAN_SWITCH parameters

Implement channel sanity check for the CHAN_SWITCH command. Verify
provided values for bandwidth, frequencies, and secondary channel
offset. Reject requested channel switch operation if basic constraints
on frequencies and bandwidth are not fulfilled.

Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com>
8 days agotests: Use complete CHAN_SWITCH parameters in ap_vht_csa_vht40_disable
Jouni Malinen [Sun, 29 Mar 2020 18:09:56 +0000 (21:09 +0300)] 
tests: Use complete CHAN_SWITCH parameters in ap_vht_csa_vht40_disable

Specify the secondary channel offset and correct center_freq1 value to
make the parameters complete for a 40 MHz channel.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 days agoAP: Drop not needed condition to delete PTK ID 1
Alexander Wetzel [Mon, 23 Mar 2020 18:42:27 +0000 (19:42 +0100)] 
AP: Drop not needed condition to delete PTK ID 1

Signed-off-by: Alexander Wetzel <alexander@wetzel-home.de>
8 days agotests: Include UML defconfig
Thomas Pedersen [Fri, 27 Mar 2020 22:51:45 +0000 (15:51 -0700)] 
tests: Include UML defconfig

Include a defconfig for building kernel as UML. Also update the README
with a few notes related to UML.

Signed-off-by: Thomas Pedersen <thomas@adapt-ip.com>
8 days agotests: Convert kernel-config to defconfig
Thomas Pedersen [Fri, 27 Mar 2020 22:51:44 +0000 (15:51 -0700)] 
tests: Convert kernel-config to defconfig

Make the included kernel-config a little more minimal by checking in the
defconfig instead.

Generate the defconfig by checking out a linux at tag wt-2020-03-17,
copy kernel-config to .config, run
'yes "" | make oldconfig && make savedefconfig',
and copy resulting defconfig to kernel-config.

Signed-off-by: Thomas Pedersen <thomas@adapt-ip.com>
8 days agoDPP2: Fix build with OpenSSL 1.0.2 (EVP_PKEY_get0_EC_KEY() wrapper)
Jouni Malinen [Sun, 29 Mar 2020 15:56:48 +0000 (18:56 +0300)] 
DPP2: Fix build with OpenSSL 1.0.2 (EVP_PKEY_get0_EC_KEY() wrapper)

EVP_PKEY_get0_EC_KEY() was added in OpenSSL 1.1.0, so add a
compatibility wrapper for it when building with OpenSSL 1.0.2.

Fixes: c025c2eb5911 ("DPP: DPPEnvelopedData generation for Configurator backup")
Fixes: 7d9e3200544c ("DPP: Received Configurator backup processing")
Signed-off-by: Jouni Malinen <j@w1.fi>
8 days agotests: Assume --long for UML
Johannes Berg [Sun, 29 Mar 2020 11:46:44 +0000 (13:46 +0200)] 
tests: Assume --long for UML

If we use user-mode-linux, we have time-travel, and then the --long
argument doesn't really make a difference, so just assume that's the
case.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 days agotests: FT roaming cases with authorized STA entry remaining
Jouni Malinen [Sat, 28 Mar 2020 18:40:47 +0000 (20:40 +0200)] 
tests: FT roaming cases with authorized STA entry remaining

Signed-off-by: Jouni Malinen <j@w1.fi>
9 days agoAdd a hostapd testing option for skipping association pruning
Jouni Malinen [Sat, 28 Mar 2020 18:39:19 +0000 (20:39 +0200)] 
Add a hostapd testing option for skipping association pruning

The new skip_prune_assoc=1 parameter can be used to configure hostapd
not to prune associations from other BSSs operated by the same process
when a station associates with another BSS. This can be helpful in
testing roaming cases where association and authorization state is
maintained in an AP when the stations returns.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 days agonl80211: Allow full AP client state capability to be disabled
Jouni Malinen [Sat, 28 Mar 2020 18:38:11 +0000 (20:38 +0200)] 
nl80211: Allow full AP client state capability to be disabled

The new driver param full_ap_client_state=0 can be used to test
functionality with the driver capability for full AP client state being
forced to be disabled.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 days agowpa_auth: Use printf format %zu instead of type casts
Jouni Malinen [Sat, 28 Mar 2020 17:54:10 +0000 (19:54 +0200)] 
wpa_auth: Use printf format %zu instead of type casts

Signed-off-by: Jouni Malinen <j@w1.fi>
9 days agowpa_auth: Do not split strings into multiple lines
Jouni Malinen [Sat, 28 Mar 2020 17:48:32 +0000 (19:48 +0200)] 
wpa_auth: Do not split strings into multiple lines

Avoid unnecessary splitting of long string constants into multiple
lines.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 days agowpa_auth: Coding style cleanup for pointer is NULL comparisons
Jouni Malinen [Sat, 28 Mar 2020 17:36:00 +0000 (19:36 +0200)] 
wpa_auth: Coding style cleanup for pointer is NULL comparisons

Use !ptr instead of ptr == NULL.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 days agowpa_auth: Clean up pointer dereferences
Jouni Malinen [Sat, 28 Mar 2020 17:29:12 +0000 (19:29 +0200)] 
wpa_auth: Clean up pointer dereferences

Use local variables to avoid sm->wpa_auth->conf type of dereferences
where multiple instances within a function can be cleaned up.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 days agonl80211: Configure PMKSA lifetime and reauth threshold timer to driver
Veerendranath Jakkam [Mon, 23 Mar 2020 13:41:24 +0000 (19:11 +0530)] 
nl80211: Configure PMKSA lifetime and reauth threshold timer to driver

Drivers that trigger roaming need to know the lifetime and reauth
threshold time of configured PMKSA so that they can trigger full
authentication to avoid unnecessary disconnection. To support this, send
dot11RSNAConfigPMKLifetime and dot11RSNAConfigPMKReauthThreshold values
configured in wpa_supplicant to the driver while configuring a PMKSA.

Signed-off-by: Veerendranath Jakkam <vjakkam@codeaurora.org>
9 days agoSync with mac80211-next.git include/uapi/linux/nl80211.h
Jouni Malinen [Sat, 28 Mar 2020 14:31:14 +0000 (16:31 +0200)] 
Sync with mac80211-next.git include/uapi/linux/nl80211.h

This brings in nl80211 definitions as of 2020-02-20.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 days agotests: DPP PFS
Jouni Malinen [Sat, 28 Mar 2020 13:05:57 +0000 (15:05 +0200)] 
tests: DPP PFS

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
9 days agoDPP2: Allow station to require or not allow PFS
Jouni Malinen [Sat, 28 Mar 2020 13:06:15 +0000 (15:06 +0200)] 
DPP2: Allow station to require or not allow PFS

The new wpa_supplicant network profile parameter dpp_pfs can be used to
specify how PFS is applied to associations. The default behavior
(dpp_pfs=0) remains same as it was previously, i.e., try to use PFS if
the AP supports it. PFS use can now be required (dpp_pfs=1) or disabled
(dpp_pfs=2).

This is also working around an interoperability issue of DPP R2 STA with
certain hostapd builds that included both OWE and DPP functionality.
That issue was introduced by commit 09368515d130 ("OWE: Process
Diffie-Hellman Parameter element in AP mode") and removed by commit
16a4e931f03e ("OWE: Allow Diffie-Hellman Parameter element to be
included with DPP"). hostapd builds between those two commits would
reject DPP association attempt with PFS. The new wpa_supplicant default
(dpp_pfs=0) behavior is to automatically try to connect again with PFS
disabled if that happens.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
9 days agoDPP2: Allow AP to require or reject PFS
Jouni Malinen [Sat, 28 Mar 2020 10:33:48 +0000 (12:33 +0200)] 
DPP2: Allow AP to require or reject PFS

The new hostapd configuration parameter dpp_pfs can be used to specify
how PFS is applied to associations. The default behavior (dpp_pfs=0)
remains same as it was previously, i.e., allow the station to decide
whether to use PFS. PFS use can now be required (dpp_pfs=1) or rejected
(dpp_pfs=2).

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
9 days agoReturn an enum from wpa_validate_wpa_ie()
Jouni Malinen [Sat, 28 Mar 2020 10:22:28 +0000 (12:22 +0200)] 
Return an enum from wpa_validate_wpa_ie()

This is more specific then returning a generic int and also allows the
compiler to do more checks.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
10 days agohostapd: Add HE bit in BSSID Information field of own Neighbor Report
Sathishkumar Muruganandam [Tue, 24 Mar 2020 11:04:42 +0000 (16:34 +0530)] 
hostapd: Add HE bit in BSSID Information field of own Neighbor Report

Add definition for HE bit in neighbor report BSSID Information field
from IEEE P802.11ax/D6.0, 9.4.2.36 Neighbor Report element.

Signed-off-by: Sathishkumar Muruganandam <murugana@codeaurora.org>
10 days agotests: Skip background scans in beacon loss tests
Jouni Malinen [Fri, 27 Mar 2020 19:05:44 +0000 (21:05 +0200)] 
tests: Skip background scans in beacon loss tests

bgscan_learn_beacon_loss was failing quite frequently and it looks like
the background scans were related to those failures. Since those scans
are not really relevant to testing beacon loss, get rid of them in these
test cases to avoid incorrect failures.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
10 days agotests: dpp_controller_rx_failure to match implementation changes
Jouni Malinen [Fri, 27 Mar 2020 18:00:42 +0000 (20:00 +0200)] 
tests: dpp_controller_rx_failure to match implementation changes

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
10 days agoDPP2: Use a helper function for encapsulating TCP message
Jouni Malinen [Fri, 27 Mar 2020 17:44:11 +0000 (19:44 +0200)] 
DPP2: Use a helper function for encapsulating TCP message

This functionality was repeated for multiple different frames. Use a
shared helper function to avoid such duplication.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
10 days agotests: DPP chirping
Jouni Malinen [Fri, 27 Mar 2020 10:41:47 +0000 (12:41 +0200)] 
tests: DPP chirping

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
10 days agoDPP2: Presence Announcement processing in Controller
Jouni Malinen [Fri, 27 Mar 2020 17:29:44 +0000 (19:29 +0200)] 
DPP2: Presence Announcement processing in Controller

Process the received Presence Announcement frames in Controller. If a
matching bootstrapping entry for the peer is found, initiate DPP
authentication to complete provisioning of the Enrollee.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
10 days agoDPP2: Presence Announcement processing in AP/Relay
Jouni Malinen [Fri, 27 Mar 2020 17:16:42 +0000 (19:16 +0200)] 
DPP2: Presence Announcement processing in AP/Relay

Process the received Presence Announcement frames in AP/Relay. If a
matching bootstrapping entry for the peer is found in a local
Configurator, that Configurator is used. Otherwise, the frame is relayed
to the first configured Controller (if available).

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
10 days agoDPP2: Presence Announcement processing at Configurator
Jouni Malinen [Fri, 27 Mar 2020 13:34:09 +0000 (15:34 +0200)] 
DPP2: Presence Announcement processing at Configurator

Process received Presence Announcement frames and initiate
Authentication exchange if matching information is available on the
Configurator.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
10 days agoDPP2: Configurator Connectivity indication
Jouni Malinen [Fri, 27 Mar 2020 12:03:04 +0000 (14:03 +0200)] 
DPP2: Configurator Connectivity indication

Add a new hostapd configuration parameter
dpp_configurator_connectivity=1 to request Configurator connectivity to
be advertised for chirping Enrollees.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
10 days agoDPP2: Chirping in wpa_supplicant Enrollee
Jouni Malinen [Fri, 27 Mar 2020 10:42:00 +0000 (12:42 +0200)] 
DPP2: Chirping in wpa_supplicant Enrollee

Add a new wpa_supplicant control interface command "DPP_CHIRP own=<BI
ID> iter=<count>" to request chirping, i.e., sending of Presence
Announcement frames, to be started.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
10 days agoDPP2: Add a helper function for building Presence Announcement frame
Jouni Malinen [Thu, 26 Mar 2020 21:41:27 +0000 (23:41 +0200)] 
DPP2: Add a helper function for building Presence Announcement frame

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
10 days agoDPP2: New identifier definitions
Jouni Malinen [Thu, 26 Mar 2020 21:24:35 +0000 (23:24 +0200)] 
DPP2: New identifier definitions

Add new identifier definitions for presence announcement,
reconfiguration, and certificate enrollment.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
10 days agoDPP: Add DPP_BOOTSTRAP_SET command
Jouni Malinen [Fri, 27 Mar 2020 15:28:59 +0000 (17:28 +0200)] 
DPP: Add DPP_BOOTSTRAP_SET command

"DPP_BOOTSTRAP_SET <ID> <configurator parameters..>" can now be used to
set peer specific configurator parameters which will override any global
parameters from dpp_configurator_params.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
10 days agoDPP: Allow per-peer configurator parameters to be set
Jouni Malinen [Fri, 27 Mar 2020 15:14:06 +0000 (17:14 +0200)] 
DPP: Allow per-peer configurator parameters to be set

This is a more convenient way of addressing cases where a
Configurator/Controller may store a large number of peer bootstrapping
information instances and may need to manage different configuration
parameters for each peer while operating as the Responder.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
10 days agoDPP: Store global pointers in struct dpp_authentication
Jouni Malinen [Fri, 27 Mar 2020 15:08:38 +0000 (17:08 +0200)] 
DPP: Store global pointers in struct dpp_authentication

Set the global pointer and msg_ctx when allocating struct
dpp_authentication instead of needing to pass these to
dpp_set_configurator().

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
10 days agoFix a typo in function documentation
Jouni Malinen [Thu, 26 Mar 2020 22:07:33 +0000 (00:07 +0200)] 
Fix a typo in function documentation

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
11 days agoUpdate STA flags to the driver immediately on disconnection
Jouni Malinen [Wed, 18 Mar 2020 10:41:46 +0000 (12:41 +0200)] 
Update STA flags to the driver immediately on disconnection

hostapd (and wpa_supplicant in AP mode) was internally updating the STA
flags on disconnection cases to remove authorization and association.
However, some cases did not result in immediate update of the driver STA
entry. Update all such cases to send out the update to the driver as
well to reduce risk of race conditions where new frames might be
accepted for TX or RX after the port authorization or association has
been lost and configured keys are removed.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
11 days agotests: Use frame injection in monitor_iface_unknown_sta
Jouni Malinen [Wed, 18 Mar 2020 21:15:18 +0000 (23:15 +0200)] 
tests: Use frame injection in monitor_iface_unknown_sta

The previously used normal data TX depends on undefined driver behavior
after all keys have been removed. That may not be available, so do this
more properly with frame injection through a monitor interface.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
11 days agotests: sigma_dut controlled AP and transition disabled indication
Jouni Malinen [Thu, 26 Mar 2020 11:01:19 +0000 (13:01 +0200)] 
tests: sigma_dut controlled AP and transition disabled indication

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
11 days agotests: sigma_dut controlled AP and beacon protection
Jouni Malinen [Thu, 26 Mar 2020 10:50:00 +0000 (12:50 +0200)] 
tests: sigma_dut controlled AP and beacon protection

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
11 days agotests: sigma_dut controlled STA and beacon protection
Jouni Malinen [Thu, 26 Mar 2020 09:52:47 +0000 (11:52 +0200)] 
tests: sigma_dut controlled STA and beacon protection

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
12 days agotests: Add forgotten step to ap_wpa3_eap_transition_disable
Jouni Malinen [Wed, 25 Mar 2020 22:57:40 +0000 (00:57 +0200)] 
tests: Add forgotten step to ap_wpa3_eap_transition_disable

This was supposed to be included, but was forgotten in an editor window
with pending changes..

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
12 days agoSTA: Fix wpa_clear_keys() PTK key deletion logic
Alexander Wetzel [Mon, 23 Mar 2020 18:42:28 +0000 (19:42 +0100)] 
STA: Fix wpa_clear_keys() PTK key deletion logic

We have to delete PTK keys when either BIT(0) or BIT(15) are zero and
not only when both are zero.

Signed-off-by: Alexander Wetzel <alexander@wetzel-home.de>
12 days agoAP: Fix Extended Key ID parameter check
Alexander Wetzel [Mon, 23 Mar 2020 18:42:26 +0000 (19:42 +0100)] 
AP: Fix Extended Key ID parameter check

Check the new variable to be set instead the current setting.

Signed-off-by: Alexander Wetzel <alexander@wetzel-home.de>
12 days agotests: Transition disable
Jouni Malinen [Wed, 25 Mar 2020 22:11:35 +0000 (00:11 +0200)] 
tests: Transition disable

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
12 days agowpa_supplicant AP mode configuration for Transition Disable KDE
Jouni Malinen [Wed, 25 Mar 2020 22:18:06 +0000 (00:18 +0200)] 
wpa_supplicant AP mode configuration for Transition Disable KDE

Allow AP mode network profile in wpa_supplicant to be configured to
advertise Transition Disable DKE.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
12 days agoProcess Transition Disable KDE in station mode
Jouni Malinen [Wed, 25 Mar 2020 22:10:16 +0000 (00:10 +0200)] 
Process Transition Disable KDE in station mode

Check whether the Transition Disable KDE is received from an
authenticated AP and if so, whether it contains valid indication for
disabling a transition mode. If that is the case, update the local
network profile by removing the less secure options.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
12 days agoAllow hostapd AP to advertise Transition Disable KDE
Jouni Malinen [Wed, 25 Mar 2020 22:08:26 +0000 (00:08 +0200)] 
Allow hostapd AP to advertise Transition Disable KDE

The new hostapd configuration parameter transition_disable can now be
used to configure the AP to advertise that use of a transition mode is
disabled. This allows stations to automatically disable transition mode
by disabling less secure network profile parameters.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
12 days agoTransition Disable KDE definitions
Jouni Malinen [Wed, 25 Mar 2020 22:06:50 +0000 (00:06 +0200)] 
Transition Disable KDE definitions

Define the OUI Type and bitmap values for Transition Disable KDE. These
will be shared by both the AP and STA implementations.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
12 days agoAdd addition CFR capture type to filter all NDPA NDP frames
Wu Gao [Tue, 24 Mar 2020 15:46:43 +0000 (23:46 +0800)] 
Add addition CFR capture type to filter all NDPA NDP frames

Add QCA_WLAN_VENDOR_CFR_NDPA_NDP_ALL in enum
qca_wlan_vendor_cfr_capture_type. This capture type requests all NDPA
NDP frames to be filtered.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
12 days agoChange CFR attributes from required to optional
Wu Gao [Mon, 23 Mar 2020 13:13:13 +0000 (21:13 +0800)] 
Change CFR attributes from required to optional

Some CFR attributes are used frequently with conditions, so change them
from required to optional.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
13 days agoAdd ACS support for 60 GHz channel bonding
Noam Shaked [Tue, 24 Mar 2020 00:19:36 +0000 (17:19 -0700)] 
Add ACS support for 60 GHz channel bonding

hostapd will trigger EDMG auto channel selection by setting
QCA_WLAN_VENDOR_ATTR_ACS_EDMG_ENABLED. The 60 GHz driver will be
called to start an auto channel selection and will return the
primary channel and the EDMG channel.

Signed-off-by: Noam Shaked <nshaked@codeaurora.org>
13 days agotests: sigma_dut sta_scan ShortSSID
Jouni Malinen [Tue, 24 Mar 2020 10:33:31 +0000 (12:33 +0200)] 
tests: sigma_dut sta_scan ShortSSID

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
2 weeks agonl80211: Fix offloaded ACS regression for the 60 GHz band
Noam Shaked [Tue, 10 Mar 2020 01:16:02 +0000 (18:16 -0700)] 
nl80211: Fix offloaded ACS regression for the 60 GHz band

Addition of chan_2ghz_or_5ghz_to_freq() broke 60 GHz ACS, because it
assumes reported ACS channel is on either 2.4 or 5 GHz band. Fix this
by converting chan_2ghz_or_5ghz_to_freq() to a more generic
chan_to_freq(). The new function uses hw_mode to support 60 GHz.

Fixes: 41cac481a889 ("ACS: Use frequency params in ACS (offload) completed event interface")
Signed-off-by: Noam Shaked <nshaked@codeaurora.org>
2 weeks agoHE: Add HE support to hostapd_set_freq_params()
John Crispin [Mon, 23 Mar 2020 13:13:15 +0000 (14:13 +0100)] 
HE: Add HE support to hostapd_set_freq_params()

The parameters that need to be applied are symmetric to those of VHT,
however the validation code needs to be tweaked to check the HE
capabilities.

Signed-off-by: Shashidhar Lakkavalli <slakkavalli@datto.com>
Signed-off-by: John Crispin <john@phrozen.org>
2 weeks agowlantest: Check for zero TK even when the real PTK is not known
Jouni Malinen [Mon, 23 Mar 2020 15:58:43 +0000 (17:58 +0200)] 
wlantest: Check for zero TK even when the real PTK is not known

This makes it easier to analyze certain encryption issues. Also print
out an error at the default INFO debug verbosity with the frame number.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
2 weeks agoExtend vendor attributes to support enhanced CFR capture
Wu Gao [Sun, 28 Aug 2016 02:56:33 +0000 (10:56 +0800)] 
Extend vendor attributes to support enhanced CFR capture

Enhanced channel frequency response supports capturing of channel status
information based on RX. Define previous CFR as version 1 and enhanced
CFR as version 2. If target supports both versions, two versions can't
be enabled at same time. Extend attributes for enhanced CFR capture in
enum qca_wlan_vendor_peer_cfr_capture_attr.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
2 weeks agoAdd QCA vendor attributes for ACS over EDMG (IEEE 802.11ay)
Noam Shaked [Sun, 22 Mar 2020 22:44:05 +0000 (15:44 -0700)] 
Add QCA vendor attributes for ACS over EDMG (IEEE 802.11ay)

QCA_WLAN_VENDOR_ATTR_ACS_EDMG_ENABLED, conduct ACS for EDMG.
QCA_WLAN_VENDOR_ATTR_ACS_EDMG_CHANNEL, return the EDMG channel.

Signed-off-by: Noam Shaked <nshaked@codeaurora.org>
2 weeks agotests: Extended Key ID
Jouni Malinen [Sun, 22 Mar 2020 22:32:15 +0000 (00:32 +0200)] 
tests: Extended Key ID

Signed-off-by: Jouni Malinen <j@w1.fi>
2 weeks agoAllow last configured Key ID for TK to be fetched from wpa_supplicant
Jouni Malinen [Mon, 23 Mar 2020 09:22:26 +0000 (11:22 +0200)] 
Allow last configured Key ID for TK to be fetched from wpa_supplicant

"GET last_tk_key_idx" can now be used in testing build to determine
which was the last configured Key ID for the pairwise key.

Signed-off-by: Jouni Malinen <j@w1.fi>
2 weeks agoUse a shared helper function for RSN supplicant capabilities
Jouni Malinen [Sun, 22 Mar 2020 22:08:38 +0000 (00:08 +0200)] 
Use a shared helper function for RSN supplicant capabilities

Avoid practically copy-pasted code for determining local RSN
capabilities.

Signed-off-by: Jouni Malinen <j@w1.fi>
2 weeks agoSTA: Support Extended Key ID
Alexander Wetzel [Fri, 20 Mar 2020 19:04:32 +0000 (20:04 +0100)] 
STA: Support Extended Key ID

Support Extended Key ID in wpa_supplicant according to
IEEE Std 802.11-2016 for infrastructure (AP) associations.

Extended Key ID allows to rekey pairwise keys without the otherwise
unavoidable MPDU losses on a busy link. The standard is fully backward
compatible, allowing STAs to also connect to APs not supporting it.

Signed-off-by: Alexander Wetzel <alexander@wetzel-home.de>
2 weeks agoAP: Support Extended Key ID
Alexander Wetzel [Fri, 20 Mar 2020 19:04:31 +0000 (20:04 +0100)] 
AP: Support Extended Key ID

Support Extended Key ID in hostapd according to IEEE Std 802.11-2016.

Extended Key ID allows to rekey pairwise keys without the otherwise
unavoidable MPDU losses on a busy link. The standard is fully backward
compatible, allowing an AP to serve STAs with and without Extended Key
ID support in the same BSS.

Signed-off-by: Alexander Wetzel <alexander@wetzel-home.de>