]> git.ipfire.org Git - thirdparty/hostap.git/log
thirdparty/hostap.git
5 years agotests: DPP chirp by an AP
Jouni Malinen [Wed, 13 May 2020 14:11:15 +0000 (17:11 +0300)] 
tests: DPP chirp by an AP

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP2: Chirping in hostapd Enrollee
Jouni Malinen [Wed, 13 May 2020 14:11:40 +0000 (17:11 +0300)] 
DPP2: Chirping in hostapd Enrollee

Add a new hostapd control interface command "DPP_CHIRP own=<BI ID>
iter=<count>" to request chirping, i.e., sending of Presence
Announcement frames, to be started. This follows the model of similar
wpa_supplicant functionality from commit 562f77144cd2 ("DPP2: Chirping
in wpa_supplicant Enrollee"). The hostapd case requires the AP to be
started without beaconing, i.e., with start_disabled=1 in hostapd
configuration, to allow iteration of channels needed for chirping.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoHandle hostapd_for_each_interface() at the process termination
Jouni Malinen [Wed, 13 May 2020 14:36:40 +0000 (17:36 +0300)] 
Handle hostapd_for_each_interface() at the process termination

Clean struct hapd_interfaces pointers and interface count during
deinitialization at the end of theh ostapd process termination so that a
call to hostapd_for_each_interface() after this does not end up
dereferencing freed memory. Such cases do not exist before this commit,
but can be added after this, e.g., for DPP needs.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agonl80211: Disable offchannel-ok in AP mode only if beaconing
Jouni Malinen [Wed, 13 May 2020 14:09:52 +0000 (17:09 +0300)] 
nl80211: Disable offchannel-ok in AP mode only if beaconing

When hostapd is started without beaconing (start_disabled=1), Public
Action frame transmission command through nl80211 needs to allow
offchannel operations regardless of the operating channel configuration.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP2: Fix CONFIG_DPP2=y build with OpenSSL 1.0.2
Jouni Malinen [Tue, 12 May 2020 18:02:39 +0000 (21:02 +0300)] 
DPP2: Fix CONFIG_DPP2=y build with OpenSSL 1.0.2

This file needs the EVP_PKEY_get0_EC_KEY() compatibility wrapper just
like other DPP source code files using this function.

Fixes: 21c612017b0c ("DPP: Move configurator backup into a separate source code file")
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: iftype parameter with GET_CAPABILITY key_mgmt
Jouni Malinen [Tue, 12 May 2020 14:33:26 +0000 (17:33 +0300)] 
tests: iftype parameter with GET_CAPABILITY key_mgmt

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoClean up GET_CAPABILITY handling of 'strict' argument
Jouni Malinen [Tue, 12 May 2020 14:21:08 +0000 (17:21 +0300)] 
Clean up GET_CAPABILITY handling of 'strict' argument

There is no need to maintain a pointer to the substring "strict"; use a
bool instead.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoUse per-interface type driver key_mgmt capabilities when possible
Veerendranath Jakkam [Wed, 22 Apr 2020 07:24:35 +0000 (12:54 +0530)] 
Use per-interface type driver key_mgmt capabilities when possible

Use key_mgmt_iftype instead of key_mgmt when the specific interface type
is known by the context of the operation.

Use per interface type AKM capabilities in capa.key_mgmt_iftype array
based on the wpa_supplicant context instead of using capa.key_mgmt to
determine the driver AKM capability.

Signed-off-by: Veerendranath Jakkam <vjakkam@codeaurora.org>
5 years agoAllow per interface type AKM capabilities to be fetched
Veerendranath Jakkam [Wed, 22 Apr 2020 07:24:35 +0000 (12:54 +0530)] 
Allow per interface type AKM capabilities to be fetched

Add support to query per interface type AKM capabilities through the
control interface. For example, "GET_CAPABILITY key_mgmt
iftype=STATION".

Signed-off-by: Veerendranath Jakkam <vjakkam@codeaurora.org>
5 years agonl80211: Fetch information on supported AKMs from the driver
Veerendranath Jakkam [Fri, 24 Apr 2020 17:19:25 +0000 (22:49 +0530)] 
nl80211: Fetch information on supported AKMs from the driver

The driver can advertise supported AKMs per wiphy and/or per interface.
Populate per interface supported AKMs based on the driver advertisement
in the following order of preference:
1. AKM suites advertised by NL80211_ATTR_IFTYPE_AKM_SUITES
2. AKM suites advertised by NL80211_ATTR_AKM_SUITES
If neither of these is available:
3. AKMs support is assumed as per legacy behavior.

In addition, extend other driver interface wrappers to set the
per-interface values based on the global capability indication.

Signed-off-by: Veerendranath Jakkam <vjakkam@codeaurora.org>
5 years agonl80211: Remove QCA vendor specific AKM capability handling
Veerendranath Jakkam [Fri, 24 Apr 2020 13:50:36 +0000 (19:20 +0530)] 
nl80211: Remove QCA vendor specific AKM capability handling

Since this functionality was not used for anything in practice, it is
easier to simply remove this functionality completely to avoid potential
conflicts in using the kernel tree upstream commit ab4dfa20534e
("cfg80211: Allow drivers to advertise supported AKM suites").

This is practically reverting the commit 8ec7c99ee4c6 ("nl80211: Fetch
supported AKM list from the driver").

Signed-off-by: Veerendranath Jakkam <vjakkam@codeaurora.org>
5 years agotests: Additional sigma_dut DPP over TCP coverage
Jouni Malinen [Tue, 12 May 2020 11:32:00 +0000 (14:32 +0300)] 
tests: Additional sigma_dut DPP over TCP coverage

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: DPP over TCP (Configurator initiates)
Jouni Malinen [Tue, 12 May 2020 11:38:56 +0000 (14:38 +0300)] 
tests: DPP over TCP (Configurator initiates)

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP2: Extend TCP encapsulation case to support Configurator as Initiator
Jouni Malinen [Tue, 12 May 2020 11:25:15 +0000 (14:25 +0300)] 
DPP2: Extend TCP encapsulation case to support Configurator as Initiator

This allows DPP_AUTH_INIT to be used with tcp_addr=<dst> argument and
Configurator parameters to perform Configurator initiated DPP
provisioning over TCP. Similarly, DPP_CONTROLLER_START can now be used
to specify Configurator/Enrollee roles and extend Controller to work in
Enrollee role.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP: Extend NFC bootstrapping script for more control by caller
Jouni Malinen [Mon, 11 May 2020 21:57:44 +0000 (00:57 +0300)] 
DPP: Extend NFC bootstrapping script for more control by caller

Add more parameters to dpp-nfc.py to allow it to be used with more
detailed control by the caller. This allows Enrollee/Configurator roles
to be selected and Configurator parameters to be specified on the
command line.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP2: Clean up CONFIG_DPP2 use with configurator connectivity IE
Jouni Malinen [Mon, 11 May 2020 14:30:26 +0000 (17:30 +0300)] 
DPP2: Clean up CONFIG_DPP2 use with configurator connectivity IE

Avoid duplicated return statement in CONFIG_DPP2=y builds.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP2: Fix DPP_CHIRP listen parameter value validation
Jouni Malinen [Mon, 11 May 2020 14:28:09 +0000 (17:28 +0300)] 
DPP2: Fix DPP_CHIRP listen parameter value validation

Check the correct variable.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: DPP reconfiguration exchange
Jouni Malinen [Fri, 1 May 2020 21:01:47 +0000 (00:01 +0300)] 
tests: DPP reconfiguration exchange

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP2: Reconfiguration support in Controller
Jouni Malinen [Mon, 11 May 2020 13:04:46 +0000 (16:04 +0300)] 
DPP2: Reconfiguration support in Controller

Add handling of Reconfiguration messages in Controller.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP2: Reconfig Announcement relaying from AP to Controller
Jouni Malinen [Mon, 11 May 2020 13:02:51 +0000 (16:02 +0300)] 
DPP2: Reconfig Announcement relaying from AP to Controller

Recognize the Reconfig Announcement message type and handle it similarly
to the Presence Announcement in the Relay, i.e., send it to the first
Controller if the local Configurator does not have matching C-sign-key.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP2: Fix Presence Announcement processing in Controller
Jouni Malinen [Mon, 11 May 2020 12:59:12 +0000 (15:59 +0300)] 
DPP2: Fix Presence Announcement processing in Controller

Use the new struct dpp_authentication instance when setting Configurator
parameters for authentication exchange triggered by Presence
Announcement. conn->auth is NULL here and would cause dereferencing of a
NULL pointer if dpp_configurator_params is set.

Fixes: fa5143feb3cb ("DPP2: Presence Announcement processing in Controller")
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP: Mark internal-to-file functions static
Jouni Malinen [Mon, 11 May 2020 09:16:20 +0000 (12:16 +0300)] 
DPP: Mark internal-to-file functions static

These functions are not used outside dpp_crypto.c anymore.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP: Move TCP encapsulation into a separate source code file
Jouni Malinen [Mon, 11 May 2020 08:59:46 +0000 (11:59 +0300)] 
DPP: Move TCP encapsulation into a separate source code file

This continues splitting dpp.c into smaller pieces.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP: Move configurator backup into a separate source code file
Jouni Malinen [Sun, 10 May 2020 22:30:13 +0000 (01:30 +0300)] 
DPP: Move configurator backup into a separate source code file

This continues splitting dpp.c into smaller pieces.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP: Move authentication functionality into a separate source code file
Jouni Malinen [Sun, 10 May 2020 22:16:12 +0000 (01:16 +0300)] 
DPP: Move authentication functionality into a separate source code file

This continues splitting dpp.c into smaller pieces.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP2: Remove reconfigured network
Jouni Malinen [Sun, 10 May 2020 21:43:07 +0000 (00:43 +0300)] 
DPP2: Remove reconfigured network

Do not leave behind the old network profile when reconfiguration is
completed successfully.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP2: Reconfig Authentication Confirm processing
Jouni Malinen [Sun, 10 May 2020 20:46:41 +0000 (23:46 +0300)] 
DPP2: Reconfig Authentication Confirm processing

Extend Enrollee functionality to process Reconfig Authentication
Confirm message and start GAS client.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP2: Reconfig Authentication Response processing and Confirm generation
Jouni Malinen [Sun, 10 May 2020 09:55:43 +0000 (12:55 +0300)] 
DPP2: Reconfig Authentication Response processing and Confirm generation

Extend Configurator functionality to process Reconfig Authentication
Response message, derive the needed keys, and generate Reconfig
Authentication Confirm message.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP2: Reconfig Authentication Request processing and Response generation
Jouni Malinen [Sat, 9 May 2020 13:30:09 +0000 (16:30 +0300)] 
DPP2: Reconfig Authentication Request processing and Response generation

Extend Enrollee functionality to process Reconfig Authentication Request
message, derive the needed keys, and generate Reconfig Authentication
Response message.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP2: Reconfig Authentication Request generation and transmission
Jouni Malinen [Sat, 2 May 2020 17:10:12 +0000 (20:10 +0300)] 
DPP2: Reconfig Authentication Request generation and transmission

Extend Configurator functionality to sign a special Connector for
reconfiguration and reply with Reconfig Authentication Request frame
when Reconfig Announcement frame is received with a matching C-sign key
hash value.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP2: Process received Reconfig Announcement frame
Jouni Malinen [Fri, 1 May 2020 21:16:05 +0000 (00:16 +0300)] 
DPP2: Process received Reconfig Announcement frame

Check if there is a matching Configurator and be ready to initiate
Reconfig Authentication (which itself is not included in this commit).

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP2: Reconfig Announcement transmission
Jouni Malinen [Fri, 1 May 2020 21:02:15 +0000 (00:02 +0300)] 
DPP2: Reconfig Announcement transmission

Extend DPP chirping mechanism to allow Reconfig Announcement frames to
be transmitted instead of the Presence Announcement frames. Add a new
wpa_supplicant control interface command "DPP_RECONFIG <network id>" to
initiate reconfiguration for a specific network profile.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP2: Extend connector matching for reconfiguration
Jouni Malinen [Sat, 9 May 2020 13:42:37 +0000 (16:42 +0300)] 
DPP2: Extend connector matching for reconfiguration

Allow the same helper functions to be used with reconfiguration
connector.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP2: Move connStatus object building into a helper function
Jouni Malinen [Sat, 9 May 2020 13:40:44 +0000 (16:40 +0300)] 
DPP2: Move connStatus object building into a helper function

Allow the same helper function to be used for reconfiguration.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: Update dpp_peer_intro_local_failures to match implementation
Jouni Malinen [Sun, 10 May 2020 12:36:24 +0000 (15:36 +0300)] 
tests: Update dpp_peer_intro_local_failures to match implementation

The memory allocation in dpp_peer_intro() was moved into a helper
function dpp_check_signed_connector(), so update the test case to match.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP: Move signed connector checking into a helper function
Jouni Malinen [Sun, 10 May 2020 10:41:51 +0000 (13:41 +0300)] 
DPP: Move signed connector checking into a helper function

This can be reused for similar need with reconfiguration.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP: Move parsing of own connector into a helper function
Jouni Malinen [Sat, 9 May 2020 13:35:21 +0000 (16:35 +0300)] 
DPP: Move parsing of own connector into a helper function

This can be used for reconfiguration as well.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP: Move PKEX functionality into a separate source code file
Jouni Malinen [Sun, 10 May 2020 13:51:46 +0000 (16:51 +0300)] 
DPP: Move PKEX functionality into a separate source code file

This continues splitting dpp.c into smaller pieces.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP: Move crypto routines into a separate source code file
Jouni Malinen [Sun, 10 May 2020 13:25:42 +0000 (16:25 +0300)] 
DPP: Move crypto routines into a separate source code file

This is an initial step in splitting the overly long dpp.c into smaller
pieces.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: Update dpp_pkex_test_fail to match implementation
Jouni Malinen [Sat, 9 May 2020 14:39:15 +0000 (17:39 +0300)] 
tests: Update dpp_pkex_test_fail to match implementation

dpp_derive_ke() was renamed to dpp_derive_bk_ke().

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP2: Derive bk ("base key")
Jouni Malinen [Fri, 8 May 2020 18:13:32 +0000 (21:13 +0300)] 
DPP2: Derive bk ("base key")

Split ke derivation into two parts so that the previously used
internal-only PRK gets stored as the bk in the authentication state.
This new key will be needed for deriving additional keys with DPP R2.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP: Use EVP_PKEY_get0_EC_KEY() when a const reference is sufficient
Jouni Malinen [Sun, 10 May 2020 12:42:47 +0000 (15:42 +0300)] 
DPP: Use EVP_PKEY_get0_EC_KEY() when a const reference is sufficient

This removes unnecessary allocations and simplifies the implementation
by not having to remember to free the cloned reference.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP: Track ending time for remain-on-channel operations
Jouni Malinen [Sat, 9 May 2020 14:30:48 +0000 (17:30 +0300)] 
DPP: Track ending time for remain-on-channel operations

This may be needed to optimize use of offchannel TX operations with
wait-for-response when near the end of a pending remain-on-channel
operation.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: DPP URI version information
Jouni Malinen [Wed, 6 May 2020 08:59:11 +0000 (11:59 +0300)] 
tests: DPP URI version information

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP2: Fix URI version parser
Jouni Malinen [Wed, 6 May 2020 08:58:04 +0000 (11:58 +0300)] 
DPP2: Fix URI version parser

Fix a copy-paste error in parsing the version info.

Fixes: 7dd768c3ca76 ("DPP2: Version information in bootstrapping info URI")
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: sigma_dut controlled AP doing DPP on offchannel
Jouni Malinen [Tue, 5 May 2020 22:14:13 +0000 (01:14 +0300)] 
tests: sigma_dut controlled AP doing DPP on offchannel

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP2: Version information in bootstrapping info URI
Jouni Malinen [Tue, 5 May 2020 17:48:23 +0000 (20:48 +0300)] 
DPP2: Version information in bootstrapping info URI

Add the local supported version information into the bootstrapping
information (V=2 in the URI) and parse this from received URI.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoFix truncated control interface command detection
Jouni Malinen [Mon, 4 May 2020 21:18:29 +0000 (00:18 +0300)] 
Fix truncated control interface command detection

The recvfrom() calls were supposed to use the full allocated buffer size
(max+1) to match the res > max check.

Fixes: 96b6dd21a022 ("Increase wpa_supplicant control interface buffer size")
Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: sigma_dut and DPP MUD URL
Jouni Malinen [Mon, 4 May 2020 12:32:35 +0000 (15:32 +0300)] 
tests: sigma_dut and DPP MUD URL

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP2: Report MUD URL and bandSupport in control interface events
Jouni Malinen [Mon, 4 May 2020 12:31:14 +0000 (15:31 +0300)] 
DPP2: Report MUD URL and bandSupport in control interface events

Report MUD URL and bandSupport from config request if those optional
nodes are included. For now, these are mainly for testing purposes since
there is no mechanism to delay sending of config response.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: sigma_dut DPP chirping
Jouni Malinen [Mon, 4 May 2020 12:07:23 +0000 (15:07 +0300)] 
tests: sigma_dut DPP chirping

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP2: Do not include Protocol Version in Auth Req when testing v1
Jouni Malinen [Mon, 4 May 2020 10:11:00 +0000 (13:11 +0300)] 
DPP2: Do not include Protocol Version in Auth Req when testing v1

When DPP v2 implementation is hardcoded to behave as v1 for testing
purposes, leave out the Protocol Version attribute form Authentication
Request instead of including it there with indication for v1.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP: Move dppCon signing to a set of helper functions
Jouni Malinen [Sat, 2 May 2020 16:43:10 +0000 (19:43 +0300)] 
DPP: Move dppCon signing to a set of helper functions

This simplifies dpp_build_conf_obj_dpp() and makes it easier to share
the signing functionality for other purposes like reconfiguration where
the Configurator needs to sign a dppCon object for itself without
generating the encapsulating config object.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: Verify Deauthentication frame transmission to STA in PS mode
Jouni Malinen [Fri, 1 May 2020 20:06:33 +0000 (23:06 +0300)] 
tests: Verify Deauthentication frame transmission to STA in PS mode

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: Disable power saving explicitly for pmksa_cache_ap_expiration
Jouni Malinen [Fri, 1 May 2020 20:02:33 +0000 (23:02 +0300)] 
tests: Disable power saving explicitly for pmksa_cache_ap_expiration

This test case seems to be failing every now and then due to the AP not
getting out the Deauthentication frame after PMKSA expiration if the STA
is in power save mode.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: Clear power save configuration in ap_open_sta_ps
Jouni Malinen [Fri, 1 May 2020 20:01:11 +0000 (23:01 +0300)] 
tests: Clear power save configuration in ap_open_sta_ps

It looks like this test case was supposed to set power_save off at the
end instead of repeating the same setting twice.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: DPP version override
Jouni Malinen [Fri, 1 May 2020 18:28:45 +0000 (21:28 +0300)] 
tests: DPP version override

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP: Allow version number to be overridden for testing purposes
Jouni Malinen [Fri, 1 May 2020 18:07:42 +0000 (21:07 +0300)] 
DPP: Allow version number to be overridden for testing purposes

"SET dpp_version_override <ver>" can now be used to request
wpa_supplicant and hostapd to support a subset of DPP versions. In
practice, the only valid case for now is to fall back from DPP version 2
support to version 1 in builds that include CONFIG_DPP2=y.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP2: Detect PFS downgrade attack while processing EAPOL-Key msg 3/4
Jouni Malinen [Fri, 1 May 2020 17:06:57 +0000 (20:06 +0300)] 
DPP2: Detect PFS downgrade attack while processing EAPOL-Key msg 3/4

Do not allow association to continue if the local configuration enables
PFS and the station indicates it supports PFS, but PFS was not
negotiated for the association.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP2: Detect PFS downgrade attack while processing EAPOL-Key msg 2/4
Jouni Malinen [Fri, 1 May 2020 17:02:48 +0000 (20:02 +0300)] 
DPP2: Detect PFS downgrade attack while processing EAPOL-Key msg 2/4

Do not allow association to continue if the local configuration enables
PFS and the station indicates it supports PFS, but PFS was not
negotiated for the association.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP2: Parse DPP KDE in EAPOL-Key Key Data field
Jouni Malinen [Fri, 1 May 2020 16:52:31 +0000 (19:52 +0300)] 
DPP2: Parse DPP KDE in EAPOL-Key Key Data field

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP2: Add DPP KDE into EAPOL-Key msg 2/4 when using DPP AKM
Jouni Malinen [Fri, 1 May 2020 16:53:07 +0000 (19:53 +0300)] 
DPP2: Add DPP KDE into EAPOL-Key msg 2/4 when using DPP AKM

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP2: Add DPP KDE into EAPOL-Key msg 3/4 when using DPP AKM
Jouni Malinen [Fri, 1 May 2020 16:51:34 +0000 (19:51 +0300)] 
DPP2: Add DPP KDE into EAPOL-Key msg 3/4 when using DPP AKM

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: Disable PFS in dpp_akm_sha*
Jouni Malinen [Fri, 1 May 2020 17:51:49 +0000 (20:51 +0300)] 
tests: Disable PFS in dpp_akm_sha*

These test cases are using externally generated PMKSA cache entry which
does not support use of PFS. This will start failing if the station
claims to support PFS in such cases, so explicitly disable PFS
functionality in these test cases for now.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: DPP PFS and cfg80211 connect command
Jouni Malinen [Fri, 1 May 2020 14:45:58 +0000 (17:45 +0300)] 
tests: DPP PFS and cfg80211 connect command

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: Check DPP PFS negotiation result
Jouni Malinen [Fri, 1 May 2020 14:43:07 +0000 (17:43 +0300)] 
tests: Check DPP PFS negotiation result

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP2: Indicate if PFS was used in control interface STATUS
Jouni Malinen [Fri, 1 May 2020 14:36:59 +0000 (17:36 +0300)] 
DPP2: Indicate if PFS was used in control interface STATUS

The new "dpp_pfs=1" entry can be used to determine whether PFS was used
during derivation of PTK when DPP AKM is negotiated for an association.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP2: Try to negotiate PFS only if AP supports version 2 or newer
Jouni Malinen [Fri, 1 May 2020 14:30:03 +0000 (17:30 +0300)] 
DPP2: Try to negotiate PFS only if AP supports version 2 or newer

Check AP's DPP Protocol Version during network introduction and mark the
PMKSA cache as suitable for PFS use with version 2 or newer. This avoids
unnecessary attempt of negotiating PFS with version 1 APs.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoUse a local pointer to simply current_ssid accesses in sme_associate()
Jouni Malinen [Fri, 1 May 2020 14:20:33 +0000 (17:20 +0300)] 
Use a local pointer to simply current_ssid accesses in sme_associate()

It is simpler to assign wpa_s->current_ssid to a local pointer now that
there are numerous dereferences of current_ssid within sme_associate().

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP2: Add Protocol Version attribute to network introduction messages
Jouni Malinen [Fri, 1 May 2020 14:06:59 +0000 (17:06 +0300)] 
DPP2: Add Protocol Version attribute to network introduction messages

This can be used to determine whether to try to negotiate PFS (only
available with version 2 or higher).

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: Skip proxyarp tests properly if ebtables rule install fails
Thomas Pedersen [Fri, 1 May 2020 21:02:10 +0000 (14:02 -0700)] 
tests: Skip proxyarp tests properly if ebtables rule install fails

Otherwise the test will continue on and fail later due to unexpected
foreign ARP request. The try/except design here did not work properly to
detect this.

Signed-off-by: Thomas Pedersen <thomas@adapt-ip.com>
5 years agotests: Move from 1024 bit private keys to 2048 bit keys
Jouni Malinen [Sat, 2 May 2020 17:58:40 +0000 (20:58 +0300)] 
tests: Move from 1024 bit private keys to 2048 bit keys

Crypto libraries are starting to refuse to accept the old shorter keys,
so move all test certificates and DH to use 2048 bit (or longer) keys.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoIncrease wpa_supplicant control interface buffer size
Jouni Malinen [Sat, 2 May 2020 18:58:59 +0000 (21:58 +0300)] 
Increase wpa_supplicant control interface buffer size

Increase the maximum command length from 4 kB to 8 kB mainly to allow
larger certificate blobs to be configured. Use heap memory to avoid
inconveniently large stack requirements. In addition, reject potentially
truncated commands instead of trying to process them.

The maximum length of the request can now be determined with
"GET max_command_len".

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: Provide digestmod to hmac.new() for Python 3.8
Jouni Malinen [Sun, 3 May 2020 08:43:23 +0000 (11:43 +0300)] 
tests: Provide digestmod to hmac.new() for Python 3.8

Python 3.8 removed the previously used default of MD5 algorithm, so
provide the explicit digestmod=hashlib.md5 parameter to the couple of
places that were missing it.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoAdd PRINTF_FORMAT for printf wrapper functions
Jouni Malinen [Sat, 2 May 2020 17:25:21 +0000 (20:25 +0300)] 
Add PRINTF_FORMAT for printf wrapper functions

This avoids compiler format-nonliteral warnings ("format string is not a
string literal").

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoRandomize GAS dialog token
Hai Shalom [Thu, 23 Apr 2020 22:13:27 +0000 (15:13 -0700)] 
Randomize GAS dialog token

Randomize GAS dialog token field, instead of using an incremental
counter with predictable values. This change will make this field
unuseful for user fingerprinting.

Signed-off-by: Hai Shalom <haishalom@google.com>
5 years agoUse more specific reason codes for 4-way handshake timeouts
Jouni Malinen [Wed, 29 Apr 2020 10:00:53 +0000 (13:00 +0300)] 
Use more specific reason codes for 4-way handshake timeouts

IEEE 802.11 defines reason codes for indicating 4-way handshake and
group key handshake timeouts. Use those reason codes instead of the more
generic one for these particular cases in the Authenticator state
machine.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: Wait a bit to get Beacon frames into capture
Jouni Malinen [Sat, 25 Apr 2020 14:23:24 +0000 (17:23 +0300)] 
tests: Wait a bit to get Beacon frames into capture

The ap_beacon_rate_* test cases could end up terminating before the very
first Beacon frame is captured, so wait a bit after the connection to
make sure at least one Beacon frame is going to be in the capture file.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: Beacon frame protection mismatch
Jouni Malinen [Wed, 1 Apr 2020 13:07:00 +0000 (16:07 +0300)] 
tests: Beacon frame protection mismatch

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agonl80211: Process unprotected Beacon frame RX events
Jouni Malinen [Wed, 1 Apr 2020 13:06:32 +0000 (16:06 +0300)] 
nl80211: Process unprotected Beacon frame RX events

Convert driver indications to internal events to allow invalid Beacon
frames to be reported to the AP.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agonl80211: DPP listen mode callback
Jouni Malinen [Mon, 20 Apr 2020 20:53:21 +0000 (23:53 +0300)] 
nl80211: DPP listen mode callback

Update frame processing registration for DPP Public Action frames to
include multicast reception when in DPP listen mode and the driver
indicates support for this type of explicit request.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: Fix sigma_dut_sae_h2e_enabled_group_rejected to clear sae_pwe
Jouni Malinen [Fri, 24 Apr 2020 14:03:32 +0000 (17:03 +0300)] 
tests: Fix sigma_dut_sae_h2e_enabled_group_rejected to clear sae_pwe

This test case was using sigma_dut to set sae_pwe=2, but that value was
not cleared in the end. This could result in following SAE test cases
failing due to unexpected behavior.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoRemove now unused Boolean/TRUE/FALSE definitions
Jouni Malinen [Thu, 23 Apr 2020 22:35:36 +0000 (01:35 +0300)] 
Remove now unused Boolean/TRUE/FALSE definitions

The previous users were converted to C99 bool.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoFILS: Convert Boolean to C99 bool
Jouni Malinen [Thu, 23 Apr 2020 22:43:32 +0000 (01:43 +0300)] 
FILS: Convert Boolean to C99 bool

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agomesh: Convert Boolean to C99 bool
Jouni Malinen [Thu, 23 Apr 2020 22:40:03 +0000 (01:40 +0300)] 
mesh: Convert Boolean to C99 bool

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoRADIUS: Convert Boolean to C99 bool
Jouni Malinen [Thu, 23 Apr 2020 22:39:02 +0000 (01:39 +0300)] 
RADIUS: Convert Boolean to C99 bool

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoairtime_policy: Convert Boolean to C99 bool
Jouni Malinen [Thu, 23 Apr 2020 22:38:10 +0000 (01:38 +0300)] 
airtime_policy: Convert Boolean to C99 bool

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agostate_machine: Convert Boolean to C99 bool
Jouni Malinen [Thu, 23 Apr 2020 22:36:42 +0000 (01:36 +0300)] 
state_machine: Convert Boolean to C99 bool

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoHE: Replace Boolean with C99 bool
Jouni Malinen [Thu, 23 Apr 2020 22:33:16 +0000 (01:33 +0300)] 
HE: Replace Boolean with C99 bool

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoMACsec: Convert Boolean to C99 bool
Jouni Malinen [Thu, 23 Apr 2020 22:27:57 +0000 (01:27 +0300)] 
MACsec: Convert Boolean to C99 bool

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoeap_example: Convert Boolean to C99 bool
Jouni Malinen [Thu, 23 Apr 2020 22:15:47 +0000 (01:15 +0300)] 
eap_example: Convert Boolean to C99 bool

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoEAP peer: Convert Boolean to C99 bool
Jouni Malinen [Thu, 23 Apr 2020 22:14:34 +0000 (01:14 +0300)] 
EAP peer: Convert Boolean to C99 bool

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoRSN supp: Convert Boolean to C99 bool
Jouni Malinen [Thu, 23 Apr 2020 22:04:24 +0000 (01:04 +0300)] 
RSN supp: Convert Boolean to C99 bool

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoEAPOL supp: Convert Boolean to C99 bool
Jouni Malinen [Thu, 23 Apr 2020 21:51:11 +0000 (00:51 +0300)] 
EAPOL supp: Convert Boolean to C99 bool

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoFST: Convert Boolean to C99 bool
Jouni Malinen [Thu, 23 Apr 2020 21:41:16 +0000 (00:41 +0300)] 
FST: Convert Boolean to C99 bool

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoEAPOL auth: Convert Boolean to C99 bool
Jouni Malinen [Thu, 23 Apr 2020 21:29:09 +0000 (00:29 +0300)] 
EAPOL auth: Convert Boolean to C99 bool

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoWPA auth: Convert Boolean to C99 bool
Jouni Malinen [Thu, 23 Apr 2020 20:52:12 +0000 (23:52 +0300)] 
WPA auth: Convert Boolean to C99 bool

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoWPA: Fix wpa_parse_kde_ies() handling with vendor specific elements
Jouni Malinen [Thu, 23 Apr 2020 20:30:23 +0000 (23:30 +0300)] 
WPA: Fix wpa_parse_kde_ies() handling with vendor specific elements

Documentation of the return values for wpa_parse_vendor_specific() and
wpa_parse_generic() were not accurate and the parsing results from these
were not really handled appropriately. There is no point in calling
wpa_parse_vendor_specific() if wpa_parse_generic() recognizes a KDE. Not
that this would break anything in practice, but still, it looks
confusing.

The part about handling wpa_parse_vendor_specific() return value can, at
least in theory, break some cases where an unexpectedly short KDE/vendor
specific element were present and something would need to be recognized
after it. That does not really happen with any standard compliant
implementation and this is unlikely to cause any real harm, but it is
clearer to handle this more appropriately even for any theoretical case,
including misbehavior of a peer device.

Instead of stopping parsing on too short vendor specific element,
continue parsing the following KDEs/IEs. Skip the
wpa_parse_vendor_specific() call when a KDE has been recognized. Also
fix the return value documentation for wpa_parse_generic() and remove
the useless return value from wpa_parse_vendor_specific().

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoSync with mac80211-next.git include/uapi/linux/nl80211.h
Jouni Malinen [Fri, 24 Apr 2020 14:06:36 +0000 (17:06 +0300)] 
Sync with mac80211-next.git include/uapi/linux/nl80211.h

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

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: DPP QR Code and authentication exchange (rand_mac_addr=1)
Jouni Malinen [Wed, 22 Apr 2020 14:04:08 +0000 (17:04 +0300)] 
tests: DPP QR Code and authentication exchange (rand_mac_addr=1)

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