mech_eap.git
10 years agoRemove leftover timeouts on cleanup
Alexandru Costache [Mon, 12 May 2014 16:14:55 +0000 (19:14 +0300)]
Remove leftover timeouts on cleanup

Signed-off-by: Alexandru Costache <alexandru.costache.100@gmail.com>
10 years agotests: DUP_NETWORK
Jouni Malinen [Mon, 12 May 2014 15:50:05 +0000 (18:50 +0300)]
tests: DUP_NETWORK

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
10 years agoAdd 'dup_network <id_s> <id_d> <name>' command
Dmitry Shmidt [Tue, 29 Apr 2014 20:41:47 +0000 (13:41 -0700)]
Add 'dup_network <id_s> <id_d> <name>' command

This command allows to copy network variable from one network to
another, e.g., to clone the psk field without having to extract it from
wpa_supplicant.

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
10 years agodbus: Reorder deauthentication and cleanup calls when removing a network
Hannu Mallat [Mon, 12 May 2014 11:33:12 +0000 (14:33 +0300)]
dbus: Reorder deauthentication and cleanup calls when removing a network

Valgrind indicates reference to already freed memory if function
wpa_config_remove_network() is called prior to calling
wpa_supplicant_deauthenticate(), and this can lead to a crash.
Inverting the call order fixes the problem.

Signed-off-by: Hannu Mallat <hannu.mallat@jollamobile.com>
10 years agotests: Clear cfg80211 scan results before HT coex tests
Jouni Malinen [Sun, 11 May 2014 20:01:10 +0000 (23:01 +0300)]
tests: Clear cfg80211 scan results before HT coex tests

This is needed to avoid incorrect failures based on neighboring BSSes
from earlier test cases.

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agotests: UNAUTH-TLS
Jouni Malinen [Sun, 11 May 2014 17:59:07 +0000 (20:59 +0300)]
tests: UNAUTH-TLS

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agotests: EAP-pwd with server fragmenting messages
Jouni Malinen [Sun, 11 May 2014 17:54:15 +0000 (20:54 +0300)]
tests: EAP-pwd with server fragmenting messages

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agoEAP-pwd server: Allow fragment_size to be configured
Jouni Malinen [Sun, 11 May 2014 17:53:41 +0000 (20:53 +0300)]
EAP-pwd server: Allow fragment_size to be configured

Previously, the fragment_size parameter was ignored and the default
value of 1020 was hardcoded.

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agotests: EAP-IKEv2 fragmentation
Jouni Malinen [Sun, 11 May 2014 17:42:18 +0000 (20:42 +0300)]
tests: EAP-IKEv2 fragmentation

This adds a test case for the server fragmenting an EAP-IKEv2 message.
In addition, the fragmentation threshold is made shorter to trigger
fragmentation for all messages.

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agoEAP-IKEv2: Allow frag ack without integrity checksum
Jouni Malinen [Sun, 11 May 2014 17:40:44 +0000 (20:40 +0300)]
EAP-IKEv2: Allow frag ack without integrity checksum

RFC 5106 is not exactly clear on the requirements for the "no data"
packet that is used to acknowledge a fragmented message. Allow it to be
processed without the integrity checksum data field since it is possible
to interpret the RFC as this not being included. This fixes reassembly
of fragmented frames after keys have been derived.

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agotests: EAP-FAST and missing PAC configuration
Jouni Malinen [Sun, 11 May 2014 17:09:40 +0000 (20:09 +0300)]
tests: EAP-FAST and missing PAC configuration

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agotests: EAP-FAST using binary PAC file format
Jouni Malinen [Sun, 11 May 2014 17:03:45 +0000 (20:03 +0300)]
tests: EAP-FAST using binary PAC file format

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agotests: EAP-pwd with invalid group
Jouni Malinen [Sun, 11 May 2014 15:39:54 +0000 (18:39 +0300)]
tests: EAP-pwd with invalid group

This could result in wpa_supplicant segmentation fault prior to the
EAP-pwd fix for error case handling.

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agoEAP-pwd: Fix processing of group setup failure
Jouni Malinen [Sun, 11 May 2014 15:38:07 +0000 (18:38 +0300)]
EAP-pwd: Fix processing of group setup failure

If invalid group was negotiated, compute_password_element() left some of
the data->grp pointer uninitialized and this could result in
segmentation fault when deinitializing the EAP method. Fix this by
explicitly clearing all the pointer with eap_zalloc(). In addition,
speed up EAP failure reporting in this type of error case by indicating
that the EAP method execution cannot continue anymore on the peer side
instead of waiting for a timeout.

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agotests: Fix scan_bss_operations
Jouni Malinen [Sun, 11 May 2014 15:18:58 +0000 (18:18 +0300)]
tests: Fix scan_bss_operations

The BSS id numbers were assumed to start from 0 at the beginning of this
test case, but that is only the case if this is run as the first test
after starting wpa_supplicant. Fix the test case to figure out the id
values dynamically to avoid false errors.

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agotests: EAP-SIM/AKA configuration parameters
Jouni Malinen [Sun, 11 May 2014 14:08:31 +0000 (17:08 +0300)]
tests: EAP-SIM/AKA configuration parameters

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agoEAP-pwd peer: Export Session-Id through getSessionId callback
Jouni Malinen [Sun, 11 May 2014 18:22:55 +0000 (21:22 +0300)]
EAP-pwd peer: Export Session-Id through getSessionId callback

EAP-pwd was already deriving the EAP Session-Id, but it was not yet
exposed through the EAP method API.

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agoeapol_test: Check EAP-Key-Name
Jouni Malinen [Sun, 11 May 2014 09:43:09 +0000 (12:43 +0300)]
eapol_test: Check EAP-Key-Name

The new command line argument -e can be used to request the server to
send EAP-Key-Name in Access-Accept. If both the local EAP peer
implementation and server provide the EAP Session-Id, compare those
values and indicate in debug log whether a match was seen.

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agoRADIUS: Define EAP-Key-Name
Jouni Malinen [Sun, 11 May 2014 09:42:55 +0000 (12:42 +0300)]
RADIUS: Define EAP-Key-Name

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agotests: EAP-SIM/AKA/AKA' with SQLite
Jouni Malinen [Sat, 10 May 2014 22:06:00 +0000 (01:06 +0300)]
tests: EAP-SIM/AKA/AKA' with SQLite

Extend EAP-SIM/AKA/AKA' test coverage by setting up another
authentication server instance to store dynamic SIM/AKA/AKA' information
into an SQLite database. This allows the stored reauth/pseudonym data to
be modified on the server side and by doing so, allows testing fallback
from reauth to pseudonym/permanent identity.

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agoEAP-SIM peer: Fix counter-too-small message building
Jouni Malinen [Sun, 11 May 2014 14:54:59 +0000 (17:54 +0300)]
EAP-SIM peer: Fix counter-too-small message building

The extra data (nonce_s) used in this message was pointing to the
parsed, decrypted data and that buffer was previously freed just before
building the new message. This resulted in use of freed data and
possibly incorrect extra data value that caused the authentication
attempt to fail. Fix this by reordering the code to free the decrypted
data only after the new message has been generated. This was already the
case for EAP-AKA/AKA', but somehow missing from EAP-SIM.

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agotests: EAP with expanded Nak
Jouni Malinen [Sat, 10 May 2014 18:33:49 +0000 (21:33 +0300)]
tests: EAP with expanded Nak

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agotests: EAP roundtrip limit
Jouni Malinen [Sat, 10 May 2014 18:20:54 +0000 (21:20 +0300)]
tests: EAP roundtrip limit

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agotests: HS 2.0 with FT
Jouni Malinen [Sat, 10 May 2014 13:17:41 +0000 (16:17 +0300)]
tests: HS 2.0 with FT

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agoInterworking: Allow FT to be used for connection
Jouni Malinen [Sat, 10 May 2014 13:15:20 +0000 (16:15 +0300)]
Interworking: Allow FT to be used for connection

This extends Interworking network selection to enable FT-EAP as an
optional key_mgmt value to allow FT to be used instead of hardcoding
WPA2-Enterprise without FT.

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agoRemove duplicated ibss_rsn_deinit() call
Eduardo Abinader [Wed, 7 May 2014 22:42:52 +0000 (18:42 -0400)]
Remove duplicated ibss_rsn_deinit() call

No need to call ibss_rsn_deinit() again since it is already being called
by wpa_supplicant_mark_disassoc().

Signed-off-by: Eduardo Abinader <eduardo.abinader@openbossa.org>
10 years agoX.509: Fix v3 parsing with issuerUniqueID/subjectUniqueID present
Jouni Malinen [Sat, 10 May 2014 09:36:19 +0000 (12:36 +0300)]
X.509: Fix v3 parsing with issuerUniqueID/subjectUniqueID present

The current position pointer was not updated when issuerUniqueID or
subjectUniqueID were present. This could result in extensions being
ignored.

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agotests: Fix couple of compiler warnings
Jouni Malinen [Sat, 10 May 2014 09:15:36 +0000 (12:15 +0300)]
tests: Fix couple of compiler warnings

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agotests: Add 4.16.1 and 4.16.2 from NIST PKITS
Jouni Malinen [Fri, 9 May 2014 19:49:49 +0000 (22:49 +0300)]
tests: Add 4.16.1 and 4.16.2 from NIST PKITS

This adds two more X.509 path validation test cases.

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agoP2P: Refrain from performing extended listen during P2P connection
Sunil Dutt [Tue, 6 May 2014 16:34:37 +0000 (22:04 +0530)]
P2P: Refrain from performing extended listen during P2P connection

Do not perform extended listen period operations when either a P2P
connection is in progress. This makes the connection more robust should
an extended listen timer trigger during such an operation.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
10 years agoAdd macsec_qca driver wrapper
Hu Wang [Tue, 25 Mar 2014 19:39:02 +0000 (21:39 +0200)]
Add macsec_qca driver wrapper

This is based on driver_wired.c and provides driver interface for the
QCA MACsec driver.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
10 years agoMACsec: wpa_supplicant integration
Hu Wang [Tue, 25 Mar 2014 19:39:02 +0000 (21:39 +0200)]
MACsec: wpa_supplicant integration

Add MACsec to the wpa_supplicant build system and configuration file.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
10 years agoMACsec: Add PAE implementation
Hu Wang [Tue, 25 Mar 2014 19:39:02 +0000 (21:39 +0200)]
MACsec: Add PAE implementation

This adds initial implementation of IEEE Std 802.1X-2010 PAE for MACsec.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
10 years agoMACsec: Add driver_ops
Hu Wang [Tue, 25 Mar 2014 19:39:02 +0000 (21:39 +0200)]
MACsec: Add driver_ops

This defines new driver_ops to be used with MACsec.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
10 years agoMACsec: Add common IEEE 802.1X definitions
Hu Wang [Tue, 25 Mar 2014 19:39:02 +0000 (21:39 +0200)]
MACsec: Add common IEEE 802.1X definitions

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
10 years agoMACsec: Add define for EAPOL type MKA
Hu Wang [Mon, 31 Mar 2014 14:38:54 +0000 (17:38 +0300)]
MACsec: Add define for EAPOL type MKA

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
10 years agoMACsec: Allow EAPOL version 3 to be configured
Hu Wang [Mon, 31 Mar 2014 14:36:55 +0000 (17:36 +0300)]
MACsec: Allow EAPOL version 3 to be configured

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
10 years agoAdd function to fetch EAP Session-Id from EAPOL supplicant
Hu Wang [Tue, 25 Mar 2014 20:06:20 +0000 (22:06 +0200)]
Add function to fetch EAP Session-Id from EAPOL supplicant

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
10 years agonl80211: Use max associated STAs information in AP mode
Chandrasekaran, Manishekar [Mon, 5 May 2014 09:21:37 +0000 (14:51 +0530)]
nl80211: Use max associated STAs information in AP mode

Propagate max associated STAs in AP mode advertised by the driver to
core wpa_supplicant implemantion. This allows wpa_supplicant to update
the P2P GO group limit information automatically without having to
configure this limit manually. The information (if available) is also
used in the generic AP implementation to control maximum number of STA
entries.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
10 years agoFix MinGW build
Jouni Malinen [Tue, 29 Apr 2014 15:47:36 +0000 (18:47 +0300)]
Fix MinGW build

No need to use ENOBUFS within core wpa_supplicant, so just replace it
with -1 to work arounds MinGW build issues.

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agowpa_supplicant: Add Wake-on-WLAN configuration support
Eliad Peller [Thu, 24 Apr 2014 05:45:39 +0000 (08:45 +0300)]
wpa_supplicant: Add Wake-on-WLAN configuration support

Add a new wowlan_triggers option to wpa_supplicant.conf. The triggers in
this key will be used to configure the kernel wowlan configuration.

For now, support only simple flags. More complex triggers can be added
later on.

Signed-off-by: Eliad Peller <eliadx.peller@intel.com>
10 years agoAndroid: Use extended P2P functionality (ANDROID_P2P) for all vendors
Dmitry Shmidt [Fri, 11 Apr 2014 23:05:39 +0000 (16:05 -0700)]
Android: Use extended P2P functionality (ANDROID_P2P) for all vendors

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
10 years agoTDLS: Fully tear down existing link before setup
Arik Nemtsov [Thu, 24 Apr 2014 05:45:38 +0000 (08:45 +0300)]
TDLS: Fully tear down existing link before setup

Disabling the link only clears the local state. The remote peer will
still think we are connected and disallow the setup.

Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
10 years agoTDLS: Disable links during AP deauth in external flow
Arik Nemtsov [Thu, 24 Apr 2014 05:45:37 +0000 (08:45 +0300)]
TDLS: Disable links during AP deauth in external flow

When de-authenticating from the AP, disable each TDLS link after
sending the teardown packet. Postpone the reset of the peer state
data until after the link disable request.

Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
10 years agoTDLS: Make wpa_tdls_send_teardown() static
Jouni Malinen [Tue, 29 Apr 2014 15:09:17 +0000 (18:09 +0300)]
TDLS: Make wpa_tdls_send_teardown() static

This function was not used anywhere outside tdls.c.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
10 years agonl80211: Take ownership of dynamically added interfaces
Ilan Peer [Thu, 24 Apr 2014 05:45:33 +0000 (08:45 +0300)]
nl80211: Take ownership of dynamically added interfaces

Indicate to cfg80211 that interfaces created by the wpa_supplicant
or hostapd are owned by them, and that in case that the socket that
created them closes, these interfaces should be removed.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
10 years agonl80211: Cancel rfkill timeout on deinit
Eduardo Abinader [Sat, 26 Apr 2014 00:46:03 +0000 (20:46 -0400)]
nl80211: Cancel rfkill timeout on deinit

Got segfault, when freeing drv and there exists registered timeout for
blocked rfkill. This patch adds cancel timeout to avoid this.

Signed-off-by: Eduardo Abinader <eduardo.abinader@openbossa.org>
10 years agotests: Add more cred parameters into config file test
Jouni Malinen [Tue, 29 Apr 2014 14:24:00 +0000 (17:24 +0300)]
tests: Add more cred parameters into config file test

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
10 years agoHS 2.0 R2: Fix writing of domain_suffix_match cred parameter
Sreenath Sharma [Mon, 28 Apr 2014 11:57:47 +0000 (17:27 +0530)]
HS 2.0 R2: Fix writing of domain_suffix_match cred parameter

This was supposed to end with a newline character so that parameters are
aligned in configuration file.

Signed-off-by: Sreenath Sharma <sreenats@broadcom.com>
10 years agoTDLS: Pass peer's capability info to the driver in open mode
Pradeep Reddy POTTETI [Mon, 28 Apr 2014 14:56:17 +0000 (20:26 +0530)]
TDLS: Pass peer's capability info to the driver in open mode

Commit 96ecea5eb14cc1362cb01b914ac4163324294a28 did not consider
to pass the VHT/HT/WMM capabilities of the peer for BSS with
open mode.
Address this issue by passing the capabilities irrespective of
the security mode.

Signed-off-by: Pradeep Reddy POTTETI <c_ppotte@qti.qualcomm.com>
10 years agotests: Verify global control interface before starting each test
Jouni Malinen [Tue, 29 Apr 2014 11:46:09 +0000 (14:46 +0300)]
tests: Verify global control interface before starting each test

This allows control interface issues to be caught in a bit more readable
way in the debug logs. In addition, dump pending monitor socket
information more frequently and within each test case in the log files
to make the output clearer and less likely to go over the socket buffer
limit.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
10 years agotests: ROAM error cases
Jouni Malinen [Sat, 26 Apr 2014 19:05:34 +0000 (22:05 +0300)]
tests: ROAM error cases

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agotests: BSS command parameters
Jouni Malinen [Sat, 26 Apr 2014 19:01:55 +0000 (22:01 +0300)]
tests: BSS command parameters

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agotests: GET_CAPABILITY special cases
Jouni Malinen [Sat, 26 Apr 2014 18:44:23 +0000 (21:44 +0300)]
tests: GET_CAPABILITY special cases

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agotests: SET_CRED/GET_CRED error cases
Jouni Malinen [Sat, 26 Apr 2014 18:39:13 +0000 (21:39 +0300)]
tests: SET_CRED/GET_CRED error cases

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agotests: Additional REMOVE_CRED coverage
Jouni Malinen [Sat, 26 Apr 2014 18:35:07 +0000 (21:35 +0300)]
tests: Additional REMOVE_CRED coverage

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agotests: Large number of creds and LIST_CREDS truncation
Jouni Malinen [Sat, 26 Apr 2014 18:29:19 +0000 (21:29 +0300)]
tests: Large number of creds and LIST_CREDS truncation

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agotests: SET/GET_NETWORK failure cases
Jouni Malinen [Sat, 26 Apr 2014 18:23:44 +0000 (21:23 +0300)]
tests: SET/GET_NETWORK failure cases

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agotests: SELECT/ENABLE/DISABLE/REMOVE_NETWORK failure cases
Jouni Malinen [Sat, 26 Apr 2014 18:16:36 +0000 (21:16 +0300)]
tests: SELECT/ENABLE/DISABLE/REMOVE_NETWORK failure cases

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agotests: SELECT_NETWORK any
Jouni Malinen [Sat, 26 Apr 2014 18:10:56 +0000 (21:10 +0300)]
tests: SELECT_NETWORK any

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agotests: WPS PIN provisioning with configured WPS v1.0 AP
Jouni Malinen [Sat, 26 Apr 2014 14:46:32 +0000 (17:46 +0300)]
tests: WPS PIN provisioning with configured WPS v1.0 AP

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agotests: Make ap_wps_init_2ap_pin/pbc more robust
Jouni Malinen [Sat, 26 Apr 2014 14:25:26 +0000 (17:25 +0300)]
tests: Make ap_wps_init_2ap_pin/pbc more robust

It is possible for the scan to miss a Probe Response frame especially
under heavy load, so try again to avoid reporting invalid failures.

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agotests: Verify network information in SCAN_RESULTS
Jouni Malinen [Sat, 26 Apr 2014 14:18:37 +0000 (17:18 +0300)]
tests: Verify network information in SCAN_RESULTS

This checks WPA/RSN IE parsing result and WEP information in
SCAN_RESULTS.

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agotests: Invalid MAC address with BLACKLIST
Jouni Malinen [Sat, 26 Apr 2014 14:09:48 +0000 (17:09 +0300)]
tests: Invalid MAC address with BLACKLIST

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agotests: id_str in network configuration
Jouni Malinen [Sat, 26 Apr 2014 14:05:57 +0000 (17:05 +0300)]
tests: id_str in network configuration

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agotests: WPS command error cases
Jouni Malinen [Sat, 26 Apr 2014 13:53:44 +0000 (16:53 +0300)]
tests: WPS command error cases

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agotests: Make INTERWORKING_SELECT tests more robust
Jouni Malinen [Sat, 26 Apr 2014 13:01:52 +0000 (16:01 +0300)]
tests: Make INTERWORKING_SELECT tests more robust

It is possible for a scan to fail to see Probe Response or Beacon frame
under heavy load (e.g., during a parallel-vm.sh test run) since the
dwell time on a chanenl is quite short. Make the test cases using
INTERWORKING_SELECT more robust by trying again if the first attempt
does not find a matching BSS.

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agoCheck rx_mgmt::frame more consistently against NULL
Jouni Malinen [Sat, 26 Apr 2014 09:09:28 +0000 (12:09 +0300)]
Check rx_mgmt::frame more consistently against NULL

If a driver wrapper misbehaves and does not indicate a frame body in the
event, core hostapd code should handle this consistently since that case
was already checked for in one location.

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agoMake sta NULL-check easier for static analyzers
Jouni Malinen [Sat, 26 Apr 2014 08:51:19 +0000 (11:51 +0300)]
Make sta NULL-check easier for static analyzers

sta == NULL check is already done above based on category !=
WLAN_ACTION_PUBLIC, but that seems to be too complex for some static
analyzers, so avoid invalid reports by explicitly checking for this
again in the WLAN_ACTION_FT case.

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agoMake dl_list_first() and dl_list_last() uses easier for static analyzers
Jouni Malinen [Sat, 26 Apr 2014 08:43:25 +0000 (11:43 +0300)]
Make dl_list_first() and dl_list_last() uses easier for static analyzers

The previous check for dl_list_len() or having an entry from the list is
sufficient, but some static analyzers cannot figure out that
dl_list_first() and dl_list_last() will return non-NULL in this type of
cases. Avoid invalid reports by explicitly checking for NULL.

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agoWPS HTTP: Remove unused assignment
Jouni Malinen [Sat, 26 Apr 2014 08:26:42 +0000 (11:26 +0300)]
WPS HTTP: Remove unused assignment

bbp is not used in the code path that skips trailers.

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agoRemove duplicated variable zeroing
Jouni Malinen [Sat, 26 Apr 2014 08:24:24 +0000 (11:24 +0300)]
Remove duplicated variable zeroing

It's enough to do this once as part of the for loop.

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agoMake PMKID check easier for static analyzers
Jouni Malinen [Sat, 26 Apr 2014 08:20:37 +0000 (11:20 +0300)]
Make PMKID check easier for static analyzers

Checking sm->pmksa is sufficient here, but that seems to be too
difficult for static analyzers to follow, so avoid false reports by
explicitly checking pmkid as well.

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agoRemove floating constant suffix 'd' from test coee
Jouni Malinen [Sat, 26 Apr 2014 08:09:29 +0000 (11:09 +0300)]
Remove floating constant suffix 'd' from test coee

clang scan-build does not seem to like the 'd' suffix on floating
constants and ends up reporting analyzer failures. Since this suffix
does not seem to be needed, get rid of it to clear such warnings.

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agoACS: Clean up ifdef CONFIG_ACS to avoid unreachable code
Jouni Malinen [Fri, 25 Apr 2014 20:43:00 +0000 (23:43 +0300)]
ACS: Clean up ifdef CONFIG_ACS to avoid unreachable code

The conf->channel assignment was unreachable if CONFIG_ACS was not
defined, so move that to be under #else.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
10 years agoMake last_scan_res update easier for static analyzers
Jouni Malinen [Fri, 25 Apr 2014 20:19:47 +0000 (23:19 +0300)]
Make last_scan_res update easier for static analyzers

The check based on last_scan_res_used is sufficient for making sure that
last_scan_res is allocated. However, it is a bit too complex for static
analyzers to notice, so add an explicit check to avoid bogus reports.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
10 years agoP2P: Verify operating channel validity for NFC connection handover
Jouni Malinen [Fri, 25 Apr 2014 20:09:56 +0000 (23:09 +0300)]
P2P: Verify operating channel validity for NFC connection handover

p2p_freq_to_channel() could return an error if the GO or P2P Client
operating channel is not valid. Check for this before generating the NFC
handover message.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
10 years agotests: Make ap_wps_er_add_enrollee check a bit more robust
Jouni Malinen [Fri, 25 Apr 2014 19:45:12 +0000 (22:45 +0300)]
tests: Make ap_wps_er_add_enrollee check a bit more robust

It is possible for the final step of the test case to fail under load
(e.g., when using parallel-vm.sh with large number of VMs), so run
through additional scan iterations if the WPS-AUTH flag does not get
removed immediately.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
10 years agotests: HT 20/40 co-ex functionality during BSS lifetime
Jouni Malinen [Tue, 15 Apr 2014 14:42:40 +0000 (17:42 +0300)]
tests: HT 20/40 co-ex functionality during BSS lifetime

Verify that AP acts on 40 MHz intolerant STA association/disassociation
and on 20/40 co-ex report indicating 40 MHz intolerant AP showed up and
removed.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
10 years agonl80211: Remove unnecessary wpa_driver_nl80211_set_freq() wrapper
Jouni Malinen [Fri, 25 Apr 2014 09:02:25 +0000 (12:02 +0300)]
nl80211: Remove unnecessary wpa_driver_nl80211_set_freq() wrapper

This is not of any real use anymore with nl80211_set_channel() taking
care of channel setting operation.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
10 years agonl80211: Add support for changing AP mode channel bandwidth
Peng Xu [Mon, 14 Apr 2014 17:51:32 +0000 (20:51 +0300)]
nl80211: Add support for changing AP mode channel bandwidth

Configure driver with the new channel parameters (mainly, HT 20/40 MHz
bandwidth changes) as part of set_ap().

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
10 years agoSync with mac80211-next.git nl80211.h
Jouni Malinen [Tue, 29 Apr 2014 08:10:22 +0000 (11:10 +0300)]
Sync with mac80211-next.git nl80211.h

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agoRetry initial 20/40 MHz co-ex scan if the driver is busy
Peng Xu [Wed, 16 Apr 2014 15:45:53 +0000 (18:45 +0300)]
Retry initial 20/40 MHz co-ex scan if the driver is busy

This makes the initial OBSS scans in AP mode before starting 40 MHz BSS
more robust. In addition, HT20 can be used as a backup option if none of
the scans succeed.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
10 years agoAdd AP mode support for HT 20/40 co-ex Action frame
Peng Xu [Mon, 14 Apr 2014 18:21:40 +0000 (21:21 +0300)]
Add AP mode support for HT 20/40 co-ex Action frame

If a 2.4 GHz band AP receives a 20/40 Coexistence management frame from
a connected station with 20/40 BSS Intolerant Channel Report element
containing the channel list in which any legacy AP are detected or AP
with 40 MHz intolerant bit set in HT Cap IE is detected in the affected
range of the BSS, the BSS will be moved from 40 to 20 MHz channel width.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
10 years agohostapd: Extend support for HT 20/40 coexistence feature
Peng Xu [Mon, 14 Apr 2014 17:40:56 +0000 (20:40 +0300)]
hostapd: Extend support for HT 20/40 coexistence feature

Extend the minimal HT 20/40 co-ex support to include dynamic changes
during the lifetime of the BSS. If any STA connects to a 2.4 GHz AP with
40 MHz intolerant bit set then the AP will switch to 20 MHz operating
mode.

If for a period of time specified by OBSS delay factor and OBSS scan
interval AP does not have any information about 40 MHz intolerant STAs,
the BSS is switched from HT20 to HT40 mode.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
10 years agoMake channel parameters available in set_ap() driver operation
Peng Xu [Mon, 14 Apr 2014 18:05:26 +0000 (21:05 +0300)]
Make channel parameters available in set_ap() driver operation

This provides information to allow the driver to be configured for
updated channel parameters, e.g., when dynamically changing HT20/HT40
bandwidth.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
10 years agowpaspy: Handle DETACH response more robustly
Jouni Malinen [Mon, 28 Apr 2014 12:31:25 +0000 (15:31 +0300)]
wpaspy: Handle DETACH response more robustly

There could be pending unsolicited event messages on the monitor socket
when the DETACH command is issued. As such, the response may be
something else then OK even if the actual detach operation succeeded.
Try to avoid this be dropping pending messages before issuing the detach
command. As an additional workaround, check the response against FAIL
instead of requiring OK so that the self.attached does not get left to
True incorrectly even if an additional event message were to be
received.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
10 years agoIndicate disconnection event on interface disabled
Jouni Malinen [Sat, 26 Apr 2014 13:42:45 +0000 (16:42 +0300)]
Indicate disconnection event on interface disabled

It is possible for the disconnection event from the driver to not get
delivered when interface is disabled. To maintain consistent ctrl_iface
event behavior, indicate CTRL-EVENT-DISCONNECTED in such a case if we
were in connected state.

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agoFix wpa_config_read() with existing config block
Jouni Malinen [Sat, 26 Apr 2014 08:39:48 +0000 (11:39 +0300)]
Fix wpa_config_read() with existing config block

If two config files are merged together, the ssid and cred blocks may
not have been processed correctly since the tail pointers were not
updated to the last entry from the first configuration file.

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agoWPS: Print setsockopt() failure in debug log
Jouni Malinen [Fri, 25 Apr 2014 20:14:24 +0000 (23:14 +0300)]
WPS: Print setsockopt() failure in debug log

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
10 years agotrace: Replace demangle.h with internal defines
Jouni Malinen [Fri, 18 Apr 2014 16:07:35 +0000 (19:07 +0300)]
trace: Replace demangle.h with internal defines

It looks like the demangle.h from binutils-dev is not installed that
commonly anymore. Since we need only two defines from that file, replace
the header file with those defines to make it easier to build with
WPA_TRACE_BFD=y.

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years agonl80211: Fix some coding style issues
Jouni Malinen [Mon, 14 Apr 2014 10:39:18 +0000 (13:39 +0300)]
nl80211: Fix some coding style issues

Some trailing whitespace and spaces for indentation were present in the
driver wrapper and header files.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
10 years agoMake qca-vendor.h independent of other header files
Jouni Malinen [Fri, 25 Apr 2014 08:41:36 +0000 (11:41 +0300)]
Make qca-vendor.h independent of other header files

Move the definitions that depended in common.h into a separate header
file so that qca-vendor.h can be copied and used as-is in other
projects.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
10 years agonl80211: Allocate QCA vendor subcmd for extended statistics
Amar Singhal [Thu, 17 Apr 2014 16:54:30 +0000 (09:54 -0700)]
nl80211: Allocate QCA vendor subcmd for extended statistics

This allocates a QCA vendor subcmd for extended statistics
functionality and also an attribute for delivering the payload
for extended statistics.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
10 years agotests: Fix a typo on a wpas_config_file error path
Jouni Malinen [Thu, 24 Apr 2014 09:10:17 +0000 (12:10 +0300)]
tests: Fix a typo on a wpas_config_file error path

In addition, print the config files in error case to the debug log.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
10 years agowpa_supplicant: Call frequency conflict handling during auth
Ilan Peer [Thu, 24 Apr 2014 05:45:40 +0000 (08:45 +0300)]
wpa_supplicant: Call frequency conflict handling during auth

Previously, the frequency conflict was handled only during the
association flow. However, some drivers, e.g., mac80211 based
drivers, will fail an authentication request in case that there
are no available channels for use (as they might be used by
other interfaces), and thus the frequency conflict resolution
is never called.

Fix this by calling frequency conflict resolution during
authentication (SME-in-wpa_supplicant) as well.

In addition, get the shared radio frequency from the wpa_s context in
both the SME-in-driver and SME-in-wpa_supplicant cases and not from the
driver.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
10 years agoscan: Reset normal scan counter when a connection succeeds
Luciano Coelho [Thu, 24 Apr 2014 05:45:36 +0000 (08:45 +0300)]
scan: Reset normal scan counter when a connection succeeds

The normal scan counter is used to trigger a few normal scans before a
scheduled scan is issued. The reason for doing this is that we get
results faster and some drivers support more SSIDs per normal scan
than during sched scan. After 2 normal scans, we start using
sched_scan. But the problem is that when a connection succeeds, we do
not reset this counter, so we will keep using sched scans.

To fix this, now we reset the counter when we switch to WPA_COMPLETED
state.

Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
10 years agoradiotap: Fix compilation for systems without le16toh/le32toh
Ilan Peer [Thu, 24 Apr 2014 05:45:34 +0000 (08:45 +0300)]
radiotap: Fix compilation for systems without le16toh/le32toh

These functions are not standard and do not exist in all systems, e.g.,
variants of Android. Instead use the macros defined in common.h.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
10 years agoAndroid: Disable unused parameter warnings
Greg Hackmann [Tue, 15 Apr 2014 00:06:02 +0000 (17:06 -0700)]
Android: Disable unused parameter warnings

This avoids large number of undesired compiler warnings since Android
build system is added -Wextra.

Signed-off-by: Greg Hackmann <ghackmann@google.com>
10 years agoInterworking: Don't filter probe requests when interworking is disabled
Maxime Bizon [Wed, 23 Apr 2014 21:23:37 +0000 (23:23 +0200)]
Interworking: Don't filter probe requests when interworking is disabled

With hidden SSID (ignore_broadcast_ssid), an IOS device trying to
connect to the AP will send a probe request with ANT == 2. If
interworking support is just compiled (not enabled), we will drop the
probe request since default ANT is 0.

Check that interworking is enabled before filtering based on ANT or
HESSID to match the behavior of code without CONFIG_INTERWORKING.

Signed-off-by: Maxime Bizon <mbizon@freebox.fr>