]> git.ipfire.org Git - thirdparty/hostap.git/log
thirdparty/hostap.git
5 years agotests: Skip TOD-TOFU/STRICT tests if build does not support this
Jouni Malinen [Sat, 16 May 2020 18:58:10 +0000 (21:58 +0300)] 
tests: Skip TOD-TOFU/STRICT tests if build does not support this

This functionality is currently available only with OpenSSL and internal
TLS implementation.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoD-Bus: Increase introspection buffer size
Jouni Malinen [Sat, 16 May 2020 18:46:24 +0000 (21:46 +0300)] 
D-Bus: Increase introspection buffer size

It was apparently possible to hit the 20000 octet limit in some cases,
so increase the limit to avoid process termination due to insufficient
room for preparing a response to Introspect calls.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agowolfssl: Do not hardcode include directory in wpa_supplicant build
Jouni Malinen [Sat, 16 May 2020 18:07:45 +0000 (21:07 +0300)] 
wolfssl: Do not hardcode include directory in wpa_supplicant build

This is not really appropriate for any kind of cross compilations and is
not really needed in general since system specific values can be set in
.config.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agowolfssl: Fix crypto_bignum_rand() implementation
Jouni Malinen [Sat, 16 May 2020 18:02:17 +0000 (21:02 +0300)] 
wolfssl: Fix crypto_bignum_rand() implementation

The previous implementation used mp_rand_prime() to generate a random
value in range 0..m. That is insanely slow way of generating a random
value since mp_rand_prime() is for generating a random _prime_ which is
not what is needed here. Replace that implementation with generationg of
a random value in the requested range without doing any kind of prime
number checks or loops to reject values that are not primes.

This speeds up SAE and EAP-pwd routines by couple of orders of
magnitude..

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agowolfssl: Fix compiler warnings on size_t printf format use
Jouni Malinen [Sat, 16 May 2020 18:01:51 +0000 (21:01 +0300)] 
wolfssl: Fix compiler warnings on size_t printf format use

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoSAE: Fix a typo in a comment
Jouni Malinen [Sat, 16 May 2020 18:01:32 +0000 (21:01 +0300)] 
SAE: Fix a typo in a comment

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: Flush scan results before checking alloc failure
Thomas Pedersen [Fri, 1 May 2020 21:02:11 +0000 (14:02 -0700)] 
tests: Flush scan results before checking alloc failure

When run after other tests, It was likely that the target
bss was already present in scan_fail, so the
scan_for_bss() wouldn't trip the allocation failure in
wpa_bss_add(). Flush the scan results before the scan to
ensure wpa_bss_add() is called and consistently pass
scan_fail.

Signed-off-by: Thomas Pedersen <thomas@adapt-ip.com>
5 years agotests: sigma_dut: set regulatory inside try/except
Thomas Pedersen [Fri, 1 May 2020 21:02:07 +0000 (14:02 -0700)] 
tests: sigma_dut: set regulatory inside try/except

If sigma_dut is not installed, start_sigma_dut() will
throw an exception. Call start_sigma_dut() inside the
try/except to correctly reset the regulatory domain.

This fixes several seemingly random failures due to
regulatory domain not being reset.

Signed-off-by: Thomas Pedersen <thomas@adapt-ip.com>
5 years agowpa_gui: Fix build with Inkscape 1.0
Jan Tojnar [Wed, 6 May 2020 22:29:53 +0000 (00:29 +0200)] 
wpa_gui: Fix build with Inkscape 1.0

Inkscape 1.0 revamped their CLI flags, breaking the icon build.

https://wiki.inkscape.org/wiki/index.php?title=Using_the_Command_Line#Background

Signed-off-by: Jan Tojnar <jtojnar@gmail.com>
5 years agonl80211: Change AKM suite limit from warning to debug print
Petr Štetiar [Mon, 11 May 2020 08:16:51 +0000 (10:16 +0200)] 
nl80211: Change AKM suite limit from warning to debug print

Commit dd74ddd0dff6 ("nl80211: Handle AKM suite selectors for AP
configuration") added warning log message "nl80211: Not enough room for
all AKM suites (num_suites=X > NL80211_MAX_NR_AKM_SUITES)" which in some
cases fills logs every 3 seconds, so fix this by increasing the log
message level to debug.

Reported-by: Stefan Lippers-Hollmann <s.l-h@gmx.de>
Ref: https://patchwork.ozlabs.org/project/openwrt/patch/20200504130757.12736-1-ynezz@true.cz/#2429246
Fixes: dd74ddd0dff6 ("nl80211: Handle AKM suite selectors for AP configuration")
Signed-off-by: Petr Štetiar <ynezz@true.cz>
Tested-by: Stefan Lippers-Hollmann <s.l-h@gmx.de>
5 years agotests: Automatic channel selection and RX during ACS
Jouni Malinen [Sat, 16 May 2020 09:18:42 +0000 (12:18 +0300)] 
tests: Automatic channel selection and RX during ACS

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoIgnore Management frames while AP interface is not fully enabled
Jouni Malinen [Sat, 16 May 2020 09:16:34 +0000 (12:16 +0300)] 
Ignore Management frames while AP interface is not fully enabled

It is possible for drivers to report received Management frames while AP
is going through initial setup (e.g., during ACS or DFS CAC). hostapd
and the driver is not yet ready for actually sending out responses to
such frames at this point and as such, it is better to explicitly ignore
such received frames rather than try to process them and have the
response (e.g., a Probe Response frame) getting dropped by the driver as
an invalid or getting out with some incorrect information.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoMove deauthentication at AP start to be after beacon configuration
Jouni Malinen [Sat, 16 May 2020 08:38:09 +0000 (11:38 +0300)] 
Move deauthentication at AP start to be after beacon configuration

This allows nl80211-based drivers to get the frame out. The old earlier
location resulted in the driver operation getting rejected before the
kernel was not ready to transmit the frame in the BSS context of the AP
interface that has not yet been started.

While getting this broadcast Deauthentication frame transmitted at the
BSS start is not critical, it is one more chance of getting any
previously associated station notified of their previous association not
being valid anymore had they missed previous notifications in cases
where the AP is stopped and restarted.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoRemove unnecessary key clearing at AP start with nl80211
Jouni Malinen [Sat, 16 May 2020 08:28:03 +0000 (11:28 +0300)] 
Remove unnecessary key clearing at AP start with nl80211

cfg80211 takes care of key removal when link/association is lost, so
there is no need to explicitly clear old keys when starting AP.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agonl80211: Remove AP mode interface from bridge for STA-mode-scan
Jouni Malinen [Fri, 15 May 2020 18:23:50 +0000 (21:23 +0300)] 
nl80211: Remove AP mode interface from bridge for STA-mode-scan

Linux bridging code does not allow a station mode WLAN interface in a
bridge and this prevents the AP mode scan workaround from working if the
AP interface is in a bridge and scanning can be only done by moving to
STA mode. Extend this workaround to remove the interface from the bridge
temporarily for the duration of the scan, i.e., for the same duration as
the interface needs to be moved into the station.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agodpp-nfc: Enable hostapd beaconing for listen state
Jouni Malinen [Fri, 15 May 2020 11:46:41 +0000 (14:46 +0300)] 
dpp-nfc: Enable hostapd beaconing for listen state

This is needed to be able to receive Public Action frames when hostapd
was initially started with start_disabled=1.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agodpp-nfc: Clean up debug prints when handover select is received
Jouni Malinen [Fri, 15 May 2020 11:20:26 +0000 (14:20 +0300)] 
dpp-nfc: Clean up debug prints when handover select is received

If the local device becomes the handover selector, make the debug log
entries about client functionality not receiving the response clearer
since that is not really an error case.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agodpp-nfc: Do not indicate a single channel 1 by default
Jouni Malinen [Fri, 15 May 2020 11:17:40 +0000 (14:17 +0300)] 
dpp-nfc: Do not indicate a single channel 1 by default

Allow any channel to be used by not including a specific single channel
in the handover request without a need (for AP mode, use the current
operating channel). When sending out the handover select, pick a single
channel if no specific channel has been negotiated.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agodpp-nfc: Make handover request collision detection more robust
Jouni Malinen [Fri, 15 May 2020 09:10:59 +0000 (12:10 +0300)] 
dpp-nfc: Make handover request collision detection more robust

Wait up to 100 ms for own handover request transmission to succeed if
peer handover request is received, but own crn is not yet available.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agodpp-nfc: Write debug info to summary log
Jouni Malinen [Fri, 15 May 2020 09:03:53 +0000 (12:03 +0300)] 
dpp-nfc: Write debug info to summary log

Convert most print() calls to use the summary() helper so that the
printed information gets written into a log file as well. In addition,
start using a mutex lock to synchronize debug prints between threads to
avoid merging of messages from different contexts.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agodpp-nfc: Collision detection for handover request
Jouni Malinen [Thu, 14 May 2020 23:26:01 +0000 (02:26 +0300)] 
dpp-nfc: Collision detection for handover request

Address possible handover request collisions for cases where both
devices try to initiate handover simultaneously.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agodpp-nfc: Start handover server regardless of init-on-touch setting
Jouni Malinen [Thu, 14 May 2020 22:21:01 +0000 (01:21 +0300)] 
dpp-nfc: Start handover server regardless of init-on-touch setting

The previous version was trying to force the handover roles based on the
--init-on-touch parameter on both sides. That is fine for some test
scenarios, but not appropriate for more normal use cases. Change this
design to enable handover server in all cases and only control starting
of the handover client based on --init-on-touch.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agodpp-nfc: Own MAC address fetching from hostapd
Jouni Malinen [Thu, 14 May 2020 21:44:27 +0000 (00:44 +0300)] 
dpp-nfc: Own MAC address fetching from hostapd

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agodpp-nfc: Be more graceful when wpa_supplicant is not available
Jouni Malinen [Thu, 14 May 2020 21:31:32 +0000 (00:31 +0300)] 
dpp-nfc: Be more graceful when wpa_supplicant is not available

Do not try to proceed with negotiated connection handover if
wpa_supplicant control interface is not available.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agodpp-nfc: Allow wpa_supplicant control interface directory to be set
Jouni Malinen [Thu, 14 May 2020 18:52:09 +0000 (21:52 +0300)] 
dpp-nfc: Allow wpa_supplicant control interface directory to be set

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agodpp-nfc: Use Configurator/Enrollee parameters with tag reading
Jouni Malinen [Thu, 14 May 2020 18:46:50 +0000 (21:46 +0300)] 
dpp-nfc: Use Configurator/Enrollee parameters with tag reading

This was previously done only for the negotiated connection handover
case, but the same parameters are useful for the tag reading cases (URI
record and static handover).

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agodpp-nfc: More robust determination of the script directory
Jouni Malinen [Thu, 14 May 2020 18:29:25 +0000 (21:29 +0300)] 
dpp-nfc: More robust determination of the script directory

Make it more robust to import wpaspy regardless of how dpp-nfc.py is
being executed.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: sigma_dut DPP/QR AP as chirping Enrollee
Jouni Malinen [Wed, 13 May 2020 14:38:40 +0000 (17:38 +0300)] 
tests: sigma_dut DPP/QR AP as chirping Enrollee

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
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>