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

11 years agoWPS NFC: Add connection handover support for ER
Jouni Malinen [Sun, 24 Feb 2013 08:56:29 +0000 (10:56 +0200)]
WPS NFC: Add connection handover support for ER

wpa_supplicant can now generate the WPS carrier record for connection
handover response when acting as an ER. The AP whose configuration is
provided in this way is identified with an UUID as an argument to
wps-nfc.py.

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

11 years agoWPS: Add wps-er-config command for writing config token from ER
Jouni Malinen [Sun, 24 Feb 2013 08:54:18 +0000 (10:54 +0200)]
WPS: Add wps-er-config command for writing config token from ER

UUID of the AP is specified on the command line to select which
configuration is used.

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

11 years agoInterworking: Select highest priority cred if multiple matches
Jouni Malinen [Sat, 16 Feb 2013 17:54:09 +0000 (19:54 +0200)]
Interworking: Select highest priority cred if multiple matches

Previously, the credential to use for a connection with a specific BSS
was picked arbitrary based on first found match of each matching
mechanism. While the credential priorities were used elsewhere, this did
not take into account that different mechanisms could find multiple
matching credentials. As such, the highest priority credential was not
always used in case more than one credential matched with the selected
BSS. Fix this by checking credential priorities again during connection
request.

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

11 years agoGAS server: Fix a regression in GAS server callback
Jouni Malinen [Sat, 16 Feb 2013 17:15:05 +0000 (19:15 +0200)]
GAS server: Fix a regression in GAS server callback

Commit 2d9ffe1e855410839468a75cf6723ee339acdd7e broke GAS server
callback for receiving Public Action frames. The incorrect context
pointer was used in the public_action_cb2 case. Fix this to use the
correct context pointer.

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

11 years agohostapd: Fix Max SP Length derivation from QoS Info
Srinivasan B [Sat, 16 Feb 2013 09:15:13 +0000 (11:15 +0200)]
hostapd: Fix Max SP Length derivation from QoS Info

Hostapd provides QoS info of the STA (Service Period & AC mask) to the
kernel during wpa_driver_nl80211_sta_add call. Bit 5 and Bit 6 of QoS
info represents the Max SP length. Fix an issue in the code to fetch the
Max SP by shifting right the QoS info by value WMM_QOSINFO_STA_SP_SHIFT.
(operator ">" is replaced with ">>" operator).

Signed-off-by: Srinivasan <srinivasanb@posedge.com>
11 years agonl80211: Configure STA Capabilities and Extended Capabilities
Sunil Dutt [Thu, 14 Feb 2013 16:12:42 +0000 (18:12 +0200)]
nl80211: Configure STA Capabilities and Extended Capabilities

These are needed to allow drivers to implement all TDLS functionality
properly.

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

11 years agoSynchronize with wireless-testing.git include/uapi/linux/nl80211.h
Jouni Malinen [Fri, 15 Feb 2013 21:45:02 +0000 (23:45 +0200)]
Synchronize with wireless-testing.git include/uapi/linux/nl80211.h

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

11 years agoWPS: Fix build without CONFIG_WPS_NFC
Jouni Malinen [Fri, 15 Feb 2013 15:09:24 +0000 (17:09 +0200)]
WPS: Fix build without CONFIG_WPS_NFC

Commit bbf41865c90c2e16510712fa32290729c194422d added calls to functions
that are only defined if CONFIG_WPS_NFC=y. Protect those calls properly
to avoid build issues.

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

11 years agoWPS: Add support for NFC handover select generation with wpa_supplicant
Jouni Malinen [Fri, 15 Feb 2013 10:34:55 +0000 (12:34 +0200)]
WPS: Add support for NFC handover select generation with wpa_supplicant

When wpa_supplicant is controlling an AP mode interface, it can generate
the alternative carrier record for NFC connection handover select
message similarly to the way this is done in hostapd.

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

11 years agoWPS: Update NFC connection handover documentation
Jouni Malinen [Fri, 15 Feb 2013 09:51:28 +0000 (11:51 +0200)]
WPS: Update NFC connection handover documentation

The last couple of changes to the control interface commands for NFC
connection handover had not yet been documented.

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

11 years agoWPS: Add support for config token generation with wpa_supplicant
Jouni Malinen [Fri, 15 Feb 2013 09:45:29 +0000 (11:45 +0200)]
WPS: Add support for config token generation with wpa_supplicant

When wpa_supplicant is controlling an AP mode interface, it can generate
the NFC configuration token similarly to the way this is done in
hostapd.

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

11 years agoWPS: Allow password token to be written with nfcpy
Jouni Malinen [Fri, 15 Feb 2013 09:29:37 +0000 (11:29 +0200)]
WPS: Allow password token to be written with nfcpy

This adds write-password option for the nfcpy example script for
wpa_supplicant to match hostapd wps-ap-nfc.py functionality.

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

11 years agoWPS: Use pre-configured NFC password token instead of overriding it
Jouni Malinen [Fri, 15 Feb 2013 09:24:29 +0000 (11:24 +0200)]
WPS: Use pre-configured NFC password token instead of overriding it

"WPS_NFC_TOKEN <WPS/NDEF>" used to generate a new NFC password token
regardless of whether there was a pre-configured token in the
configuration. Change this to use the pre-configured value, if
available, instead. This allows the same command to be used to write the
password token to an NFC tag more conveniently.

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

11 years agoTDLS: Pass peer's Capability and Ext Capability info during sta_add
Sunil Dutt [Tue, 5 Feb 2013 14:50:36 +0000 (16:50 +0200)]
TDLS: Pass peer's Capability and Ext Capability info during sta_add

The contents of the peer's capability and extended capability
information is required for the driver to perform TDLS P-UAPSD and Off
Channel operations. Pass this information to the driver when the peer
station is getting added.

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

11 years agoAndroid: Enable TDLS support in the build
Sunil Dutt [Thu, 14 Feb 2013 15:47:42 +0000 (17:47 +0200)]
Android: Enable TDLS support in the build

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

11 years agoTDLS: Pass peer's HT Capability and QOS information during sta_add
Sunil Dutt [Tue, 5 Feb 2013 14:41:01 +0000 (16:41 +0200)]
TDLS: Pass peer's HT Capability and QOS information during sta_add

The information of the peer's HT capability and the QOS information is
required for the driver to perform TDLS operations. Pass this
information to the driver when the peer station is getting added.

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

11 years agonl80211: Add debug prints for STA add/set operations
Jouni Malinen [Thu, 14 Feb 2013 15:44:21 +0000 (17:44 +0200)]
nl80211: Add debug prints for STA add/set operations

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

11 years agoTDLS: Fix add/set STA operation
Jouni Malinen [Thu, 14 Feb 2013 16:23:33 +0000 (18:23 +0200)]
TDLS: Fix add/set STA operation

Commit a9a1d0f08aaf7c96f40def0d7966399b89b2a7c0 added vht_capabilities
to struct hostapd_sta_add_params but forgot to update
wpa_supplicant_tdls_peer_addset() to initialize the variable to NULL.
This could result in uninitialized pointer being used in
driver_nl80211.c when adding a TDLS peer entry. Fix this by clearing the
hostapd_sta_add_params with memset.

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

11 years agoSynchronize with wireless-testing.git include/uapi/linux/nl80211.h
Jouni Malinen [Thu, 14 Feb 2013 16:17:16 +0000 (18:17 +0200)]
Synchronize with wireless-testing.git include/uapi/linux/nl80211.h

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

11 years agoWPS: Allow Device Password to be changed from M1 to M2
Jouni Malinen [Thu, 14 Feb 2013 18:41:14 +0000 (20:41 +0200)]
WPS: Allow Device Password to be changed from M1 to M2

Registrar is allowed to propose another Device Password ID in M2. Make
Enrollee validate Device Password ID in M2 to check if this happened.
This commit adds support for changing from NFC password token to default
PIN for the case where the AP is the Enrollee and has both the NFC
password token and AP PIN enabled at the same time.

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

11 years agoWPS: Fix wps_reg nfc-pw option
Jouni Malinen [Thu, 14 Feb 2013 17:44:54 +0000 (19:44 +0200)]
WPS: Fix wps_reg nfc-pw option

Commit ffdaa05a6b1b59c4b2e50f9b7fef82769fc2d3fe added support for using
NFC password token from an AP. However, it had a bug that prevented the
wpa_supplicant wps_reg command from being used with "nfc-pw" as the PIN
value. Fix string comparison to handle this correctly.

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

11 years agoTDLS: Tear down peers when disconnecting from the AP
Sunil Dutt [Tue, 12 Feb 2013 21:25:21 +0000 (23:25 +0200)]
TDLS: Tear down peers when disconnecting from the AP

A TDLS Teardown frame with Reason Code 3 (Deauthenticated because
sending STA is leaving (or has left) IBSS or ESS) shall be transmitted
to all TDLS peer STAs (via the AP or via the direct path) prior to
transmitting a Disassociation frame or a Deauthentication frame to the
AP.

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

11 years agoP2P: Do not use old scan result data for peer discovery
Jouni Malinen [Tue, 12 Feb 2013 17:25:18 +0000 (19:25 +0200)]
P2P: Do not use old scan result data for peer discovery

The driver may have cached (e.g., in cfg80211 BSS table) the scan
results for relatively long time. To avoid reporting stale information,
update P2P peers only based on results that have based on frames
received after the last p2p_find operation was started.

This helps especially in detecting when a previously operating GO stops
the group since the BSS entry for that could live for 30 seconds in the
cfg80211 cache. Running p2p_flush followed by p2p_find will now allow
wpa_supplicant to not add a P2P peer entry for that GO if the group had
been terminated just before that p2p_flush command. Previously, that GO
could have been indicated as a newly found device for up to 30 seconds
after it had stopped the group.

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

11 years agoUse more accurate timestamps for scan results
Jouni Malinen [Tue, 12 Feb 2013 17:14:32 +0000 (19:14 +0200)]
Use more accurate timestamps for scan results

For various P2P use cases, it is useful to have more accurate timestamp
for the peer information update. This commit improves scan result
handling by using a single timestamp that is taken immediately after
fetching the results from the driver and then using that value to
calculate the time when the driver last updated the BSS entry. In
addition, more debug information is added for P2P peer updates to be
able to clearly see how old information is being used here.

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

11 years agoP2P: Postpone P2P-DEVICE-FOUND if config_methods not known
Jouni Malinen [Tue, 12 Feb 2013 16:24:56 +0000 (18:24 +0200)]
P2P: Postpone P2P-DEVICE-FOUND if config_methods not known

If we discover a P2P peer based on a Beacon frame from the GO role, we
do not get information about the supported configuration methods. This
can result in issues if the P2P managing entity above wpa_supplicant is
not prepared to handling config_methods=0x0. To avoid this, postpone
reporting of the P2P-DEVICE-FOUND event when this happens on one of the
social channels. It would be good to be able to this on all channels,
but that could result in issues of never indicating the event for a peer
that is operating a GO on a channel that requires passive scanning.

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

11 years agoP2P: Do not allow peer update to clear config_methods
Jouni Malinen [Tue, 12 Feb 2013 16:14:48 +0000 (18:14 +0200)]
P2P: Do not allow peer update to clear config_methods

It could be possible for the scan results to include two entries for a
peer, one from the Listen state and the second one from the GO role. The
latter could be based on a Beason frame. If that happens and the entry
from GO is processed last, the P2P peer config_methods value could
potentially get cleared since Beacon frames do not include this
information in either WPS or P2P element. Avoid this by allowing the
config_methods value for P2P peers to be updated only if the new value
is non-zero.

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

11 years agoWPS: Report NFC connection handover completion differently
Jouni Malinen [Mon, 11 Feb 2013 16:43:46 +0000 (18:43 +0200)]
WPS: Report NFC connection handover completion differently

Instead of reporting only one connection handover message, report
completion of NFC connection handover with carrier record from both the
request and select messages.

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

11 years agoP2P: Avoid concurrent scans during all steps of group formation
Jouni Malinen [Mon, 11 Feb 2013 10:21:03 +0000 (12:21 +0200)]
P2P: Avoid concurrent scans during all steps of group formation

Previously, only some P2P states were considered to postpone concurrent
station mode scans during group formation. Especially the WPS
provisioning step was skipped due to issues to scans run on the P2P
client interface (see commit fc6997b345d97c80965725b12c52b0d225f32a1a).
This is not ideal since a concurrent scan can slow down group formation
considerably and potentially make it time out. Enforce p2p-in-progress
through all steps of group formation on another interface to address
this.

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

11 years agoP2P: Cancel group formation timeout on group removal (on client)
Jouni Malinen [Sun, 10 Feb 2013 21:36:52 +0000 (23:36 +0200)]
P2P: Cancel group formation timeout on group removal (on client)

Group formation timeout is normally canceled when 4-way handshake is
completed (WPA_COMPLETED -> wpas_p2p_completed). However, it is possible
for the GO to stop the group before this happens (i.e., send
Deauthentication frame with reason code 3 before 4-way handshake is
completed). This resulted in the group getting removed, but the group
formation timeout left behind. The unexpected timeout may then result in
undesired termination of the following operation. Fix this by canceling
the group formation timeout in wpas_p2p_group_delete() similarly to how
group idle timeout was canceled there.

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

11 years agoWPS: Change listen time to match nfcpy default (250 ms)
Jouni Malinen [Sun, 10 Feb 2013 16:49:20 +0000 (18:49 +0200)]
WPS: Change listen time to match nfcpy default (250 ms)

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

11 years agoWPS: Report only the carrier record from NFC to wpa_supplicant
Jouni Malinen [Sun, 10 Feb 2013 16:42:43 +0000 (18:42 +0200)]
WPS: Report only the carrier record from NFC to wpa_supplicant

Since there could be multiple carrier records, it is cleaner to report
only the WPS carrier record instead of full NFC connection handover
select to wpa_supplicant.

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

11 years agoWPS: Fetch only the carrier record from wpa_supplicant for NFC
Jouni Malinen [Sun, 10 Feb 2013 16:19:59 +0000 (18:19 +0200)]
WPS: Fetch only the carrier record from wpa_supplicant for NFC

Since there could be multiple carrier records, it is cleaner to build
only the WPS carrier record instead of full NFC connection handover
request within wpa_supplicant.

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

11 years agoWPS: Update nfcpy script to support AP mode NFC connection handover
Jouni Malinen [Sun, 10 Feb 2013 15:14:11 +0000 (17:14 +0200)]
WPS: Update nfcpy script to support AP mode NFC connection handover

Initialize NFC connection handover as the server and reply with WPS
carrier record in connection select.

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

11 years agoWPS: Add command for fetching carrier record for NFC handover
Jouni Malinen [Sun, 10 Feb 2013 15:12:55 +0000 (17:12 +0200)]
WPS: Add command for fetching carrier record for NFC handover

Control interface command "NFC_GET_HANDOVER_SEL NDEF WPS-CR" can now be
used to fetch WPS carrier record from hostapd.

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

11 years agoWPS: Clean up debug prints with nfcpy
Jouni Malinen [Sun, 10 Feb 2013 14:27:59 +0000 (16:27 +0200)]
WPS: Clean up debug prints with nfcpy

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

11 years agoWPS: Remove 0.5 sec extra wait from NFC handover with nfcpy
Jouni Malinen [Sun, 10 Feb 2013 14:27:14 +0000 (16:27 +0200)]
WPS: Remove 0.5 sec extra wait from NFC handover with nfcpy

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

11 years agoWPS: Use alternating poll/listen for NFC peer discovery with nfcpy
Jouni Malinen [Sun, 10 Feb 2013 14:25:20 +0000 (16:25 +0200)]
WPS: Use alternating poll/listen for NFC peer discovery with nfcpy

This is needed to find the NFC peer to avoid cases where both devices
could be using the same operation.

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

11 years agoWPS: Configure logging to show nfcpy log message
Jouni Malinen [Sun, 10 Feb 2013 14:20:25 +0000 (16:20 +0200)]
WPS: Configure logging to show nfcpy log message

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

11 years agoWPS: Add an example python script for NFC operations with hostapd
Jouni Malinen [Sat, 9 Feb 2013 18:44:15 +0000 (20:44 +0200)]
WPS: Add an example python script for NFC operations with hostapd

wps-ap-nfc.py uses nfcpy and python-wpactrl to support NFC operations
with hostapd for WPS operations.

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

11 years agohostapd: Do not change HT40 capability due to OBSS scan
Johannes Berg [Sat, 9 Feb 2013 10:16:58 +0000 (12:16 +0200)]
hostapd: Do not change HT40 capability due to OBSS scan

The capability itself isn't really affected by an OBSS
scan, only the HT operation must then be restricted to
20 MHz. Change this, and therefore use the secondary
channel configuration to determine the setting of the
OP_MODE_20MHZ_HT_STA_ASSOCED flag.

This shouldn't really change anything functionally,
it just makes the code a little less confusing and
is also needed to implement more dynamic bandwidth
changes if ever desired.

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

11 years agodbus: Add missing signal description for WPS (7)
Peter Wu [Sat, 9 Feb 2013 10:13:54 +0000 (12:13 +0200)]
dbus: Add missing signal description for WPS (7)

Commit caff399250311abfea3376b38530a88bb78b957d added a property named
"WPS" to the dbus interface. It did not add the new
WPAS_DBUS_BSS_PROP_WPS property to the function responsible for marking
changed properties though. This cause the following messages to be
printed repeatedly to syslog:

    dbus: wpas_dbus_bss_signal_prop_changed: Unknown Property value 7

Signed-hostap: Peter Wu <lekensteyn@gmail.com>