]> git.ipfire.org Git - thirdparty/hostap.git/log
thirdparty/hostap.git
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>
7 years agotests: Add the EC root CA private keys to repository
Jouni Malinen [Fri, 12 Jan 2018 20:42:23 +0000 (22:42 +0200)] 
tests: Add the EC root CA private keys to repository

These were forgotten from the initial commit adding the EC PKI.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agotests: Suite B 192-bit RSA validation with 2048-bit client cert
Jouni Malinen [Fri, 12 Jan 2018 20:40:55 +0000 (22:40 +0200)] 
tests: Suite B 192-bit RSA validation with 2048-bit client cert

Verify that unexpected 2048-bit RSA client certificate gets rejected by
the RADIUS server if the server is configured to use Suite B at 192-bit
level.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoCopy WLAN-Reason-Code value from Access-Reject to Deauthentication
Jouni Malinen [Fri, 12 Jan 2018 18:55:33 +0000 (20:55 +0200)] 
Copy WLAN-Reason-Code value from Access-Reject to Deauthentication

This makes hostapd use the WLAN-Reason-Code value from Access-Reject
when disconnecting a station due to IEEE 802.1X authentication failure.
If the RADIUS server does not include this attribute, the default value
23 (IEEE 802.1X authentication failed) is used. That value was the
previously hardcoded reason code.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoRADIUS: Add WLAN-Reason-Code attribute to Access-Reject
Jouni Malinen [Fri, 12 Jan 2018 18:45:12 +0000 (20:45 +0200)] 
RADIUS: Add WLAN-Reason-Code attribute to Access-Reject

Make the RADIUS server in hostapd add WLAN-Reason-Code attribute to all
Access-Reject messages generated based on EAP-Failure from the EAP
server. For now, the reason code value is set to 23 (IEEE 802.1X
authentication failed). This can be extending in future commits to cover
addition failure reasons.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agotests: Suite B 192-bit validation with p256 client cert
Jouni Malinen [Fri, 12 Jan 2018 18:30:07 +0000 (20:30 +0200)] 
tests: Suite B 192-bit validation with p256 client cert

Verify that unexpected p256 client certificate gets rejected if the
server is configured to use Suite B at 192-bit level.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoHS 2.0: Set appropriate permission(s) for cert file/folders on Android
Purushottam Kushwaha [Wed, 27 Dec 2017 10:57:59 +0000 (16:27 +0530)] 
HS 2.0: Set appropriate permission(s) for cert file/folders on Android

This commit adds additional permission to 'SP' and 'Cert' folders
which is needed to copy certificates from Cert to SP. Additionally,
this associates AID_WIFI group id with these folders.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agotests: Update ap_wpa2_eap_assoc_rsn to match implementation change
Jouni Malinen [Fri, 12 Jan 2018 00:08:39 +0000 (02:08 +0200)] 
tests: Update ap_wpa2_eap_assoc_rsn to match implementation change

This covers the new status code for group management cipher mismatch.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoReplace RSNE group key management mismatch status/reason codes
Jouni Malinen [Thu, 11 Jan 2018 23:12:00 +0000 (01:12 +0200)] 
Replace RSNE group key management mismatch status/reason codes

Use "cipher out of policy" value instead of invalid group cipher (which
is for the group data frame cipher) and management frame policy
violation (which is used for MFPC/MFPR mismatch).

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoAdd QCA vendor command to get the WLAN MAC information
Sunil Dutt [Thu, 21 Dec 2017 09:30:29 +0000 (15:00 +0530)] 
Add QCA vendor command to get the WLAN MAC information

This commit introduces a QCA vendor command that provides the current
information of WLAN hardware MAC and its associated WLAN netdev
interfaces.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agotests: sigma_dut Suite B tests to not explicitly set PMF
Jouni Malinen [Thu, 11 Jan 2018 18:21:48 +0000 (20:21 +0200)] 
tests: sigma_dut Suite B tests to not explicitly set PMF

PMF is supposed to be enabled automatically in sigma_dut, so remove
the explicit argument to do so from the commands.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agotests: WPA2-PSK AP and association request RSN IE with PMKID
Jouni Malinen [Thu, 11 Jan 2018 00:24:52 +0000 (02:24 +0200)] 
tests: WPA2-PSK AP and association request RSN IE with PMKID

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoDPP: Report reception of Config Request to upper layers
Jouni Malinen [Wed, 10 Jan 2018 20:14:22 +0000 (22:14 +0200)] 
DPP: Report reception of Config Request to upper layers

This is mainly for protocol testing purposes.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agotests: Use longer timeout in sigma_dut_dpp_proto_initiator
Jouni Malinen [Wed, 10 Jan 2018 20:13:48 +0000 (22:13 +0200)] 
tests: Use longer timeout in sigma_dut_dpp_proto_initiator

This is needed to be ready for a sigma_dut change to wait for an extra
frame RX event.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agotests: sigma_dut sta_scan_bss
Jouni Malinen [Wed, 10 Jan 2018 15:50:43 +0000 (17:50 +0200)] 
tests: sigma_dut sta_scan_bss

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agotests: sigma_dut with alternative OWE transition mode configuration
Jouni Malinen [Wed, 10 Jan 2018 15:09:50 +0000 (17:09 +0200)] 
tests: sigma_dut with alternative OWE transition mode configuration

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agotests: sigma_dut and new DPP config index values
Jouni Malinen [Tue, 9 Jan 2018 19:22:25 +0000 (21:22 +0200)] 
tests: sigma_dut and new DPP config index values

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agotests: DPP QR Code and hostapd as initiator (offchannel)
Jouni Malinen [Mon, 8 Jan 2018 03:21:49 +0000 (05:21 +0200)] 
tests: DPP QR Code and hostapd as initiator (offchannel)

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoDPP: Authentication exchange retries and channel iteration in hostapd
Jouni Malinen [Mon, 8 Jan 2018 03:19:05 +0000 (05:19 +0200)] 
DPP: Authentication exchange retries and channel iteration in hostapd

This extends hostapd with previoiusly implemented wpa_supplicant
functionality to retry DPP Authentication Request/Response and to
iterate over possible negotiation channels.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoReport offchannel RX frame frequency to hostapd
Jouni Malinen [Mon, 8 Jan 2018 01:37:48 +0000 (03:37 +0200)] 
Report offchannel RX frame frequency to hostapd

Not all code paths for management frame RX reporting delivered the
correct frequency for offchannel RX cases. This is needed mainly for
Public Action frame processing in some special cases where AP is
operating, but an exchange is done on a non-operational channel. For
example, DPP Initiator role may need to do this.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agotests: Enable and require PMF in SAE and OWE test cases with sigma_dut
Jouni Malinen [Thu, 4 Jan 2018 15:06:40 +0000 (17:06 +0200)] 
tests: Enable and require PMF in SAE and OWE test cases with sigma_dut

All SAE and OWE associations are expected to require PMF to be
negotiated, so enable or require PMF in AP and STA configurations
accordingly to match the new sigma_dut behavior.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoGnuTLS: Add option to build with libnettle instead of libgcrypt
Jouni Malinen [Fri, 29 Dec 2017 15:11:21 +0000 (17:11 +0200)] 
GnuTLS: Add option to build with libnettle instead of libgcrypt

GnuTLS-based builds can now be done using either libnettle or libgcrypt
for crypto functionality:

CONFIG_TLS=gnutls
CONFIG_CRYPTO=nettle

CONFIG_TLS=gnutls
CONFIG_CRYPTO=gnutls

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agotests: GnuTLS configuration of intermediate CA certificate
Jouni Malinen [Fri, 29 Dec 2017 10:01:22 +0000 (12:01 +0200)] 
tests: GnuTLS configuration of intermediate CA certificate

GnuTLS seems to require the intermediate CA certificate to be included
both in the ca_cert and client_cert file for the cases of server and
client certificates using different intermediate CA certificates. Use
the user_and_ica.pem file with GnuTLS builds and reorder the
certificates in that file to make this work with GnuTLS.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agotests: Enable Suite B test cases with GnuTLS
Jouni Malinen [Thu, 28 Dec 2017 16:48:23 +0000 (18:48 +0200)] 
tests: Enable Suite B test cases with GnuTLS

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agotests: Speed up suite_b_192_rsa_insufficient_dh in failure case
Jouni Malinen [Thu, 28 Dec 2017 18:26:57 +0000 (20:26 +0200)] 
tests: Speed up suite_b_192_rsa_insufficient_dh in failure case

Check for unexpected connection to avoid timeout on TLS alert event if
the implementation does not check DH key size at all.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoGnuTLS: Suite B validation
Jouni Malinen [Thu, 28 Dec 2017 16:46:28 +0000 (18:46 +0200)] 
GnuTLS: Suite B validation

This allows OpenSSL-style configuration of Suite B parameters to be used
in the wpa_supplicant network profile. 128-bit and 192-bit level
requirements for ECDHE-ECDSA cases are supported. RSA >=3K case is
enforced using GnuTLS %PROFILE_HIGH special priority string keyword.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoGnuTLS: Add support for disabling TLS versions
Jouni Malinen [Thu, 28 Dec 2017 16:03:29 +0000 (18:03 +0200)] 
GnuTLS: Add support for disabling TLS versions

This extends GnuTLS support for tls_disable_v1_{0,1,2}=1 flags in the
phase1 network profile parameter in wpa_supplicant.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoGnuTLS: Implement tls_get_cipher()
Jouni Malinen [Thu, 28 Dec 2017 15:41:20 +0000 (17:41 +0200)] 
GnuTLS: Implement tls_get_cipher()

Provide OpenSSL-style name for the negotiated cipher suite.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoGnuTLS: Make debug prints clearer for cert/key parsing
Jouni Malinen [Thu, 28 Dec 2017 11:18:15 +0000 (13:18 +0200)] 
GnuTLS: Make debug prints clearer for cert/key parsing

Indicate more clearly when the parsing succeeds to avoid ending the
debug prints with various internal GnuTLS internal error messages even
when the parsing actually succeeded in the end.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agotests: Skip eap_tls_pkcs8_pkcs5_v15 with GnuTLS
Jouni Malinen [Thu, 28 Dec 2017 11:02:04 +0000 (13:02 +0200)] 
tests: Skip eap_tls_pkcs8_pkcs5_v15 with GnuTLS

It looks like this private key format is not supported in GnuTLS (tested
with version 3.4.10).

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agotests: Fix wpas_config_file with non-mesh and non-SAE builds
Jouni Malinen [Thu, 28 Dec 2017 10:57:47 +0000 (12:57 +0200)] 
tests: Fix wpas_config_file with non-mesh and non-SAE builds

Check wpa_supplicant capabilities before testing mesh and SAE
parameters.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agotests: Fix gas_anqp_overrides with non-FILS builds
Jouni Malinen [Thu, 28 Dec 2017 10:45:59 +0000 (12:45 +0200)] 
tests: Fix gas_anqp_overrides with non-FILS builds

Need to ignore missing RX-ANQP event for the FILS Realm Info if
wpa_supplicant build does not include FILS support.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoGnuTLS: Add TEST_FAIL() to crypto routines for testing purposes
Jouni Malinen [Thu, 28 Dec 2017 10:33:02 +0000 (12:33 +0200)] 
GnuTLS: Add TEST_FAIL() to crypto routines for testing purposes

This allows number of hwsim test cases for local error conditions to be
executed with GnuTLS-based builds.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoGnuTLS: Implement tls_get_version()
Jouni Malinen [Wed, 27 Dec 2017 22:29:18 +0000 (00:29 +0200)] 
GnuTLS: Implement tls_get_version()

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agotests: Skip sigma_dut tests for SAE/DPP based on build capabilities
Jouni Malinen [Wed, 27 Dec 2017 22:16:53 +0000 (00:16 +0200)] 
tests: Skip sigma_dut tests for SAE/DPP based on build capabilities

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoGnuTLS: Implement HMAC functions using libgcrypt
Jouni Malinen [Wed, 27 Dec 2017 21:35:26 +0000 (23:35 +0200)] 
GnuTLS: Implement HMAC functions using libgcrypt

Replace the internal HMAC MD5, SHA-1, and SHA256 implementations with
the ones from libgcrypt and also add the SHA384 and SHA512 versions.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoGnuTLS: Implement sha{256,384,512}_vector() using libgcrypt
Jouni Malinen [Wed, 27 Dec 2017 21:19:32 +0000 (23:19 +0200)] 
GnuTLS: Implement sha{256,384,512}_vector() using libgcrypt

Replace the internal SHA256 implementation with the one from libgcrypt
and also add the SHA384 and SHA512 versions.

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