]> git.ipfire.org Git - thirdparty/hostap.git/log
thirdparty/hostap.git
11 years agowpa_cli: Accept more arguments for set_network
Jouni Malinen [Mon, 19 Nov 2012 12:04:42 +0000 (14:04 +0200)] 
wpa_cli: Accept more arguments for set_network

Some network parameters, e.g., auth_alg and eap use a space separated
list of values without quotation marks. To allow these to be entered
from the interactive mode, change set_network command to allow more than
three arguments.

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

11 years agoUpdate ChangeLog files to match the current implementation
Jouni Malinen [Sun, 18 Nov 2012 19:30:38 +0000 (21:30 +0200)] 
Update ChangeLog files to match the current implementation

This commit adds description of the main changes from the forking of
hostap-1.git for 1.x releases to the current master branch snapshot.

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

11 years agohostapd: Fix a regression in TKIP countermeasures processing
Jouni Malinen [Sun, 18 Nov 2012 11:06:03 +0000 (13:06 +0200)] 
hostapd: Fix a regression in TKIP countermeasures processing

Commit 296a34f0c1730416bf2a61ab78690be43d82a3c0 changed hostapd to
remove the internal STA entry at the beginning of TKIP countermeasures.
However, this did not take into account the case where this is triggered
by an EAPOL-Key error report from a station. In such a case, WPA
authenticator state machine may continue processing after having
processed the error report. This could result in use of freed memory.
Fix this by stopping WPA processing if the STA entry got removed.

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

11 years agoWPS: Add a workaround for PBC session overlap detection
Jouni Malinen [Thu, 15 Nov 2012 17:59:04 +0000 (19:59 +0200)] 
WPS: Add a workaround for PBC session overlap detection

Some deployed station implementations implement WPS incorrectly and
end up causing PBC session overlap issues by indicating active PBC
mode in a scan after the WPS provisioning step. Work around this by
ignoring active PBC indication in a Probe Request from a station that
completed PBC provisioning during the last five seconds.

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

11 years agoRemove unused disassociate() driver_ops
Jouni Malinen [Wed, 14 Nov 2012 22:06:12 +0000 (00:06 +0200)] 
Remove unused disassociate() driver_ops

Commits 07783eaaa05c07e2c0071780ed3ebf7d0abfe4b5 and
3da372fae8b25a4aec12245b05680646f3bd0ccd removed the only users of the
disassociate() driver operation, so these driver wrapper functions can
also be removed now.

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

11 years agoFix forgotten no-CONFIG_WPS=y wrapper
Jouni Malinen [Wed, 14 Nov 2012 11:05:53 +0000 (13:05 +0200)] 
Fix forgotten no-CONFIG_WPS=y wrapper

Commit 620c783753bddd37988269314862dc7e4a62f700 modified
wpas_wps_ssid_wildcard_ok() prototype, but forgot to update the
non-WPS-build wrapper. Fix that to match with the new bss parameter
type and remove the now unused declaration of wpa_scan_res.

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

11 years agoAllow OKC to be enabled by default
Jouni Malinen [Mon, 12 Nov 2012 18:07:53 +0000 (20:07 +0200)] 
Allow OKC to be enabled by default

Previously, OKC (opportunistic key caching, a.k.a. proactive key
caching) could be enabled only with a per-network parameter
(proactive_key_caching). The new global parameter (okc) can now be used
to change the default behavior to be OKC enabled (okc=1) for network
blocks that do not override this with the proactive_key_caching
parameter.

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

11 years agoP2P: Avoid extra group interface creation on GO reinvocation
Jouni Malinen [Sun, 11 Nov 2012 18:45:27 +0000 (20:45 +0200)] 
P2P: Avoid extra group interface creation on GO reinvocation

If separate group interfaces are used, the pending group interface got
removed unnecessarily when stopping find operations when accepting an
invitation to reinvoke the group in GO role. This resulted in the group
interfaces getting created twice. Avoid this unnecessary extra operation
by skipping removal of the pending interface in the reinvocation
sequence.

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

11 years agoHide strict-aliasing warning with gcc 4.7
Jouni Malinen [Sun, 11 Nov 2012 18:29:20 +0000 (20:29 +0200)] 
Hide strict-aliasing warning with gcc 4.7

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

11 years agonl80211: Avoid strict-aliasing warning with gcc 4.7
Jouni Malinen [Sun, 11 Nov 2012 18:28:27 +0000 (20:28 +0200)] 
nl80211: Avoid strict-aliasing warning with gcc 4.7

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

11 years agobgscan_learn: Prevent infinite busy looping
Pawel Kulakowski [Sun, 11 Nov 2012 14:26:36 +0000 (16:26 +0200)] 
bgscan_learn: Prevent infinite busy looping

In highly congested network (BSSes almost on every channel
within ESS) we have hit a bug when wpa_supplicant become
completly irresponsive, infinite looping on while loop.

When probe_idx was equal 0 and we are not able to probe
new frequency, following condition were never fulfilled:
"if (!in_array(freqs, data->supp_freqs[idx]))"

Signed-hostap: Pawel Kulakowski <pawel.kulakowski@tieto.com>

11 years agodbus: Do not quote scan_freq and freq_list
Robert Shade [Sun, 11 Nov 2012 14:21:16 +0000 (16:21 +0200)] 
dbus: Do not quote scan_freq and freq_list

scan_freq and freq_list are not parsed by wpa_config_parse_freqs if
quoted.

Signed-hostap: Robert Shade <robert.shade@gmail.com>

11 years agonl80211: Roam correctly through cfg80211 without SME
Christopher Wiley [Sun, 11 Nov 2012 14:15:29 +0000 (16:15 +0200)] 
nl80211: Roam correctly through cfg80211 without SME

Change the nl80211 driver in wpa_supplicant to correctly handle
connecting to a new AP through cfg80211 without SME capability. As
before, the driver will disconnect from the previously associated AP,
but now we attempt to immediately connect to our intended AP. This
prevents us from blacklisting the AP we were trying to connect to
because of a semantic mismatch between cfg80211 and wpa_supplicant. The
disconnect/connect patch generates a local disconnect nl80211 event
which we discard because we're already correctly tracking the pending
association request.

In detail:

cfg80211 does not support connecting to a new BSS while already
connected to another BSS, if the underlying driver doesn't support
separate authenticate and associate commands. wpa_supplicant is written
to expect that this is a supported operation, except for a little error
handling that disconnects from the current BSS when roaming fails and
relies on autoconnect logic to reconnect later. However, this failure to
connect is incorrectly attributed to the new AP we attempted to
associate with, rather than a local condition in cfg80211.

The combined effect of these two conditions is that full-mac drivers
accessible through cfg80211 but without SME capability take a long time
to roam across BSS's because wpa_supplicant will:
1) Fail to associate for local reasons
2) Disconnect and return that the association request failed
3) Blacklist the association target (incorrectly)
4) Do a scan
5) Pick a less desirable AP to associate with

Signed-hostap: Christoper Wiley <wiley@chromium.org>

11 years agoFix a typo in a comment
Jouni Malinen [Sun, 11 Nov 2012 14:09:36 +0000 (16:09 +0200)] 
Fix a typo in a comment

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

11 years agoatheros: Remove redundant l2_packet_get_own_addr call
Baruch Siach [Sun, 11 Nov 2012 14:07:28 +0000 (16:07 +0200)] 
atheros: Remove redundant l2_packet_get_own_addr call

Commit deca6eff74411b8c93e7c7c31406de7367a0b540 added a redundant call
to l2_packet_get_own_addr. Use the information we already have in
atheros_init.

Signed-hostap: Baruch Siach <baruch@tkos.co.il>

11 years agoEAP-SIM/AKA server: Fix memory leak in error path
Jouni Malinen [Sun, 11 Nov 2012 11:15:49 +0000 (13:15 +0200)] 
EAP-SIM/AKA server: Fix memory leak in error path

If identity round limit is reached, EAP-SIM/AKA session is terminated.
This needs to free the allocated message.

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

11 years agoCheck hapd_iface more consistently in hostapd_disable_iface()
Jouni Malinen [Sun, 11 Nov 2012 11:11:15 +0000 (13:11 +0200)] 
Check hapd_iface more consistently in hostapd_disable_iface()

There is no point in the hapd_iface == NULL validate after this pointer
has been dereferences, so move the code dereferencing hapd_iface after
the check.

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

11 years agoWPS: Remove deprecated UFD config method and OOB ctrl_iface
Jouni Malinen [Sun, 11 Nov 2012 11:01:06 +0000 (13:01 +0200)] 
WPS: Remove deprecated UFD config method and OOB ctrl_iface

The UFD (USB flash drive) configuration method was deprecated in WSC
2.0. Since this is not known to be used, remove the UFD implementation
from hostapd and wpa_supplicant to allow the WPS implementation to be
cleaned up. This removes the now unused OOB operations and ctrl_iface
commands that had already been deprecated by the new NFC operations.

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

11 years agoP2P: Reduce redundant PSK generation for GO
Masashi Honma [Sun, 11 Nov 2012 09:39:24 +0000 (11:39 +0200)] 
P2P: Reduce redundant PSK generation for GO

The PSK generation done by pbkdf2_sha1() is one of the longest CPU time
users according to our profiling from boot to GO started.

So I have reduced some steps.

I could boot a GO by this command sequence.
-------------
add_net
set_network 0 ssid '"DIRECT-XX"'
set_network 0 psk
'"123456789012345678901234567890123456789012345678901234567890123"'
set_network 0 proto RSN
set_network 0 key_mgmt WPA-PSK
set_network 0 pairwise CCMP
set_network 0 auth_alg OPEN
set_network 0 mode 3
set_network 0 disabled 2
p2p_group_add persistent=0 freq=2412
-------------

By this sequence, pbkdf2_sha1() was called three times and the function
calculates the same value each time. Reduce number of calls to
pbkdf2_sha1() from 3 to 1 by caching the previous result.

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

11 years agonew_dbus_handlers: Clear errno
Paul Stewart [Sun, 11 Nov 2012 09:18:31 +0000 (11:18 +0200)] 
new_dbus_handlers: Clear errno

There are a few instances where dbus handlers test the value
of errno to test whether strtoul completes successfully.
Since strtoul does not clear errno, and there's no strong
reason to suspect that errno is already clear, it is safer
to clear it right before calling strtoul.  Also, any failure
in strtoul (setting errno non-zero) should be considered a
failure.

While testing using dbus-send, I found that a malformed
network path can cause a crash due to net_id being left
NULL.  We should test for this before calling strtoul
on it.

Tested with:

dbus-send --system --dest=fi.w1.wpa_supplicant1 --print-reply \
    /fi/w1/wpa_supplicant1/Interfaces/0 \
    org.freedesktop.DBus.Properties.Get \
    string:fi.w1.wpa_supplicant1.Interface string:Networks
dbus-send --system --dest=fi.w1.wpa_supplicant1 --print-reply \
   /fi/w1/wpa_supplicant1/Interfaces/0 \
   fi.w1.wpa_supplicant1.Interface.RemoveNetwork \
   objpath:/fi/w1/wpa_supplicant1/Interfaces/0/Networks/0
dbus-send --system --dest=fi.w1.wpa_supplicant1 --print-reply \
   /fi/w1/wpa_supplicant1/Interfaces/0 \
   fi.w1.wpa_supplicant1.Interface.RemoveNetwork \
   objpath:/fi/w1/wpa_supplicant1/Interfaces/0/Networks/0
dbus-send --system --dest=fi.w1.wpa_supplicant1 --print-reply \
   /fi/w1/wpa_supplicant1/Interfaces/0 \
   fi.w1.wpa_supplicant1.Interface.RemoveNetwork \
   objpath:/fi/w1/wpa_supplicant1/Interfaces/0

Signed-hostap: Paul Stewart <pstew@chromium.org>
intended-for: hostap-1

11 years agoRemove unused wpa_supplicant_disassociate()
Jouni Malinen [Mon, 5 Nov 2012 15:05:37 +0000 (17:05 +0200)] 
Remove unused wpa_supplicant_disassociate()

This function is now unused after the last couple of commits that
removed the last uses, so remove this to keep code simpler since all
places that disassociate, can use deauthentication instead.

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

11 years agoUse deauthentication instead of disassociation on RSN element mismatch
Jouni Malinen [Mon, 5 Nov 2012 15:01:07 +0000 (17:01 +0200)] 
Use deauthentication instead of disassociation on RSN element mismatch

Even though the standard currently describes disassociation to be used
for RSN element mismatch between Beacon/Probe Response frames and
EAPOL-Key msg 3/4, this is unnecessary difference from other cases that
deauthenticate. In addition, there is no point in leaving the 802.11
Authentication in place in this case. To keep things simpler, use
deauthentication here to get rid of the only use of
wpa_sm_disassociate().

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

11 years agoUse deauthentication instead of disassociation if not associated
Jouni Malinen [Mon, 5 Nov 2012 14:55:30 +0000 (16:55 +0200)] 
Use deauthentication instead of disassociation if not associated

cfg80211/mac80211 may reject disassociation command if association has
not yet been formed. Use deauthentication in cases where it is possible
that we are associating at the moment the command is issued.

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

11 years agoUse wpa_drv_{disassociate,deauthenticate} while waiting for connection
Jouni Malinen [Mon, 5 Nov 2012 14:42:28 +0000 (16:42 +0200)] 
Use wpa_drv_{disassociate,deauthenticate} while waiting for connection

wpa_supplicant_{disassociate,deauthenticate}() need to inform the driver
about decision to disconnect even if this happens during the time when
the driver is still trying to complete association. During that time,
wpa_s->bssid is not set, so the code in these functions needs to figure
out the correct BSSID based on that field or wpa_s->pending_bssid. In
addition, it is possible that the BSSID is not even known at
wpa_supplicant at this point in time when using drivers that perform BSS
selection internally. In those cases, the disconnect command needs to be
sent to the driver without the BSSID.

This fixes issues where the driver (or cfg80211 in particular) may be
left in mismatching state with wpa_supplicant when disconnection (e.g.,
due to a ctrl_iface command) happens between connection request and
association event.

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

11 years agoWPS: Add support for NFC connection handover with nfcpy
Jouni Malinen [Sun, 4 Nov 2012 14:04:42 +0000 (16:04 +0200)] 
WPS: Add support for NFC connection handover with nfcpy

This helper script can now handle both reading of a NFC tag and
initiation of NFC connection handover if a peer NFC device is touched.

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

11 years agoWPS: Move NFC tag processing into a separate function
Jouni Malinen [Sun, 4 Nov 2012 13:56:46 +0000 (15:56 +0200)] 
WPS: Move NFC tag processing into a separate function

This makes it cleaner to add processing of other NFC operations to the
python script.

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

11 years agoWPS: Move wpactrl setup into a separate function
Jouni Malinen [Sun, 4 Nov 2012 13:53:33 +0000 (15:53 +0200)] 
WPS: Move wpactrl setup into a separate function

This makes it easier to share this functionality for new NFC use cases.

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

11 years agoWPS: Add an example python script for NFC operations
Jouni Malinen [Sat, 3 Nov 2012 20:43:15 +0000 (22:43 +0200)] 
WPS: Add an example python script for NFC operations

wps-nfc.py uses nfcpy and python-wpactrl to provide NFC tag information
to wpa_supplicant for WPS operations.

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

11 years agodbus: Add getter for WPS properties
Sven Neumann [Sat, 3 Nov 2012 16:37:20 +0000 (18:37 +0200)] 
dbus: Add getter for WPS properties

Add "WPS" property to the DBus interface that allows to
identify the active WPS method of a BSS.

Signed-hostap: Sven Neumann <s.neumann@raumfeld.com>

11 years agonl80211: Make debug log more readable for driver events
Jouni Malinen [Sat, 3 Nov 2012 11:54:43 +0000 (13:54 +0200)] 
nl80211: Make debug log more readable for driver events

Print the full name of the nl80211 event message in the debug log to
make it easier to parse the debug log.

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

11 years agoHandle assoc reject events without wpa_supplicant SME
Jouni Malinen [Sat, 3 Nov 2012 11:50:17 +0000 (13:50 +0200)] 
Handle assoc reject events without wpa_supplicant SME

If the driver indicates the association (or authentication) was
rejected, wpa_supplicant should handle this connection failure similarly
to other cases. Previously, this was only handled with drivers that use
wpa_supplicant SME.

In case of cfg80211-based drivers, a rejected association was actually
already handled since cfg80211 generates a deauthentication event after
indicating connection failure. However, rejected authentication resulted
in wpa_supplicant waiting for authentication timeout to expire which is
unnecessary long wait.

Fix this by calling wpas_connection_failed() to use the common mechanism
to reschedule a new connection attempt with the previously attempted
BSSID blacklisted.

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

11 years agoAdd parameter checking and error reporting to wpa_blacklist API
Sasha Levitskiy [Thu, 1 Nov 2012 18:41:27 +0000 (20:41 +0200)] 
Add parameter checking and error reporting to wpa_blacklist API

Signed-off-by: Sasha Levitskiy <sanek@google.com>
11 years agoWPS: Reject invalid credential more cleanly
Jouni Malinen [Thu, 1 Nov 2012 14:30:35 +0000 (16:30 +0200)] 
WPS: Reject invalid credential more cleanly

If WPS Registrar tries to provision a WPA/WPA2-Personal network without
including a valid Network Key, the network block cannot be used to
connect to the network. Reject such credential without adding the
network block. This makes wpa_supplicant send WSC_NACK as a response to
the invalid Credential and stop the provisioning process immediately
rather than only after trying unsuccessfully to connect to the network.

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

11 years agoP2P: Relax Bonjour SD query matching
Jouni Malinen [Wed, 31 Oct 2012 16:25:30 +0000 (18:25 +0200)] 
P2P: Relax Bonjour SD query matching

The DNS Name is allowed to use or not use domain name compression. To
handle both cases, check human readable DNS Name match if binary
matching does not show a hit.

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

11 years agoP2P: Support multiple P2P SD Bonjour services with same key
Jouni Malinen [Wed, 31 Oct 2012 11:01:43 +0000 (13:01 +0200)] 
P2P: Support multiple P2P SD Bonjour services with same key

There may be multiple Bonjour PTR matches for the same key, so extend
the P2P SD code for this to allow such entries to be added (i.e., do not
override previously added value, but add a new one). Similarly, return
multiple matches (one per Service TLV) for a query if it happens to
match more than a single configured Bonjour service.

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

11 years agoP2P: Allow discoverable interval for p2p_find to be configured
Jouni Malinen [Tue, 30 Oct 2012 13:12:04 +0000 (15:12 +0200)] 
P2P: Allow discoverable interval for p2p_find to be configured

The new P2P_SET parameter disc_int can now be used to configure
discoverable interval for p2p_find operations. The format of the command
for setting the values is "P2P_SET disc_int <minDiscoverableInterval>
<maxDiscoverableInterval> <max TUs for discoverable interval>". The
first two parameters are given in units of 100 TUs (102.4 ms). The third
parameter can be used to further limit the interval into a specific TU
amount. If it is set to -1, no such additional limitation is enforced.
It should be noted that the P2P specification describes the random
Listen state interval to be in units of 100 TUs, so setting the max TU
value to anything else than -1 is not compliant with the specification
and should not be used in normal cases. The default parameters can be
set with "P2P_SET disc_int 1 3 -1".

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

11 years agoRestore wpa_s->scan_req if scan trigger fails
Jouni Malinen [Tue, 30 Oct 2012 10:27:05 +0000 (12:27 +0200)] 
Restore wpa_s->scan_req if scan trigger fails

If the driver rejects the scan request while handling an external
requested scan (e.g., SCAN command on ctrl_iface), wpa_s->scan_req gets
cleared in wpa_supplicant_scan(). This can results in issues when the
scheduled re-try of the scan in one seconds trigger another call to this
function. If ap_scan==2 mode is used, this would result in new
association attempt instead of a new scan. Avoid this by restoring value
of wpa_s->scan_req in case the scan trigger fails and a new scan attempt
is scheduled.

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

11 years agoP2P: Clear pending_pd_before_join on PD timeout
Jouni Malinen [Mon, 29 Oct 2012 14:25:02 +0000 (16:25 +0200)] 
P2P: Clear pending_pd_before_join on PD timeout

wpas_p2p_pd_before_join_timeout() needs to clear the
pending_pd_before_join flag to match other uses of this flag prior to
calling wpas_p2p_join_start(). Without this, the flag could be left set
which can cause following P2P operations to behave in unexpected ways.

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

11 years agoP2P: Allow separate P2P group interface use to be disabled
Jouni Malinen [Mon, 29 Oct 2012 13:02:30 +0000 (15:02 +0200)] 
P2P: Allow separate P2P group interface use to be disabled

The new p2p_no_group_iface=1 configuration parameter can now be used to
disable the default behavior of adding a separate interface for the P2P
group when driver support for concurrent interfaces is available.

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

11 years agoP2P: Fix default p2p_group_idle timeout for P2P client role
Jouni Malinen [Sun, 28 Oct 2012 19:37:15 +0000 (21:37 +0200)] 
P2P: Fix default p2p_group_idle timeout for P2P client role

Commit 0d30cc240fa36905b034dc9676f9d8da0ac18e56 forced
wpa_s->current_ssid to be cleared in wpa_supplicant_mark_disassoc()
which gets called from wpa_supplicant_event_disassoc(). This breaks the
P2P group idle mechanism for the case where p2p_group_idle is not set
(i.e., is the default 0) since wpas_p2p_group_idle_timeout() ignores the
timeout in that case if the interface is not recognized as a client
interface (which was based on wpa_s->current_ssid being set).

Fix this by making wpas_p2p_is_client() default to client case if
wpa_s->current_ssid is NULL. This is much more likely case since the P2P
GO mode operation would not really clear the pointer without explicit
request to disconnect.

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

11 years agoWPS: Remove old OOB NFC interface
Jouni Malinen [Sun, 28 Oct 2012 16:20:03 +0000 (18:20 +0200)] 
WPS: Remove old OOB NFC interface

The old WPS interface for using NFC has no known deployments and even
the binary libraries referenced here are not easily available anymore.
Since the new interface for using NFC with WPS covers the same
functionality, remove the old implementation to clean up WPS
implementation.

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

11 years agoWPS: Use AP Channel attribute in credential to speed up scan
Jouni Malinen [Sun, 28 Oct 2012 16:02:04 +0000 (18:02 +0200)] 
WPS: Use AP Channel attribute in credential to speed up scan

When WPS is used with NFC connection handover, the AP may indicate its
operating channel within the credential information. Use this
informatiom, if present, to speed up the scan process.

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

11 years agoWPS: Add preliminary NFC connection handover support for Enrollee
Jouni Malinen [Sun, 28 Oct 2012 15:39:46 +0000 (17:39 +0200)] 
WPS: Add preliminary NFC connection handover support for Enrollee

This commit adds new wpa_supplicant ctrl_iface commands to allow
external programs to go through NFC connection handover mechanism
with wpa_supplicant taking care of the WPS processing. This version
includes only the case where wpa_supplicant is operating as a
station/Enrollee.

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

11 years agoFix EAPOL supplicant port authorization with PMKSA caching
Jouni Malinen [Sat, 27 Oct 2012 08:52:43 +0000 (11:52 +0300)] 
Fix EAPOL supplicant port authorization with PMKSA caching

The previous eapol_sm_notify_cached() implementation forced the port
to be authorized when receiving EAPOL-Key msg 1/4 that included a
matching PMKID in cases when PMKSA caching is used. This is too early
since the port should really be authorized only after the PTK has been
configured which is the case when PMKSA caching is not used.

Fix this by using the EAPOL supplicant PAE state machine to go through
the AUTHENTICATING and AUTHENTICATED states instead of forcing a jump
to AUTHENTICATED without performing full state machine steps. This can
be achieved simply by marking eapSuccess TRUE at least with the current
version of EAP and EAPOL state machines (the earlier commits in this
function seemed to indicate that this may have not been that easy in
the older versions due to the hacks needed here).

This addresses an issue with nl80211-based driver interface when the
driver depends on the STA Authorized flag being used to prevent
unprotected frames from being accepted (both TX and RX) prior to PTK
configuration.

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

11 years agoP2P: Allow all channels with multi-channel concurrency
Jouni Malinen [Fri, 26 Oct 2012 15:10:46 +0000 (18:10 +0300)] 
P2P: Allow all channels with multi-channel concurrency

If the driver indicates support for multi-channel concurrency, change
the p2p_connect behavior to not force the current operating channel, but
instead, just mark it as preferred for GO Negotiation. This change
applies only for the case when the freq parameter is not used with the
p2p_connect command.

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

11 years agoFix EAPOL processing when STA switches between multi-BSSes
David Bird [Thu, 25 Oct 2012 06:20:15 +0000 (09:20 +0300)] 
Fix EAPOL processing when STA switches between multi-BSSes

There was an issue with EAPOL frame exchanges in a multi-BSS
configuration when a station switches between the BSSes controlled by
the same hostapd process. When processing the EAPOL packet, the array of
virtual APs (iface->bss) is searched looking for the station that sent
the packet in order to identify which signal context should be used
during processing. The first match of the station in its list gets used
in the ieee802_1x_receive() function. However, even after a station has
disassociated, it remains in the list of stations pending an inactivity
timeout. This leads to the wrong hapd context (one where the station had
already disassociated) being used in some cases (if the current/active
bss entry appears in the list after one where the station has just
disassociated from) for EAPOL processing.

Fix this by checking the WLAN_STA_ASSOC flag before assuming the right
hapd context was found for the given station.

Signed-hostap: David Bird <dbird@powercloudsystems.com>
intended-for: hostap-1

11 years agoP2P: Add secondary device types into p2p_peer output
Jouni Malinen [Thu, 25 Oct 2012 06:16:27 +0000 (09:16 +0300)] 
P2P: Add secondary device types into p2p_peer output

This allows the P2P_PEER command to be used to fetch the list of
secondary device types that each P2P peer has advertised.

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

11 years agonl80211: Add support for SAE operations
Jouni Malinen [Wed, 24 Oct 2012 06:10:42 +0000 (09:10 +0300)] 
nl80211: Add support for SAE operations

This uses the recent cfg80211 changes to allow SAE authentication to be
implemented with the nl80211 driver interface.

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

11 years agoSync with linux/nl80211.h in wireless-testing.git
Jouni Malinen [Wed, 24 Oct 2012 06:08:38 +0000 (09:08 +0300)] 
Sync with linux/nl80211.h in wireless-testing.git

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

11 years agoP2P: Improve robustness against lost ctrl::ack frames
Jouni Malinen [Sat, 13 Oct 2012 14:33:16 +0000 (17:33 +0300)] 
P2P: Improve robustness against lost ctrl::ack frames

P2P includes two use cases where one of the devices is going to start a
group and likely change channels immediately after processing a frame.
This operation may be fast enough to make the device leave the current
channel before the peer has completed layer 2 retransmission of the
frame in case the ctrl::ack frame was lost. This can result in the peer
not getting TX status success notification.

For GO Negotiation Confirm frame, p2p_go_neg_conf_cb() has a workaround
that ignores the TX status failure and will continue with the group
formation with the assumption that the peer actually received the frame
even though we did not receive ctrl::ack. For Invitation Response frame
to re-invoke a persistent group, no such workaround is used in
p2p_invitation_resp_cb(). Consequently, TX status failure due to lost
ctrl::ack frame results in one of the peers not starting the group.

Increase the likelihood of layer 2 retransmission getting acknowledged
and ctrl::ack being received by waiting a short duration after having
processed the GO Negotiation Confirm and Invitation Response frames for
the re-invocation case. For the former, use 20 ms wait since this case
has been worked around in deployed devices. For the latter, use 50 ms
wait to get even higher likelihood of getting ctrl::ack through since
deployed devices (and the current wpa_supplicant implementation) do not
have a workaround to ignore TX status failure.

20 ms is long enough to include at least couple of retries and that
should increase likelihood of getting ctrl::ack through quite a bit. The
longer 50 ms wait is likely to include full set of layer 2 retries.

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

11 years agoFix regression in LEAP
Jouni Malinen [Thu, 11 Oct 2012 18:50:57 +0000 (21:50 +0300)] 
Fix regression in LEAP

Commit 458cb3019108b6cb8c0c1cab94ae6ebf244eda27 broke LEAP since it
rejects EAP-Success packet that is used within LEAP and this frame does
not have a payload. Fix LEAP by relaxing the generic EAP packet
validation if LEAP has been negotiated.

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

11 years agoWPS: Limit number of active wildcard PINs to one
Jouni Malinen [Wed, 10 Oct 2012 14:38:06 +0000 (17:38 +0300)] 
WPS: Limit number of active wildcard PINs to one

Previously, WPS Registrar allowed multiple wildcard PINs to be
configured. This can get confusing since these PINs get assigned to any
Enrollee that does not have a specific PIN and as such, cannot really be
used with different PIN values in reasonable ways. To avoid confusion
with multiple enabled PINs, invalidate any previously configured
wildcard PIN whenever adding a new one.

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

11 years agoWPS: Allow PIN timeout to be specified with wpa_supplicant AP/GO
Jouni Malinen [Wed, 10 Oct 2012 14:22:35 +0000 (17:22 +0300)] 
WPS: Allow PIN timeout to be specified with wpa_supplicant AP/GO

Extend the wpa_cli wps_pin command to support specification of the PIN
expiration time in seconds similarly to hostapd_cli wps_pin command when
using wpa_supplicant for AP mode (including P2P GO).

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

11 years agoP2P: Allow P2P functionality to be disabled per interface
Jouni Malinen [Wed, 10 Oct 2012 10:08:23 +0000 (13:08 +0300)] 
P2P: Allow P2P functionality to be disabled per interface

By default, P2P is enabled globally for all virtual interfaces and this
makes wpa_supplicant include WSC and P2P IEs in Probe Request frames for
all scans even if this is for a non-P2P station connection to speed up
device discovery. If an interface is dedicated for non-P2P station mode
operations, it is now possible to disable addition of WSC and P2P IEs
into Probe Request frames with a per-interface p2p_disabled parameter.
This can be set either in the configuration file (p2p_disabled=1) or at
run time ("wpa_cli -i wlan0 set p2p_disabled 1"). Unlike the previous
mechanism ("wpa_cli p2p_set disabled 1"), the new parameter changes the
behavior only for the specified interface while other interfaces
continue to follow the global P2P enabled/disabled state.

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

11 years agoDo not clear PMKSA cache on all network block parameter changes
Jouni Malinen [Tue, 9 Oct 2012 10:06:37 +0000 (13:06 +0300)] 
Do not clear PMKSA cache on all network block parameter changes

The bssid and priority parameters in a network block do not have any
effect on the validity of a PMKSA cache entry, so avoid flushing the
PMKSA cache when only these parameters are changed. This is mainly
to allow forced roaming or network selection changes without causing
a disconnection if the changes are done during RSN association that
used EAP.

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

11 years agoFilter out unlikely "pre-shared key may be incorrect" messages
Jouni Malinen [Mon, 8 Oct 2012 14:49:54 +0000 (17:49 +0300)] 
Filter out unlikely "pre-shared key may be incorrect" messages

Add a function to filter out known cases of disconnection during 4-way
handshake that are caused by something else than mismatch in PSK. This
commit adds the case where the local end determines a mismatch in
WPA/RSN element between Beacon/Probe Response frames and EAPOL-Key msg
3/4.

This can avoid some potentially confusing "WPA: 4-Way Handshake failed -
pre-shared key may be incorrect" ctrl_iface messages.

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

11 years agoEAP-TLS: Add extra validation for TLS Message Length
Jouni Malinen [Sun, 7 Oct 2012 17:18:10 +0000 (20:18 +0300)] 
EAP-TLS: Add extra validation for TLS Message Length

While the existing code already addresses TLS Message Length validation
for both EAP-TLS peer and server side, this adds explicit checks and
rejection of invalid messages in the functions handling reassembly. This
does not change externally observable behavior in case of EAP server.
For EAP peer, this starts rejecting invalid messages instead of
addressing them by reallocating the buffer (i.e., ignoring TLS Message
Length in practice).

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

11 years agoEAP-TLS server: Fix TLS Message Length validation
Jouni Malinen [Sun, 7 Oct 2012 17:06:29 +0000 (20:06 +0300)] 
EAP-TLS server: Fix TLS Message Length validation

EAP-TLS/PEAP/TTLS/FAST server implementation did not validate TLS
Message Length value properly and could end up trying to store more
information into the message buffer than the allocated size if the first
fragment is longer than the indicated size. This could result in hostapd
process terminating in wpabuf length validation. Fix this by rejecting
messages that have invalid TLS Message Length value.

This would affect cases that use the internal EAP authentication server
in hostapd either directly with IEEE 802.1X or when using hostapd as a
RADIUS authentication server and when receiving an incorrectly
constructed EAP-TLS message. Cases where hostapd uses an external
authentication are not affected.

Thanks to Timo Warns for finding and reporting this issue.

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

11 years agoSAE: Add Finite Cyclic Group negotiation and Send-Confirm
Jouni Malinen [Sat, 6 Oct 2012 16:30:54 +0000 (19:30 +0300)] 
SAE: Add Finite Cyclic Group negotiation and Send-Confirm

This replaces the previously used bogus test data in SAE messages with
the first real field. The actual SAE authentication mechanism is still
missing and the Scaler, Element, and Confirm fields are not included.

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

11 years agoP2P: Fix network removal on P2P connect to select correct block
Jouni Malinen [Fri, 5 Oct 2012 17:37:49 +0000 (20:37 +0300)] 
P2P: Fix network removal on P2P connect to select correct block

If wpa_s->current_ssid is not set (e.g., after disconnection that
did not result in immediate group removal), an incorrect group could
have been removed since the network block iteration here could select
the network block that is used to store persistent group credentials.
Fix this by verifying that disabled != 2 to avoid picking the network
block that could not have been the temporary P2P group.

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

11 years agoWPS: Reenable the networks disabled during wpa_wpas_reassoc
Sunil Dutt [Thu, 4 Oct 2012 18:11:04 +0000 (21:11 +0300)] 
WPS: Reenable the networks disabled during wpa_wpas_reassoc

During the association for the WPS handshake all the other configured
networks are disabled. This patch makes wpa_supplicant reenable the
disabled networks after the success/failure of the WPS handshake.

Signed-hostap: Sunil Dutt Undekari <duttus@codeaurora.org>

11 years ago60 GHz: Fix error while processing scan results
Vladimir Kondratiev [Thu, 4 Oct 2012 13:32:23 +0000 (16:32 +0300)] 
60 GHz: Fix error while processing scan results

Channel frequency for 60 GHz band do not fit into 'short int', as was
used. Expand it to 'int'

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>

11 years agoInterworking: Unshare ANQP results on explicit ANQP requests
Jouni Malinen [Wed, 3 Oct 2012 11:17:41 +0000 (14:17 +0300)] 
Interworking: Unshare ANQP results on explicit ANQP requests

When ANQP_GET or HS20_ANQP_GET is used to request ANQP information,
unshare the ANQP information (i.e., create a per-BSS copy of it) to
make sure the information from the specified BSS is available in case
the APs provide different information within HESSID.

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

11 years agoHS 2.0: Include parsed WAN Metrics in RX-HS20-ANQP event
Jouni Malinen [Wed, 3 Oct 2012 10:58:56 +0000 (13:58 +0300)] 
HS 2.0: Include parsed WAN Metrics in RX-HS20-ANQP event

This adds parsed version of WAN Metrics information to the control
event message as follows:

RX-HS20-ANQP 02:00:00:00:01:00 WAN Metrics 01:8000:1000:80:240:3000

format: <WAN Info>:<DL Speed>:<UL Speed>:<DL Load>:<UL Load>:<LMD>
WAN Info: B0-B1: Link Status, B2: Symmetric Link, B3: At Capabity
   (encoded as two hex digits)
Downlink Speed: Estimate of WAN backhaul link current downlink speed in kbps;
1..4294967295; 0 = unknown
Uplink Speed: Estimate of WAN backhaul link current uplink speed in kbps
1..4294967295; 0 = unknown
Downlink Load: Current load of downlink WAN connection (scaled to 255 = 100%)
Uplink Load: Current load of uplink WAN connection (scaled to 255 = 100%)
Load Measurement Duration: Duration for measuring downlink/uplink load in
tenths of a second (1..65535); 0 if load cannot be determined

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

11 years agoWPS: Fix a potential memory leak on wps_init() error path
Jouni Malinen [Tue, 2 Oct 2012 13:51:27 +0000 (16:51 +0300)] 
WPS: Fix a potential memory leak on wps_init() error path

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

11 years agoFix build without CONFIG_WPS=y
Jouni Malinen [Mon, 1 Oct 2012 13:07:07 +0000 (16:07 +0300)] 
Fix build without CONFIG_WPS=y

Commit 620c783753bddd37988269314862dc7e4a62f700 modified
wpas_wps_ssid_bss_match() prototype but forgot to update the non-WPS
wrapper inline function. Fix that to match with the new bss parameter
type.

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

11 years agoP2P: Add a conf parameter to start a GO as HT40 if allowed
Arik Nemtsov [Sun, 30 Sep 2012 17:35:51 +0000 (20:35 +0300)] 
P2P: Add a conf parameter to start a GO as HT40 if allowed

When specified in the conf file this parameter will make all invocations
of p2p_group_add, p2p_connect, and p2p_invite behave as if "ht40" has
been specified on the command line. This shouldn't do harm since
regulatory constraints and driver capabilities are consulted anyway
before starting HT40 mode.

Signed-hostap: Arik Nemtsov <arik@wizery.com>

11 years agoReserve AKM and cipher suite values
Jouni Malinen [Sun, 30 Sep 2012 17:26:55 +0000 (20:26 +0300)] 
Reserve AKM and cipher suite values

These values are used with WAPI and CCX and reserving the definitions
here reduces the number of merge conflicts with repositories that
include these functions.

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

11 years agoAdd initial parts for SAE
Jouni Malinen [Sun, 30 Sep 2012 16:51:07 +0000 (19:51 +0300)] 
Add initial parts for SAE

This introduces new AKM for SAE and FT-SAE and adds the initial parts
for going through the SAE Authentication frame exchange. The actual SAE
algorithm and new fields in Authentication frames are not yet included
in this commit and will be added separately. This version is able to
complete a dummy authentication with the correct authentication
algorithm and transaction values to allow cfg80211/mac80211 drivers to
be tested (all the missing parts can be handled with
hostapd/wpa_supplicant changes).

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

11 years agoSync with linux/nl80211.h in wireless-testing.git
Jouni Malinen [Sun, 30 Sep 2012 07:49:46 +0000 (10:49 +0300)] 
Sync with linux/nl80211.h in wireless-testing.git

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

11 years agodbus: Add global capabilities property
Dan Williams [Sat, 29 Sep 2012 16:06:30 +0000 (19:06 +0300)] 
dbus: Add global capabilities property

Otherwise it's difficult to determine if the supplicant was built with
CONFIG_AP, CONFIG_IBSS_RSN, CONFIG_P2P, etc. CONFIG_AP and CONFIG_P2P
can be inferred from the introspection data of the Interface object,
but CONFIG_IBSS_RSN does not change the introspection data at all and
thus it's impossible to determine whether the supplicant supports it
without knowing its compile-time options.

Signed-hostap: Dan Williams <dcbw@redhat.com>
intended-for: hostap-1

11 years agonl80211: Don't send BSSID with disconnect command
Mykyta Iziumtsev [Sat, 29 Sep 2012 16:01:50 +0000 (19:01 +0300)] 
nl80211: Don't send BSSID with disconnect command

NL80211_CMD_DISCONNECT doesn't need BSSID, because cfg80211
uses locally saved value.

Signed-hostap: Mykyta Iziumtsev <mykyta.iziumtsev@gmail.com>

11 years agoP2P: Fix p2p_cancel processing during group formation
Jouni Malinen [Fri, 28 Sep 2012 19:01:48 +0000 (22:01 +0300)] 
P2P: Fix p2p_cancel processing during group formation

The wpa_s->p2p_in_provisioning flag did not get cleared in some cases
where p2p_cancel command is used to stop group formation. This can result
in some operations (like p2p_find) failing afterwards. Fix this by using
wpas_group_formation_completed() when processing p2p_cancel for a group
that has not yet completed group formation.

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

11 years agoInterworking: Support Android JB keystore with EAP-TLS
Jouni Malinen [Fri, 28 Sep 2012 14:12:27 +0000 (17:12 +0300)] 
Interworking: Support Android JB keystore with EAP-TLS

If the keystore:// prefix is used in the private_key entry, convert that
to the OpenSSL engine style configuration used for Android JB keystore.

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

11 years agoInterworking: Fix failed GAS query processing
Jouni Malinen [Fri, 28 Sep 2012 14:09:15 +0000 (17:09 +0300)] 
Interworking: Fix failed GAS query processing

The pending GAS entry must be removed from the list when it is removed.
This fixes an issue with potential segfault due to freed memory being
accessed if the driver fails to accept a GAS query.

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

11 years agoAdd disallow_aps parameter to disallow BSSIDs/SSIDs
Jouni Malinen [Thu, 27 Sep 2012 14:36:59 +0000 (17:36 +0300)] 
Add disallow_aps parameter to disallow BSSIDs/SSIDs

External programs can use this new parameter to prevent wpa_supplicant
from connecting to a list of BSSIDs and/or SSIDs. The disallowed BSSes
will still be visible in scan results and it is possible to run ANQP
operations with them, but BSS selection for connection will skip any
BSS that matches an entry in the disallowed list.

The new parameter can be set with the control interface SET command
using following syntax:

SET disallow_aps <disallow_list>
disallow_list ::= <ssid_spec> | <bssid_spec> | <disallow_list> | “”
SSID_SPEC ::= ssid <SSID_HEX>
BSSID_SPEC ::= bssid <BSSID_HEX>

For example:
wpa_cli set disallow_list "ssid 74657374 bssid 001122334455 ssid 68656c6c6f"
wpa_cli set disallow_list
(the empty value removes all entries)

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

11 years agoInclude connected time in AP mode STA-* commands
Raja Mani [Wed, 26 Sep 2012 10:52:19 +0000 (13:52 +0300)] 
Include connected time in AP mode STA-* commands

This allows hostapd_cli and wpa_cli all_sta command to be used to
display connected time (in seconds) of each station in AP mode.

Signed-hostap: Raja Mani <rmani@qca.qualcomm.com>

11 years agoP2P: Fix ignoring of PD Response due to dialog token mismatch
Jouni Malinen [Tue, 25 Sep 2012 18:41:52 +0000 (21:41 +0300)] 
P2P: Fix ignoring of PD Response due to dialog token mismatch

Commit 6b56cc2d97fe9efd1feea8d418714b4658b056f1 added clearing of the
p2p->pending_action_state too early in this function. This should not
be done if we are going to silently ignore the frame due to dialog
token mismatch. Fix this by moving the code around to check the dialog
token first.

This issue resulted in PD Request retries getting stopped too early if
the peer is sending out an unexpected PD Response (e.g., because of it
being excessively slow with the response so that the response is
received only after the next TX attempt with a new dialog token).

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

11 years agoP2P: Clear sta_scan_pending on group removal
Jouni Malinen [Mon, 24 Sep 2012 23:55:20 +0000 (02:55 +0300)] 
P2P: Clear sta_scan_pending on group removal

It is possible for the P2P client group to be removed while waiting for
a pending scan operation (e.g., when p2p_group_idle timeout hits after
getting disconnected from the GO with something else than
Deauthentication with reason code 3). If this happens with a P2P
interface that is used both for P2P Device and group roles, scan state
could get stuck while waiting for the next scan to complete since no
more station (P2P client) mode scans are scheduled. Fix this by clearing
sta_scan_pending when removing the temporary group network block.

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

11 years agoP2P: Allow peer to propose channel in invitation process
Jouni Malinen [Mon, 24 Sep 2012 19:15:58 +0000 (22:15 +0300)] 
P2P: Allow peer to propose channel in invitation process

Make Invitation process for re-invoking a persistent group behave
similarly to GO Negotiation as far as channel negotiation is concerned.
The Operating Channel value (if present) is used as a starting point if
the local device does not have a forced operating channel (e.g., due to
concurrent use). Channel lists from devices are then compared to check
that the selected channel is in the intersection. If not, channel is
selected based on GO Negotiation channel rules (best channel preferences
etc.). Invitation Request is rejected if no common channel can be
selected.

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

11 years agoP2P: Show own channel list in debug log
Jouni Malinen [Mon, 24 Sep 2012 19:14:50 +0000 (22:14 +0300)] 
P2P: Show own channel list in debug log

This makes it easier to debug channel negotiation mechanisms.

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

11 years agoP2P: Fix pending-sta-scan processing for concurrent operation cases
Jouni Malinen [Mon, 24 Sep 2012 10:46:27 +0000 (13:46 +0300)] 
P2P: Fix pending-sta-scan processing for concurrent operation cases

If two P2P_FIND commands and a station mode SCAN command are issued in a
sequence with the second P2P_FIND and SCAN commands started before the
initial scan from the first P2P_FIND command has completed,
sta_scan_pending may be left set without an automatic way of getting it
cleared. This can get P2P search stuck if no further station mode scan
operations are run.

Fix this by clearing the sta_scan_pending flag whenever station mode scans
are stopped due to no enabled networks resulting in INACTIVE mode getting
entered. In addition, avoid setting sta_scan_pending flag when a special
scan_res_handler is set so that this does not get enabled on the P2P
Device interface during a P2P search operation.

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

11 years agoP2P: Add more debug prints for GO start routines
Jouni Malinen [Sun, 23 Sep 2012 22:05:51 +0000 (01:05 +0300)] 
P2P: Add more debug prints for GO start routines

This makes it easier to debug issues in starting GO mode.

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

11 years agoAdd debug print for no-enabled-networks case
Jouni Malinen [Sun, 23 Sep 2012 22:04:00 +0000 (01:04 +0300)] 
Add debug print for no-enabled-networks case

If there are any disabled networks, show a debug print with the count
of those networks when no enabled networks are found. This can be
helpful in trying to figure out why scans are being skipped.

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

11 years agoPrint control interface commands in easier format
Jouni Malinen [Sun, 23 Sep 2012 22:01:26 +0000 (01:01 +0300)] 
Print control interface commands in easier format

The ASCII hexdump is somewhat difficult to search for (especially on
Android builds), so make the debug log easier to parse by printing the
full control interface command as a text string. In addition, use
wpa_dbg() to get the interface name printed so that multi-interface
cases can be debugged.

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

11 years agoP2P: Fix PSK configuration for GO network
Jouni Malinen [Sun, 23 Sep 2012 21:56:57 +0000 (00:56 +0300)] 
P2P: Fix PSK configuration for GO network

Setting just ssid->passphrase is not enough to complete the network
block for the GO entry. Also the PSK needs to be derived so that the
network is considered enabled by wpas_network_disabled(). The previous
version worked as long as something else allowed the scan request to be
performed (this is needed even though the actual scan is skipped when
starting GO).

The first GO start was allowed because wpa_s->scan_req is initialized to
1 in wpa_supplicant_alloc(). However, other attempts may fail if
wpa_s->scan_req is cleared. This failure shows up as "No enabled
networkas - do not scan" in debug log followed by state change to
INACTIVE when trying to start GO.

Fix this by deriving PSK from the passphrase for GO mode.

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

11 years agoP2P: Fix p2p_group_idle in no-group-interface P2P client case
Jouni Malinen [Sun, 23 Sep 2012 17:28:03 +0000 (20:28 +0300)] 
P2P: Fix p2p_group_idle in no-group-interface P2P client case

Commit 30ee769235f3170d9bf6b62c11c6e018e97deb84 started skipping P2P
group removal if wpa_s->current_ssid is not set and commit
0d30cc240fa36905b034dc9676f9d8da0ac18e56 started clearing
wpa_s->current_ssid on disconnection. This combination broke
p2p_group_idle timeout on P2P client interface in a case where no
separate P2P group interface is used and when the disconnection is
triggered by something else than an explicit indication of GO
terminating the group.

Fix this by relaxing network block matching rules when figuring out
whether any of the configured network blocks could be in P2P use. The
p2p_group flag alone should be enough for this since temporary P2P group
network blocks are removed once the P2P group is terminated.

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

11 years agowpa_supplicant: Set state to DISCONNECTED on AP creation errors
Dan Williams [Sun, 23 Sep 2012 10:55:58 +0000 (13:55 +0300)] 
wpa_supplicant: Set state to DISCONNECTED on AP creation errors

If the AP creation failed (missing freq= or driver error) the supplicant
would previously stay in SCANNING state forever. Instead, it should
handle the error a bit better and drop back to DISCONNECTED so clients
know something went wrong.

Signed-hostap: Dan Williams <dcbw@redhat.com>
intended-for: hostap-1

11 years agonl80211: Use the monitor interface if socket tx status is not supported
Felix Fietkau [Sun, 23 Sep 2012 10:28:31 +0000 (13:28 +0300)] 
nl80211: Use the monitor interface if socket tx status is not supported

Fixes hostapd on recent compat-wireless builds with older kernels.

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

11 years agohostapd: Add check for the wds sta flag before creating 4addr VLANs
Felix Fietkau [Sun, 23 Sep 2012 10:25:49 +0000 (13:25 +0300)] 
hostapd: Add check for the wds sta flag before creating 4addr VLANs

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

11 years agohostapd: Clear WLAN_STA_ASSOC_REQ_OK if sending the assoc response failed
Felix Fietkau [Sun, 23 Sep 2012 10:23:16 +0000 (13:23 +0300)] 
hostapd: Clear WLAN_STA_ASSOC_REQ_OK if sending the assoc response failed

As long as WLAN_STA_ASSOC_REQ_OK is set in sta->flags, Class 3 frames do
not trigger a disassoc/deauth. If it is still set even after the assoc
response tx has already failed, it may take somewhat longer for clients
to realize that the connection wasn't fully established.

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

11 years agoP2P: Remove channel 14 from supported P2P channels
Mykyta Iziumtsev [Sun, 23 Sep 2012 09:49:52 +0000 (12:49 +0300)] 
P2P: Remove channel 14 from supported P2P channels

Channel 14 is available only in Japan and is DSSS-only according to
IEEE 802.11-2012 19.4.3 and MIC Equipment Ordinance (EO)
for Regulating Radio Equipment article 49.20.

At the same time, P2P should avoid using DSSS modulation in normal
operation according to P2P specification v1.2 2.4.1.

Signed-hostap: Mykyta Iziumtsev <mykyta.iziumtsev@gmail.com>
intended-for: hostap-1

11 years agohostapd: Send EAPOL frames from the VO queue if WMM is active
Felix Fietkau [Sun, 16 Sep 2012 05:40:00 +0000 (22:40 -0700)] 
hostapd: Send EAPOL frames from the VO queue if WMM is active

This avoids extra latency caused by establishing an aggregation session
and makes the initial connection attempt more reliable

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

11 years agohostapd: Fix WDS VLAN bridge handling
Felix Fietkau [Sun, 16 Sep 2012 05:38:14 +0000 (22:38 -0700)] 
hostapd: Fix WDS VLAN bridge handling

This patch fixes an issue where removing a WDS VLAN interface also
removed the main AP interface from the same bridge.

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

11 years agohostapd: Fix CONFIG_INTERWORKING=y build without CONFIG_HS20=y
Jouni Malinen [Sun, 16 Sep 2012 05:37:27 +0000 (22:37 -0700)] 
hostapd: Fix CONFIG_INTERWORKING=y build without CONFIG_HS20=y

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

11 years agoP2P: Fix p2p_ctrl_invite_persistent() to parse peer parameter
Jouni Malinen [Sun, 16 Sep 2012 05:21:46 +0000 (22:21 -0700)] 
P2P: Fix p2p_ctrl_invite_persistent() to parse peer parameter

Commit 4d32c0c44db43d496f45c5094a9b6ae60c35115e added another use for the
local pos variable and that broke the mechanism used to determine wheter
the peer address was provided. Fix this by using a separate pointer to the
peer address.

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

11 years agoRemove unused function warning in WPS NFC case
Masashi Honma [Sun, 16 Sep 2012 05:02:09 +0000 (22:02 -0700)] 
Remove unused function warning in WPS NFC case

When I use CONFIG_WPS_NFC=y a warning appears.

wps_supplicant.c:1872:12: warning: 'wpas_wps_add_nfc_password_token'
defined but not used [-Wunused-function]

This patch removes this warning.

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

11 years agoDo not inform other virtual interfaces of scan results in all cases
Jouni Malinen [Fri, 14 Sep 2012 01:07:02 +0000 (18:07 -0700)] 
Do not inform other virtual interfaces of scan results in all cases

If a connection operation is started on an interface based on scan
results, other virtual interfaces should not be information about the
results to avoid potential concurrent operations during the association
steps. Since the sibling notification of scan results received was added
as an optimization, skipping it for this type of cases is the simplest
way of avoiding unnecessary concurrent operations.

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

11 years agoP2P: Schedule new scan if P2P operation delays scan
Jouni Malinen [Fri, 14 Sep 2012 01:05:55 +0000 (18:05 -0700)] 
P2P: Schedule new scan if P2P operation delays scan

This makes sure that the interrupted station mode scan can be completed
after the P2P operations have had their chance of using the radio.

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

11 years agoP2P: Check all interfaces for pending scan for p2p_scan failures
Jouni Malinen [Fri, 14 Sep 2012 01:03:14 +0000 (18:03 -0700)] 
P2P: Check all interfaces for pending scan for p2p_scan failures

Driver could reject the new scan based on any virtual interface
running a concurrent scan. As such, mark the pending scan callback
for P2P based on any interfaces instead of just the one used for
the p2p_scan operation.

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