mech_eap.git
11 years agoTDLS: Fix TDLS Setup Request processing in existing-peer cases
Jouni Malinen [Thu, 28 Mar 2013 10:38:24 +0000 (12:38 +0200)]
TDLS: Fix TDLS Setup Request processing in existing-peer cases

wpa_tdls_peer_free() ended up getting called after some of the
parameters from the TDLS Setup Request frame were copied into the struct
wpa_tdls_peer information. This could result in continuing with cleared
information in case the new exchange was the one that is used in
concurrent initialization case or if this is to re-negotiated an
existing TDLS link. The driver would not be provided with all the peer
capabilities correctly in such case.

Fix this by moving the existing_peer check to happen before the
information from the TDLS Setup Request frame is copied.

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

11 years agotests: Add more test cases for TDLS functionality
Jouni Malinen [Wed, 27 Mar 2013 14:40:49 +0000 (16:40 +0200)]
tests: Add more test cases for TDLS functionality

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

11 years agotests: Use more thorough validation of TDLS frame paths
Jouni Malinen [Wed, 27 Mar 2013 14:05:52 +0000 (16:05 +0200)]
tests: Use more thorough validation of TDLS frame paths

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

11 years agotests: Add forgotten new files to the repository
Jouni Malinen [Wed, 27 Mar 2013 12:40:10 +0000 (14:40 +0200)]
tests: Add forgotten new files to the repository

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

11 years agoTDLS: Fix TPK M2 processing in concurrent initiation case
Jouni Malinen [Wed, 27 Mar 2013 12:17:23 +0000 (14:17 +0200)]
TDLS: Fix TPK M2 processing in concurrent initiation case

If we accept the peer TPK M1 after having sent our TPK M1, we need to
reject TPK M2 from the peer to avoid going through two TDLS setup
exchanges.

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

11 years agotests: Add initial AP tests with hostapd
Jouni Malinen [Wed, 27 Mar 2013 11:57:48 +0000 (13:57 +0200)]
tests: Add initial AP tests with hostapd

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

11 years agotests: Fix TDLS counter validation
Jouni Malinen [Wed, 27 Mar 2013 11:32:36 +0000 (13:32 +0200)]
tests: Fix TDLS counter validation

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

11 years agoP2P: Write p2p_ignore_shared_freq to configuration file on updates
Jouni Malinen [Tue, 26 Mar 2013 20:24:41 +0000 (22:24 +0200)]
P2P: Write p2p_ignore_shared_freq to configuration file on updates

Commit b277a2bebc9365ec7db444d51e34aab6d1b48e63 added a new global
configuration parameter, but forgot to update configuration file saving
to store this.

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

11 years agoP2P: Ignore Tx acknowledgment status for Invitation Response
Vivek Natarajan [Mon, 25 Mar 2013 22:28:56 +0000 (00:28 +0200)]
P2P: Ignore Tx acknowledgment status for Invitation Response

In some cases where the ack for Invitation response is lost,
the device is stuck in invited state but the peer device starts
GO. In line with the implementation of Negotiation Confirm,
assume invitation response was actually received by the peer
even though ack was not reported.

Signed-hostap: Vivek Natarajan <nataraja@qca.qualcomm.com>

11 years agoAdd ap_vendor_elements for wpa_supplicant AP/P2P GO mode
Jouni Malinen [Thu, 21 Mar 2013 13:52:41 +0000 (15:52 +0200)]
Add ap_vendor_elements for wpa_supplicant AP/P2P GO mode

This new parameter allows wpa_supplicant AP mode operations to use
similar design to the vendor_elements parameter in hostapd to add
vendor_elements into Beacon/Probe Response IE parameters.

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

11 years agoAdd vendor_elements into Beacon/Probe Response IE parameters
Jouni Malinen [Thu, 21 Mar 2013 13:41:27 +0000 (15:41 +0200)]
Add vendor_elements into Beacon/Probe Response IE parameters

Commit b52f084cfaae5a10bf5886cfa159d2df0dfc350a introduced a mechanism
for adding arbitrary vendor-specific elements into the Beacon and Probe
Response frames. However, this information was not added to the separate
buffers used for specifying Beacon and Probe Response IEs for drivers
that build the frames internally. Add vendor_elements to these values,
too, to support such drivers in addition to drivers that use the full
Beacon tail/head buffers.

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

11 years agonl80211: Add debug prints for set_ap parameters
Jouni Malinen [Thu, 21 Mar 2013 13:40:25 +0000 (15:40 +0200)]
nl80211: Add debug prints for set_ap parameters

This makes it easier to see how exactly the driver is configured for AP
mode operations.

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

11 years agotests: Add concurrent version of P2P test setup
Jouni Malinen [Tue, 19 Mar 2013 08:58:28 +0000 (10:58 +0200)]
tests: Add concurrent version of P2P test setup

A virtual station interface in scanning state can change the P2P
operations quite a bit, so running all the P2P tests also in such
setup can increase testing coverage quite a bit.

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

11 years agonl80211: Fix mode settings with split wiphy dump
Johannes Berg [Tue, 19 Mar 2013 00:01:46 +0000 (02:01 +0200)]
nl80211: Fix mode settings with split wiphy dump

When the wiphy information is split, there's no guarantee that the
channels are processed before the bitrates; in fact, with the current
kernel it happens the other way around. Therefore, the mode information
isn't set up correctly and there's no 11g mode.

Fix this by doing the 11b/11g determination as part of the
postprocessing.

Signed-hostap: Johannes Berg <johannes.berg@intel.com>

11 years agowpaspy: Add native Python implementation of ctrl_iface access
Jouni Malinen [Mon, 18 Mar 2013 23:53:09 +0000 (01:53 +0200)]
wpaspy: Add native Python implementation of ctrl_iface access

This can be used as a replacement for the wpaspy.c module that uses
wpa_ctrl.c to access wpa_supplicant/hostapd control interface. Only
the UNIX domain socket version of the control interface is currently
supported.

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

11 years agoP2P: Stop P2P_PD_DURING_FIND wait on PD Response RX
Jouni Malinen [Mon, 18 Mar 2013 18:31:47 +0000 (20:31 +0200)]
P2P: Stop P2P_PD_DURING_FIND wait on PD Response RX

Previously, P2P_PD_DURING_FIND state was scheduled for 200 ms and the
P2P state was not change until that timeout regardless of whether the PD
Response for recieved or not. There is no need to wait for that timeout
if the response is received, so allow the next operation to be performed
immediately after the response has been processed.

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

11 years agotests: Use social channel scan to speed up tests
Jouni Malinen [Mon, 18 Mar 2013 15:36:12 +0000 (17:36 +0200)]
tests: Use social channel scan to speed up tests

The discovery and group formation test cases do not need to run the full
scan as the first step, so get rid of it to make the tests complete more
quickly.

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

11 years agoP2P: Postpone P2P scan only if station mode scan is pending
Jouni Malinen [Mon, 18 Mar 2013 15:11:15 +0000 (17:11 +0200)]
P2P: Postpone P2P scan only if station mode scan is pending

sta_scan_pending was supposed to be accurate enough for determining
whether a P2P scan needs to be postponed. However, it has turned out
that there were cases where sta_scan_pending was not cleared properly.
While the known cases have now been addressed, it is possible that some
other cases may still exist. To avoid issues with P2P operationg getting
stuck, verify more carefully that there is a real pending station mode
scan (either in progress or scheduled to be requested).

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

11 years agoUse special scan result processing steps only on requesting interface
Jouni Malinen [Mon, 18 Mar 2013 15:07:09 +0000 (17:07 +0200)]
Use special scan result processing steps only on requesting interface

Scan result events are shared between all virtual interfaces sharing the
same radio. However, some of the steps are not really appropriate on
virtual interfaces that did not issue the scan request. Fix this by
making these steps conditional on the scan results being processed on
the interface that requested them.

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

11 years agoP2P: Re-start P2P operation if station mode scanning is stopped
Jouni Malinen [Mon, 18 Mar 2013 15:04:23 +0000 (17:04 +0200)]
P2P: Re-start P2P operation if station mode scanning is stopped

There were couple of code paths that could end up stopping station mode
scanning without clearing sta_scan_pending. This could result in P2P
search getting stuck waiting for completion of station mode scan which
would never show up. Fix this by calling wpas_p2p_continue_after_scan()
in cases where station mode scans are stopped. This allows
sta_scan_pending to be cleared and P2P search operation continued.

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

11 years agoP2P: Use common function for re-starting P2P scan after station scan
Jouni Malinen [Mon, 18 Mar 2013 14:31:09 +0000 (16:31 +0200)]
P2P: Use common function for re-starting P2P scan after station scan

Make the implementation more consistent and cleaner by using a single
function for addressing all the cases where completion of a station mode
scan operation allows a P2P operation (search) to be re-started.

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

11 years agonl80211: Include interface name in more debug prints
Jouni Malinen [Mon, 18 Mar 2013 14:05:24 +0000 (16:05 +0200)]
nl80211: Include interface name in more debug prints

This makes it easier to understand how scan operations and events occur
when multiple interfaces is being controlled by a single wpa_supplicant
process.

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

11 years agoAndroid: Enable WNM in the build
Jouni Malinen [Sun, 17 Mar 2013 18:19:44 +0000 (20:19 +0200)]
Android: Enable WNM in the build

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

11 years agoAndroid: Use CONFIG_WNM mode consistently
Jouni Malinen [Sun, 17 Mar 2013 18:13:46 +0000 (20:13 +0200)]
Android: Use CONFIG_WNM mode consistently

Replace CONFIG_IEEE80211V with CONFIG_WNM to get more consistent build
options for WNM-Sleep Mode operations. This is similar to the Makefile
change in commit ad3872a3720df13d8fc1a4345a5f0a8c3a204b4e.

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

11 years agoAndroid: Fix CONFIG_WNM use in Android.mk
Jouni Malinen [Sun, 17 Mar 2013 18:10:44 +0000 (20:10 +0200)]
Android: Fix CONFIG_WNM use in Android.mk

This code was within ifdef CONFIG_AP and did not get included unless
AP mode support was also enabled. This is similar to the Makefile
change in commit 2dfb9a447c7b71e03d4f4a318b4f8d67244d57d1.

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

11 years agoAndroid: Update Android.mk based on Makefile changes
Jouni Malinen [Sun, 17 Mar 2013 18:08:23 +0000 (20:08 +0200)]
Android: Update Android.mk based on Makefile changes

This brings the Android makefiles a bit closer to the Makefile changes
that had been missed in the past.

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

11 years agotests: Give document string for each test case as a description
Jouni Malinen [Sun, 17 Mar 2013 09:19:24 +0000 (11:19 +0200)]
tests: Give document string for each test case as a description

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

11 years agotests: Group formation with PBC
Jouni Malinen [Sun, 17 Mar 2013 09:10:59 +0000 (11:10 +0200)]
tests: Group formation with PBC

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

11 years agotests: Add P2P device discovery and provision discovery test case
Jouni Malinen [Sun, 17 Mar 2013 08:58:48 +0000 (10:58 +0200)]
tests: Add P2P device discovery and provision discovery test case

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

11 years agoConvert WPS NFC python scripts from using wpactrl to wpaspy
Jouni Malinen [Sat, 16 Mar 2013 19:47:10 +0000 (21:47 +0200)]
Convert WPS NFC python scripts from using wpactrl to wpaspy

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

11 years agowpaspy: Fix exception handling in the test script
Jouni Malinen [Sat, 16 Mar 2013 19:46:51 +0000 (21:46 +0200)]
wpaspy: Fix exception handling in the test script

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

11 years agowpa_supplicant: Fix lookup of cached PMKSA
Partha Narasimhan [Sat, 16 Mar 2013 10:45:31 +0000 (12:45 +0200)]
wpa_supplicant: Fix lookup of cached PMKSA

This fixes the lookup of a usable PMKSA entry in the cache. Using
wpa_s->current_ssid often returns nothing when a usable PMKSA exists in
the cache since wpa_s->current_ssid does not necessarily point to the
correct network entry at this point in time (prior to association).

Signed-hostap: Partha Narasimhan <parthan@gmail.com>

11 years agoAdd capability flag for IBSS and add get_capability modes
Bruno Randolf [Sat, 16 Mar 2013 10:42:15 +0000 (12:42 +0200)]
Add capability flag for IBSS and add get_capability modes

Add a driver capability flag for drivers which support IBSS mode and set
it for nl80211 drivers which have set the NL80211_IFTYPE_ADHOC.

Add a new option "modes" to "get_capability" which will return "AP" and
"IBSS" if the corresponding capability flags are set.

The idea is that this can be used for UIs to find out if the driver
supports IBSS mode.

Signed-hostap: Bruno Randolf <br1@einfach.org>

11 years agohostapd: Fix client reassociation after disconnect due to ACK failure
Felix Fietkau [Sat, 16 Mar 2013 10:35:49 +0000 (12:35 +0200)]
hostapd: Fix client reassociation after disconnect due to ACK failure

Clear WLAN_STA_ASSOC_REQ_OK, otherwise no Class 3 frame will be sent to
the disconnected STA in response to data frames.

Signed-hostap: Felix Fietkau <nbd@openwrt.org>

11 years agoFix build with CONFIG_NO_CONFIG_BLOBS
Jouni Malinen [Sat, 16 Mar 2013 10:20:21 +0000 (12:20 +0200)]
Fix build with CONFIG_NO_CONFIG_BLOBS

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

11 years agoFix build without CONFIG_CTRL_IFACE or CONFIG_NO_STDOUT_DEBUG
Solomon Peachy [Sat, 16 Mar 2013 10:07:18 +0000 (12:07 +0200)]
Fix build without CONFIG_CTRL_IFACE or CONFIG_NO_STDOUT_DEBUG

Signed-off-by: Solomon Peachy <pizza@shaftnet.org>
11 years agolibtommath: Avoid a compiler warning on unused variable
Jouni Malinen [Sat, 16 Mar 2013 10:03:37 +0000 (12:03 +0200)]
libtommath: Avoid a compiler warning on unused variable

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

11 years agolibtommath: Condition fast_s_mp_mul_digs() on LTM_FAST
Solomon Peachy [Sat, 16 Mar 2013 10:01:03 +0000 (12:01 +0200)]
libtommath: Condition fast_s_mp_mul_digs() on LTM_FAST

This function uses ~1.7kB of stack, and since there's a slower
alternative, wrap it with LTM_FAST.

Signed-off-by: Solomon Peachy <pizza@shaftnet.org>
11 years agotests: Use social-only scan by default to speed up tests
Jouni Malinen [Sat, 16 Mar 2013 09:47:01 +0000 (11:47 +0200)]
tests: Use social-only scan by default to speed up tests

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

11 years agotests: Add GO Negotiation without pre-authorization
Jouni Malinen [Sat, 16 Mar 2013 09:36:59 +0000 (11:36 +0200)]
tests: Add GO Negotiation without pre-authorization

This is the most common sequence for initiating GO Negotiation, so
include a test case that uses threads to follow both peers at the
same time to allow GO Negotiation to be re-initiated.

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

11 years agotests: Fix wait duration
Jouni Malinen [Sat, 16 Mar 2013 09:21:22 +0000 (11:21 +0200)]
tests: Fix wait duration

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

11 years agoP2P: Remove persistent group peer if it rejects invitation
Jouni Malinen [Fri, 15 Mar 2013 14:31:31 +0000 (16:31 +0200)]
P2P: Remove persistent group peer if it rejects invitation

If a peer replies to persistent group invitation with status code 8
(unknown group), remove the peer from the p2p_client_list if we are the
GO or remove the persistent group if we are the P2P client since it
looks like that the peer has dropped persistent group credentials and
the provisioning step needs to be executed again.

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

11 years agoP2P: Allow shared interface channel preference to be ignored
Jouni Malinen [Thu, 14 Mar 2013 14:32:35 +0000 (16:32 +0200)]
P2P: Allow shared interface channel preference to be ignored

p2p_ignore_shared_freq=1 in the configuration file (or "SET
p2p_ignore_shared_freq 1" on control interface) can now be used to
configure wpa_supplicant to ignore the preference on shared operating
channel when the driver support multi-channel concurrency. The default
behavior is to try to start any new P2P group on an operating channel
that is already in use on another virtual interface to avoid extra cost
from hopping between multiple channels. If this new parameter is set to
1, such preference is not used and instead, the channel for the new P2P
group is selected based on other preferences while ignoring operating
channels of any concurrent connection.

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

11 years agoP2P: Fix shared frequency preference for concurrent operations
Jouni Malinen [Thu, 14 Mar 2013 14:22:31 +0000 (16:22 +0200)]
P2P: Fix shared frequency preference for concurrent operations

Commit 50285f5ca8086cca45afa42cd23c3a3c1cd58f40 changed number of rules
in channel selection and among other things, it broke the design where
the currently used operating channel on a virtual interface that is
shared by the same radio is preferred to avoid costs related to
multi-channel concurrency. Fix this regression by making the P2P module
aware of the shared channel and using that preference as the highest
priority when re-selecting the channel during negotiation.

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

11 years agoP2P: Use best-overall channel in p2p_reselect_channel()
Jouni Malinen [Thu, 14 Mar 2013 14:05:47 +0000 (16:05 +0200)]
P2P: Use best-overall channel in p2p_reselect_channel()

Commit 50285f5ca8086cca45afa42cd23c3a3c1cd58f40 ended up forcing channel
re-selection in number of cases where the peer would actually have
accepted our initial preference. Fix the parts related to best channel
information by using best_freq_overall as the highest priority and by
skipping the band changes if the peer supports the channel that we
picked since these were based on the assumption that
p2p_reselect_channel() is called only if the peer could not accept our
initial choice which is not the case anymore.

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

11 years agoP2P: Allow all channels for multi-channel concurrency (no negotiation)
Jouni Malinen [Thu, 14 Mar 2013 13:38:11 +0000 (15:38 +0200)]
P2P: Allow all channels for multi-channel concurrency (no negotiation)

Commit 79879f4ae8f3eacee52699e3ccd5e0baba601c4d enabled all channels to
be used when negotiating channel with a driver that supports
multi-channel concurrency. Extend that to cover cases where the channel
is not being negotiated (e.g., p2p_group_add to start a GO).

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

11 years agoTDLS: Disable link to existing peer with lower address
Sunil Dutt [Thu, 14 Mar 2013 11:48:36 +0000 (13:48 +0200)]
TDLS: Disable link to existing peer with lower address

If the previously started setup is terminated in case both peers
initiate TDLS link at more or less the same time, disable the old link
to allow the dummy station entry to be deleted from cfg80211 so that a
new entry can be added for the setup direction that will be allowed to
proceed.

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

11 years agoFix compiler warning when CONFIG_IEEE80211R is not included
Jouni Malinen [Wed, 13 Mar 2013 10:38:26 +0000 (12:38 +0200)]
Fix compiler warning when CONFIG_IEEE80211R is not included

Commit 6a1ce39599c857e6e612d8dd81e892ec5ca36c7c moved the bssid
variable declaration to be outside CONFIG_IEEE80211R block and
triggered a compiler warning about unused variable.

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

11 years agoWPS NFC: Fix build without CONFIG_WPS_ER
Jouni Malinen [Tue, 12 Mar 2013 22:01:32 +0000 (00:01 +0200)]
WPS NFC: Fix build without CONFIG_WPS_ER

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

11 years agoAndroid: Enable IEEE 802.11r in wpa_supplicant builds
Deepthi Gowri [Tue, 12 Mar 2013 18:09:41 +0000 (20:09 +0200)]
Android: Enable IEEE 802.11r in wpa_supplicant builds

Signed-off-by: Deepthi Gowri <deepthi@codeaurora.org>
11 years agoFT: Add support for IEEE 802.11r with driver-based SME
Deepthi Gowri [Tue, 12 Mar 2013 18:08:53 +0000 (20:08 +0200)]
FT: Add support for IEEE 802.11r with driver-based SME

Add NL80211_CMD_UPDATE_FT_IES to support update of FT IEs to the
WLAN driver. Add NL80211_CMD_FT_EVENT to send FT event from the
WLAN driver. This will carry the target AP's MAC address along
with the relevant Information Elements. This event is used to
report received FT IEs (MDIE, FTIE, RSN IE, TIE, RICIE).

Signed-off-by: Deepthi Gowri <deepthi@codeaurora.org>
11 years agoP2P: Add a peer entry based on Association Request frame
Jouni Malinen [Tue, 12 Mar 2013 11:04:33 +0000 (13:04 +0200)]
P2P: Add a peer entry based on Association Request frame

It is possible for a P2P client to connect to an operating group without
exchanging any Probe Request/Response frames that would allow the GO to
discover the peer. To make sure there is a P2P peer entry at the GO, try
to add the peer information based on P2P IE in (Re)Association Request
frame.

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

11 years agoP2P: Clear p2p_in_provisioning flag on group removal
Vivek Natarajan [Mon, 11 Mar 2013 18:47:24 +0000 (20:47 +0200)]
P2P: Clear p2p_in_provisioning flag on group removal

Commit 77dfafd07d3a0335e250b8ffaf74fe7b3714b0bc cancels group formation
timeout on group removal case but failed to reset the
p2p_in_provisioning flag. This can lead to repeated p2p_find failures if
the group gets removed before completion of the WPS provisioning step
(e.g., GO tears down the group). Fix this by clearing
p2p_pin_provisioning when cancelling group formation.

Signed-hostap: Vivek Natarajan <nataraja@qca.qualcomm.com>

11 years agoAndroid: Enable IEEE 802.11w support in the build
Chet Lanctot [Mon, 11 Mar 2013 11:52:13 +0000 (13:52 +0200)]
Android: Enable IEEE 802.11w support in the build

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

11 years agoAllow SME SA Query to be used by all drivers
Chet Lanctot [Mon, 11 Mar 2013 11:49:40 +0000 (13:49 +0200)]
Allow SME SA Query to be used by all drivers

The unprotected disconnection events were previously processed only for
drivers that used the wpa_supplicant SME implementation (separate
authentication and association commands). However, this can be useful
for drivers that use the connect API, so remove the limitation and allow
the same IEEE 802.11w SA Query mechanism to be used even without full
use of the wpa_supplicant SME.

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

11 years agoAndroid: Sync makefile changes for HT/VHT overrides
Jouni Malinen [Sun, 10 Mar 2013 16:05:40 +0000 (18:05 +0200)]
Android: Sync makefile changes for HT/VHT overrides

CONFIG_HT_OVERRIDES and CONFIG_VHT_OVERRIDES were already mentioned in
android.config, but Android.mk did not yet know about them.

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

11 years agowpa_supplicant: Support VHT capability overrides
Johannes Berg [Sun, 10 Mar 2013 16:04:39 +0000 (18:04 +0200)]
wpa_supplicant: Support VHT capability overrides

Add support for VHT capability overrides to allow testing connections
with a subset of the VHT capabilities that are actually supported by
the device. The only thing that isn't currently supported (by mac80211
and this code) is the RX/TX highest rate field.

Signed-hostap: Johannes Berg <johannes.berg@intel.com>

11 years agowpa_supplicant: Parse int values in different bases and reject invalid
Johannes Berg [Sun, 10 Mar 2013 15:55:24 +0000 (17:55 +0200)]
wpa_supplicant: Parse int values in different bases and reject invalid

Instead of using atoi(), use strtol() which allows checking if
the configuration values are valid integers and can understand
more than just decimal (also hexadecimal and octal). This not
only allows specifying some fields in hex (which can be useful)
but also rejecting invalid configurations, e.g.,
        disassoc_low_ack=27 * 2
which was previously read as just 27.

Signed-hostap: Johannes Berg <johannes.berg@intel.com>

11 years agowpa_supplicant: Reschedule sched scan after network change
David Spinadel [Sun, 10 Mar 2013 15:51:13 +0000 (17:51 +0200)]
wpa_supplicant: Reschedule sched scan after network change

Stop sched scan, if running, after any disabling or removing of
a network, and request a new scan if needed.

Signed-hostap: David Spinadel <david.spinadel@intel.com>

11 years agoRemove unnecessary local variable
Jouni Malinen [Sun, 10 Mar 2013 15:45:15 +0000 (17:45 +0200)]
Remove unnecessary local variable

The ssid parameter (if NULL) can be used for the loop, too, to make the
code look a bit prettier.

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

11 years agowpa_supplicant: Handle enabling of one or all networks equally
David Spinadel [Sun, 10 Mar 2013 15:43:00 +0000 (17:43 +0200)]
wpa_supplicant: Handle enabling of one or all networks equally

Move enabling a network to a separate function. Try to reconnect if not
associated to an AP. Abort scheduled scan in any case of a new scan.

Signed-hostap: David Spinadel <david.spinadel@intel.com>

11 years agowpa_supplicant: Save prev_sched_ssid only if needed
David Spinadel [Sun, 10 Mar 2013 15:32:03 +0000 (17:32 +0200)]
wpa_supplicant: Save prev_sched_ssid only if needed

If the whole ssid list was scanned, don't save the prev scheduled ssid
since we are going to start from beginning. Thos avoids starting sched
scan from prev_sched_ssid after scanning the full list, in case of
adding a network to ssid during scheduled scan.

Signed-hostap: David Spinadel <david.spinadel@intel.com>

11 years agowpa_supplicant: Do not allow too short sched scan
David Spinadel [Sun, 10 Mar 2013 15:27:48 +0000 (17:27 +0200)]
wpa_supplicant: Do not allow too short sched scan

In case that the ssid list is longer than max number of ssids,
ths scheduled scan aborted after timeout and rescheduled again
with shorter timeout and longer interval. In case that the timeout
is shorter than the interval, only one scan iteration will
be run. In this case, go back to the initial values.

Signed-hostap: David Spinadel <david.spinadel@intel.com>

11 years agonl80211: Use helper function for phy_info_freqs()
Jouni Malinen [Sun, 10 Mar 2013 14:44:23 +0000 (16:44 +0200)]
nl80211: Use helper function for phy_info_freqs()

This allows one level of indentation to be removed by using a helper
function to process each frequency.

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

11 years agonl80211: Split phy_info_band() into smaller helper functions
Jouni Malinen [Sun, 10 Mar 2013 14:35:23 +0000 (16:35 +0200)]
nl80211: Split phy_info_band() into smaller helper functions

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

11 years agonl80211: Use helper function for phy_info_handler()
Jouni Malinen [Sun, 10 Mar 2013 14:17:18 +0000 (16:17 +0200)]
nl80211: Use helper function for phy_info_handler()

This allows one level of indentation to be removed by using a helper
function to process each wiphy band.

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

11 years agonl80211: Split wiphy_info_handler() into smaller helper functions
Jouni Malinen [Sun, 10 Mar 2013 14:05:55 +0000 (16:05 +0200)]
nl80211: Split wiphy_info_handler() into smaller helper functions

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

11 years agonl80211: Support splitting wiphy information in dumps
Dennis H Jensen [Sun, 10 Mar 2013 11:22:43 +0000 (13:22 +0200)]
nl80211: Support splitting wiphy information in dumps

This implements support for the new NL80211_ATTR_SPLIT_WIPHY_DUMP in
nl80211 to handle wiphy information that cannot fit in one message.

Reviewed-by: Johannes Berg <johannes@sipsolutions.net>
Signed-hostap: Dennis H Jensen <dennis.h.jensen@siemens.com>

11 years agoSynchronize with wireless-testing.git include/uapi/linux/nl80211.h
Jouni Malinen [Sun, 10 Mar 2013 11:06:31 +0000 (13:06 +0200)]
Synchronize with wireless-testing.git include/uapi/linux/nl80211.h

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

11 years agoSAE: Add forgotten commit element validation step for FFC groups
Jouni Malinen [Sun, 10 Mar 2013 09:45:55 +0000 (11:45 +0200)]
SAE: Add forgotten commit element validation step for FFC groups

The peer commit element needs to be validated to pass one of the steps
listed in IEEE 802.11, 11.3.5.4:
scalar-op(r, ELEMENT) = 1 modulo p

Similar step was present for ECC groups, but was missing for FFC groups.
This is needed to avoid dictionary attacks.

Thanks to Michael Roßberg and Sascha Grau for reporting this.

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

11 years agoSAE: Move commit element validation steps into single location
Jouni Malinen [Sun, 10 Mar 2013 09:26:22 +0000 (11:26 +0200)]
SAE: Move commit element validation steps into single location

It is clearer to keep all the validation steps described in IEEE 802.11
11.3.5.4 in a single location instead of splitting this between the
parsing and processing functions.

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

11 years agotests: Do not hide error return when using run-all.sh
Jouni Malinen [Sat, 9 Mar 2013 21:29:22 +0000 (23:29 +0200)]
tests: Do not hide error return when using run-all.sh

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

11 years agotests: Register test cases automatically from test_p2p_*.py
Jouni Malinen [Sat, 9 Mar 2013 21:18:20 +0000 (23:18 +0200)]
tests: Register test cases automatically from test_p2p_*.py

This removes need for editing run-p2p-tests.py whenever new test files
are added.

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

11 years agotests: Add a script for running all the automated tests
Jouni Malinen [Sat, 9 Mar 2013 19:40:31 +0000 (21:40 +0200)]
tests: Add a script for running all the automated tests

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

11 years agotests: Use wlantest to validate TDLS behavior
Jouni Malinen [Sat, 9 Mar 2013 17:01:56 +0000 (19:01 +0200)]
tests: Use wlantest to validate TDLS behavior

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

11 years agotests: Reset devices based on each test
Jouni Malinen [Sat, 9 Mar 2013 17:00:57 +0000 (19:00 +0200)]
tests: Reset devices based on each test

Make sure the devices are in known state before starting each test case.

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

11 years agotests: Add a test case for using TDLS in a P2P group
Jouni Malinen [Sat, 9 Mar 2013 16:24:32 +0000 (18:24 +0200)]
tests: Add a test case for using TDLS in a P2P group

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

11 years agotests: Add autogo test with two clients
Jouni Malinen [Sat, 9 Mar 2013 15:51:22 +0000 (17:51 +0200)]
tests: Add autogo test with two clients

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

11 years agotests: Start wlantest on hwsim0
Jouni Malinen [Sat, 9 Mar 2013 15:39:11 +0000 (17:39 +0200)]
tests: Start wlantest on hwsim0

This is in preparation for using wlantest to verify correct behavior in
various test cases.

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

11 years agotests: Add support for separate P2P group interfaces
Jouni Malinen [Sat, 9 Mar 2013 15:34:08 +0000 (17:34 +0200)]
tests: Add support for separate P2P group interfaces

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

11 years agotests: Reset device state at the end of full test run
Jouni Malinen [Sat, 9 Mar 2013 14:32:09 +0000 (16:32 +0200)]
tests: Reset device state at the end of full test run

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

11 years agotests: Add autonomous GO testing
Jouni Malinen [Sat, 9 Mar 2013 14:30:25 +0000 (16:30 +0200)]
tests: Add autonomous GO testing

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

11 years agotests: Allow selected tests to be specified
Jouni Malinen [Sat, 9 Mar 2013 14:01:11 +0000 (16:01 +0200)]
tests: Allow selected tests to be specified

Command line parameter to run-p2p-tests.py can now be used to select
which test case is run instead of always running all test cases.

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

11 years agotests: Add GO Negotiation provisioning method validation
Jouni Malinen [Sat, 9 Mar 2013 14:00:43 +0000 (16:00 +0200)]
tests: Add GO Negotiation provisioning method validation

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

11 years agotests: Validate GO Negotiation status code
Jouni Malinen [Sat, 9 Mar 2013 13:52:57 +0000 (15:52 +0200)]
tests: Validate GO Negotiation status code

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

11 years agotests: GO Negotiation with both devices using GO intent 15
Jouni Malinen [Sat, 9 Mar 2013 11:52:59 +0000 (13:52 +0200)]
tests: GO Negotiation with both devices using GO intent 15

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

11 years agotests: Report group formation results as a dict
Jouni Malinen [Sat, 9 Mar 2013 11:36:35 +0000 (13:36 +0200)]
tests: Report group formation results as a dict

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

11 years agotests: Add test execution mechanism
Jouni Malinen [Sat, 2 Mar 2013 10:22:28 +0000 (12:22 +0200)]
tests: Add test execution mechanism

run-p2p-tests.py can now be used to run all P2P test cases. The
actual test cases are defined in test_p2p_*.py files.

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

11 years agotests: Add start/stop scripts and configuration files
Jouni Malinen [Sat, 2 Mar 2013 09:39:54 +0000 (11:39 +0200)]
tests: Add start/stop scripts and configuration files

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

11 years agotests: Check connectivity in the P2P group
Jouni Malinen [Sat, 2 Mar 2013 09:38:56 +0000 (11:38 +0200)]
tests: Check connectivity in the P2P group

Use hwsim_test to verify that the formed group has working data
connectivity.

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

11 years agoAdd a starting point for mac80211_hwsim-based testing
Jouni Malinen [Fri, 1 Mar 2013 23:05:03 +0000 (01:05 +0200)]
Add a starting point for mac80211_hwsim-based testing

This will hopefully grow over time to become a much more complete
testing mechanism that uses mac80211_hwsim to verify various
wpa_supplicant and hostapd functions automatically.

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

11 years agowpaspy: Add Python bindings for wpa_ctrl
Jouni Malinen [Fri, 1 Mar 2013 21:27:56 +0000 (23:27 +0200)]
wpaspy: Add Python bindings for wpa_ctrl

This allows Python to be used to control wpa_supplicant/hostapd through
the control interface.

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

11 years agoP2P: Mark peer authorized for persistent group invitation
Jouni Malinen [Fri, 1 Mar 2013 19:32:33 +0000 (21:32 +0200)]
P2P: Mark peer authorized for persistent group invitation

When p2p_invite persistent=<id> is used to request a persistent group to
be re-invoked, the peer may reply with status=1 (info not yet available)
if upper layer processing of the invitiation is requested. The peer is
ten expected to start another invitation exchanged within 120 seconds if
the user authorizes the connection. Allow this process to be used more
easily by automatically authorizing the peer that we tried to invite to
use this second invitation sequence even if persistent_reconnect=0.

For this mechanism to work, the device that starts the invitation needs
to start listen mode to be able to receive the invitation request from
the peer. At least for now, this is not done automatically, but future
changes could potentially enable this automatically at least if there
are no concurrent operations in progress.

Example sequence on the initiator:

cmd: P2P_INVITE persistent=1 peer=<addr>
event: P2P-INVITATION-RESULT status=1
cmd: P2P_LISTEN 120
wait for peer to start another invitiation round.. group will be
re-invoked automatically

On the peer (with persistent_reconnect=0):

event: P2P-INVITATION-RECEIVED sa=<addr> persistent=1 [freq=<MHz>]
wait for user approval
cmd: P2P_INVITE persistent=1 peer=<addr>
group will be re-invoked automatically

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

11 years agoP2P: Indicate frequency for upper layer invitation processing
Jouni Malinen [Fri, 1 Mar 2013 19:27:31 +0000 (21:27 +0200)]
P2P: Indicate frequency for upper layer invitation processing

When a device that is a GO in a persistent group receives an Invitation
Request from a P2P client and persistent_reconnect=0, upper layer is
notified of this with P2P-INVITATION-RECEIVED event. The upper layer is
supposed to run another invitation exchange is this case, but if that
does not happen and the GO is started without successful (status=0)
invitation exchange, the operating channel for the group may end up
getting set in a way that the P2P client is not able to support. Provide
optional freq parameter in the P2P-INVITATION-RECEIVED event on the GO
side. If this parameter is received and the upper layer decides to issue
P2P_GROUP_ADD command, that command should include this freq parameter
to make sure the operating channel gets selected from the set that the
peer can support.

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

11 years agoAllow wpa_supplicant AP mode to configure Beacon interval
Jouni Malinen [Fri, 1 Mar 2013 18:50:08 +0000 (20:50 +0200)]
Allow wpa_supplicant AP mode to configure Beacon interval

beacon_int (in TU) can now be used to configure Beacon interval for AP
mode operations (including P2P GO) in wpa_supplicant. This can be set
either in a network block or as a global parameter in the configuration
file (or with "SET beacon_int <value>" control interface command) to
apply for all networks that do not include the beacon_int parameter to
override the default.

In addition, this commits extends the dtim_period parameter to be
available as a global parameter to set the default value. dtim_period is
now stored in the configuration file, too, if it was set.

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

11 years agoP2P: Use peer's channel list to limit GO freq on invitation
Jouni Malinen [Fri, 1 Mar 2013 12:22:29 +0000 (14:22 +0200)]
P2P: Use peer's channel list to limit GO freq on invitation

Peer device includes its list of allowed operating channels in the
Invitation Response frame. When we are becoming the GO, use that list
from the peer to filter out acceptable channels to avoid selecting a
channel that the peer is unable to use.

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

11 years agoP2P: Allow P2P client to specify preferred group channel
Jouni Malinen [Fri, 1 Mar 2013 17:40:54 +0000 (19:40 +0200)]
P2P: Allow P2P client to specify preferred group channel

When re-invoking a persistent group in P2P client role, the new
pref=<MHz> parameter can now be used with the p2p_invite command to
indicate a preferred operating frequency. Unlike the older freq=<MHz>
parameter, this leaves GO an option to select another channel (from our
supported channels) if the GO cannot accept the channel.

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

11 years agoP2P: Use shared function for setting up frequencies
Jouni Malinen [Mon, 25 Feb 2013 17:30:14 +0000 (19:30 +0200)]
P2P: Use shared function for setting up frequencies

p2p_connect() and p2p_invite() cases used more or less identical
implementatin. Use a shared function to avoid duplicated code.

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

11 years agoP2P: Allow all channels in case of multi channel concurrency
Deepthi Gowri [Mon, 25 Feb 2013 16:41:32 +0000 (18:41 +0200)]
P2P: Allow all channels in case of multi channel concurrency

If multi channel concurrency is supported, we have to populate the
p2p_channels with list of channels that we support. Use the same design
that was previously added for GO Negotiation.

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

11 years agohostapd: Make VHT IE struct more expressive
Johannes Berg [Fri, 1 Mar 2013 16:24:57 +0000 (18:24 +0200)]
hostapd: Make VHT IE struct more expressive

The VHT IE struct just has an opaque 8-byte array for the MCS
set, make it more expressive by explicitly naming the pieces.

Signed-hostap: Johannes Berg <johannes.berg@intel.com>