mech_eap.git
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>

11 years agoP2P: Fix regression in GO Negotiation
Jouni Malinen [Fri, 1 Mar 2013 09:53:46 +0000 (11:53 +0200)]
P2P: Fix regression in GO Negotiation

Commit fb8984fd6f4b49d9178dd87a880dd7add514b7d1 cleared wps_method to
WPS_NOT_READY in p2p_stop_find_for_freq() as an attempt to clear
authorization when a group formation is cancelled. However, this code
path is hit also in cases where the user did not actually cancel
anything (e.g., from p2p_process_go_neg_req()). As such, it is not fine
to clear wps_method here even if it could be proper for some cases. For
now, revert that part to avoid regressions and consider clearing
wps_method on cancel separately.

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

11 years agoP2P: Skip Listen phase when peer is expected to be waiting
Jouni Malinen [Thu, 28 Feb 2013 20:35:11 +0000 (22:35 +0200)]
P2P: Skip Listen phase when peer is expected to be waiting

In case we have replied to a peer's GO Negotiation Request frame with a
GO Negotiation Response frame using status code
info-currently-unavailable (1), the peer is likely going to wait for us
to initiate GO Negotiation on its Listen channel. We were previously
using alternativing send-GO-Neg-Req and Listen phase when providing that
response after the user had authorized the connection. However, the
Listen phase here is unnecessary in this case and will make the
connection take longer time to go through. Skip the Listen phase and
make the wait-for-GO-Neg-Resp timeout random between 100 and 200 ms to
avoid getting in sync with the peer. In practice, this will make us
retry GO Negotiation Request frames more frequently and remain on the
peer's Listen channel for most of the time when initiating GO
Negotiation after status=1 response.

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

11 years agoP2P: Increase GO Negotiation timeouts
Jouni Malinen [Thu, 28 Feb 2013 20:15:46 +0000 (22:15 +0200)]
P2P: Increase GO Negotiation timeouts

There may be environments in which large number of devices are operating
on the social channels. In such cases, it is possible for the Action
frame TX operation wait for quite long time before being able to get the
frame out. To avoid triggering GO Negotiation failures, increase the
timeouts for GO Neg Req (with TX ACK) and GO Neg Resp (with or without
TX ACK as long as status=0) to 500 ms.

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

11 years agonl80211: Add debug print for cancel-frame-wait command
Jouni Malinen [Thu, 28 Feb 2013 20:09:32 +0000 (22:09 +0200)]
nl80211: Add debug print for cancel-frame-wait command

This makes it easier to interpret the logs for offloaded TX frame
operations.

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

11 years agoAvoid partial BSS entries in control interface
Jouni Malinen [Thu, 28 Feb 2013 16:49:33 +0000 (18:49 +0200)]
Avoid partial BSS entries in control interface

Most of the print_bss_info() cases were already returning zero lenth to
avoid returning partial returns to the BSS commands, but the HS 2.0 and
Wi-Fi Display entries behaved differently. Make those consistent with
rest of the items.

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

11 years agoMark last BSS entry by #### instead of ====
Dmitry Shmidt [Thu, 28 Feb 2013 16:46:06 +0000 (18:46 +0200)]
Mark last BSS entry by #### instead of ====

This allows ctrl_iface users to iterate through the BSS entries by
fetching multiple BSS entries with "BSS RANGE=N-" without having to use
one extra round to get empty return value as the indication of the last
entry having been found.

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
11 years agoAdd WPA_BSS_MASK_DELIM flag to BSS command
Dmitry Shmidt [Thu, 28 Feb 2013 16:43:05 +0000 (18:43 +0200)]
Add WPA_BSS_MASK_DELIM flag to BSS command

This flag will add ==== delimiter between to separate bss results.
Unlike the other BSS command MASK values, this delimiter is not
included by default to avoid issues with existing users of the BSS
command.

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
11 years agonl80211: Fix WDS STA handling with multiple BSS interfaces
Felix Fietkau [Thu, 28 Feb 2013 14:55:13 +0000 (16:55 +0200)]
nl80211: Fix WDS STA handling with multiple BSS interfaces

The MAC address of the AP VLAN needs to be the same as the BSS that the
STA belongs to.

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

11 years agoUse scan results for reconnection
Masashi Honma [Thu, 28 Feb 2013 14:33:28 +0000 (16:33 +0200)]
Use scan results for reconnection

This patch uses existing scan results for fast connection on REASSOCIATE
and RECONNECT commands.

Signed-hostap: Masashi Honma <masashi.honma@gmail.com>

11 years agoFix test-{md5,sha1} builds
Jouni Malinen [Thu, 28 Feb 2013 14:16:07 +0000 (16:16 +0200)]
Fix test-{md5,sha1} builds

These need to include the libraries to fix aliasing_hide_typecast()
in md5-internal.c.

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

11 years agoInterworking: Remove unused variable warnings
Masashi Honma [Thu, 28 Feb 2013 13:01:09 +0000 (15:01 +0200)]
Interworking: Remove unused variable warnings

This patch removes these warnings.

interworking.c: In function 'interworking_credentials_available_3gpp':
interworking.c:1330:6: warning: unused variable 'ret' [-Wunused-variable]
interworking.c:1329:19: warning: unused variable 'cred' [-Wunused-variable]

Signed-hostap: Masashi Honma <masashi.honma@gmail.com>

11 years agowpa_cli: Increase receive buffer from 2048 to 4096 bytes
Jouni Malinen [Wed, 27 Feb 2013 13:59:55 +0000 (15:59 +0200)]
wpa_cli: Increase receive buffer from 2048 to 4096 bytes

wpa_supplicant uses 4096 byte buffer for control interface responses, so
wpa_cli should do the same to avoid truncating responses unnecessarily.

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

11 years agoP2P: Only schedule a single p2p_go_neg_start timeout at a time
Jouni Malinen [Tue, 26 Feb 2013 16:07:17 +0000 (18:07 +0200)]
P2P: Only schedule a single p2p_go_neg_start timeout at a time

It is possible for the driver to indicate multiple Probe Request frames
that would be processed in a single loop. If those frames happen to be
from a peer which with we are trying to start GO Negotiation, multiple
timeouts to start GO Negotiation (p2p_go_neg_start) could end up being
scheduled. This would result in confusing burst of multiple GO
Negotiation Request frames being sent once the RX loop finally
concludes. Avoid this by scheduling only a single eloop timeout to
trigger GO Negotiation regardless of how many Probe Request frames from
the peer is received. In addition, make sure this timeout gets canceled
in p2p_deinit().

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

11 years agoP2P: Do not start new GO Neg on Probe Req when waiting for Confirm
Jouni Malinen [Tue, 26 Feb 2013 16:02:51 +0000 (18:02 +0200)]
P2P: Do not start new GO Neg on Probe Req when waiting for Confirm

If we have already sent out GO Negotiation Response and are waiting for
the peer to reply with GO Negotiation Confirm, there is no point in
re-starting GO Negotiation based on Probe Request frame from the peer.
Doing that would just result in confusing GO Negotiation exchange with
multiple sessions running at the same time.

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

11 years agoP2P: Fail GO Negotiation on missing Group ID
Jouni Malinen [Tue, 26 Feb 2013 15:22:11 +0000 (17:22 +0200)]
P2P: Fail GO Negotiation on missing Group ID

The device that is selected as the GO shall incode P2P Group ID
attribute in GO Negotiation Response/Confirm message. Previously we did
not reject a message without that attribute since it was possible to
continue operations even without knowing the SSID. However, this can
potentially result in confusing results since missing P2P Group ID
attribute can be a sign of conflicting GO role determination (both
devices assuming the peer is the GO). To get clearer end result for the
GO Negotiation, reject this as a fatal error. In addition, stop GO
Negotiation if GO Negotiation Confirm indicates non-zero status since
that is also a fatal error.

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

11 years agoP2P: Assign GO tie breaker bit at the same time with dialog token
Jouni Malinen [Tue, 26 Feb 2013 14:56:48 +0000 (16:56 +0200)]
P2P: Assign GO tie breaker bit at the same time with dialog token

Commit 624b4d5a6469c92b039e0d39655b9e0eb26588aa changed GO Negotiation
to use the same Dialog Token value for all retransmissions of the GO
Negotiation Request within the same session. However, it did leave the
tie breaker bit changing for each frame. While this should not have
caused issues for most cases, it looks like there are possible sequences
where the peer may end up replying to two GO Negotiation Request frames
with different tie breaker values. If in such a case the different GO
Negotiation Response frames are used at each device, GO role
determination may result in conflicting results when same GO intent is
used.

Fix this by assigning the tie breaker value at the same time with the
dialog token (i.e., when processing the p2p_connect command instead of
for each transmitted GO Negotiation Request frame) to avoid issues with
GO selection.

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

11 years agoTDLS: Pass peer's VHT Capability information during sta_add
Sunil Dutt [Mon, 25 Feb 2013 08:31:50 +0000 (10:31 +0200)]
TDLS: Pass peer's VHT Capability information during sta_add

The information of the peer's VHT capability is required for the
driver to establish a TDLS link in VHT mode with a compatible peer.
Pass this information to the driver when the peer station is
getting added.

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

11 years agoWPS: Clear sent_carrier to avoid errors in python script
Jouni Malinen [Sun, 24 Feb 2013 11:12:32 +0000 (13:12 +0200)]
WPS: Clear sent_carrier to avoid errors in python script

This is needed to avoid errors when reporting the result of an NFC
connection handover that failed.

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

11 years agoWPS: Fix OOB Device Password use in PSK1,PSK1 derivation
Jouni Malinen [Sun, 24 Feb 2013 08:57:49 +0000 (10:57 +0200)]
WPS: Fix OOB Device Password use in PSK1,PSK1 derivation

WSC specification 2.0 section 7.4 describes OOB password to be expressed
in ASCII format (upper case hexdump) instead of raw binary.

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

11 years agoWPS: Add AP mode NFC connection handover with wpa_supplicant/nfcpy
Jouni Malinen [Sun, 24 Feb 2013 08:57:06 +0000 (10:57 +0200)]
WPS: Add AP mode NFC connection handover with wpa_supplicant/nfcpy

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