]> git.ipfire.org Git - thirdparty/hostap.git/log
thirdparty/hostap.git
7 years agotests: Update FT RRB function OOM paths
Michael Braun [Sun, 2 Apr 2017 12:52:51 +0000 (14:52 +0200)] 
tests: Update FT RRB function OOM paths

Signed-off-by: Michael Braun <michael-dev@fami-braun.de>
7 years agoFT RRB: Add msg replay and msg delay protection
Michael Braun [Sun, 2 Apr 2017 12:52:51 +0000 (14:52 +0200)] 
FT RRB: Add msg replay and msg delay protection

This adds a counter and adds sequence numbering to FT RRB packets. The
sequence number is checked against r0kh/r1kh sequence number cache.

Special attention is needed in case the remote AP reboots and thus loses
its state. I prefer it to recover automatically even without synchronized
clocks. Therefore an identifier called dom is generated randomly along the
initial sequence number. If the dom transmitted does not match or the
sequence number is not in the range currently expected, the sender is asked
for a fresh confirmation of its currently used sequence numbers. The packet
that triggered this is cached and processed again later.

Additionally, in order to ensure freshness, the remote AP includes an
timestamp with its messages. It is then verified that the received
messages are indeed fresh by comparing it to the older timestamps
received and the time elapsed since then. Therefore FT_RRB_TIMESTAMP is
no longer needed.

This assigns new OUI 00:13:74 vendor-specific subtype 0x0001 subtypes:
4 (SEQ_REQ) and 5 (SEQ_RESP).

This breaks backward compatibility, i.e., hostapd needs to be updated
on all APs at the same time to allow FT to remain functional.

Signed-off-by: Michael Braun <michael-dev@fami-braun.de>
7 years agotests: FT using old style key for AP-to-AP protocol
Jouni Malinen [Sat, 15 Apr 2017 09:22:29 +0000 (12:22 +0300)] 
tests: FT using old style key for AP-to-AP protocol

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agotests: Update FT test cases for new RRB message format
Michael Braun [Sun, 2 Apr 2017 12:52:50 +0000 (14:52 +0200)] 
tests: Update FT test cases for new RRB message format

This updates the AP-to-AP keys to the longer form and OOM test case
functions to match the new implementation.

Signed-off-by: Michael Braun <michael-dev@fami-braun.de>
7 years agoFT: New RRB message format
Michael Braun [Sun, 2 Apr 2017 12:52:50 +0000 (14:52 +0200)] 
FT: New RRB message format

Convert FT RRB into a new TLV based format. Use AES-SIV as AEAD cipher
to protect the messages.

This needs at least 32 byte long keys. These can be provided either
by a config file change or letting a KDF derive the 32 byte key used
from the 16 byte key given.

This breaks backward compatibility, i.e., hostapd needs to be updated on
all APs at the same time to allow FT to remain functional.

Signed-off-by: Michael Braun <michael-dev@fami-braun.de>
7 years agoFT: Replace inter-AP protocol with use of OUI Extended Ethertype
Michael Braun [Sun, 2 Apr 2017 12:52:49 +0000 (14:52 +0200)] 
FT: Replace inter-AP protocol with use of OUI Extended Ethertype

Replace the previously used extension of IEEE 802.11 managed Ethertype
89-0d (originally added for Remote Request/Response in IEEE 802.11r)
with Ethertype 88-b7 (OUI Extended EtherType) for FT inter-AP
communication. The new design uses a more properly assigned identifier
for the messages.

This assigns the OUI 00:13:74 vendor-specific subtype 0x0001 for the new
hostapd AP-to-AP communication purposes. Subtypes 1 (PULL), 2 (RESP),
and 3 (PUSH) are also assigned in this commit for the R0KH-R1KH
protocol.

This breaks backward compatibility, i.e., hostapd needs to be updated on
all APs at the same time to allow FT to remain functional.

Signed-off-by: Michael Braun <michael-dev@fami-braun.de>
7 years agotests: Validate kernel behavior in wnm_bss_tm_connect_cmd
Jouni Malinen [Tue, 2 May 2017 14:18:50 +0000 (17:18 +0300)] 
tests: Validate kernel behavior in wnm_bss_tm_connect_cmd

The cfg80211 connect command extension to allow roaming request from
user space while connect was added to the kernel, so uncomment the
previously commented out TODO item to verify this behavior.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoMBO: Fix possible NULL pointer dereference on candidate handling
Pradeep Reddy Potteti [Fri, 28 Apr 2017 10:52:08 +0000 (16:22 +0530)] 
MBO: Fix possible NULL pointer dereference on candidate handling

If the driver provides input on MBO transition candidate handling, the
target value in get_mbo_transition_candidate() can be NULL if the driver
provided BSSID is not found in the wpa_supplicant BSS table. And later
it would be dereferenced. Fix this by adding an explicit check before
dereferencing the pointer.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoERP: Silence static analyzer warning
Jouni Malinen [Mon, 1 May 2017 19:06:53 +0000 (22:06 +0300)] 
ERP: Silence static analyzer warning

The check for erp->keyname_nai within eap_erp_get_key() is apparently
too difficult for some static analyzers to notice. Add an explicit check
for os_strchr() return value being non-NULL to avoid false reports.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoatheros: Get rid of static analyzer warnings on 0-length memcpy
Jouni Malinen [Mon, 1 May 2017 14:45:53 +0000 (17:45 +0300)] 
atheros: Get rid of static analyzer warnings on 0-length memcpy

These functions can potentially be called with ie == NULL and ie_len ==
0. Check explitcitly for the ie == NULL case to avoid confusing
memcpy(dst, NULL, 0) calls.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoEnable CONFIG_WNM=y automatically for CONFIG_MBO=y builds
Jouni Malinen [Mon, 1 May 2017 14:33:10 +0000 (17:33 +0300)] 
Enable CONFIG_WNM=y automatically for CONFIG_MBO=y builds

wpa_supplicant build with MBO enabled failed in CONFIG_WNM=y was not
specified explicitly. Add the WNM dependency automatically to avoid
needing explicit addition in build configuration.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoFix GAS server ifdef block use
Jouni Malinen [Mon, 1 May 2017 14:29:06 +0000 (17:29 +0300)] 
Fix GAS server ifdef block use

Commit 941caed98009104484ca894dd49f87bf23cff091 ('MBO: Add MBO
ANQP-element processing on AP') changed the design by using the
rx_anqp_vendor_specific() function to process all ANQP vendor specific
elements. However, the caller for this was within ifdef CONFIG_HS20
block. Fix this by calling the function even in CONFIG_HS20=y is not
included in the build. This fixes CONFIG_MBO=y builds without
CONFIG_HS20=y.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoFix CONFIG_INTERWORKING=y build without CONFIG_HS20=y
Jouni Malinen [Mon, 1 May 2017 14:24:18 +0000 (17:24 +0300)] 
Fix CONFIG_INTERWORKING=y build without CONFIG_HS20=y

Commit 34f28519027d2504168e109519112c1b12d1fdf6 ('MBO: Parse MBO
ANQP-element on STA') started using the type variable outside
CONFIG_HS20 block, but forgot to remove the ifdef from the variable
declaration.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agotests: Make p2p_service_discovery_peer_not_listening a bit more robust
Jouni Malinen [Sat, 29 Apr 2017 19:40:01 +0000 (22:40 +0300)] 
tests: Make p2p_service_discovery_peer_not_listening a bit more robust

It was apparently possible for the P2P_FIND operation to terminate
before the peer device was found. Increase the timeout to avoid this.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agotests: DISABLE_NETWORK during connection and blacklist behavior
Jouni Malinen [Sat, 29 Apr 2017 15:00:26 +0000 (18:00 +0300)] 
tests: DISABLE_NETWORK during connection and blacklist behavior

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoDo not blacklist the current AP on DISABLE_NETWORK
Sunil Dutt [Mon, 24 Apr 2017 10:01:05 +0000 (15:31 +0530)] 
Do not blacklist the current AP on DISABLE_NETWORK

Disconnection due to DISABLE_NETWORK while being connected was resulting
in the AP getting blacklisted. Avoid this by setting own_disconnect_req
on a disconnect request due to DISABLE_NETWORK similarly to the
SELECT_NETWORK disconnection case.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agotests: HT40 with both plus and minus allowed
Jouni Malinen [Sat, 29 Apr 2017 11:11:17 +0000 (14:11 +0300)] 
tests: HT40 with both plus and minus allowed

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agohostapd: Select a valid secondary channel if both enabled
Peng Xu [Fri, 21 Apr 2017 00:05:25 +0000 (17:05 -0700)] 
hostapd: Select a valid secondary channel if both enabled

When starting AP in HT40 mode and both HT40+ and HT40- options are
specified in hostapd.conf, select a valid secondary channel for the AP
automatically.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoFILS: Specify if FILS HLP was sent in connect
Vidyullatha Kanchanapally [Thu, 20 Apr 2017 12:08:49 +0000 (17:38 +0530)] 
FILS: Specify if FILS HLP was sent in connect

This adds a string "FILS_HLP_SENT" to connect event when HLP is sent
as part of ASSOC/CONNECT request.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoFILS: Add HLP to Connect IEs
Vidyullatha Kanchanapally [Fri, 14 Apr 2017 10:55:30 +0000 (16:25 +0530)] 
FILS: Add HLP to Connect IEs

Add FILS HLP elements to Connect IEs and fragment them if necessary.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoAllocate dynamic memory for connect IEs
Vidyullatha Kanchanapally [Fri, 14 Apr 2017 10:55:30 +0000 (16:25 +0530)] 
Allocate dynamic memory for connect IEs

This is needed to allow new elements (e.g., FILS HLP request) to be
added.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoPAE: Silence static analyzer warning about NULL pointer dereference
Ranga Ravuri [Mon, 24 Apr 2017 08:38:10 +0000 (11:38 +0300)] 
PAE: Silence static analyzer warning about NULL pointer dereference

ieee802_1x_kay_move_live_peer() did not check
ieee802_1x_kay_get_potential_peer() result explicitly and a static
analyzer reported a warning about the possible NULL result. This cannot
really happen in practice since the only caller of
ieee802_1x_kay_move_live_peer() verifies that the specific peer entry is
available. Anyway, it is easy to silence the false warning by adding an
explicit check here and cover any other potential case if another caller
is added.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoAdd control interface command to enable/disable roaming
Ashwini Patil [Mon, 10 Apr 2017 06:58:49 +0000 (12:28 +0530)] 
Add control interface command to enable/disable roaming

The new "SET roaming <0/1>" command can now be used to control
driver-based roaming.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoFILS: Handle authentication/association in partial driver AP SME
Jeffin Mammen [Fri, 21 Apr 2017 15:42:00 +0000 (18:42 +0300)] 
FILS: Handle authentication/association in partial driver AP SME

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoFILS: Make handle_auth_fils() re-usable for driver-based AP SME
Jeffin Mammen [Fri, 21 Apr 2017 15:42:00 +0000 (18:42 +0300)] 
FILS: Make handle_auth_fils() re-usable for driver-based AP SME

Allow this function to be called from outside ieee802_11.c and with the
final steps replaced through a callback function.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoFILS: Move authentication response handling into a helper function
Jeffin Mammen [Fri, 21 Apr 2017 15:42:00 +0000 (18:42 +0300)] 
FILS: Move authentication response handling into a helper function

This can be reused when splitting handle_auth_fils() to support the
driver-based AP SME case.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoFILS: Pass only IE area to handle_auth_fils()
Jeffin Mammen [Sun, 23 Apr 2017 15:24:38 +0000 (18:24 +0300)] 
FILS: Pass only IE area to handle_auth_fils()

This function does not need the frame header, so pass in only the IE
area to make it easier to share this for driver-based AP SME handling.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoFILS: Move AssocResp construction to a helper function
Jeffin Mammen [Fri, 21 Apr 2017 15:42:00 +0000 (18:42 +0300)] 
FILS: Move AssocResp construction to a helper function

This can be reused from driver-based AP SME callback.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoFILS: Move Key Confirm element validation to a helper function
Jeffin Mammen [Fri, 21 Apr 2017 15:42:00 +0000 (18:42 +0300)] 
FILS: Move Key Confirm element validation to a helper function

This can be reused from driver-based AP SME callback.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoFILS: Move Session element validation to a helper function
Jeffin Mammen [Fri, 21 Apr 2017 15:42:00 +0000 (18:42 +0300)] 
FILS: Move Session element validation to a helper function

This can be reused from driver-based AP SME callback.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoFILS: Add FILS auth_alg to driver-based AP SME association handling
Jeffin Mammen [Fri, 21 Apr 2017 18:10:23 +0000 (21:10 +0300)] 
FILS: Add FILS auth_alg to driver-based AP SME association handling

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoFILS: Add driver-AP SME callback to set TK after association
Jeffin Mammen [Fri, 21 Apr 2017 18:01:03 +0000 (21:01 +0300)] 
FILS: Add driver-AP SME callback to set TK after association

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoFILS: Add FILS AEAD parameters for sta_auth() calls
Jeffin Mammen [Fri, 21 Apr 2017 17:43:57 +0000 (20:43 +0300)] 
FILS: Add FILS AEAD parameters for sta_auth() calls

This is used with partial AP SME in driver cases to enable FILS
association (AES-SIV) processing.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoatheros: Add FILS AAD parameters in sta_auth() handler
Jeffin Mammen [Fri, 21 Apr 2017 16:39:55 +0000 (19:39 +0300)] 
atheros: Add FILS AAD parameters in sta_auth() handler

This is needed to allow the driver SME to perform the needed AES-SIV
operations during FILS association.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agodriver: Move sta_auth() arguments to a struct
Jeffin Mammen [Fri, 21 Apr 2017 15:15:37 +0000 (18:15 +0300)] 
driver: Move sta_auth() arguments to a struct

This makes it easier to add more parameters without having to change the
callback function prototype.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoatheros: Enable raw management frame receive for FILS builds
Jeffin Mammen [Fri, 21 Apr 2017 15:48:25 +0000 (18:48 +0300)] 
atheros: Enable raw management frame receive for FILS builds

This is needed to be able to process authentication and association
frames for FILS.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoatheros: Read driver FILS capability
Jeffin Mammen [Fri, 21 Apr 2017 15:17:01 +0000 (18:17 +0300)] 
atheros: Read driver FILS capability

This will be used to determine what type of operations to use for STA
authentication and association.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoFILS: Add FILS Indication element into Beacon/Probe Response template
Jeffin Mammen [Fri, 21 Apr 2017 15:44:04 +0000 (18:44 +0300)] 
FILS: Add FILS Indication element into Beacon/Probe Response template

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoDefine a QCA attribute to specify the PCL policy for external ACS
Sunil Dutt [Thu, 20 Apr 2017 14:40:12 +0000 (20:10 +0530)] 
Define a QCA attribute to specify the PCL policy for external ACS

This commit defines an attribute
QCA_WLAN_VENDOR_ATTR_EXTERNAL_ACS_EVENT_POLICY to signify the preferred
channel list policy for external ACS.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agotests: WPS and random UUID on Enrollee
Jouni Malinen [Thu, 13 Apr 2017 18:45:57 +0000 (21:45 +0300)] 
tests: WPS and random UUID on Enrollee

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoWPS: Add option for using random UUID
Jouni Malinen [Thu, 13 Apr 2017 10:22:56 +0000 (13:22 +0300)] 
WPS: Add option for using random UUID

If the uuid configuration parameter is not set, wpa_supplicant generates
an UUID automatically to allow WPS operations to proceed. This was
previously always using an UUID generated from the MAC address. This
commit adds an option to use a random UUID instead. The type of the
automatically generated UUID is set with the auto_uuid parameter: 0 =
based on MAC address (default; old behavior), 1 = random UUID.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agotests: GTK rekeying after FILS authentication
Jouni Malinen [Mon, 10 Apr 2017 13:19:26 +0000 (16:19 +0300)] 
tests: GTK rekeying after FILS authentication

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoFILS: Fix key info in GTK rekey EAPOL-Key msg 2/2
Vidyullatha Kanchanapally [Mon, 10 Apr 2017 10:25:59 +0000 (15:55 +0530)] 
FILS: Fix key info in GTK rekey EAPOL-Key msg 2/2

While responding to EAPOL-Key message 1/2 with EAPOL-Key message 2/2
when using FILS AKM suites the ENCRYPTED bit is not set in key info of
2/2 which causes AP to drop 2/2. Fix this by setting the ENCRYPTED bit
since FILS AKM based connection uses AEAD encryption/decryption.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoFILS: Fix GTK rekey by accepting EAPOL-Key msg 1/2 with FILS AKM
Vidyullatha Kanchanapally [Mon, 10 Apr 2017 10:25:59 +0000 (15:55 +0530)] 
FILS: Fix GTK rekey by accepting EAPOL-Key msg 1/2 with FILS AKM

GTK rekeying was rejected if a prior 4-way handshake is not done.
Fix this by allowing GTK rekey to happen in case of a FILS connection
since it does not involve a 4-way handshake.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoFILS: Update cache identifier on association
Vidyullatha Kanchanapally [Wed, 22 Mar 2017 10:40:05 +0000 (16:10 +0530)] 
FILS: Update cache identifier on association

This is needed when offloading FILS shared key to the drivers.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoFILS: Update PMKSA cache with FILS shared key offload
Vidyullatha Kanchanapally [Wed, 22 Mar 2017 10:40:05 +0000 (16:10 +0530)] 
FILS: Update PMKSA cache with FILS shared key offload

Add a new PMKSA cache entry within wpa_supplicant if a driver event from
offloaded FILS shared key authentication indicates a new PMKSA entry was
created.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoFILS: Update ERP next sequence number with driver offload
Vidyullatha Kanchanapally [Wed, 22 Mar 2017 10:40:05 +0000 (16:10 +0530)] 
FILS: Update ERP next sequence number with driver offload

This keeps the internal ERP information within wpa_supplicant in sync
with the driver when offloading FILS shared key authentication.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoFILS: Track completion with FILS shared key authentication offload
Vidyullatha Kanchanapally [Wed, 22 Mar 2017 10:40:05 +0000 (16:10 +0530)] 
FILS: Track completion with FILS shared key authentication offload

Update the internal fils_completed state when offloading FILS shared key
authentication to the driver.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoFILS: Connect request for offloaded FILS shared key authentication
Vidyullatha Kanchanapally [Wed, 22 Mar 2017 10:40:05 +0000 (16:10 +0530)] 
FILS: Connect request for offloaded FILS shared key authentication

Add FILS/ERP parameters into the driver connect command to support FILS
shared key authentication offload.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoFILS: Set cache identifier in current PMKSA entry for driver-SME case
Vidyullatha Kanchanapally [Wed, 22 Mar 2017 10:40:05 +0000 (16:10 +0530)] 
FILS: Set cache identifier in current PMKSA entry for driver-SME case

This was already done in sme_send_authentication() for the case where
wpa_supplicant SME is used. Similar change is needed for driver-SME to
allow FILS authentication to be offloaded to the driver.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agotests: Update erp_home_realm function name for erp_home_realm_oom
Jouni Malinen [Fri, 7 Apr 2017 14:05:49 +0000 (17:05 +0300)] 
tests: Update erp_home_realm function name for erp_home_realm_oom

This function got renamed, so need to update the OOM test case to use
the new function name when matching backtrace information.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoERP: External control of ERP key information
Vidyullatha Kanchanapally [Wed, 22 Mar 2017 10:40:05 +0000 (16:10 +0530)] 
ERP: External control of ERP key information

This allows ERP keys to be managed by external entities, e.g., when
offloading FILS shared key authentication to a driver.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoFILS: Add support for Cache Identifier in add/remove PMKSA
Vidyullatha Kanchanapally [Thu, 30 Mar 2017 13:57:15 +0000 (19:27 +0530)] 
FILS: Add support for Cache Identifier in add/remove PMKSA

Add support for setting and deleting PMKSA cache entries based on FILS Cache
Identifer. Also additionally add support for sending PMK as part of
SET_PMKSA to enable driver to derive keys in case of FILS shared key
offload using PMKSA caching.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agonl80211: Add support for FILS Cache Identifier in add/remove_pmkid()
Vidyullatha Kanchanapally [Thu, 30 Mar 2017 13:57:15 +0000 (19:27 +0530)] 
nl80211: Add support for FILS Cache Identifier in add/remove_pmkid()

This is needed for configuring PMKSA cache entries to the driver with
the FILS Cache Identifier and SSID.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agodriver: Move add_pmkid() and remove_pmkid() arguments into a struct
Vidyullatha Kanchanapally [Thu, 30 Mar 2017 13:57:15 +0000 (19:27 +0530)] 
driver: Move add_pmkid() and remove_pmkid() arguments into a struct

This makes it easier to add more arguments to these wpa_driver_ops
functions.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agonl80211: Add support for FILS shared key offload
Vidyullatha Kanchanapally [Wed, 22 Mar 2017 10:40:05 +0000 (16:10 +0530)] 
nl80211: Add support for FILS shared key offload

Add support for FILS shared key offload for drivers which advertize
FILS shared key support using NL80211_CMD_CONNECT.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoFILS: Add support to write FILS key_mgmt values in network blocks
vamsi krishna [Thu, 6 Apr 2017 16:19:34 +0000 (21:49 +0530)] 
FILS: Add support to write FILS key_mgmt values in network blocks

Add support to write FILS related key_mgmt values also while saving a
network block.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoQCA vendor commands and attributes for spectral scan
Peng Xu [Tue, 21 Mar 2017 00:12:40 +0000 (17:12 -0700)] 
QCA vendor commands and attributes for spectral scan

Add new vendor commands for starting and stoppping spectral scan. Add
vendor attributes for configuring spectral scan parameters as part of
the start command.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoFILS: Add FTE into FILS Authentication frame from AP when using FILS+FT
Jouni Malinen [Sun, 2 Apr 2017 19:38:48 +0000 (22:38 +0300)] 
FILS: Add FTE into FILS Authentication frame from AP when using FILS+FT

MDE was already added with RSNE, but FTE needed to be added to the FILS
Authentication frame for the FT initial mobility domain association
using FILS authentication case.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoFILS: Add MDE into Authentication frame for FILS+FT
Jouni Malinen [Sun, 2 Apr 2017 10:22:52 +0000 (13:22 +0300)] 
FILS: Add MDE into Authentication frame for FILS+FT

When using FILS for FT initial mobility domain association, add MDE to
the Authentication frame from the STA to indicate this special case for
FILS authentication.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoFT: Add selection of FT+FILS AKMs
Jouni Malinen [Sun, 2 Apr 2017 09:57:32 +0000 (12:57 +0300)] 
FT: Add selection of FT+FILS AKMs

This is needed to enable use of FILS for the FT initial mobility domain
association.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoHide *PMKSA_ADD parameters from debug log
Jouni Malinen [Sun, 2 Apr 2017 09:37:33 +0000 (12:37 +0300)] 
Hide *PMKSA_ADD parameters from debug log

PMKSA_ADD and MESH_PMKSA_ADD command arguments include keying material,
so show it in debug log only if requested to do with the command line -K
argument.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agogitignore: tests/remote/logs
Jouni Malinen [Sat, 1 Apr 2017 14:03:59 +0000 (17:03 +0300)] 
gitignore: tests/remote/logs

This directory is created automatically when running hwsim test cases
remotely.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoP2P: Do not use wait_time for SD Response TX for last fragmentation
Jouni Malinen [Sat, 1 Apr 2017 11:25:26 +0000 (14:25 +0300)] 
P2P: Do not use wait_time for SD Response TX for last fragmentation

The last SD Response frame fragment is not going to be followed by
another Action frame from the peer, so remove the 200 ms wait time from
the offchannel TX command in that case. This avoids leaving a 200 ms
lock on the radio to remain on the channel unnecessarily.

This is similar to commit 7655bd7388f82e67a2d0461ccab0ae037bb8cd77
('P2P: Do not use wait_time for SD Response TX without fragmentation').

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agotests: Fix regdom clearing in wnm_bss_tm_scan_needed_e4
Jouni Malinen [Sat, 1 Apr 2017 11:10:32 +0000 (14:10 +0300)] 
tests: Fix regdom clearing in wnm_bss_tm_scan_needed_e4

It was possible for the cfg80211 regulatory code to get confused if the
disconnection and user hint to set country code to 00 happened
immediately after the BTM-initiated roam. The country IE update seemed
to be performed just before the 00 user hint and that resulted in
cfg80211 intersecting the regulatory domains instead of clearing to 00.
This resulted in the following test cases being unable to set the
country code.

This happened with the following test case sequence:
wnm_bss_tm_scan_needed_e4 wnm_bss_tm_scan_not_needed

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoFT: Schedule wpa_ft_rrb_rx() through eloop in intra-process communication
Michael Braun [Thu, 23 Mar 2017 11:57:18 +0000 (12:57 +0100)] 
FT: Schedule wpa_ft_rrb_rx() through eloop in intra-process communication

With AP-AP communication, when hapd0 sends a packet, hapd1 can receive
it immediately and send a response. But hapd0 will only read and process
the response after it has returned from the sending context, that is
entered eloop again. So one does not need to consider the RX function of
the reply to run for the request sending hapd before the send calling
function has returned.

Previously, with intra-process communication, the packet is not
scheduled through eloop. Thus the RX handler of the reply might be run
while the sending context of the original request has not returned.
This might become problematic, e.g., when deferring a management frame
processing until an RRB response is received and then have the request
restarted and finished before the original request handling has been
stopped.

I'm not aware of any concrete bug this is currently triggering but came
across it while thinking of FT RRB AP-AP sequence numbering.

I think the non-eloop scheduling approach might be error-prone and thus
propose to model it more closely to the way the message would be
received from a socket. Additionally, this ensures that the tests model
AP-AP communication more closely to real world.

Solution: queue these packets through eloop.

Signed-off-by: Michael Braun <michael-dev@fami-braun.de>
7 years agoSync with mac80211-next.git include/uapi/linux/nl80211.h
Jouni Malinen [Fri, 31 Mar 2017 10:14:20 +0000 (13:14 +0300)] 
Sync with mac80211-next.git include/uapi/linux/nl80211.h

This brings in nl80211 definitions as of 2017-03-31.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agotests: Add more details to DFS event failure reports
Jouni Malinen [Fri, 31 Mar 2017 10:13:12 +0000 (13:13 +0300)] 
tests: Add more details to DFS event failure reports

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agohostapd: Fix crash on consecutive channel switch failures
Mohammed Shafi Shajakhan [Wed, 22 Mar 2017 11:42:38 +0000 (17:12 +0530)] 
hostapd: Fix crash on consecutive channel switch failures

With multiple interface like AP and station which is already
associated to some other AP, when we try to do channel switch
for the AP mode (different from the operation channel support of
station) and if the AP channel switch fails continously (including
the fallback channel switch), results in a crash due to NULL pointer
dereference. This is because hostapd_deinit_driver() assigns the
driver context (drv_priv) to NULL as we are not able to bring up
the interface with a new channel

Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qti.qualcomm.com>
7 years agowpa_supplicant: Avoid associating to temp disabled SSID in ap_scan=2
Shaul Triebitz [Tue, 28 Mar 2017 12:26:38 +0000 (15:26 +0300)] 
wpa_supplicant: Avoid associating to temp disabled SSID in ap_scan=2

In ap_scan=2 mode, wpa_supplicant_assoc_try() did not check whether the
SSID is temporarily disabled before trying to associate and this may
result in an infinite connect/disconnect loop. If the association
succeeds while the SSID is temporarily disabled, wpa_supplicant will
request to deauthenticate and that in turn will cause the SSID to be
temporarily disabled again. Fix that by postponing the association until
the SSID is no longer temporarily disabled.

Signed-off-by: Shaul Triebitz <shaul.triebitz@intel.com>
7 years agotests: Document rfkill workaround for systemd for hwsim tests
Michael Braun [Thu, 23 Mar 2017 11:57:17 +0000 (12:57 +0100)] 
tests: Document rfkill workaround for systemd for hwsim tests

Signed-off-by: Michael Braun <michael-dev@fami-braun.de>
7 years agotests: Add a test of mesh RANN
Masashi Honma [Tue, 28 Mar 2017 01:30:10 +0000 (10:30 +0900)] 
tests: Add a test of mesh RANN

This is a test for a RANN functionality defined in IEEE Std 802.11-2016
14.10.12 Root announcement (RANN) mechanism.

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
7 years agotests: Add a test of mesh path request TTL
Masashi Honma [Tue, 21 Mar 2017 01:50:33 +0000 (10:50 +0900)] 
tests: Add a test of mesh path request TTL

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
7 years agotests: Use error probability model instead of SNR model
Masashi Honma [Tue, 21 Mar 2017 01:50:32 +0000 (10:50 +0900)] 
tests: Use error probability model instead of SNR model

If wmediumd changes its SNR model, these tests need to be modified (ex.
previously SNR = 0 means disconnection, on the new model, SNR should be
-10 for disconnection). So use error probability model not to be
influenced by SNR model change.

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
7 years agotests: Check wmediumd version
Masashi Honma [Tue, 21 Mar 2017 01:50:31 +0000 (10:50 +0900)] 
tests: Check wmediumd version

Some wmediumd test cases requires new wmediumd features (mdified SNR
table, location-based config, and log levels). The wmediumd 0.2 does not
have these features, so skip such test cases with versions below 0.3.1.

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
7 years agotests: Extend test_connectivity to check disconnection
Masashi Honma [Tue, 21 Mar 2017 01:50:30 +0000 (10:50 +0900)] 
tests: Extend test_connectivity to check disconnection

Add success_expected argument to test_connectivity because the function
is expected to fail in some test cases.

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
7 years agoP2P: Suppress warning on non-P2P config
Masashi Honma [Thu, 16 Mar 2017 01:59:40 +0000 (10:59 +0900)] 
P2P: Suppress warning on non-P2P config

Without CONFIG_P2P config, the following warning occurs if CONFIG_AP is
enabled for the build:

ap.c: In function ‘wpas_conf_ap_vht’:
ap.c:54:5: warning: unused variable ‘channel’ [-Wunused-variable]
  u8 channel = conf->channel;
     ^
ap.c:53:5: warning: unused variable ‘center_chan’ [-Wunused-variable]
  u8 center_chan = 0;
     ^

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
7 years agoQCA vendor command: Add TA max duration attribute for OCB configure
Zhaoyang Liu [Sun, 19 Mar 2017 06:40:00 +0000 (14:40 +0800)] 
QCA vendor command: Add TA max duration attribute for OCB configure

Add attribute for TA max duration after last TA received. So that local
time is synchromous to other communicating OCB STAs. If the duration
expires, OCB STA without UTC time source is not in sync to other STAs
and stop scheduling DSRC channel switch after max duration.

Signed-off-by: Zhaoyang Liu <zhaoyang@codeaurora.org>
Signed-off-by: Ferry Zhou <tianguiz@codeaurora.org>
7 years agoDefine attributes for QCA vendor OCB commands
Zhaoyang Liu [Sun, 19 Mar 2017 06:38:15 +0000 (14:38 +0800)] 
Define attributes for QCA vendor OCB commands

Document QCA vendor OCB commands about IEEE Std 802.11 communication
outside the context of a basic service set. Also define all attributes
for the specific OCB commands.

Signed-off-by: Zhaoyang Liu <zhaoyang@codeaurora.org>
Signed-off-by: Ferry Zhou <tianguiz@codeaurora.org>
7 years agoMBO: Fix reject reason codes
Vidyullatha Kanchanapally [Thu, 23 Mar 2017 10:41:22 +0000 (16:11 +0530)] 
MBO: Fix reject reason codes

This change fixes the following compilation warnings:

wnm_sta.c:1007:4: warning: implicit conversion from enumeration type
 'enum mbo_transition_reason' to different enumeration type
 'enum mbo_transition_reject_reason' [-Wenum-conversion]

The actual value of both MBO_TRANSITION_REASON_UNSPECIFIED and
MBO_TRANSITION_REJECT_REASON_UNSPECIFIED is 0, so this does not result
in any change in the contents of the frames.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoFILS: Fix wpa_supplicant compilation errors
Vidyullatha Kanchanapally [Thu, 23 Mar 2017 10:41:22 +0000 (16:11 +0530)] 
FILS: Fix wpa_supplicant compilation errors

This change fixes the following compilation error:

wpa.c:2465: error: undefined reference to 'crypto_ecdh_deinit'

in builds where CONFIG_ECC does not get defined.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoFILS: Fix fils_cache_id check
Vidyullatha Kanchanapally [Thu, 23 Mar 2017 10:41:22 +0000 (16:11 +0530)] 
FILS: Fix fils_cache_id check

This fixes the following compiler warning:
wpa_auth.c:4249:34: error: address of array 'a->conf.fils_cache_id'
 will always evaluate to 'true' [-Werror,-Wpointer-bool-conversion]

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agowlantest: Fix pcapng writer to include decrypted EAPOL-Key Key Data
Jouni Malinen [Sun, 26 Mar 2017 09:49:59 +0000 (12:49 +0300)] 
wlantest: Fix pcapng writer to include decrypted EAPOL-Key Key Data

This was only written to pcapng files if both pcap and pcapng writing
was requested. Fix this for the case where only a pcapng file is being
written.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agowpa_helpers: Ignore link-local IPv4 address while waiting for DHCP
Jouni Malinen [Sun, 26 Mar 2017 09:41:36 +0000 (12:41 +0300)] 
wpa_helpers: Ignore link-local IPv4 address while waiting for DHCP

Do not accept a link-local IPv4 address when waiting for a valid DHCP
address. This helps with hs20-osu-client use cases where DHCP response
has not yet been received.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoxml: Add Value node in TNDS node conversion for empty value case
Jouni Malinen [Sun, 26 Mar 2017 09:39:34 +0000 (12:39 +0300)] 
xml: Add Value node in TNDS node conversion for empty value case

Previously, the Value node was not added if value of a node could not be
fetched. This can cause interoperability issues, so address that in the
same way as an empty length value, i.e., by adding a Value node with
zero-length contents.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoGAS: Handle no-ACK TX status for GAS request frames
Jouni Malinen [Sun, 26 Mar 2017 09:34:06 +0000 (12:34 +0300)] 
GAS: Handle no-ACK TX status for GAS request frames

Previously, only the success and failure (to TX) cases were handled. It
is also possible for the driver to transmit the frame, but not receive
an ACK from the recipient. Address that by waiting for a short period of
time for a response. This fixes cases where OSU provider icon fetching
could get stuck if no ACK frame is received.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agotests: WPA2-PSK-FT AP with non-FT AKMs enabled
Jouni Malinen [Sun, 26 Mar 2017 09:28:40 +0000 (12:28 +0300)] 
tests: WPA2-PSK-FT AP with non-FT AKMs enabled

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agomacsec_linux: Fix NULL pointer dereference on error cases
Davide Caratti [Fri, 24 Mar 2017 09:25:24 +0000 (10:25 +0100)] 
macsec_linux: Fix NULL pointer dereference on error cases

In case wpa_supplicant is using driver_macsec_linux, but macsec module
is not (yet) loaded in the kernel, nl_socket_alloc() fails and drv->sk
is NULL. In this case, don't call libnl functions rntl_link_add() or
rtnl_link_change() using such NULL pointer, to prevent program from
getting segmentation faults like:

 Program received signal SIGSEGV, Segmentation fault.
 nl_socket_get_local_port (sk=sk@entry=0x0) at socket.c:365
 365             if (sk->s_local.nl_pid == 0) {
 (gdb) p sk
 $1 = (const struct nl_sock *) 0x0
 (gdb) bt
 #0  nl_socket_get_local_port (sk=sk@entry=0x0) at socket.c:365
 #1  0x00007ffff79c56a0 in nl_complete_msg (sk=sk@entry=0x0,
  msg=msg@entry=0x55555595a1f0) at nl.c:491
 #2  0x00007ffff79c56d1 in nl_send_auto (sk=sk@entry=0x0,
  msg=msg@entry=0x55555595a1f0) at nl.c:522
 #3  0x00007ffff79c652f in nl_send_sync (sk=sk@entry=0x0,
  msg=0x55555595a1f0) at nl.c:556
 #4  0x00007ffff755faf5 in rtnl_link_add (sk=0x0,
  link=link@entry=0x55555595b0f0, flags=flags@entry=1024) at route/link.c:1548
 #5  0x000055555567a298 in macsec_drv_create_transmit_sc (priv=0x55555593b130,
  sc=0x55555593b320, conf_offset=<optimized out>) at ../src/drivers/driver_macsec_linux.c:998

Signed-off-by: Davide Caratti <davide.caratti@gmail.com>
7 years agomka: Fix use-after-free when transmit secure channels are deleted
Davide Caratti [Thu, 16 Mar 2017 13:01:55 +0000 (14:01 +0100)] 
mka: Fix use-after-free when transmit secure channels are deleted

ieee802_1x_kay_deinit_transmit_sc() frees the transmit secure channel
data, but secy_delete_transmit_sc() still needs it. Since this functions
are called sequentially, secy_delete_transmit_sc() can be called from
ieee802_1x_kay_deinit_transmit_sc() before txsc is freed.

Fixes: 128f6a98b3d4 ("mka: Fix the order of operations in secure channel deletion")
Signed-off-by: Davide Caratti <davide.caratti@gmail.com>
7 years agomka: Fix use-after-free when receive secure channels are deleted
Davide Caratti [Thu, 16 Mar 2017 13:01:54 +0000 (14:01 +0100)] 
mka: Fix use-after-free when receive secure channels are deleted

ieee802_1x_kay_deinit_receive_sc() frees the receive secure channel data,
but secy_delete_receive_sc() still needs it. Since these two functions
are always called sequentially, secy_delete_receive_sc() can be called
from ieee802_1x_kay_deinit_receive_sc() before rxsc is freed.

Fixes: 128f6a98b3d4 ("mka: Fix the order of operations in secure channel deletion")
Signed-off-by: Davide Caratti <davide.caratti@gmail.com>
7 years agowlantest: Fix EAPOL-Key Key Data padding removal
Jouni Malinen [Fri, 24 Mar 2017 21:34:19 +0000 (23:34 +0200)] 
wlantest: Fix EAPOL-Key Key Data padding removal

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agowlantest: Add initial support for FT-EAP decryption
Jouni Malinen [Fri, 24 Mar 2017 18:54:47 +0000 (20:54 +0200)] 
wlantest: Add initial support for FT-EAP decryption

Add second half of MSK as XXKey for FT-EAP.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agowlantest: Fix EAPOL buffer length with variable MIC length
Jouni Malinen [Fri, 24 Mar 2017 18:53:54 +0000 (20:53 +0200)] 
wlantest: Fix EAPOL buffer length with variable MIC length

struct wpa_eapol_key does not include the MIC field anymore, so need to
add it explicitly.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoQCA vendor attributes to extend antenna diversity functionality
lifeng [Fri, 10 Mar 2017 10:51:56 +0000 (18:51 +0800)] 
QCA vendor attributes to extend antenna diversity functionality

1. Add new attribute to report corresponding antenna information to the
chain RSSI which is used in subcmd
QCA_NL80211_VENDOR_SUBCMD_GET_CHAIN_RSSI.

2. Add a series of attr to support the new wmi interface
WMI_PDEV_PARAM_ANT_DIV_USRCFG which export parameters setting of antenna
diversity algorithm to userspace.

Signed-off-by: Li Feng <lifeng@qti.qualcomm.com>
7 years agoAdd vendor attribute to config propagation delay's absolute value
Zhang Qian [Fri, 10 Mar 2017 13:12:49 +0000 (21:12 +0800)] 
Add vendor attribute to config propagation delay's absolute value

QCA_WLAN_VENDOR_ATTR_CONFIG_PROPAGATION_ABS_DELAY is added to set
propagation delay's absolute value. This is a more detailed version of
QCA_WLAN_VENDOR_ATTR_CONFIG_PROPAGATION_DELAY.

Signed-off-by: Zhang Qian <zhangq@qti.qualcomm.com>
7 years agoFix QCA_ATTR_NUD_STATS_IS_DAD value
Dmitry Shmidt [Tue, 14 Mar 2017 17:33:50 +0000 (17:33 +0000)] 
Fix QCA_ATTR_NUD_STATS_IS_DAD value

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
7 years agotests: P2P device discovery and p2p_find restart
Jouni Malinen [Mon, 13 Mar 2017 15:08:22 +0000 (17:08 +0200)] 
tests: P2P device discovery and p2p_find restart

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoP2P: Run full P2P_FIND scan after pending scan completes
Jouni Malinen [Mon, 13 Mar 2017 15:05:55 +0000 (17:05 +0200)] 
P2P: Run full P2P_FIND scan after pending scan completes

If a P2P_FIND command is issued for running the initial full scan and
the attempt to start that full scan fails, the previous behavior was to
wait for the ongoing scan to complete and then continue p2p_find scan
iterations. However, this continued with the social channels scan
instead of the initial full scan. This could end up missing the full
scan completely.

Fix this by marking the full scan pending if the new scan cannot be
started immediately. Then start the initial full scan after the ongoing
scan completes before moving to social channel only scan iterations.
This applies both for the P2P_FIND_START_WITH_FULL (no specific
frequency set) and P2P_FIND_PROGRESSIVE cases since both of them start
with a single full scan round.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agotests: Additional coverage for P2P_FIND freq argument
Jouni Malinen [Mon, 13 Mar 2017 10:52:44 +0000 (12:52 +0200)] 
tests: Additional coverage for P2P_FIND freq argument

This test case verifies that the specified channel is included in the
consecutive p2p_find scan iterations.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoP2P: Continue scanning specified channel with P2P_FIND freq argument
Jouni Malinen [Mon, 13 Mar 2017 10:50:50 +0000 (12:50 +0200)] 
P2P: Continue scanning specified channel with P2P_FIND freq argument

This makes the "P2P_FIND freq=<MHz>" operation more robust by continuing
to include the specified frequency in the consecutive scan rounds
instead of including it only once in the first scan. In other words, the
first scan is only for the specified frequency just like the previous
behavior, but the following scans include all the social channels and
the specified frequency instead of just the previously used social
channels.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>