]> git.ipfire.org Git - thirdparty/hostap.git/log
thirdparty/hostap.git
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>
5 years agoDPP: Fix config exchange with gas_rand_mac_addr
Jouni Malinen [Wed, 22 Apr 2020 14:04:43 +0000 (17:04 +0300)] 
DPP: Fix config exchange with gas_rand_mac_addr

Do not use a random MAC address for the GAS exchange that is used as
part of the DPP protocol exchange since that would break DPP.
Configurator expects the same MAC address to be used for DPP
Authentication exchange and DPP Configuration exchange (GAS).

Since the DPP Authentication exchange has already used the MAC address
configured on the interface, use of a random address for the GAS
exchange would not provide any additional privacy protection. If a
random MAC address needs to be used for this type of an exchange, that
random address would need to be first configured on the interface before
starting DPP exchange.

This does not change GAS query behavior for any other use case, i.e.,
the gas_rand_mac_addr configuration continues to apply to all the
Interworking/Hotspot 2.0 uses.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: Fix new fuzzer builds
Jouni Malinen [Tue, 21 Apr 2020 21:51:13 +0000 (00:51 +0300)] 
tests: Fix new fuzzer builds

$(LIBS) got included twice into the linker command line from $^ and
$(LIBS). The former ended up getting converted based on host CPU rather
than target. Fix that by removing duplication and -lcrypto from $(LIBS).

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoEAP server: Convert Boolean to C99 bool
Jouni Malinen [Mon, 20 Apr 2020 21:16:16 +0000 (00:16 +0300)] 
EAP server: Convert Boolean to C99 bool

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP: Add driver operation for enabling/disabling listen mode
Jouni Malinen [Mon, 20 Apr 2020 20:52:04 +0000 (23:52 +0300)] 
DPP: Add driver operation for enabling/disabling listen mode

This can be used to configure RX filter to be able to receive broadcast
DPP Public Action frames.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoInclude stdbool.h to allow C99 bool to be used
Jouni Malinen [Mon, 20 Apr 2020 17:29:31 +0000 (20:29 +0300)] 
Include stdbool.h to allow C99 bool to be used

We have practically started requiring some C99 features, so might as
well finally go ahead and bring in the C99 bool as well.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP2: Silence compiler warning with no-CONFIG_DPP2 and OpenSSL 1.0.2
Jouni Malinen [Sun, 19 Apr 2020 13:58:59 +0000 (16:58 +0300)] 
DPP2: Silence compiler warning with no-CONFIG_DPP2 and OpenSSL 1.0.2

EVP_PKEY_get0_EC_KEY() compatibility wrapper is used only within
CONFIG_DPP2 blocks, so define it with matching condition.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoSilence compiler warning in no-NEED_AP_MLME hostapd builds
Jouni Malinen [Sun, 19 Apr 2020 13:56:35 +0000 (16:56 +0300)] 
Silence compiler warning in no-NEED_AP_MLME hostapd builds

The static function hostapd_ctrl_check_freq_params() was called only
within #ifdef NEED_AP_MLME block so the function needs to be defined
under matching condition.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agonl80211: Move nl80211_init_connect_handle() to avoid forward declaration
Jouni Malinen [Sun, 19 Apr 2020 13:41:47 +0000 (16:41 +0300)] 
nl80211: Move nl80211_init_connect_handle() to avoid forward declaration

This has no changes to the function itself, i.e., it is just moved to a
location that is above the first caller.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoDo not open l2_packet(EAPOL) for receive unnecessarily
Jouni Malinen [Sun, 19 Apr 2020 13:38:29 +0000 (16:38 +0300)] 
Do not open l2_packet(EAPOL) for receive unnecessarily

If the driver supports control port for EAPOL RX, do not register
l2_packet for RX to minimize unnecessary operation load.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agol2_packet: Allow initialization without RX handling
Jouni Malinen [Sun, 19 Apr 2020 13:36:47 +0000 (16:36 +0300)] 
l2_packet: Allow initialization without RX handling

This can be used to minimize resource use when receive path is not
needed.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agonl80211: Do not open EAPOL RX socket when using control port for RX (AP)
Jouni Malinen [Sun, 19 Apr 2020 13:25:27 +0000 (16:25 +0300)] 
nl80211: Do not open EAPOL RX socket when using control port for RX (AP)

drv->eapol_sock is used only for receiving EAPOL frames in AP mode, so
it is not needed when using control port for EAPOL frame RX.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: ap_open_out_of_memory to skip i802_init test if needed
Jouni Malinen [Sun, 19 Apr 2020 14:41:38 +0000 (17:41 +0300)] 
tests: ap_open_out_of_memory to skip i802_init test if needed

The eloop_register_read_sock() call in i802_init() will be skipped if
the driver supports control port for EAPOL RX, so need to skip this part
of the test case conditionally.

Signed-off-by: Jouni Malinen <j@w1.fi>