]> git.ipfire.org Git - thirdparty/hostap.git/log
thirdparty/hostap.git
7 years agoMake struct wpa_eapol_key easier to use with variable length MIC
Jouni Malinen [Wed, 2 Sep 2015 19:55:03 +0000 (22:55 +0300)] 
Make struct wpa_eapol_key easier to use with variable length MIC

Suite B 192-bit addition from IEEE Std 802.11ac-2013 replaced the
previous fixed length Key MIC field with a variable length field. That
change was addressed with an addition of a new struct defined for the
second MIC length. This is not really scalable and with FILS coming up
with a zero-length MIC case for AEAD, a more thorough change to support
variable length MIC is needed.

Remove the Key MIC and Key Data Length fields from the struct
wpa_eapol_key and find their location based on the MIC length
information (which is determined by the AKMP). This change allows the
separate struct wpa_eapol_key_192 to be removed since struct
wpa_eapol_key will now include only the fixed length fields that are
shared with all EAPOL-Key cases in IEEE Std 802.11.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoFILS: Advertise ERP domain in FILS Indication element
Jouni Malinen [Wed, 2 Sep 2015 13:33:42 +0000 (16:33 +0300)] 
FILS: Advertise ERP domain in FILS Indication element

Calculate the hashed realm from hostapd erp_domain configuration
parameter and add this to the FILS Indication element when ERP is
enabled.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoFILS: Allow hostapd to select FILS AKM for connection
Jouni Malinen [Wed, 2 Sep 2015 12:58:23 +0000 (15:58 +0300)] 
FILS: Allow hostapd to select FILS AKM for connection

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoFILS: Allow wpa_supplicant to select FILS AKM for connection
Jouni Malinen [Wed, 2 Sep 2015 12:35:55 +0000 (15:35 +0300)] 
FILS: Allow wpa_supplicant to select FILS AKM for connection

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoFILS: Add FILS flags into wpa_supplicant BSS command output
Jouni Malinen [Tue, 1 Sep 2015 17:35:00 +0000 (20:35 +0300)] 
FILS: Add FILS flags into wpa_supplicant BSS command output

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoFILS: Add 'GET_CAPABILITY fils' for runtime check
Jouni Malinen [Tue, 1 Sep 2015 17:04:20 +0000 (20:04 +0300)] 
FILS: Add 'GET_CAPABILITY fils' for runtime check

This can be used to check whether the running wpa_supplicant version was
built with CONFIG_FILS=y.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoFILS: Set FILS Capability bit in management frames from station
Jouni Malinen [Tue, 1 Sep 2015 17:00:16 +0000 (20:00 +0300)] 
FILS: Set FILS Capability bit in management frames from station

If FILS is supported, indicate that in Probe Request and (Re)Association
Request frames in the Extended Capabilities element.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoFILS: Set FILS Capability bit in management frames from AP
Jouni Malinen [Tue, 1 Sep 2015 16:44:23 +0000 (19:44 +0300)] 
FILS: Set FILS Capability bit in management frames from AP

If FILS is enabled, indicate that in Beacon, Probe Response, and
(Re)Association Response frames in the Extended Capabilities element.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoFILS: Add FILS Indication element to Beacon and Probe Response frames
Jouni Malinen [Tue, 1 Sep 2015 16:33:32 +0000 (19:33 +0300)] 
FILS: Add FILS Indication element to Beacon and Probe Response frames

If FILS is enabled, indicate that in AP Beacon/Probe Response frames.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoFILS: Add wpa_supplicant configuration options
Jouni Malinen [Tue, 1 Sep 2015 14:58:53 +0000 (17:58 +0300)] 
FILS: Add wpa_supplicant configuration options

This adds CONFIG_FILS=y build configuration option and new key
management options for FILS authentication.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoFILS: Add hostapd configuration options
Jouni Malinen [Tue, 1 Sep 2015 14:57:59 +0000 (17:57 +0300)] 
FILS: Add hostapd configuration options

This adds CONFIG_FILS=y build configuration option and new key
management options for FILS authentication.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoFILS: Add definitions for new frames and values
Jouni Malinen [Tue, 1 Sep 2015 14:50:04 +0000 (17:50 +0300)] 
FILS: Add definitions for new frames and values

This adds definitions for various management frame elements and values
from P802.11ai/D11.0.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoFILS: Add AKM definitions
Jouni Malinen [Tue, 1 Sep 2015 14:50:04 +0000 (17:50 +0300)] 
FILS: Add AKM definitions

This adds definitions for the new AKM suite values from P802.11ai/D11.0.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoFILS: Add new information elements
Jouni Malinen [Tue, 1 Sep 2015 14:50:04 +0000 (17:50 +0300)] 
FILS: Add new information elements

This adds definitions for new information elements from P802.11ai/D11.0
and parsing of these IEs.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agotests: Update eap_proto_psk_errors and ap_wpa2_eap_psk_oom
Jouni Malinen [Mon, 10 Oct 2016 17:23:57 +0000 (20:23 +0300)] 
tests: Update eap_proto_psk_errors and ap_wpa2_eap_psk_oom

The extension of aes_128_ctr_encrypt() to allow AES-192 and AES-256 to
be used in addition to AES-128 for CTR mode encryption resulted in the
backtrace for the function calls changing. Update the test cases that
started failing due to that change.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoExtend AES-SIV implementation to support different key lengths
Jouni Malinen [Mon, 10 Oct 2016 16:27:57 +0000 (19:27 +0300)] 
Extend AES-SIV implementation to support different key lengths

The previous implementation was hardcoded to use 128-bit AES key
(AEAD_AES_SIV_CMAC_256). Extend this by allowing AEAD_AES_SIV_CMAC_384
and AEAD_AES_SIV_CMAC_512 with 192-bit and 256-bit AES keys.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoMove CRC-32 routine from wlantest to src/utils
Jouni Malinen [Wed, 2 Sep 2015 13:16:50 +0000 (16:16 +0300)] 
Move CRC-32 routine from wlantest to src/utils

This allows the CRC-32 routine to be shared for other purposes in
addition to the WEP/TKIP/FCS within wlantest.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agotests: Mesh network and SELECT_NETWORK
Jouni Malinen [Sun, 9 Oct 2016 14:09:56 +0000 (17:09 +0300)] 
tests: Mesh network and SELECT_NETWORK

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agotest: FT: EAP test for mismatching keys
Michael Braun [Sat, 24 Sep 2016 20:53:44 +0000 (22:53 +0200)] 
test: FT: EAP test for mismatching keys

Signed-off-by: Michael Braun <michael-dev@fami-braun.de>
7 years agotest: FT with locally generated PMK-R0/PMK-R1 from PSK
Michael Braun [Sat, 24 Sep 2016 20:53:43 +0000 (22:53 +0200)] 
test: FT with locally generated PMK-R0/PMK-R1 from PSK

Signed-off-by: Michael Braun <michael-dev@fami-braun.de>
7 years agoFT: Allow PMK-R0 and PMK-R1 for FT-PSK to be generated locally
Michael Braun [Sat, 24 Sep 2016 20:53:42 +0000 (22:53 +0200)] 
FT: Allow PMK-R0 and PMK-R1 for FT-PSK to be generated locally

Station should be able to connect initially without ft_pmk_cache filled,
so the target AP has the PSK available and thus the same information as
the origin AP. Therefore neither caching nor communication between the
APs with respect to PMK-R0 or PMK-R1 or VLANs is required if the target
AP derives the required PMKs locally.

This patch introduces the generation of the required PMKs locally for
FT-PSK. Additionally, PMK-R0 is not stored (and thus pushed) for FT-PSK.

So for FT-PSK networks, no configuration of inter-AP communication is
needed anymore when using ft_psk_generate_local=1 configuration. The
default behavior (ft_psk_generate_local=0) remains to use the pull/push
protocol.

Signed-off-by: Michael Braun <michael-dev@fami-braun.de>
7 years agomka: Add driver op to get macsec capabilities
Sabrina Dubroca [Fri, 7 Oct 2016 10:08:12 +0000 (12:08 +0200)] 
mka: Add driver op to get macsec capabilities

This also implements the macsec_get_capability for the macsec_qca
driver to maintain the existing behavior.

Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
7 years agoEAP-pwd: Validate Prep field in EAP-pwd-ID/Response
Jouni Malinen [Sat, 8 Oct 2016 16:43:36 +0000 (19:43 +0300)] 
EAP-pwd: Validate Prep field in EAP-pwd-ID/Response

RFC 5931 Section 2.8.5.1 does not list the Prep field as something that
the server validates to match the Request. However, the supplicant side
has to use the same pre-processing mechanism for the password for the
authentication to work, so we may as well as enforce this field to match
the requested value now that wpa_supplicant implementation is fixed to
copy the value from the request.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoEAP-pwd: Fix Prep in EAP-pwd-ID/Response when EAP_PWD_PREP_MS is used
Brian Candler [Sat, 8 Oct 2016 07:09:07 +0000 (08:09 +0100)] 
EAP-pwd: Fix Prep in EAP-pwd-ID/Response when EAP_PWD_PREP_MS is used

Fix the pre-processing field in the response when EAP_PWD_PREP_MS is
being used. This fixes interoperability with EAP-pwd servers that
validate the Prep field in EAP-pwd-ID/Response when the RFC2759
(PasswordHashHash) pre-processing is used.

Signed-off-by: Brian Candler <B.Candler@pobox.com>
7 years agomka: Pass full structures down to macsec drivers' receive SC ops
Sabrina Dubroca [Fri, 7 Oct 2016 10:08:10 +0000 (12:08 +0200)] 
mka: Pass full structures down to macsec drivers' receive SC ops

Clean up the driver interface by passing pointers to struct receive_sc
down the stack to the {create,delete}_recevie_sc() ops, instead of
passing the individual properties of the SC.

Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
7 years agomka: Pass full structures down to macsec drivers' transmit SC ops
Sabrina Dubroca [Fri, 7 Oct 2016 10:08:09 +0000 (12:08 +0200)] 
mka: Pass full structures down to macsec drivers' transmit SC ops

Clean up the driver interface by passing pointers to struct transmit_sc
down the stack to the {create,delete}_transmit_sc() ops, instead of
passing the individual arguments.

Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
7 years agoLibreSSL: Fix compatibility for EAP-FAST
Julian Ospald [Fri, 7 Oct 2016 15:51:05 +0000 (17:51 +0200)] 
LibreSSL: Fix compatibility for EAP-FAST

This basically just follows commit
587b0457e0238b7b1800d46f5cdd5e1d2b06732f ('LibreSSL: Fix build with
LibreSSL') with the same pattern, which was missed here.

Signed-off-by: Julian Ospald <hasufell@hasufell.de>
7 years agoLibreSSL: Fix TLS initialization/deinitialization
Christian Neukirchen [Wed, 5 Oct 2016 14:37:40 +0000 (16:37 +0200)] 
LibreSSL: Fix TLS initialization/deinitialization

Due to a missing guard for old OpenSSL code, SSL_library_init() was not
called, which is required for LibreSSL. Likewise for cleanup.

Signed-off-by: Christian Neukirchen <chneukirchen@gmail.com>
7 years agoLibreSSL: Fix dh5 code
Christian Neukirchen [Wed, 5 Oct 2016 14:35:48 +0000 (16:35 +0200)] 
LibreSSL: Fix dh5 code

Add LibreSSL check to old OpenSSL #ifdef guard as DH_{get0,set0}_key()
is not implemented in LibreSSL.

Signed-off-by: Christian Neukirchen <chneukirchen@gmail.com>
7 years agoAdd QCA vendor attributes for measurement frequency for FTM/AOA
Lior David [Sun, 25 Sep 2016 09:29:07 +0000 (12:29 +0300)] 
Add QCA vendor attributes for measurement frequency for FTM/AOA

Add attributes for specifing the frequency where FTM/AOA measurement is
done over the air. This allows the user space framework to maintain its
own cache of peers without depending on the kernel scan results cache,
or perform scans less often (since entries in the kernel scan results
cache expire quickly). The change is backward compatible. If the
frequency attribute is not specified, the kernel scan results cache will
be queried, like done today.

Signed-off-by: Lior David <qca_liord@qca.qualcomm.com>
7 years agomka: Pass full structures down to macsec drivers' receive SA ops
Sabrina Dubroca [Tue, 20 Sep 2016 07:43:09 +0000 (09:43 +0200)] 
mka: Pass full structures down to macsec drivers' receive SA ops

Clean up the driver interface by passing pointers to struct receive_sa
down the stack to the {create,enable,disable}_receive_sa() ops, instead
of passing the individual properties of the SA.

Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
7 years agomka: Pass full structures down to macsec drivers' transmit SA ops
Sabrina Dubroca [Tue, 20 Sep 2016 07:43:07 +0000 (09:43 +0200)] 
mka: Pass full structures down to macsec drivers' transmit SA ops

Clean up the driver interface by passing pointers to struct transmit_sa
down the stack to the {create,enable,disable}_transmit_sa ops, instead
of passing the individual properties of the SA.

Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
7 years agomka: Pass full structures down to macsec drivers' packet number ops
Sabrina Dubroca [Tue, 20 Sep 2016 07:43:05 +0000 (09:43 +0200)] 
mka: Pass full structures down to macsec drivers' packet number ops

Clean up the driver interface by passing pointers to structs transmit_sa
and receive_sa down the stack to get_receive_lowest_pn(),
get_transmit_next_pn(), and set_transmit_next_pn() ops, instead of
passing the individual arguments.

Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
7 years agomka: Move structs {transmit,receive}_{sa,sc} to a common header
Sabrina Dubroca [Tue, 20 Sep 2016 07:43:04 +0000 (09:43 +0200)] 
mka: Move structs {transmit,receive}_{sa,sc} to a common header

These structs will be passed down to macsec drivers in a coming patch to
make the driver interface cleaner, so they need to be shared between the
core MKA implementation and the drivers.

Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
7 years agotests: Fix wpas_ctrl_sched_scan_plans without WPA_TRACE
Jouni Malinen [Mon, 3 Oct 2016 08:35:42 +0000 (11:35 +0300)] 
tests: Fix wpas_ctrl_sched_scan_plans without WPA_TRACE

This test case did not clear sched_scan_plans if alloc_fail() resulted
in skipping the test case. This would result in the following
autoscan_exponential and autoscan_periodic test cases failing.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoautoscan: Add more debug prints for cases where autoscan is not used
Jouni Malinen [Mon, 3 Oct 2016 08:34:35 +0000 (11:34 +0300)] 
autoscan: Add more debug prints for cases where autoscan is not used

This makes it easier to figure out why autoscan is not used even when
being configured through the control interface.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoThe master branch is now used for v2.7 development
Jouni Malinen [Sun, 2 Oct 2016 19:27:26 +0000 (22:27 +0300)] 
The master branch is now used for v2.7 development

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoChange version number to v2.6 for the release hostap_2_6
Jouni Malinen [Sun, 2 Oct 2016 18:51:11 +0000 (21:51 +0300)] 
Change version number to v2.6 for the release

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agotests: Fix cfg80211_tx_frame test
Avraham Stern [Mon, 5 Sep 2016 14:33:11 +0000 (17:33 +0300)] 
tests: Fix cfg80211_tx_frame test

In case that a dedicated P2P Device interface is used, a new interface
must be create for a P2P group. Thus, in order to send mgmt
frames, attach a new WpaSupplicant object to the newly created group
and use this object for sending the frames.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
7 years agotests: Use global control interface to remove P2P networks
Ilan Peer [Mon, 5 Sep 2016 14:33:08 +0000 (17:33 +0300)] 
tests: Use global control interface to remove P2P networks

Use the global control interface to remove P2P networks in
persistent_group_peer_dropped3 to support configurations that use a
dedicated P2P Device interface.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
7 years agotests: Fix p2p_ext_vendor_elem_assoc test with P2P Device interface
Avraham Stern [Mon, 5 Sep 2016 14:33:06 +0000 (17:33 +0300)] 
tests: Fix p2p_ext_vendor_elem_assoc test with P2P Device interface

For configurations that use a dedicated P2P Device interface, which
mandates that a separate interface is used for the P2P group, vendor
specific IE's must be added to the VENDOR_ELEM_P2P_* frame types in
order to be used by the P2P group interface. The VENDOR_ELEM_ASSOC_REQ
(13) parameter would need to be issued on the group interface which
would be challenging to do due to timing in case a separate group
interface gets used.

In case a dedicated P2P Device interface is used, don't include a test
for VENDOR_ELEM_ASSOC_REQ to avoid failing this part of the test case.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
7 years agoFix PNO restart flow
Avraham Stern [Mon, 5 Sep 2016 14:33:03 +0000 (17:33 +0300)] 
Fix PNO restart flow

PNO is sometimes restarted due to changes in scan parameters
(e.g., selected network changed or MAC randomization being
 enabled/disabled). Restart is done by stopping PNO and immediately
starting it again. This may result in the SCHED_SCAN_STOPPED event being
received after the request for new PNO, which will make wpa_supplicant
believe PNO is not active although it is actually is. As a result, the
next request to start PNO will fail because PNO is active and should be
stopped first.

Fix this by deferring the request to start PNO until the
SCHED_SCAN_STOPPED event is received in case sched_scan is being
stopped.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
7 years agoContinue scanning if sched_scan stops unexpectedly
Avraham Stern [Mon, 5 Sep 2016 14:32:59 +0000 (17:32 +0300)] 
Continue scanning if sched_scan stops unexpectedly

When scheduled scan stops without the interface request (for example,
driver stopped it unexpectedly), start a regular scan to continue
scanning for networks and avoid being left with no scan at all.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
7 years agoRemove disconnected APs from BSS table if likely out-of-range
David Spinadel [Mon, 5 Sep 2016 14:33:07 +0000 (17:33 +0300)] 
Remove disconnected APs from BSS table if likely out-of-range

In some cases, after a sudden AP disappearing and reconnection to
another AP in the same ESS, if another scan occurs, wpa_supplicant might
try to roam to the old AP (if it was better ranked than the new one)
because it is still saved in BSS list and the blacklist entry was
cleared in previous reconnect. This attempt is going to fail if the AP
is not present anymore and it'll cause long disconnections.

Remove an AP that is probably out of range from the BSS list to avoid
such disconnections. In particular mac80211-based drivers use the
WLAN_REASON_DISASSOC_DUE_TO_INACTIVITY reason code in locally generated
disconnection events for cases where the AP does not reply anymore.

Signed-off-by: David Spinadel <david.spinadel@intel.com>
7 years agotests: Fix ap_track_taxonomy to clear country code setting
Jouni Malinen [Fri, 30 Sep 2016 20:46:17 +0000 (23:46 +0300)] 
tests: Fix ap_track_taxonomy to clear country code setting

This test case could have ended with the station devices still in US
regulatory domain and that could make a following test case fail in some
sequences. For example, "ap_track_taxonomy ibss_5ghz" sequence made
ibss_5ghz fail to see the regdom change event since there was not one
due to the US country code already being in use at the beginning of the
test case. Fix this by clearing the country code at the end of
ap_track_taxonomy.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoRestart PNO/sched_scan on channel list update
Arik Nemtsov [Tue, 27 Sep 2016 10:09:58 +0000 (13:09 +0300)] 
Restart PNO/sched_scan on channel list update

As the scan channels might need to change when the channel list has been
updated by the kernel. Use the simulated sched_scan timeout
(wpas_scan_restart_sched_scan()) to handle a possible race where an
ongoing sched_scan has stopped asynchronously while trying to restart a
new sched_scan.

Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
7 years agoFix spelling mistakes in number of comments
Nishant Chaprana [Fri, 30 Sep 2016 10:06:36 +0000 (15:36 +0530)] 
Fix spelling mistakes in number of comments

Signed-off-by: Nishant Chaprana <n.chaprana@samsung.com>
7 years agoAdd explicit enum values for QCA vendor config attributes
Sunil Dutt [Fri, 30 Sep 2016 10:30:31 +0000 (16:00 +0530)] 
Add explicit enum values for QCA vendor config attributes

This makes it easier to copy a subset of definitions without
accidentally getting mismatching values.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agotests: Extend gas_anqp_get to cover MBO cases with non-MBO AP
Jouni Malinen [Thu, 29 Sep 2016 15:06:49 +0000 (18:06 +0300)] 
tests: Extend gas_anqp_get to cover MBO cases with non-MBO AP

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoMBO: Add support to send ANQP request to get cellular preference
vamsi krishna [Fri, 9 Sep 2016 12:05:50 +0000 (17:35 +0530)] 
MBO: Add support to send ANQP request to get cellular preference

This extends ANQP_GET command to support querying MBO cellular
preference also. The cellular preference can be requested along with
neigbor report by appending mbo:1 to the command arguments.

For example:
ANQP_GET <bssid> 272,mbo:1

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agotests: Update server and user certificates (2015)
Jouni Malinen [Fri, 30 Sep 2016 19:03:40 +0000 (22:03 +0300)] 
tests: Update server and user certificates (2015)

The previous versions expired, so need to re-sign these to fix number of
the EAP test cases.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Long P2P_LISTEN and offchannel TX
Jouni Malinen [Mon, 26 Sep 2016 21:43:27 +0000 (00:43 +0300)] 
tests: Long P2P_LISTEN and offchannel TX

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoShare a common helper function for restarting sched_scan
Jouni Malinen [Mon, 26 Sep 2016 21:09:33 +0000 (00:09 +0300)] 
Share a common helper function for restarting sched_scan

This code sequence was already used at two different places (and an
additional one has been proposed), so add a common helper function to
avoid having to copy-paste this functionality in multiple locations.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agowpa_supplicant: Cancel sched_scan on SELECT_NETWORK initiated scan
Max Stepanov [Mon, 5 Sep 2016 14:32:58 +0000 (17:32 +0300)] 
wpa_supplicant: Cancel sched_scan on SELECT_NETWORK initiated scan

If a scheduled scan is running on select network command,
cancel and reset it before kicking off a regular scan request.

Signed-off-by: Max Stepanov <Max.Stepanov@intel.com>
8 years agoQCA vendor command for antenna diversity feature
lifeng [Tue, 20 Sep 2016 07:38:16 +0000 (15:38 +0800)] 
QCA vendor command for antenna diversity feature

The user space app use QCA_NL80211_VENDOR_SUBCMD_GET_CHAIN_RSSI cmd to
get the corresponding antenna rssi value for the specific chain. And the
associcated attributes are added to configure the antenna diversity and
related selftest.

Signed-off-by: Li Feng <lifeng@qti.qualcomm.com>
8 years agoUpdate ChangeLog files for v2.6
Jouni Malinen [Sun, 25 Sep 2016 18:08:18 +0000 (21:08 +0300)] 
Update ChangeLog files for v2.6

This adds a summary of new changes since the last update.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: WNM BSS Transition Management request getting rejected
Jouni Malinen [Sun, 25 Sep 2016 14:15:22 +0000 (17:15 +0300)] 
tests: WNM BSS Transition Management request getting rejected

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: MBO and ignoring disallowed association
Jouni Malinen [Sun, 25 Sep 2016 14:06:23 +0000 (17:06 +0300)] 
tests: MBO and ignoring disallowed association

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: Fix a typo in a debug message (mbo_assoc_disallow)
Jouni Malinen [Sun, 25 Sep 2016 13:56:18 +0000 (16:56 +0300)] 
tests: Fix a typo in a debug message (mbo_assoc_disallow)

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: Update MBO test cases for non_pref_chan changes
Jouni Malinen [Sat, 24 Sep 2016 09:04:39 +0000 (12:04 +0300)] 
tests: Update MBO test cases for non_pref_chan changes

The reason_detail field was removed from the implementation, so the test
cases need matching changes.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoMBO: Do not parse reason_detail in non_pref_chan attr (AP)
vamsi krishna [Fri, 23 Sep 2016 12:54:13 +0000 (18:24 +0530)] 
MBO: Do not parse reason_detail in non_pref_chan attr (AP)

The reason detail field was removed from non_pref_chan attr in MBO
v0.0_r25 draft. Don't parse for this element to be compliant with the
latest drafr.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoMBO: Do not add reason_detail in non_pref_chan attr (STA)
vamsi krishna [Fri, 23 Sep 2016 12:36:37 +0000 (18:06 +0530)] 
MBO: Do not add reason_detail in non_pref_chan attr (STA)

The reason detail field in non_pref_chan attribute was removed from MBO
draft v0.0_r25, so the STA should not include this field to be compliant
with the latest draft.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoWNM: Add testing option to reject BSS Transition Management Request
vamsi krishna [Thu, 15 Sep 2016 08:35:53 +0000 (14:05 +0530)] 
WNM: Add testing option to reject BSS Transition Management Request

For testing purposes, it is useful to have an option to be able to
reject BTM Request sent by AP in order to verify the AP behavior upon
BTM Request rejection.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoMBO: Add QCA vendor option to configure driver to ignore assoc disallow
vamsi krishna [Fri, 23 Sep 2016 13:33:42 +0000 (19:03 +0530)] 
MBO: Add QCA vendor option to configure driver to ignore assoc disallow

MBO capable APs can set association disallowed in the Beacon/Probe
Response frames. For testing purposes, the STA needs to be configured to
not ignore the association disallowed set by APs and continue to connect
to such AP like non-MBO enabled STA. Add a QCA vendor attribute for
QCA_NL80211_VENDOR_SUBCMD_SET_WIFI_CONFIGURATION vendor sub command to
configure the driver to ignore association disallowed functionality.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoMBO: Add support to ignore association disallowed set by AP
vamsi krishna [Thu, 15 Sep 2016 07:40:58 +0000 (13:10 +0530)] 
MBO: Add support to ignore association disallowed set by AP

Add a testing mechanism to allow association disallowed set by AP to be
ignored. This can be used to verify AP behavior for disallowing a
specific association.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoAdd attributes for QCA_NL80211_VENDOR_SUBCMD_LL_STATS_EXT
Zhang Qian [Wed, 21 Sep 2016 09:23:08 +0000 (17:23 +0800)] 
Add attributes for QCA_NL80211_VENDOR_SUBCMD_LL_STATS_EXT

More attributes are added for QCA_NL80211_VENDOR_SUBCMD_LL_STATS_EXT
1. Peer signal stats;
2. Peer TX stats;
3. Peer RX stats

Signed-off-by: Zhang Qian <zhangq@qti.qualcomm.com>
8 years agoIEEE P802.11ah/D10.0 PV1 CCMP test vectors
Jouni Malinen [Tue, 26 Apr 2016 13:51:09 +0000 (16:51 +0300)] 
IEEE P802.11ah/D10.0 PV1 CCMP test vectors

Extend wlantest test_vectors to calculate test vectors for P802.11ah
Annex J.6.4.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Add testcase for reconnect failure due to auth timeout
Mikael Kanstrup [Tue, 20 Sep 2016 06:40:06 +0000 (08:40 +0200)] 
tests: Add testcase for reconnect failure due to auth timeout

Add testcase to verify a failed reconnect attempt due to authentication
timeout blacklists the correct AP. Driver capabilities are forced to
non-SME and driver roaming (BSS selection) mode.

Signed-off-by: Mikael Kanstrup <mikael.kanstrup@sonymobile.com>
8 years agotests: Add testcase for (reassoc) roam failure due to auth timeout
Mikael Kanstrup [Tue, 20 Sep 2016 06:40:05 +0000 (08:40 +0200)] 
tests: Add testcase for (reassoc) roam failure due to auth timeout

Add testcase to verify failed roaming attempt due to authentication
timeout blacklists the correct AP. Roaming attempt is performed
with the reassociate command and bssid_set=1. Driver capabilities
are forced to non-SME and driver roaming (BSS selection) mode.

Signed-off-by: Mikael Kanstrup <mikael.kanstrup@sonymobile.com>
8 years agoAdd ignore_auth_resp control interface debug parameter
Mikael Kanstrup [Tue, 20 Sep 2016 06:40:04 +0000 (08:40 +0200)] 
Add ignore_auth_resp control interface debug parameter

Implement "SET ignore_auth_resp <0/1>" command to simulate auth/assoc
response loss and EAPOL RX packet loss by ignoring corresponding
incoming events.

Signed-off-by: Mikael Kanstrup <mikael.kanstrup@sonymobile.com>
8 years agonl80211: Remove unnecessary duplication from nl80211_set_param()
Jouni Malinen [Fri, 23 Sep 2016 09:19:57 +0000 (12:19 +0300)] 
nl80211: Remove unnecessary duplication from nl80211_set_param()

There is no need to find bss->drv separately for each parameter, so do
this once at the beginning of the function.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agonl80211: Add driver parameter force_bss_selection
Mikael Kanstrup [Tue, 20 Sep 2016 06:40:03 +0000 (08:40 +0200)] 
nl80211: Add driver parameter force_bss_selection

Add driver parameter command to force capability flag
WPA_DRIVER_FLAGS_BSS_SELECTION even if driver states otherwise. This is
mainly for testing purposes.

Signed-off-by: Mikael Kanstrup <mikael.kanstrup@sonymobile.com>
8 years agoBlacklist correct BSSID on authentication timeout
Mikael Kanstrup [Tue, 20 Sep 2016 06:40:07 +0000 (08:40 +0200)] 
Blacklist correct BSSID on authentication timeout

If authentication times out while reassociating to same ESS incorrect
BSSID may end up being blacklisted. Use pending_bssid field on
authentication timeout and deauthentication to ensure the correct AP
gets blacklisted. This is mainly to address cases related to Android
framework roaming behavior.

Signed-off-by: Mikael Kanstrup <mikael.kanstrup@sonymobile.com>
8 years agotests: Make pmksa_cache_{,opportunistic_}multiple_sta more robust
Jouni Malinen [Fri, 23 Sep 2016 13:02:46 +0000 (16:02 +0300)] 
tests: Make pmksa_cache_{,opportunistic_}multiple_sta more robust

Clear wpa_supplicant scan cache before starting these test cases since
the ROAM command depends on the correct BSS entry being found.
scan_for_bss() does not enforce that correct entry to be present if
there was an earlier BSS entry with the same BSSID.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: Reset wlan5 device before RELOG command
Jouni Malinen [Fri, 23 Sep 2016 13:01:36 +0000 (16:01 +0300)] 
tests: Reset wlan5 device before RELOG command

This moves the wpa_supplicant debug entries from the end of a test case
using a dynamically added wlan5 interface to the correct test case,
i.e., the test case that added the interface instead of whatever test
case happens to follow this.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: WPA-PSK AP and only rsn_pairwise set
Jouni Malinen [Fri, 23 Sep 2016 08:45:55 +0000 (11:45 +0300)] 
tests: WPA-PSK AP and only rsn_pairwise set

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoP2P: Fix common frequencies calculation for a group
Ilan Peer [Mon, 5 Sep 2016 14:33:01 +0000 (17:33 +0300)] 
P2P: Fix common frequencies calculation for a group

Ignore group members for which there is no supported channels
information when calculating common group frequencies.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
8 years agotests: Skip wpas_ap_dfs when MCC > 1
Ilan Peer [Tue, 6 Sep 2016 06:52:41 +0000 (09:52 +0300)] 
tests: Skip wpas_ap_dfs when MCC > 1

Skip wpas_ap_dfs in case that multi-channel is used, as
DFS operation is not supported in such a case.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
8 years agoP2P: Fix compilation warning in p2p_supplicant.c
Max Stepanov [Tue, 6 Sep 2016 06:44:33 +0000 (09:44 +0300)] 
P2P: Fix compilation warning in p2p_supplicant.c

On some architectures unsigned int differs from size_t, and
some compilers warn about it.

Signed-off-by: Max Stepanov <Max.Stepanov@intel.com>
8 years agoFlush the BSS (scan) entries when an interface becomes disabled
Moshe Benji [Mon, 5 Sep 2016 14:32:55 +0000 (17:32 +0300)] 
Flush the BSS (scan) entries when an interface becomes disabled

When an interface becomes disabled (e.g., when RF-kill becomes blocked)
we should clear the stored scan results to avoid maintaining stale
information.

Fix this by flushing the BSS entries when an interface becomes
disabled.

Signed-off-by: Moshe Benji <moshe.benji@intel.com>
8 years agodoc: Remove duplicate description for -t
Reiner Herrmann [Wed, 21 Sep 2016 19:54:01 +0000 (21:54 +0200)] 
doc: Remove duplicate description for -t

Signed-off-by: Reiner Herrmann <reiner@reiner-h.de>
8 years agotests: mode=mesh in STATUS
Jouni Malinen [Thu, 22 Sep 2016 20:20:48 +0000 (23:20 +0300)] 
tests: mode=mesh in STATUS

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoShow mode=mesh in STATUS command
Saurav Babu [Wed, 21 Sep 2016 14:25:26 +0000 (19:55 +0530)] 
Show mode=mesh in STATUS command

Signed-off-by: Saurav Babu <saurav.babu@samsung.com>
8 years agoDefine a QCA vendor command to validate encryption engine
Srinivas Dasari [Wed, 21 Sep 2016 07:37:32 +0000 (13:07 +0530)] 
Define a QCA vendor command to validate encryption engine

This command carries 802.11 header and payload along with key (TK) and
PN for encryption/decryption purpose. Firmware/driver encrypts/decrypts
the given data and sends to userspace as a response to the command. User
space component can validate the data received from the driver to unit
test the hardware's encryption engine.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: AP tracking STA taxonomy
Jouni Malinen [Wed, 21 Sep 2016 18:22:58 +0000 (21:22 +0300)] 
tests: AP tracking STA taxonomy

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotaxonomy: Store Probe Request frames in hostapd_sta_info
Denton Gentry [Mon, 15 Aug 2016 04:42:49 +0000 (21:42 -0700)] 
taxonomy: Store Probe Request frames in hostapd_sta_info

A weakness in the initial client taxonomy mechanism is from storing both
the Probe and Associate in struct sta_info. struct sta_info is created
after a client associates (or starts authentication frame exchange),
which means that any Probe Request frames sent prior to association are
not retained. The Associate Request frame has to be seen, and then
another Probe Request frame after association, before we have a
signature for the client.

Most clients send lots of Probe Request frames (lots and lots and lots
of Probes, actually), but a few do not. ChromeOS is notably sparing in
sending Probe Request frames, it can take a long time before a signature
for a ChromeOS device is available.

Store the most recent Probe Request frame in struct hostapd_sta_info
tracking list. When a struct sta_info is created, move the Probe Request
frame information from struct hostapd_sta_info to struct sta_info.

Signed-off-by: dgentry@google.com (Denton Gentry)
Signed-off-by: denny@geekhold.com (Denton Gentry)
Signed-off-by: rofrankel@google.com (Richard Frankel)
Signed-off-by: richard@frankel.tv (Richard Frankel)
8 years agoPassive Client Taxonomy
Denton Gentry [Mon, 15 Aug 2016 04:42:48 +0000 (21:42 -0700)] 
Passive Client Taxonomy

Implement the signature mechanism described in the paper
"Passive Taxonomy of Wifi Clients using MLME Frame Contents"
published by Denton Gentry and Avery Pennarun.

http://research.google.com/pubs/pub45429.html
https://arxiv.org/abs/1608.01725

This involves:
1. Add a CONFIG_TAXONOMY compile option. Enabling taxonomy incurs
   a memory overhead of up to several kilobytes per associated
   station.
2. If enabled, store the Probe Request and (Re)Associate Request frame in
   struct sta_info.
3. Implement code to extract the ID of each Information Element,
   plus selected fields and bitmasks from certain IEs, into a
   descriptive text string. This is done in a new source file,
   src/ap/taxonomy.c.
4. Implement a "signature qq:rr:ss:tt:uu:vv" command
   in hostapd_cli to retrieve the signature.

Signatures take the form of a text string. For example, a signature
for the Nexus 5X is:
  wifi4|probe:0,1,127,45,191,htcap:01ef,htagg:03,htmcs:0000ffff,vhtcap:338061b2,
  vhtrxmcs:030cfffa,vhttxmcs:030cfffa,extcap:00000a0201000040|assoc:0,1,48,45,
  221(0050f2,2),191,127,htcap:01ef,htagg:03,htmcs:0000ffff,vhtcap:339071b2,
  vhtrxmcs:030cfffa,vhttxmcs:030cfffa,extcap:0000000000000040

Signed-off-by: dgentry@google.com (Denton Gentry)
Signed-off-by: denny@geekhold.com (Denton Gentry)
Signed-off-by: rofrankel@google.com (Richard Frankel)
Signed-off-by: richard@frankel.tv (Richard Frankel)
8 years agoInitialize iface->sta_seen on allocation
Jouni Malinen [Wed, 21 Sep 2016 21:31:00 +0000 (00:31 +0300)] 
Initialize iface->sta_seen on allocation

Previously, struct hostapd_iface sta_seen list head was initialized only
when completing interface setup. This left a window for operation that
could potentially iterate through the list before the list head has been
initialized. While the existing code checked iface->num_sta_seen to
avoid this case, it is much cleaner to initialize the list when struct
hostapd_iface is allocated to avoid any accidental missing of the extra
checks before list iteration.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoP2P: Fix D-Bus persistent parameter in group started event on GO
Jouni Malinen [Tue, 20 Sep 2016 15:00:22 +0000 (18:00 +0300)] 
P2P: Fix D-Bus persistent parameter in group started event on GO

When starting a P2P GO, the struct p2p_go_neg_results may use
persistent_group == 2 to indicate use of persistent reconnect. Setting
ssid->p2p_persistent_group based on this did not take into account this
special case and that ended up in D-Bus code trying to encode 2 as a
DBUS_TYPE_BOOLEAN value which results in an assert from the library. Fix
this by setting ssid->p2p_persistent_group to 0 or 1 instead of raw
params->persistent_group value without any filtering.

This is similar to an earlier fix in commit
112fdee738d28c4e8bfb66ad7202d4348c4e7771 ('P2P: Fix D-Bus persistent
parameter in group started event') that addressed another code path in
sending out this D-Bus signal.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoRemove unused generation of Request Authenticator in Account-Request
Nick Lowe [Sun, 14 Aug 2016 14:40:11 +0000 (15:40 +0100)] 
Remove unused generation of Request Authenticator in Account-Request

Do not generate an unused and invalid Request Authenticator (random
value) when constructing Accounting-Request packets. The correct Request
Authenticator is calculated subsequently in radius_msg_finish_acct()
using MD5(msg + shared secret).

Signed-off-by: Nick Lowe <nick.lowe@lugatech.com>
8 years agotests: Setup wlantest once for qosmap tests
Jonathan Afek [Wed, 13 Jul 2016 17:06:05 +0000 (20:06 +0300)] 
tests: Setup wlantest once for qosmap tests

Some tests call the check_qos_map() function more than once. Make sure
each test sets up wlantest only once before the first time the function
is called.

The wlantest setup sets the channel for the wlantest interface and
executes the wlantest executable. It is more efficient to do that only
once for each test.

Signed-off-by: Jonathan Afek <jonathanx.afek@intel.com>
8 years agotests: Increase timeout for remote tests
Jonathan Afek [Wed, 13 Jul 2016 17:06:04 +0000 (20:06 +0300)] 
tests: Increase timeout for remote tests

Some operations take longer time on real hardware than on hwsim. This
commit increases two timeouts so that the tests will pass on real
hardware, too.

Signed-off-by: Jonathan Afek <jonathanx.afek@intel.com>
8 years agotests: Increase connection timeouts for remote tests
Jonathan Afek [Wed, 13 Jul 2016 17:06:03 +0000 (20:06 +0300)] 
tests: Increase connection timeouts for remote tests

Use increased timeouts for connect and disconnect since these operations
take a longer time on real harware than they do on hwsim.

Signed-off-by: Jonathan Afek <jonathanx.afek@intel.com>
8 years agoRevert "nl80211: Remove duplicated check in nl80211_setup_ap()"
Rafał Miłecki [Mon, 12 Sep 2016 17:28:22 +0000 (19:28 +0200)] 
Revert "nl80211: Remove duplicated check in nl80211_setup_ap()"

This reverts commit 647862eb60c324015ea31293cc052558b5185ca4.

The second check of device_ap_sme looks like duplicated, but it isn't
actually. The trick is nl80211_create_monitor_interface may change that
variable value and the second evaluation may give a different result.

This definitely isn't a very clear code, but that change caused a
regression for drivers that:
1) Don't report NL80211_ATTR_DEVICE_AP_SME
2) Don't support monitor mode
3) Don't support subscribing for PROBE_REQ and/or ACTION frames
like brcmfmac. With such drivers hostapd doesn't start anymore.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
8 years agoFix typos in wpa_supplicant configuration parameter documentation
Jouni Malinen [Sat, 10 Sep 2016 18:09:36 +0000 (21:09 +0300)] 
Fix typos in wpa_supplicant configuration parameter documentation

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agonl80211: Use the monitor interface only without device_ap_sme support
Sunil Dutt [Thu, 1 Sep 2016 16:44:36 +0000 (22:14 +0530)] 
nl80211: Use the monitor interface only without device_ap_sme support

The places using drv->use_monitor were already skipping creation of the
monitor interface if drv->device_ap_sme == 0. This means that the
monitor interface operations would not have worked anyway and it is safe
to set drv->use_monitor to zero for all such cases. This fixes an issue
with management frame subscription not happening properly for the case
where the AP SME is in the driver and the driver supports monitor
interfaces (for other purposes).

This commit also removes the check for monitor support and the
previously used workaround that cleared drv->use_monitor in
drv->device_ap_sme == 1 case if monitor interface was not supported
since that condition cannot occur anymore.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: Dynamic Interworking element update
Jouni Malinen [Thu, 8 Sep 2016 16:48:44 +0000 (19:48 +0300)] 
tests: Dynamic Interworking element update

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoFST: Fix search for peer's "other" connection
Dedy Lansky [Mon, 5 Sep 2016 11:41:00 +0000 (14:41 +0300)] 
FST: Fix search for peer's "other" connection

Upon receiving FST Setup Request from some peer on some interface,
search is made to see if same peer is connected on other interface with
specific band_id. With multiple peers, bug in
fst_group_does_iface_appear_in_other_mbies() caused wrong peer address
to be returned sometimes.

Fix this with a modified, simplified search algorithm of peer's "other"
connection.

Signed-off-by: Dedy Lansky <qca_dlansky@qca.qualcomm.com>
8 years agoFix mistakes in definition of QCA vendor commands for indoor location
Lior David [Tue, 6 Sep 2016 13:16:42 +0000 (16:16 +0300)] 
Fix mistakes in definition of QCA vendor commands for indoor location

Fix some mistakes in the previous commit for adding QCA vendor commands
for indoor location.

Note: The renamed enum value does not change the ABI, but the addition
of QCA_WLAN_VENDOR_ATTR_FTM_MEAS_INVALID in the beginning of enum
qca_wlan_vendor_attr_ftm_meas does renumber
QCA_WLAN_VENDOR_ATTR_FTM_MEAS_* values. The previous values were
committed yesterday and have not been used in any released code yet, so
this is a justifiable quick fix.

Signed-off-by: Lior David <qca_liord@qca.qualcomm.com>
8 years agoHandle NULL return from os_zalloc() in sta_track_add()
Joel Cunningham [Fri, 2 Sep 2016 20:38:47 +0000 (15:38 -0500)] 
Handle NULL return from os_zalloc() in sta_track_add()

This adds handling for a memory allocation failure in sta_track_add().

Signed-off-by: Joel Cunningham <joel.cunningham@me.com>