]> git.ipfire.org Git - thirdparty/hostap.git/log
thirdparty/hostap.git
5 years agoFT: Do not expose GTK/IGTK in FT Reassociation Response frame in OSEN
Jouni Malinen [Fri, 29 May 2020 18:23:09 +0000 (21:23 +0300)] 
FT: Do not expose GTK/IGTK in FT Reassociation Response frame in OSEN

Do not include the actual GTK/IGTK value in FT protocol cases in OSEN or
with DGAF disabled (Hotspot 2.0). This was already the case for the
EAPOL-Key cases of providing GTK/IGTK, but the FT protocol case was
missed. OSEN cannot really use FT, so that part is not impacted, but it
would be possible to enable FT in a Hotspot 2.0 network that has DGAF
disabled.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoWNM: Do not expose GTK/IGTK in WNM Sleep Mode Response frame in OSEN
Jouni Malinen [Fri, 29 May 2020 18:04:40 +0000 (21:04 +0300)] 
WNM: Do not expose GTK/IGTK in WNM Sleep Mode Response frame in OSEN

Do not include the actual GTK/IGTK value in WNM Sleep Mode Response
frame if WNM Sleep Mode is used in OSEN or in a network where use of GTK
is disabled. This was already the case for the EAPOL-Key cases of
providing GTK/IGTK, but the WNM Sleep Mode exit case was missed.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: HS 2.0 deauthentication request PMF misbehavior (+HTC)
Jouni Malinen [Fri, 29 May 2020 17:55:18 +0000 (20:55 +0300)] 
tests: HS 2.0 deauthentication request PMF misbehavior (+HTC)

Verify driver/mac80211 behavior with HT Control field in Public Action
frames.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: OWE transition mode with owe_transition_ifname
Jouni Malinen [Tue, 26 May 2020 13:15:45 +0000 (16:15 +0300)] 
tests: OWE transition mode with owe_transition_ifname

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoOWE: Skip beacon update of transition BSS if it is not yet enabled
Hu Wang [Fri, 15 May 2020 06:20:32 +0000 (14:20 +0800)] 
OWE: Skip beacon update of transition BSS if it is not yet enabled

When a single hostapd process manages both the OWE and open BSS for
transition mode, owe_transition_ifname can be used to clone the
transition mode information (i.e., BSSID/SSID) automatically. When both
BSSs use ACS, the completion of ACS on the 1st BSS sets state to
HAPD_IFACE_ENABLED and the OWE transition mode information is updated
for all the other BSSs. However, the 2nd BSS is still in the ACS phase
and the beacon update messes up the state for AP startup and prevents
proper ACS competion.

If 2nd BSS is not yet enabled (e.g., in ACS), skip beacon update and
defer OWE transition information cloning until the BSS is enabled.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: Enforce proper OCV behavior for SA Query Response from STA
Jouni Malinen [Tue, 26 May 2020 09:31:16 +0000 (12:31 +0300)] 
tests: Enforce proper OCV behavior for SA Query Response from STA

Now that there is a pending mac80211 patch ("mac80211: allow SA-QUERY
processing in userspace") to allow wpa_supplicant to take care of SA
Query Request processing, start enforcing correct behavior for this in
ocv_sa_query and wpa2_ocv_sta_override_sa_query_resp.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoAdd a vendor attribute to get OEM data
Sachin Ahuja [Mon, 18 May 2020 14:30:18 +0000 (20:00 +0530)] 
Add a vendor attribute to get OEM data

Add an attribute QCA_WLAN_VENDOR_ATTR_OEM_DATA_RESPONSE_EXPECTED
to get the response for the queried data.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoVendor attributes for configuring LDPC, TX STBC, RX STBC
Sunil Dutt [Wed, 6 May 2020 19:46:35 +0000 (01:16 +0530)] 
Vendor attributes for configuring LDPC, TX STBC, RX STBC

Defines the attributes in SET(GET)_WIFI_CONFIGURATION to dynamically
configure capabilities: LDPC, TX STBC, RX STBC.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: sigma_dut controlled STA using OCV
Jouni Malinen [Mon, 25 May 2020 20:24:55 +0000 (23:24 +0300)] 
tests: sigma_dut controlled STA using OCV

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: OCV and post-CSA SA Query error cases
Jouni Malinen [Mon, 25 May 2020 18:54:49 +0000 (21:54 +0300)] 
tests: OCV and post-CSA SA Query error cases

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoOCV: Disconnect STAs that do not use SA Query after CSA
Jouni Malinen [Mon, 25 May 2020 18:55:49 +0000 (21:55 +0300)] 
OCV: Disconnect STAs that do not use SA Query after CSA

Verify that all associated STAs that claim support for OCV initiate an
SA Query after CSA. If no SA Query is seen within 15 seconds,
deauthenticate the STA.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoOCV: Report validation errors for (Re)Association Request frames
Jouni Malinen [Mon, 25 May 2020 17:46:32 +0000 (20:46 +0300)] 
OCV: Report validation errors for (Re)Association Request frames

Add the OCV-FAILURE control interface event to notify upper layers of
OCV validation issues in FT and FILS (Re)Association Request frames.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: OCV with OCI override on STA
Jouni Malinen [Mon, 25 May 2020 15:32:32 +0000 (18:32 +0300)] 
tests: OCV with OCI override on STA

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoOCV: Report validation errors for EAPOL-Key messages in AP mode
Jouni Malinen [Mon, 25 May 2020 16:08:16 +0000 (19:08 +0300)] 
OCV: Report validation errors for EAPOL-Key messages in AP mode

Add the OCV-FAILURE control interface event to notify upper layers of
OCV validation issues in EAPOL-Key msg 2/4 and group 2/2.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoOCV: Report validation errors for SA Query Request/Response in AP mode
Jouni Malinen [Mon, 25 May 2020 15:41:04 +0000 (18:41 +0300)] 
OCV: Report validation errors for SA Query Request/Response in AP mode

Add a new OCV-FAILURE control interface event to notify upper layers of
OCV validation issues. This commit adds this for SA Query processing in
AP mode.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoOCV: Move "OCV failed" prefix to callers
Jouni Malinen [Mon, 25 May 2020 15:33:00 +0000 (18:33 +0300)] 
OCV: Move "OCV failed" prefix to callers

Make reporting of OCV validation failure reasons more flexible by
removing the fixed prefix from ocv_verify_tx_params() output in
ocv_errorstr so that the caller can use whatever prefix or encapsulation
that is most appropriate for each case.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoOCV: Add support to override channel info OCI element (STA)
Vamsi Krishna [Fri, 8 May 2020 17:59:04 +0000 (23:29 +0530)] 
OCV: Add support to override channel info OCI element (STA)

To support the STA testbed role, the STA has to use specified channel
information in OCI element sent to the AP in EAPOL-Key msg 2/4, SA Query
Request, and SA Query Response frames. Add override parameters to use
the specified channel while populating OCI element in all these frames.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoClear current PMKSA cache selection on association/roam
Jouni Malinen [Mon, 25 May 2020 13:25:50 +0000 (16:25 +0300)] 
Clear current PMKSA cache selection on association/roam

It was possible for the RSN state machine to maintain old PMKSA cache
selection (sm->cur_pmksa) when roaming to another BSS based on
driver-based roaming indication. This could result in mismatching state
and unexpected behavior, e.g., with not generating a Suite B PMKSA cache
entry.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: Suite B using PMKSA caching and roaming
Jouni Malinen [Mon, 25 May 2020 13:20:33 +0000 (16:20 +0300)] 
tests: Suite B using PMKSA caching and roaming

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agowlantest: Fix RSNE check in FT 4-way handshake msg 3/4
Jouni Malinen [Mon, 25 May 2020 10:42:08 +0000 (13:42 +0300)] 
wlantest: Fix RSNE check in FT 4-way handshake msg 3/4

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agowlantest: Validate FT elements in Reassociation Response frame
Jouni Malinen [Sat, 23 May 2020 21:35:13 +0000 (00:35 +0300)] 
wlantest: Validate FT elements in Reassociation Response frame

Verify that RSNE, MDE, and FTE have valid information in FT
Reassociation Response frames. In addition, decrypt GTK, IGTK, and BIGTK
from the frame.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agowlantest: Validate FT elements in Reassociation Request frame
Jouni Malinen [Sat, 23 May 2020 18:44:16 +0000 (21:44 +0300)] 
wlantest: Validate FT elements in Reassociation Request frame

Verify that RSNE, MDE, and FTE have valid information in FT
Reassociation Request frames.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agowlantest: Store PMK-R1 in STA entry
Jouni Malinen [Sat, 23 May 2020 18:43:36 +0000 (21:43 +0300)] 
wlantest: Store PMK-R1 in STA entry

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoDebug print PMK-R0/R1 and PMKR0/R1Name in the helper functions
Jouni Malinen [Sat, 23 May 2020 18:42:45 +0000 (21:42 +0300)] 
Debug print PMK-R0/R1 and PMKR0/R1Name in the helper functions

There is no need to have all callers debug print these separately.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agowlantest: Store PMK-R0 length explicitly
Jouni Malinen [Sat, 23 May 2020 18:24:01 +0000 (21:24 +0300)] 
wlantest: Store PMK-R0 length explicitly

PMK-R0 is not of fixed length, so store its length explicitly.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agowlantest: Handle FT over-the-DS association state update cleanly
Jouni Malinen [Sat, 23 May 2020 18:11:33 +0000 (21:11 +0300)] 
wlantest: Handle FT over-the-DS association state update cleanly

It is expected for the STA entry on the target AP to move directly from
State 1 to State 3 when performing FT over-the-DS (i.e., FT Action
Request/Response frame exchange through the old AP followed by
Reassociation Request/Response frame exchange with the target AP).

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoVendor attributes for ssetting TX A-MSDU and RX A-MSDU parameters
Min Liu [Thu, 7 May 2020 08:20:10 +0000 (16:20 +0800)] 
Vendor attributes for ssetting TX A-MSDU and RX A-MSDU parameters

Define QCA vendor attributes for SET(GET)_WIFI_CONFIGURATION to
dynamically configure capabilities for TX A-MSDU and RX A-MSDU.

Signed-off-by: Min Liu <minliu@codeaurora.org>
5 years agoQCA vendor command for adding and deleting TSPEC
Min Liu [Mon, 13 Apr 2020 13:36:48 +0000 (21:36 +0800)] 
QCA vendor command for adding and deleting TSPEC

Add a QCA vendor subcommand QCA_NL80211_VENDOR_SUBCMD_CONFIG_TSPEC
to add and delete TSPEC in STA mode.
The attributes defined in enum qca_wlan_vendor_attr_config_tspec
are used to encapsulate required information.

Signed-off-by: Min Liu <minliu@codeaurora.org>
5 years agoVendor attributes to configure PMF protection and disassoc Tx for testing
Kiran Kumar Lokere [Fri, 24 Apr 2020 20:15:34 +0000 (13:15 -0700)] 
Vendor attributes to configure PMF protection and disassoc Tx for testing

Add new QCA vendor attributes to configure misbehavior for PMF
protection for Management frames and to inject Disassociation frames.

These attributes are used for testing purposes.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoAdd QCA vendor interface support to configure PHY modes
Vamsi Krishna [Fri, 17 Apr 2020 11:30:34 +0000 (17:00 +0530)] 
Add QCA vendor interface support to configure PHY modes

Add an attribute that can be used with
QCA_NL80211_VENDOR_SUBCMD_SET_WIFI_CONFIGURATION vendor command to
configure different PHY modes to the driver/firmware.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agonl80211: Control the registration for RRM frame with driver_param
Sunil Dutt [Mon, 27 Apr 2020 09:06:16 +0000 (14:36 +0530)] 
nl80211: Control the registration for RRM frame with driver_param

wpa_supplicant registered to process the Radio Measurement Request
frames unconditionally. This would prevent other location based
applications from handling these frames. Enable such a use case by
allowing wpa_supplicant to be configured not to register to process
these frames. This can now be done by adding "no_rrm=1" to the
driver_param configuration parameter.

In addition, wpa_driver_nl80211_init() does not have the provision to
take driver_params. Hence, resubscribe again with cfg80211 when this
driver parameter "no_rrm=1" is set after the initial setup steps.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoHE: Process HE 6 GHz band capab from associating HE STA
Rajkumar Manoharan [Fri, 24 Apr 2020 22:45:41 +0000 (15:45 -0700)] 
HE: Process HE 6 GHz band capab from associating HE STA

Process HE 6 GHz band capabilities in (Re)Association Request frames and
pass the information to the driver.

Signed-off-by: Rajkumar Manoharan <rmanohar@codeaurora.org>
5 years agoHE: Add 6 GHz Band Capabilities element in Beacon and response frames
Rajkumar Manoharan [Fri, 24 Apr 2020 22:45:37 +0000 (15:45 -0700)] 
HE: Add 6 GHz Band Capabilities element in Beacon and response frames

Construct HE 6 GHz Band Capabilities element (IEEE 802.11ax/D6.0,
9.4.2.261) from HT and VHT capabilities and add it to Beacon, Probe
Response, and (Re)Association Response frames when operating on the 6
GHz band.

Signed-off-by: Rajkumar Manoharan <rmanohar@codeaurora.org>
5 years agoHE: Add HE 6 GHz Band Capabilities into ieee802_11_parse_elems()
Rajkumar Manoharan [Fri, 24 Apr 2020 22:45:36 +0000 (15:45 -0700)] 
HE: Add HE 6 GHz Band Capabilities into ieee802_11_parse_elems()

Handle 6 GHz band capability element parsing for association.

Signed-off-by: Rajkumar Manoharan <rmanohar@codeaurora.org>
5 years agoHE: Remove VHT Operation Information from HE Operation element
Rajkumar Manoharan [Fri, 24 Apr 2020 22:45:35 +0000 (15:45 -0700)] 
HE: Remove VHT Operation Information from HE Operation element

The VHT Operation Information subfield is conditonally present, so do
not hardcoded it in struct ieee80211_he_operation. These members of the
struct are not currently used, so these can be removed without impact to
functionality.

Signed-off-by: Rajkumar Manoharan <rmanohar@codeaurora.org>
5 years agoHE: Define 6 GHz band capability elements
Rajkumar Manoharan [Fri, 24 Apr 2020 22:45:34 +0000 (15:45 -0700)] 
HE: Define 6 GHz band capability elements

Defines IEEE P802.11ax/D6.0, 9.4.2.261 HE 6 GHz Band Capabilities
element and 6 GHz Operation Information field of HE Operation element
(IEEE P802.11ax/D6.0, Figure 9-787k).

Signed-off-by: Rajkumar Manoharan <rmanohar@codeaurora.org>
5 years agodefconfig: Enable TDLS
Davide Caratti [Fri, 24 Apr 2020 12:43:06 +0000 (14:43 +0200)] 
defconfig: Enable TDLS

Some distros (e.g., Debian and Arch) already build wpa_supplicant with
support for TDLS, and Fedora is about to enable this feature as well.
Set CONFIG_TDLS=y in wpa_supplicant default build configuration.

Signed-off-by: Davide Caratti <davide.caratti@gmail.com>
5 years agotests: Use test-name.* style files more consistently
Jouni Malinen [Sun, 17 May 2020 13:03:29 +0000 (16:03 +0300)] 
tests: Use test-name.* style files more consistently

Use params['prefix'] to build the file names for dynamically generated
files.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: Handle unexpected get_driver_status_field() error
Jouni Malinen [Sun, 17 May 2020 10:04:26 +0000 (13:04 +0300)] 
tests: Handle unexpected get_driver_status_field() error

If the current country code cannot be fetched, do not try to report the
current value in the log since that will result in TypeError exception.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: Avoid hapd reference before assignment on error cases
Jouni Malinen [Sun, 17 May 2020 09:59:53 +0000 (12:59 +0300)] 
tests: Avoid hapd reference before assignment on error cases

Couple of VHT test cases missed explicit setting of hapd to None before
trying to start hostapd. Add those to avoid unexpected exceptions in
case hostapd start fails.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: Add description for test cases that were missing it
Jouni Malinen [Sat, 16 May 2020 22:29:40 +0000 (01:29 +0300)] 
tests: Add description for test cases that were missing it

All test_*() functions are expected to use __doc__ to provide a short
description of the test case.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: Unify ignore_old_scan_res resetting
Jouni Malinen [Sat, 16 May 2020 22:25:11 +0000 (01:25 +0300)] 
tests: Unify ignore_old_scan_res resetting

Add a decorator that clears ignore_old_scan_res parameter value instead
of doing this with try/finally in large number of test cases.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: Unify IPv6 disabling
Johannes Berg [Thu, 7 May 2020 10:47:52 +0000 (12:47 +0200)] 
tests: Unify IPv6 disabling

Add a decorator that disables IPv6 and requires running
under a VM, rather than open-coding that many times.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 years agotests: Fix ACS freqlist testing
Jouni Malinen [Sat, 16 May 2020 21:59:00 +0000 (00:59 +0300)] 
tests: Fix ACS freqlist testing

The freqlist parameter uses comma, not space, separated values. Add
another test case for checking freqlist values that do not use the
preferred channel numbers to make sure the frequency list is actually
used as a constraint for selecting the channel.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoACS: Channel selection based freqlist
neo_jou [Mon, 11 May 2020 07:42:49 +0000 (15:42 +0800)] 
ACS: Channel selection based freqlist

When doing ACS, check freqlist also if it is specified.

Signed-off-by: neojou <neojou@gmail.com>
5 years agotests: Delayed group rekey retransmit test for IGTK
Johannes Berg [Thu, 7 May 2020 08:26:51 +0000 (10:26 +0200)] 
tests: Delayed group rekey retransmit test for IGTK

Add a test for delayed group rekey retransmission that checks that
the IGTK is protected against it by not resetting the IPN replay
counter when reinstalling such a key.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 years agotests: Reset the correct key's PN for group key handshake testing
Johannes Berg [Thu, 7 May 2020 08:26:50 +0000 (10:26 +0200)] 
tests: Reset the correct key's PN for group key handshake testing

While adding support for IGTK and BIGTK here, I tested this without
protections (i.e., with protections removed from both wpa_supplicant and
the driver), and while I got some bad resets on the debugfs values, it
should have failed with "unexpected connectivity".

Fix this to be correct - we need to reset the GTK PN, not the PTK PN in
this test.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 years agotests: Extend debugfs key state reading for IGTK/BIGTK
Johannes Berg [Thu, 7 May 2020 08:26:49 +0000 (10:26 +0200)] 
tests: Extend debugfs key state reading for IGTK/BIGTK

Extend the debugfs read helpers to work with IGTK and BIGTK.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 years agoAdd a helper function for recognizing BIP enum wpa_alg values
Jouni Malinen [Sat, 16 May 2020 21:17:55 +0000 (00:17 +0300)] 
Add a helper function for recognizing BIP enum wpa_alg values

Use a shared wpa_alg_bip() function for this and fix the case in
nl_add_key() to cover all BIP algorithms. That fix does not change any
behavior since the function is not currently used with any BIP
algorithm, but it is better to avoid surprises should it ever be needed
with IGTK.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoRename WPA_ALG_IGTK to use the correct cipher name for BIP
Jouni Malinen [Sat, 16 May 2020 21:11:59 +0000 (00:11 +0300)] 
Rename WPA_ALG_IGTK to use the correct cipher name for BIP

IGTK is the key that is used a BIP cipher. WPA_ALG_IGTK was the
historical name used for this enum value when only the AES-128-CMAC
based BIP algorithm was supported. Rename this to match the style used
with the other BIP options.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agohostapd: Extend RESET_PN for BIGTK
Johannes Berg [Thu, 7 May 2020 08:26:48 +0000 (10:26 +0200)] 
hostapd: Extend RESET_PN for BIGTK

Extend the RESET_PN command to allow resetting the BIGTK PN
for testing.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 years agotests: Replace gtk boolean by keytype in cipher suite tests
Johannes Berg [Thu, 7 May 2020 08:26:47 +0000 (10:26 +0200)] 
tests: Replace gtk boolean by keytype in cipher suite tests

Replace the gtk boolean by a keytype value indicating
GTK or PTK, to be able to extend to other types later.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 years agoFix a typo in a comment
Jouni Malinen [Sat, 16 May 2020 19:12:46 +0000 (22:12 +0300)] 
Fix a typo in a comment

Signed-off-by: Jouni Malinen <j@w1.fi>
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>