]> git.ipfire.org Git - thirdparty/hostap.git/log
thirdparty/hostap.git
7 years agoAdd new WiFi test config attribute to allow WEP/TKIP in HE
Kiran Kumar Lokere [Tue, 27 Feb 2018 02:54:37 +0000 (18:54 -0800)] 
Add new WiFi test config attribute to allow WEP/TKIP in HE

Define a new WiFi test configuration attribute in QCA vendor
command to allow or not to allow WEP/TKIP in HT/VHT/HE mode.
This is used for configuring the testbed device.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoFILS: Check kde more consistently to avoid static analyzer warnings
Jeffin Mammen [Fri, 2 Mar 2018 19:10:38 +0000 (21:10 +0200)] 
FILS: Check kde more consistently to avoid static analyzer warnings

For FILS, __wpa_send_eapol() is called only with the kde != NULL, but a
static analyzer might not understand that. Add an explicit check kde !=
NULL similarly to the other cases going through the kde parameter to
silence such bogus warnings.

Signed-off-by: Jeffin Mammen <jmammen@codeaurora.org>
7 years agoSAE: Debug print group support in the crypto library
Jouni Malinen [Fri, 2 Mar 2018 10:29:30 +0000 (12:29 +0200)] 
SAE: Debug print group support in the crypto library

This makes it easier to understand why "SAE: Failed to select group"
debug entry shows up in cases the selected crypto library does not
support a specific group.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoSAE: Fix potential infinite loop in mismatching PMK case on AP
Jouni Malinen [Fri, 2 Mar 2018 10:13:16 +0000 (12:13 +0200)] 
SAE: Fix potential infinite loop in mismatching PMK case on AP

Commit e61fea6b467bec0702096c795b06195584d32a6c ('SAE: Fix PMKSA caching
behavior in AP mode') modified the PSK fetching loop to not override PMK
in case of SAE with PMKSA caching. However, that commit missed the error
path cases where there is need to break from the loop with exact
negative of the check in the beginning of the loop. This could result in
hitting an infinite loop in hostapd if a station derived a different PMK
value from otherwise successfully completed SAE authentication or if a
STA used a different PMK with a PMKSA caching attempt after a previously
completed successful authentication.

Fix this by adding the matching break condition on SAE AKM within the
loops.

Fixes: e61fea6b467b ("SAE: Fix PMKSA caching behavior in AP mode")
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoReject eap_server_erp hostapd.conf parameter without CONFIG_ERP=y
Jouni Malinen [Wed, 28 Feb 2018 11:09:07 +0000 (13:09 +0200)] 
Reject eap_server_erp hostapd.conf parameter without CONFIG_ERP=y

This provides an explicit error report if runtime configuration is not
valid and ERP server functionality cannot be used.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agowpadebug: Improve QR Code scanning with zxing
Jouni Malinen [Fri, 23 Feb 2018 14:29:05 +0000 (16:29 +0200)] 
wpadebug: Improve QR Code scanning with zxing

Set SCAN_MODE to accept only QR Codes and close the scanner more
reliably after a successfully scanned QR Code.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agowpadebug: Add activity to select method for QR Code scanning
Anurag Das [Fri, 23 Feb 2018 10:14:02 +0000 (15:44 +0530)] 
wpadebug: Add activity to select method for QR Code scanning

Add QrCodeReadActivity that makes a decision to select between InputUri
and QrCodeScannerActivity depending on the availability of the camera in
the device.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agowpadebug: Close InputUri activity automatically on DPP URI completion
Jouni Malinen [Thu, 22 Feb 2018 12:40:47 +0000 (14:40 +0200)] 
wpadebug: Close InputUri activity automatically on DPP URI completion

Check the entered text and stop automatically at the end of full DPP
URI.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agowpadebug: Add main screen buttons for QR Code operations
Jouni Malinen [Thu, 22 Feb 2018 12:20:10 +0000 (14:20 +0200)] 
wpadebug: Add main screen buttons for QR Code operations

These can be used for manual testing of the DPP QR Code functionality.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agowpadebug: A dialog activity to input the URI from QR Code Scanner
Anurag Das [Wed, 21 Feb 2018 12:35:33 +0000 (18:05 +0530)] 
wpadebug: A dialog activity to input the URI from QR Code Scanner

This should help to read the URI from the QR Code Scanner's (USB HID
devices instead of USB video device) that decodes the QR Code.
This dialog box provisions the mechanism to enter the decoded
URI code from such hardware devices.

This dialog can be used with:
am start -n w1.fi.wpadebug/w1.fi.wpadebug.InputUri

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agowpadebug: Update default project target to android-22
Jouni Malinen [Thu, 22 Feb 2018 10:22:12 +0000 (12:22 +0200)] 
wpadebug: Update default project target to android-22

This matches the current zxing target level and as such, is more likely
to be installed on devices that build wpadebug.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agotests: Suite B tests with BoringSSL
Jouni Malinen [Fri, 16 Feb 2018 15:15:57 +0000 (17:15 +0200)] 
tests: Suite B tests with BoringSSL

Enable appropriate Suite B test cases with BoringSSL. Currently, this
means enabling only the 192-bit level ECDSA and ECDHE-RSA since
BoringSSL has removed support for DHE and there is no need to support
128-bit level ECDSA anymore.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoBoringSSL: Set appropriate sigalgs for Suite B RSA 3K cases
Jouni Malinen [Mon, 19 Feb 2018 14:37:36 +0000 (16:37 +0200)] 
BoringSSL: Set appropriate sigalgs for Suite B RSA 3K cases

This commit takes care of the sigalg configuration using the relatively
recent SSL_CTX_set_verify_algorithm_prefs() addition from April 2017 to
address the functionality that was already there with OpenSSL using
SSL_set1_sigalgs_list().

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoBoringSSL: Map OpenSSL SUITEB192 cipher into appropriate sigalgs
Jouni Malinen [Mon, 19 Feb 2018 14:25:54 +0000 (16:25 +0200)] 
BoringSSL: Map OpenSSL SUITEB192 cipher into appropriate sigalgs

BoringSSL removed the special OpenSSL cipher suite value "SUITEB192", so
need to map that to the explicit ciphersuite
(ECDHE-ECDSA-AES256-GCM-SHA384), curve (P-384), and sigalg
(SSL_SIGN_ECDSA_SECP384R1_SHA384) to allow 192-bit level Suite B with
ECDSA to be used.

This commit takes care of the sigalg configuration using the relatively
recent SSL_CTX_set_verify_algorithm_prefs() addition from April 2017.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoBoringSSL: Map OpenSSL SUITEB192 cipher into appropriate parameters
Jouni Malinen [Fri, 16 Feb 2018 15:14:16 +0000 (17:14 +0200)] 
BoringSSL: Map OpenSSL SUITEB192 cipher into appropriate parameters

BoringSSL removed the special OpenSSL cipher suite value "SUITEB192", so
need to map that to the explicit ciphersuite
(ECDHE-ECDSA-AES256-GCM-SHA384), curve (P-384), and sigalg
(SSL_SIGN_ECDSA_SECP384R1_SHA384) to allow 192-bit level Suite B with
ECDSA to be used.

This commit takes care of the ciphersuite and curve configuration.
sigalg change is in a separate commit since it requires a newer
BoringSSL API function that may not be available in all builds.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoOpenSSL: Replace SSL_set1_curves_list() with SSL_set1_curves()
Jouni Malinen [Mon, 19 Feb 2018 14:00:19 +0000 (16:00 +0200)] 
OpenSSL: Replace SSL_set1_curves_list() with SSL_set1_curves()

In practice, this does the same thing (i.e., allows only the P-384 curve
to be used), but using an older API function that happens to be
available in some BoringSSL builds while the newer one is not.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agotests: Processing of truncated RSNE fields
Jouni Malinen [Fri, 16 Feb 2018 11:55:38 +0000 (13:55 +0200)] 
tests: Processing of truncated RSNE fields

Verify that truncated RSN Capabilities field and PMKIDCount field get
ignored.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agotests: Fix Permission denied on Fedora
Masashi Honma [Sat, 30 Dec 2017 20:35:28 +0000 (05:35 +0900)] 
tests: Fix Permission denied on Fedora

On Fedora 26, start.sh fails with these error messages.

Failed to connect to wpa_supplicant global interface: /tmp/wpas-wlan0  error: Permission denied
Failed to connect to wpa_supplicant global interface: /tmp/wpas-wlan0  error: Permission denied
...

This is because Fedora 26 uses "wheel" group as administrative group.

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
7 years agoAllow HT40 on 5 GHz channels 165 and 169
Ben Greear [Wed, 3 Jan 2018 18:53:53 +0000 (10:53 -0800)] 
Allow HT40 on 5 GHz channels 165 and 169

India supports 5 GHz channels 169 and 173 now. Enable HT40 across
channels 165 and 169. Leave channel 173 to remain HT20 only.

Signed-off-by: Ben Greear <greearb@candelatech.com>
7 years agonl80211: Use the new NL80211_MFP_OPTIONAL option
Emmanuel Grumbach [Thu, 1 Feb 2018 14:21:57 +0000 (16:21 +0200)] 
nl80211: Use the new NL80211_MFP_OPTIONAL option

Now we can configure the network block so that it allows MFP setting for
the NL80211_CMD_CONNECT command. If the kernel finds an AP that requires
MFP, it'll be able to connect to it.

Note that since NL80211_MFP_OPTIONAL isn't supported for
NL80211_CMD_ASSOCIATE, we need to take the MFP configuration outside
nl80211_connect_common(). In addition, check that
NL80211_EXT_FEATURE_MFP_OPTIONAL is supported, to be backward compatible
with older kernels.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
7 years agowpa_supplicant: Handle port authorized event
Avraham Stern [Sun, 28 Jan 2018 12:45:37 +0000 (14:45 +0200)] 
wpa_supplicant: Handle port authorized event

When the driver indicates that the connection is authorized (i.e., the
4-way handshake was completed by the driver), cancel the EAP
authentication timeout and set the EAP state machine to success state.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
7 years agonl80211: Handle port authorized event
Avraham Stern [Sun, 28 Jan 2018 12:45:36 +0000 (14:45 +0200)] 
nl80211: Handle port authorized event

Indicate that the connection is authorized when receiving a port
authorized event from the driver.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
7 years agodriver: Add port authorized event
Avraham Stern [Sun, 28 Jan 2018 12:45:35 +0000 (14:45 +0200)] 
driver: Add port authorized event

Add an event that indicates that the 4 way handshake was completed by
the driver.

This event is useful for networks that require 802.1X authentication.
The driver can use this event that a new connection is already
authorized (e.g. when the driver used PMKSA caching) and 802.1X
authentication is not required.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
7 years agonl80211: Add API to set the PMK to the driver
Avraham Stern [Sun, 28 Jan 2018 12:45:34 +0000 (14:45 +0200)] 
nl80211: Add API to set the PMK to the driver

Add support for setting the PMK to the driver. This is used for
drivers that support 4-way handshake offload.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
7 years agonl80211: Check 4-way handshake offload support
Eliad Peller [Sun, 28 Jan 2018 12:45:33 +0000 (14:45 +0200)] 
nl80211: Check 4-way handshake offload support

Set the WPA_DRIVER_FLAGS_4WAY_HANDSHAKE flag if the driver indicates
both 4-way handshake PSK and 802.1X support. Currently wpa_supplicant
doesn't distinguish between 4-way handshake for 802.1X and PSK, but
nl80211 API has different capabilities for each one.

Signed-off-by: Eliad Peller <eliadx.peller@intel.com>
Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
7 years agonl80211: Support passing PSK on connect
Eliad Peller [Sun, 28 Jan 2018 12:45:32 +0000 (14:45 +0200)] 
nl80211: Support passing PSK on connect

If the driver advertises WPA_DRIVER_FLAGS_4WAY_HANDSHAKE support, pass
the PSK on connect.

Signed-off-by: Eliad Peller <eliadx.peller@intel.com>
7 years agotests: Add option --dbus for logging D-Bus messages
Vasyl Vavrychuk [Mon, 12 Feb 2018 19:26:10 +0000 (21:26 +0200)] 
tests: Add option --dbus for logging D-Bus messages

Signed-off-by: Vasyl Vavrychuk <vvavrychuk@gmail.com>
7 years agotests: Document building of hostapd_cli for hwsim builds
Vasyl Vavrychuk [Mon, 12 Feb 2018 19:24:10 +0000 (21:24 +0200)] 
tests: Document building of hostapd_cli for hwsim builds

This is used in the tests, too, and was already covered by the build.sh
script, but not this README file.

Signed-off-by: Vasyl Vavrychuk <vvavrychuk@gmail.com>
7 years agowpa_passphrase: Include $(LIBS) for linking
Arkadiusz Drabczyk [Tue, 13 Feb 2018 22:49:08 +0000 (23:49 +0100)] 
wpa_passphrase: Include $(LIBS) for linking

wpa_passphrase requires libcrypto from OpenSSL (or another selected
library). User can set an alternative path to OpenSSL libraries by
defining LIBS at the top of .config but if $(LIBS) is not actually used
wrong libcrypto is used or compilation fails if there is no libcrypto in
the default locations cc is looking for it. It's especially bad for
cross-compilers that fail with 'cannot find -lcrypto' message.

Signed-off-by: Arkadiusz Drabczyk <arkadiusz@drabczyk.org>
7 years agoDPP: Do not include common/dpp.h without CONFIG_DPP=y
Jouni Malinen [Sat, 17 Feb 2018 16:07:43 +0000 (18:07 +0200)] 
DPP: Do not include common/dpp.h without CONFIG_DPP=y

This header file pulls in an OpenSSL header file and as such, should not
be included without CONFIG_DPP=y to avoid bringing in an unnecessary
build dependency on OpenSSL header files.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoDefine host_to_le64() for Windows builds
Jouni Malinen [Sat, 17 Feb 2018 16:04:54 +0000 (18:04 +0200)] 
Define host_to_le64() for Windows builds

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoFix a typo in disassoc_low_ack documentation
Jouni Malinen [Sat, 17 Feb 2018 15:59:27 +0000 (17:59 +0200)] 
Fix a typo in disassoc_low_ack documentation

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agotests: wpa_supplicant AP mode - open network with client isolation
Jouni Malinen [Sat, 17 Feb 2018 15:57:45 +0000 (17:57 +0200)] 
tests: wpa_supplicant AP mode - open network with client isolation

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoAdd ap_isolate configuration option for wpa_supplicant AP mode
Danilo Ravotto [Thu, 1 Feb 2018 11:09:38 +0000 (12:09 +0100)] 
Add ap_isolate configuration option for wpa_supplicant AP mode

Allow client isolation to be configured with ap_isolate inside
wpa_supplicant configuration file.

Signed-off-by: Danilo Ravotto <danilo.ravotto@zirak.it>
7 years agotests: Fix dbus_set_global_properties failure if run twice
Jouni Malinen [Sat, 17 Feb 2018 15:41:57 +0000 (17:41 +0200)] 
tests: Fix dbus_set_global_properties failure if run twice

Clear the model_name parameter back to the default (empty string) at the
beginning and the end of dbus_set_global_properties to avoid failures if
the test case is run multiple times.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agotests: Make dbus_p2p_discovery more robust
Jouni Malinen [Sat, 17 Feb 2018 15:21:05 +0000 (17:21 +0200)] 
tests: Make dbus_p2p_discovery more robust

Ignore any unexpected deviceLost event before the peer devices has been
discovered. This works around issues where the previous test case
terminates before the D-Bus events have been fully delivered. This could
happen, e.g., when running dbus_p2p_discovery twice in a row.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoExtend APF interface for read/write and enable/disable ops
Vamsi Krishna [Fri, 12 Jan 2018 07:12:58 +0000 (12:42 +0530)] 
Extend APF interface for read/write and enable/disable ops

Enhance QCA vendor specific APF interface to support write/read program
and/or data and to enable/disable APF feature.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoOpenSSL: Fix EAP-FAST with OpenSSL 1.1.1-pre1
Jouni Malinen [Wed, 14 Feb 2018 10:40:33 +0000 (12:40 +0200)] 
OpenSSL: Fix EAP-FAST with OpenSSL 1.1.1-pre1

TLS v1.3 needs to be explicitly disabled to allow cipher suite selection
for EAP-FAST to work with OpenSSL builds that include TLS v1.3 support.
Without this, OpenSSL refuses to generate ClientHello due to the cipher
suite list including only ciphers allowed with older versions than TLS
v1.3.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agotests: sigma_dut controlled STA as DPP PKEX responder and error case
Jouni Malinen [Mon, 12 Feb 2018 22:24:50 +0000 (00:24 +0200)] 
tests: sigma_dut controlled STA as DPP PKEX responder and error case

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoOWE: Add testing RSNE for OWE assoc response with driver SME/MLME
Ashok Ponnaiah [Mon, 12 Feb 2018 11:57:12 +0000 (17:27 +0530)] 
OWE: Add testing RSNE for OWE assoc response with driver SME/MLME

Allow RSNE to be overwritten for testing purposes also in the
driver-based SME/MLME case.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoDPP: Use wildcard BSSID in GAS query frames
Jouni Malinen [Sat, 10 Feb 2018 10:42:00 +0000 (12:42 +0200)] 
DPP: Use wildcard BSSID in GAS query frames

Force use of the wildcard BSSID address in GAS query frames with DPP
regardless of how the gas_address3 configuration parameter is set. DPP
specification mandates this and the use of GAS here is really outside
the context of a BSS, so using the wildcard BSSID makes sense even for
the corner case of Configurator running on a known AP (where IEEE 802.11
standard would allow the BSSID of the AP to be used).

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agonl80211: Do not try to add too large NL80211_ATTR_PMK for set/del PMKSA
Jouni Malinen [Sat, 10 Feb 2018 10:16:53 +0000 (12:16 +0200)] 
nl80211: Do not try to add too large NL80211_ATTR_PMK for set/del PMKSA

The current cfg80211 limit for the maximum NL80211_ATTR_PMK length is
48, so anything larger than that will result in the operation completely
failing. Since the PMKSA entries can be used without the PMK for most
purposes (the main use case for PMK currently is offloaded FILS
authentication), try to go ahead by configuring only the PMKID for the
case where 64-octet PMK is needed (which is currently limited to only
DPP with NIST P-521 and brainpoolP512r1 curves). This can fix DPP
connections with drivers that expect to get the PMKID through this
interface while still leaving the actual 4-way handshake for user space.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agonl80211: Print NL80211_CMD_{SET,DEL}_PMKSA failures in debug log
Jouni Malinen [Sat, 10 Feb 2018 10:10:07 +0000 (12:10 +0200)] 
nl80211: Print NL80211_CMD_{SET,DEL}_PMKSA failures in debug log

This makes it easier to notice if the driver operation to manage PMKSA
cache information fails unexpectedly.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agowpadebug: Add support for QR Code scanning and display via zxing
Purushottam Kushwaha [Tue, 30 Jan 2018 15:05:46 +0000 (20:35 +0530)] 
wpadebug: Add support for QR Code scanning and display via zxing

Enhance wpadebug application to support scanning and displaying of QR
codes. This depends on a third-party source: zxing
(https://github.com/zxing/zxing).

Shell command to launch scanner/viewer via wpadebug is:
>adb root
>adb shell

Scanner:
>am start -n w1.fi.wpadebug/w1.fi.wpadebug.QrCodeScannerActivity
Viewer:
>am start -n w1.fi.wpadebug/w1.fi.wpadebug.QrCodeDisplayActivity

QR code string input/output file would be generated in
'/sdcard/wpadebug_qrdata.txt' in the device.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agotests: MAC ACL accept/deny management
Jouni Malinen [Wed, 7 Feb 2018 17:45:32 +0000 (19:45 +0200)] 
tests: MAC ACL accept/deny management

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agohostapd: Dynamic MAC ACL management over control interface
Tamizh chelvam [Thu, 11 Jan 2018 09:59:03 +0000 (15:29 +0530)] 
hostapd: Dynamic MAC ACL management over control interface

Previously, MAC ACL could be modified only through file operations
(modify accept/deny_mac_file and reload it to hostapd). Extend this to
allow MAC ACL to be modified and displayed through new control interface
commands:

ACCEPT_ACL <subcmd> [argument]
DENY_ACL <subcmd> [argument]

subcmd: ADD_MAC <addr>[ VLAN_ID=<id>]|DEL_MAC <addr>|SHOW|CLEAR

Signed-off-by: Tamizh chelvam <tamizhr@codeaurora.org>
7 years agoDPP: Fix GAS query removal race condition on DPP_STOP_LISTEN
Jouni Malinen [Wed, 7 Feb 2018 16:03:58 +0000 (18:03 +0200)] 
DPP: Fix GAS query removal race condition on DPP_STOP_LISTEN

If a DPP_STOP_LISTEN call happens to be received when there is a pending
gas-query radio work that has not yet been started, it was possible for
gas_query_stop() to go through gas_query_done() processing with
gas->work == NULL and that ended up with the pending GAS query getting
freed without removing the pending radio work that hold a reference to
the now freed memory. Fix this by removing the pending non-started radio
work for the GAS query in this specific corner case.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agotests: Make dpp_qr_code_curve_select more robust
Jouni Malinen [Wed, 7 Feb 2018 15:09:20 +0000 (17:09 +0200)] 
tests: Make dpp_qr_code_curve_select more robust

Wait for the configuration exchange to complete before issuing the
DPP_STOP_LISTEN command to avoid confusing sequence of operation between
the ongoing and immediately following DPP exchanges.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agotests: DPP and PKEX on 5 GHz
Jouni Malinen [Wed, 7 Feb 2018 14:58:52 +0000 (16:58 +0200)] 
tests: DPP and PKEX on 5 GHz

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoDPP: PKEX initiation on other bands
Jouni Malinen [Wed, 7 Feb 2018 14:56:43 +0000 (16:56 +0200)] 
DPP: PKEX initiation on other bands

Add support for wpa_supplicant to try to initiate PKEX on 5 GHz and 60
GHz bands in addition to the previously available 2.4 GHz case. If no
response from a peer device is seen on the 2.4 GHz band (channel 6) for
the five attempts, try the other PKEX channels (5 GHz channels 44 and
149; and 60 GHz channel 2) if they are supported and allowed for
initiating radiation.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agotests: Make owe_transition_mode_multi_bss more robust
Jouni Malinen [Wed, 7 Feb 2018 11:45:48 +0000 (13:45 +0200)] 
tests: Make owe_transition_mode_multi_bss more robust

Fix bssid2 value to make scanning more reliable for the second OWE BSS.
In addition, reorder the STA status checks to happen before the data
connectivity check to get more accurate failure reason into the log if
the test case fails.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoieee802_11_mgmt: Handle frame info more consistently
Jouni Malinen [Wed, 7 Feb 2018 10:34:41 +0000 (12:34 +0200)] 
ieee802_11_mgmt: Handle frame info more consistently

Check for the fi parameter to be non-NULL before trying to fetch the
ssi_signal information similarly to how the fi->freq was already
handled. While the meta information is supposed to be available, it
looks like there is at least one corner case where fi == NULL could be
used (Authentication frame reprocessing after RADIUS-based ACL).

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoSAE: Reject request with mismatching PMKID (no PMKSA cache entry)
Ashok Ponnaiah [Wed, 7 Feb 2018 10:16:20 +0000 (12:16 +0200)] 
SAE: Reject request with mismatching PMKID (no PMKSA cache entry)

Reject SAE association request when PMKID is included in the RSNE, but
the corresponding PMKSA is not available in the AP.

Signed-off-by: Ashok Ponnaiah <aponnaia@codeaurora.org>
7 years agoDefine new QCA vendor sub command for wifi test configuration
Kiran Kumar Lokere [Fri, 2 Feb 2018 22:14:34 +0000 (14:14 -0800)] 
Define new QCA vendor sub command for wifi test configuration

Define a new QCA vendor sub command for configuring the device with wifi
test configuration. Add new test config attributes for this sub command
that are used to configure the device for testbed configuration.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agotests: sigma_dut DPP roles incompatible
Jouni Malinen [Tue, 6 Feb 2018 20:07:57 +0000 (22:07 +0200)] 
tests: sigma_dut DPP roles incompatible

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoDPP: Require use of PMF for DPP AKM
Jouni Malinen [Tue, 6 Feb 2018 18:54:55 +0000 (20:54 +0200)] 
DPP: Require use of PMF for DPP AKM

Previously, wpa_supplicant set PMF as optional for the DPP AKM since
there was no clear statement about this requirement in the tech spec.
Now that this requirement has been added, update the implementation to
match. In addition, set ssid->ieee80211w using the actual enum
mfp_options values instead of magic constants to make this a bit more
readable.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agotests: Enable PMF in sigma_dut DPP tests
Jouni Malinen [Tue, 6 Feb 2018 20:07:30 +0000 (22:07 +0200)] 
tests: Enable PMF in sigma_dut DPP tests

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agotests: Use PMF in DPP with legacy PSK/SAE cases
Jouni Malinen [Tue, 6 Feb 2018 18:52:44 +0000 (20:52 +0200)] 
tests: Use PMF in DPP with legacy PSK/SAE cases

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoOWE: Rename function to match use (driver-SME/MLME)
Ashok Ponnaiah [Tue, 6 Feb 2018 18:27:41 +0000 (20:27 +0200)] 
OWE: Rename function to match use (driver-SME/MLME)

This function is used to process a (Re)Association Request frame, so
rename it appropriately to mention assoc_req instead of auth_req.

Signed-off-by: Ashok Ponnaiah <aponnaia@codeaurora.org>
7 years agoOWE: Check for ECDH availability before use (driver-SME/MLME)
Ashok Ponnaiah [Tue, 6 Feb 2018 18:25:41 +0000 (20:25 +0200)] 
OWE: Check for ECDH availability before use (driver-SME/MLME)

Verify that the STA has ECDH data available before trying to use this
data to add the OWE DH Params element.

Signed-off-by: Ashok Ponnaiah <aponnaia@codeaurora.org>
7 years agoOWE: Add RSNE when not using PMKSA caching (driver-SME/MLME)
Ashok Ponnaiah [Tue, 6 Feb 2018 18:22:53 +0000 (20:22 +0200)] 
OWE: Add RSNE when not using PMKSA caching (driver-SME/MLME)

RSNE needs to be added both with and without use of PMKSA caching.

Signed-off-by: Ashok Ponnaiah <aponnaia@codeaurora.org>
7 years agoOWE: Support DH groups 20 and 21 with driver-SME/MLME
Ashok Ponnaiah [Tue, 6 Feb 2018 18:20:22 +0000 (20:20 +0200)] 
OWE: Support DH groups 20 and 21 with driver-SME/MLME

This was already the case with the hostapd-based SME/MLME
implementation, but the OWE DH Param element construction for the
driver-based SME/MLME needed a matching change to set the group
properly.

Signed-off-by: Ashok Ponnaiah <aponnaia@codeaurora.org>
7 years agotests: Run owe test with PMF required
Jouni Malinen [Tue, 6 Feb 2018 16:55:18 +0000 (18:55 +0200)] 
tests: Run owe test with PMF required

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agotests: WPA2-PSK-FT AP with PSK from a file
Jouni Malinen [Sun, 4 Feb 2018 10:40:03 +0000 (12:40 +0200)] 
tests: WPA2-PSK-FT AP with PSK from a file

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agohostapd: Fix wpa_psk_file support for FT-PSK
Michal Kazior [Thu, 1 Feb 2018 11:03:28 +0000 (12:03 +0100)] 
hostapd: Fix wpa_psk_file support for FT-PSK

For FT-PSK sm->xxkey was populated with only the first password on the
linked list (i.e., last matching password in the wpa_psk_file) in
INITPSK. This caused only that password to be recognized and accepted.
All other passwords were not verified properly and subsequently
prevented clients from connecting.

Hostapd would report:

 Jan 30 12:55:44 hostapd: ap0: STA xx:xx:xx:xx:xx:xx WPA: sending 1/4 msg of 4-Way Handshake
 Jan 30 12:55:44 hostapd: ap0: STA xx:xx:xx:xx:xx:xx WPA: received EAPOL-Key frame (2/4 Pairwise)
 Jan 30 12:55:44 hostapd: ap0: STA xx:xx:xx:xx:xx:xx WPA: invalid MIC in msg 2/4 of 4-Way Handshake
 Jan 30 12:55:45 hostapd: ap0: STA xx:xx:xx:xx:xx:xx WPA: EAPOL-Key timeout

Signed-off-by: Michal Kazior <michal@plumewifi.com>
7 years agowpa_supplicant: Fix parsing errors on additional config file
Jouni Malinen [Sun, 4 Feb 2018 10:20:13 +0000 (12:20 +0200)] 
wpa_supplicant: Fix parsing errors on additional config file

If the -I<config> argument is used and the referenced configuration file
cannot be parsed, wpa_config_read() ended up freeing the main
configuration data structure and that resulted in use of freed memory in
such an error case. Fix this by not freeing the main config data and
handling the error case in the caller.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agowpa_supplicant: Free config only if it was allocated in same call
Dmitry Shmidt [Thu, 1 Feb 2018 00:34:54 +0000 (00:34 +0000)] 
wpa_supplicant: Free config only if it was allocated in same call

If option -I:config points to a non-existing file, the the previously
allocated config must not be freed. Avoid use of freed memory in such an
error case by skipping the incorrect freeing operation.

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
7 years agotests: Enable device PS before sending PS-Poll
Adiel Aloni [Tue, 30 Jan 2018 11:10:10 +0000 (13:10 +0200)] 
tests: Enable device PS before sending PS-Poll

Linux kernel commit c9491367b759 ("mac80211: always update the PM state
of a peer on MGMT / DATA frames") enforces the AP to check only
mgmt/data frames PM bit, and to update station's power save accordingly.
When sending only a PS-Poll (control frame) the AP will ignore the PM
bit. As the result, the partial virtual bitmap will not be updated, and
the test ap_open_disconnect_in_ps will fail on tshark check. Since the
test needs only the TIM to be updated, setting PS enabled will send NDP
that will signal that the station is sleeping. Sending PS-Poll to enable
power save is not correct, according to the following standard
statement: "A PS-Poll frame exchange does not necessarily result in an
Ack frame from the AP, so a non-AP STA cannot change power management
mode using a PS-Poll frame."

Signed-off-by: Adiel Aloni <adiel.aloni@intel.com>
7 years agoOWE: Fix association IEs for transition mode open AP connection
Jouni Malinen [Sun, 4 Feb 2018 09:55:01 +0000 (11:55 +0200)] 
OWE: Fix association IEs for transition mode open AP connection

The special case of returning from wpa_supplicant_set_suites() when OWE
transition mode profile is used for an open association did not clear
the wpa_ie buffer length properly. This resulted in trying to use
corrupted IEs in the association request and failed association
(cfg80211 rejects the request or if the request were to go out, the AP
would likely reject it).

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agowpa_cli: Enable add/remove/get vendor elements without P2P
Simon Dinkin [Thu, 1 Feb 2018 15:12:02 +0000 (17:12 +0200)] 
wpa_cli: Enable add/remove/get vendor elements without P2P

This functionality can be used regardless of P2P and should not be under
the ifdef of CONFIG_P2P.

Signed-off-by: Simon Dinkin <simon.dinkin@tandemg.com>
Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
7 years agocommon: Fix the description of wpa_ctrl_request() function
Simon Dinkin [Thu, 1 Feb 2018 15:12:03 +0000 (17:12 +0200)] 
common: Fix the description of wpa_ctrl_request() function

The blocking timeout of this function was changed from 2 seconds to 10
seconds in this commit 1480633f ("Use longer timeout in
wpa_ctrl_request()"), but the description was never changed accordingly.

Signed-off-by: Simon Dinkin <simon.dinkin@tandemg.com>
Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
7 years agoFix compiler issue with CONFIG_TESTING_OPTIONS
David Messer [Wed, 31 Jan 2018 16:01:00 +0000 (11:01 -0500)] 
Fix compiler issue with CONFIG_TESTING_OPTIONS

Use the preprocessor conditional "ifdef" instead of "if" before
CONFIG_TESTING_OPTIONS to prevent an issue on build systems that treat
undefined preprocessor identifiers as an error.

Signed-off-by: David Messer <david.messer@garmin.com>
7 years agoD-Bus: Report error on starting P2P find
Vasyl Vavrychuk [Thu, 1 Feb 2018 12:07:30 +0000 (14:07 +0200)] 
D-Bus: Report error on starting P2P find

Signed-off-by: Vasyl Vavrychuk <vvavrychuk@gmail.com>
7 years agowpa_cli: Fix cred_fields[] declaration
Jouni Malinen [Sat, 3 Feb 2018 10:08:09 +0000 (12:08 +0200)] 
wpa_cli: Fix cred_fields[] declaration

This was supposed to be an array of const-pointers to const-char; not
something duplicating const for char and resulting in compiler warnings
with more recent gcc versions.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoSAE: Support external authentication offload for driver-SME cases
Sunil Dutt [Thu, 1 Feb 2018 11:31:28 +0000 (17:01 +0530)] 
SAE: Support external authentication offload for driver-SME cases

Extend the SME functionality to support the external authentication.
External authentication may be used by the drivers that do not define
separate commands for authentication and association
(~WPA_DRIVER_FLAGS_SME) but rely on wpa_supplicant's SME for the
authentication.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agotests: SAE with connect command
Jouni Malinen [Fri, 2 Feb 2018 17:08:34 +0000 (19:08 +0200)] 
tests: SAE with connect command

This does not really work with mac80211_hwsim due to missing offload
support, but at least some minimal extra code coverage can be achieved.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agonl80211: Create a netlink socket handle for the Connect interface
Sunil Dutt [Thu, 1 Feb 2018 11:22:57 +0000 (16:52 +0530)] 
nl80211: Create a netlink socket handle for the Connect interface

This netlink socket handle owns the connect request and is further used
by the host driver/kernel to request for the external authentication.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agonl80211: Introduce the interface for external authentication
Sunil Dutt [Thu, 1 Feb 2018 07:15:41 +0000 (12:45 +0530)] 
nl80211: Introduce the interface for external authentication

This command/event interface can be used by host drivers that do not
define separate commands for authentication and association but rely on
wpa_supplicant for the authentication (SAE) processing.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoAdd new QCA vendor commands for thermal shutdown
Guisen Yang [Thu, 1 Feb 2018 09:05:19 +0000 (17:05 +0800)] 
Add new QCA vendor commands for thermal shutdown

Add new QCA vendor commands and attributes to get thermal information
and send thermal shutdown related commands. Indicates the driver to
enter the power saving mode or resume from the power saving mode based
on the given temperature and thresholds.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoSync with mac80211-next.git include/uapi/linux/nl80211.h
Jouni Malinen [Fri, 2 Feb 2018 16:34:14 +0000 (18:34 +0200)] 
Sync with mac80211-next.git include/uapi/linux/nl80211.h

This brings in nl80211 definitions as of 2018-01-31.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoOWE: Use PMKSA caching if available with driver AP MLME
Ashok Ponnaiah [Tue, 30 Jan 2018 11:24:39 +0000 (16:54 +0530)] 
OWE: Use PMKSA caching if available with driver AP MLME

If a matching PMKSA cache entry is present for an OWE client, use it and
do not go through DH while processing Association Rquest frame.
Association Response frame will identify the PMKID in such a case and DH
parameters won't be present.

Signed-off-by: Ashok Ponnaiah <aponnaia@codeaurora.org>
7 years agoOWE: Handle unsupported finite cyclic group with driver MLME
Ashok Ponnaiah [Tue, 30 Jan 2018 11:21:12 +0000 (16:51 +0530)] 
OWE: Handle unsupported finite cyclic group with driver MLME

Handle OWE unsupported finite cyclic group in (Re)Association Request
frame when not using the hostapd SME/MLME.

Signed-off-by: Ashok Ponnaiah <aponnaia@codeaurora.org>
7 years agoatheros: Send correct SSID length to the driver
Ashok Ponnaiah [Tue, 30 Jan 2018 10:13:57 +0000 (15:43 +0530)] 
atheros: Send correct SSID length to the driver

Send the exact SSID length to the driver by removing the legacy +1
padding.

Signed-off-by: Ashok Ponnaiah <aponnaia@codeaurora.org>
7 years agonl80211: Add DPP and OWE AKM selectors to CONNECT/ASSOC request
Srinivas Dasari [Tue, 30 Jan 2018 07:12:46 +0000 (12:42 +0530)] 
nl80211: Add DPP and OWE AKM selectors to CONNECT/ASSOC request

This is needed to support drivers that use NL80211_ATTR_AKM_SUITES.

Signed-off-by: Srinivas Dasari <dasaris@codeaurora.org>
7 years agotests: Update DPP PKEX test vector parameters to match new tech spec
Jouni Malinen [Tue, 30 Jan 2018 16:28:24 +0000 (18:28 +0200)] 
tests: Update DPP PKEX test vector parameters to match new tech spec

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agotests: Make dpp_pkex_test_vector parameters clearer
Jouni Malinen [Tue, 30 Jan 2018 16:21:37 +0000 (18:21 +0200)] 
tests: Make dpp_pkex_test_vector parameters clearer

This makes it a bit clearer to see which parameters need to be modified
if the test vector needs to be recreated based on new values.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoExtend QCA vendor NDP params to support schedule update indication
Subhani Shaik [Thu, 25 Jan 2018 22:31:21 +0000 (14:31 -0800)] 
Extend QCA vendor NDP params to support schedule update indication

Add additional NDP attributes and NDP subcommand value which is
provided as part of schedule update indication from driver/firmware
to HAL.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoUpdate QCA vendor commands to match ASOP
Subhani Shaik [Fri, 19 Jan 2018 01:49:37 +0000 (17:49 -0800)] 
Update QCA vendor commands to match ASOP

This updates QCA vendor command and attribute definitions to match AOSP.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoOWE: Transition mode with non-AP-MLME
Ashok Ponnaiah [Tue, 16 Jan 2018 09:03:14 +0000 (14:33 +0530)] 
OWE: Transition mode with non-AP-MLME

Add OWE Transition IE in build_ap_extra() ies to support drivers that do
not use hostapd MLME.

Signed-off-by: Ashok Ponnaiah <aponnaia@codeaurora.org>
7 years agohostapd: Send broadcast Public Action frame with wildcard BSSID address
Ashok Ponnaiah [Mon, 29 Jan 2018 16:11:03 +0000 (18:11 +0200)] 
hostapd: Send broadcast Public Action frame with wildcard BSSID address

Send Public Action frames with wildcard BSSID when destination was
broadcast address. This is required for DPP PKEX where the recipients
may drop the frames received with different BSSID than the wildcard
address or the current BSSID.

Signed-off-by: Ashok Ponnaiah <aponnaia@codeaurora.org>
7 years agotests: DPP using externally generated bootstrapping keys
Jouni Malinen [Mon, 29 Jan 2018 11:23:19 +0000 (13:23 +0200)] 
tests: DPP using externally generated bootstrapping keys

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoDPP: Update PKEX role-specific points
Jouni Malinen [Fri, 26 Jan 2018 15:54:49 +0000 (17:54 +0200)] 
DPP: Update PKEX role-specific points

The y coordinates for some of these PKEX role-specific points were
changed in the PKEX specification, so update the implementation to
match.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoAdd QCA vendor command and attributes for MSDU queue depth threshold
Venkateswara Swamy Bandaru [Mon, 8 Jan 2018 08:23:59 +0000 (13:53 +0530)] 
Add QCA vendor command and attributes for MSDU queue depth threshold

This allow MSDU queue depth threshold in target to be set per peer per
TID. This command contains MAC address, TID, update mask, and threshold
values.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoFILS: Fix extended capability bit setting for FILS in AP mode
Jouni Malinen [Sun, 21 Jan 2018 22:07:44 +0000 (00:07 +0200)] 
FILS: Fix extended capability bit setting for FILS in AP mode

FILS capability bit setting could have ended up setting boths biths 72
(correct) and 64 (incorrect; part of Max Number of MSDUs In A-MSDU). Fix
this by adding the missing break to the switch statement.

Fixed: f55acd909e37 ("FILS: Set FILS Capability bit in management frames from AP")
Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoEAP-SIM/AKA: Separate identity for MK derivation
Jouni Malinen [Fri, 8 Dec 2017 15:05:40 +0000 (17:05 +0200)] 
EAP-SIM/AKA: Separate identity for MK derivation

This allows a separate configuration parameter (imsi_identity) to be
used in EAP-SIM/AKA/AKA' profiles to override the identity used in MK
derivation for the case where the identity is expected to be from the
last AT_IDENTITY attribute (or EAP-Response/Identity if AT_IDENTITY was
not used). This may be needed to avoid sending out an unprotected
permanent identity information over-the-air and if the EAP-SIM/AKA
server ends up using a value based on the real IMSI during the internal
key derivation operation (that does not expose the data to others).

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoDPP: Get rid of compiler warnings on signed/unsigned comparison
Jouni Malinen [Sun, 21 Jan 2018 09:24:33 +0000 (11:24 +0200)] 
DPP: Get rid of compiler warnings on signed/unsigned comparison

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoDPP: Track M.x/N.x/L.x availability for ke derivation
Jouni Malinen [Sat, 13 Jan 2018 02:12:46 +0000 (04:12 +0200)] 
DPP: Track M.x/N.x/L.x availability for ke derivation

This prevents an issue where duplicated Authentication Response frame
could have resulted in deriving a new ke value after M.x had already
been cleared. This would result in the following configuration exchange
failing. This could happen since many driver do not filter out
retransmitted Public Action frames and link layer. Furthermore, this
could have been used as a denial-of-service attack agains the DPP
exchange.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agotests: OWE with PMF required and with open network selection
Jouni Malinen [Sat, 13 Jan 2018 01:57:40 +0000 (03:57 +0200)] 
tests: OWE with PMF required and with open network selection

Verify that PMF can be marked required OWE networks and verify that a
station in transition mode can connect to an open network.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoOWE: Allow station in transition mode to connect to an open BSS
Jouni Malinen [Sat, 13 Jan 2018 01:56:26 +0000 (03:56 +0200)] 
OWE: Allow station in transition mode to connect to an open BSS

If the OWE network profile matches an open network which does not
advertise OWE BSS, allow open connection. The new owe_only=1 network
profile parameter can be used to disable this transition mode and
enforce connection only with OWE networks.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoExtend NUD Stats to collect the data packet statistics
Sunil Dutt [Thu, 21 Dec 2017 12:08:01 +0000 (17:38 +0530)] 
Extend NUD Stats to collect the data packet statistics

This commit extends the existing QCA vendor specific NUD_STATS_GET/SET
interface to also collect the statistics of the data packets. The
intention here is to get more comprehensive information to detect the
network unreachability.

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