]> git.ipfire.org Git - thirdparty/hostap.git/log
thirdparty/hostap.git
11 years agoRemove unused function prototype
Jouni Malinen [Sun, 25 Nov 2012 14:27:19 +0000 (16:27 +0200)] 
Remove unused function prototype

This function was not added, so the prototype should not have been here
either.

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

11 years agoMaintain maximum blacklist count over list clear operations
Jouni Malinen [Sun, 25 Nov 2012 14:20:44 +0000 (16:20 +0200)] 
Maintain maximum blacklist count over list clear operations

wpas_connection_failed() uses the blacklist count to figure out a
suitable time to wait for the next scan. This mechanism did not work
properly in cases where the temporary blacklist gets cleared due to no
other BSSes being available. Address this by maintaining an additional
count of blacklisting values over wpa_blacklist_clear() calls. In
addition, add one more step in the count to timeout mapping to go to 10
second interval if more than four failures are seen.

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

11 years agoDocument wpa_s->scan_req
Jouni Malinen [Sun, 25 Nov 2012 13:55:32 +0000 (15:55 +0200)] 
Document wpa_s->scan_req

Use an enum with documented values to make it easier to understand how
wpa_s->scan_req is used.

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

11 years agoMark sme_send_authentication() static
Jouni Malinen [Sun, 25 Nov 2012 13:47:43 +0000 (15:47 +0200)] 
Mark sme_send_authentication() static

This function is not used outside sme.c.

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

11 years agoP2P: Avoid multi-channel scans when they are not needed
Jouni Malinen [Sun, 25 Nov 2012 10:47:43 +0000 (12:47 +0200)] 
P2P: Avoid multi-channel scans when they are not needed

If the driver does not support multi-channel concurrency and a virtual
interface that shares the same radio with the current interface is
operating there may not be need to scan other channels apart from the
current operating channel on the other virtual interface. Filter out
other channels in case we are trying to find a connection for a station
interface when we are not configured to prefer station connection and a
concurrent operation is already in process.

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

11 years agoIndicate if PMF was negotiated for the connection
Jouni Malinen [Sat, 24 Nov 2012 20:45:17 +0000 (22:45 +0200)] 
Indicate if PMF was negotiated for the connection

Add pmf=1/2 to wpa_supplicant STATUS command output to indicate that PMF
was negotiated for the connect (1 = optional in this BSS, 2 = required
in this BSS).

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

11 years agoInterworking: Enable key_mgmt WPA-EAP-SHA256 if PMF is enabled
Jouni Malinen [Sat, 24 Nov 2012 20:31:17 +0000 (22:31 +0200)] 
Interworking: Enable key_mgmt WPA-EAP-SHA256 if PMF is enabled

If the global pmf=1/2 parameter is used to enable PMF for Interworking
networks, add WPA-EAP-SHA256 to the temporary network block to allow
connection to PMF required APs.

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

11 years agoAllow PMF to be enabled by default
Jouni Malinen [Sat, 24 Nov 2012 20:21:29 +0000 (22:21 +0200)] 
Allow PMF to be enabled by default

Previously, PMF (protected management frames, IEEE 802.11w) could be
enabled only with a per-network parameter (ieee80211w). The new global
parameter (pmf) can now be used to change the default behavior to be PMF
enabled (pmf=1) or required (pmf=2) for network blocks that do not
override this with the ieee80211w parameter.

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

11 years agoAllow OBSS scan and 20/40 coex reports to non-SME drivers
Amitkumar Karwar [Sat, 24 Nov 2012 16:08:48 +0000 (18:08 +0200)] 
Allow OBSS scan and 20/40 coex reports to non-SME drivers

We enable this feature for non-SME drivers as well if
they explicitly indicate need for it.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
11 years agoSync with linux/nl80211.h in wireless-testing.git
Jouni Malinen [Sat, 24 Nov 2012 16:04:55 +0000 (18:04 +0200)] 
Sync with linux/nl80211.h in wireless-testing.git

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

11 years agohostapd: Add second VHT frequency segment config
Johannes Berg [Sat, 24 Nov 2012 16:02:29 +0000 (18:02 +0200)] 
hostapd: Add second VHT frequency segment config

Add the configuration option vht_oper_centr_freq_seg1_idx
for the second segment of an 80+80 MHz channel and use it
when building the VHT operation IE.

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

11 years agohostapd: Add VHT PHY selector if VHT is required
Johannes Berg [Sat, 24 Nov 2012 15:27:16 +0000 (17:27 +0200)] 
hostapd: Add VHT PHY selector if VHT is required

If VHT is required, add the VHT PHY selector to
the (extended) supported rates IE.

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

11 years agoVerify that the selected BSS has a better signal level before roaming
Robert Shade [Sat, 24 Nov 2012 15:17:50 +0000 (17:17 +0200)] 
Verify that the selected BSS has a better signal level before roaming

This prevents situations like the following where we roam to a
lesser quality BSS just because the signal level delta is over our
threshold.

wlan0: Considering within-ESS reassociation
wlan0: Current BSS: 00:24:6c:74:0a:40 level=-51
wlan0: Selected BSS: 00:24:6c:74:0a:e0 level=-64
wlan0: Request association: reassociate: 0  selected: 00:24:6c:74:0a:e0
    bssid: 00:24:6c:74:0a:40  pending: 00:00:00:00:00:00  wpa_state: COMPLETED

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

11 years agoDo not double free cfg struct if netlink_init() fails
Pontus Fuchs [Sat, 24 Nov 2012 14:47:20 +0000 (16:47 +0200)] 
Do not double free cfg struct if netlink_init() fails

If netlink_init() fails on socket create or bind the cfg struct
provided as parameter is freed by netlink_init(). Callers of
netlink_init() also free this struct on their error paths leading
to double free.

Signed-hostap: Pontus Fuchs <pontus.fuchs@gmail.com>

11 years agoHS 2.0: Add Home SP FQDN and roaming/home to status command
Jouni Malinen [Thu, 22 Nov 2012 18:51:49 +0000 (20:51 +0200)] 
HS 2.0: Add Home SP FQDN and roaming/home to status command

This allows the ctrl_iface STATUS information to be used to determine
which Home SP credential (domain in the cred block) was used and whether
the network is operated by the home SP.

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

11 years agoHS 2.0: Add REMOVE_CRED sp_fqdn=<FQDN> command
Jouni Malinen [Thu, 22 Nov 2012 16:04:57 +0000 (18:04 +0200)] 
HS 2.0: Add REMOVE_CRED sp_fqdn=<FQDN> command

This allows credential entries to be removed based on SP FQDN without
having to iterate through the configured entries from an external
program to figure out which credentials should be removed for a specific
SP.

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

11 years agoHS 2.0: Remove temporary network block on cred block removal
Jouni Malinen [Thu, 22 Nov 2012 15:53:27 +0000 (17:53 +0200)] 
HS 2.0: Remove temporary network block on cred block removal

If the credential that was used to create a temporary HS 2.0 network
block is removed, remove the network block, too.

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

11 years agoHS 2.0: Maintain a copy of HS 2.0 Indication from Association Request
Jouni Malinen [Wed, 21 Nov 2012 22:19:17 +0000 (00:19 +0200)] 
HS 2.0: Maintain a copy of HS 2.0 Indication from Association Request

This allows the AP to figure out whether a station is a HS 2.0 STA
during the association and access any information that the STA may have
included in this element.

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

11 years agoAndroid: Force group access to ctrl_iface directory
Jouni Malinen [Fri, 23 Nov 2012 15:05:47 +0000 (17:05 +0200)] 
Android: Force group access to ctrl_iface directory

wpa_supplicant is started from /init.*.rc on Android and that seems
to be using umask 0077 which would leave the control interface
directory without group access. This breaks things since Wi-Fi
framework assumes that this directory can be accessed by other
applications in the wifi group. Fix this by adding group access even
if umask value would prevent this.

In most cases, this issue was not hit since the control interface
directory is normally created by that same init.*.rc file with suitable
mode and wpa_supplicant is killed in the way that does not allow it to
remove the file. However, if wpa_supplicant is allowed stop cleanly, it
will remove the directory and the next start could result with the Wi-Fi
framework not being able to use Wi-Fi (and GUI not showing Wi-Fi getting
enabled).

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

11 years agoP2P: Increase the maximum number of PD Request retries
Sunil Dutt [Thu, 22 Nov 2012 22:57:59 +0000 (00:57 +0200)] 
P2P: Increase the maximum number of PD Request retries

Change the maximum retry limit from 10 to 120 to match the behavior
used with GO Negotiation Request frames when trying to start GO
Negotiation with a peer that does not acknowledge frames (e.g., due
to being in sleep or on another channel most of the time).

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

11 years agoP2P: Remove PD-before-join-timeout mechanism
Sunil Dutt [Thu, 22 Nov 2012 23:14:15 +0000 (01:14 +0200)] 
P2P: Remove PD-before-join-timeout mechanism

The PD Request retry limit can be used to achieve the same behavior,
so drop this duplicated timeout mechanism and control the timeout
based on MAX_PROV_DISC_REQ_RETRIES.

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

11 years agoP2P: Retry PD Request in join-a-running-group case
Jouni Malinen [Thu, 22 Nov 2012 22:53:42 +0000 (00:53 +0200)] 
P2P: Retry PD Request in join-a-running-group case

The GO may be in sleep when we send a PD Request frame to indicate that
we are about to join a running group. Previously, this frame was not
retried more than normal low level retries. This can result in the GO
not getting the frame especially in cases where concurrent multi-channel
operations or aggressive sleep schedule is used since most drivers do
not yet synchronize with the GO's NoA before association.

Increase the likelihood of the GO receiving the PD Request frame by
retransmitting it similarly to the PD-for-GO-Negotiation case. Start
the actual join operation only after these retries have failed to get
an acknowledgment from the GO to give the connection attempt a chance
to succeed if the driver implements better NoA synchronization for it.

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

11 years agoP2P: Set user_initiated_pd separately from the join parameter
Sunil Dutt [Thu, 22 Nov 2012 22:48:58 +0000 (00:48 +0200)] 
P2P: Set user_initiated_pd separately from the join parameter

p2p_prov_disc_req() used the join parameter to figure out whether the PD
request was a user initiated or not. This does not cover all use cases
of PD, so add a separate parameter to allow caller to indicate whether
the user requested the operation.

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

11 years agoAndroid: Fix AP builds to include the new eap_user_db.c
Jouni Malinen [Wed, 21 Nov 2012 15:55:36 +0000 (17:55 +0200)] 
Android: Fix AP builds to include the new eap_user_db.c

This is needed to fix the builds after commit
ee431d77a51b361b4697f2b737bcf46a1860a6fe.

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

11 years agoFix wpa_supplicant compilation after adding eap_user database
Vladimir Kondratiev [Wed, 21 Nov 2012 15:49:47 +0000 (17:49 +0200)] 
Fix wpa_supplicant compilation after adding eap_user database

Commit ee431d77a51b361b4697f2b737bcf46a1860a6fe broke wpa_supplicant
compilation:

../src/ap/ieee802_1x.o: In function `ieee802_1x_get_eap_user':
/../src/ap/ieee802_1x.c:1689: undefined reference to `hostapd_get_eap_user'
collect2: error: ld returned 1 exit status
make: *** [wpa_supplicant] Error 1

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
11 years agoAdd preliminary support for using SQLite for eap_user database
Jouni Malinen [Tue, 20 Nov 2012 22:47:47 +0000 (00:47 +0200)] 
Add preliminary support for using SQLite for eap_user database

CONFIG_SQLITE=y option can now be used to allow the eap_user_file text
file to be replaced with a SQLite database
(eap_user_file=sqlite:/path/to/sqlite.db). hostapd.eap_user_sqlite
shows an example of how the database tables can be created for this
purpose. This commit does not yet include full functionality of the
text file format, but at least basic EAP-TTLS/MSCHAPv2 style
authentication mechanisms with plaintext passwords can be used for
tests.

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

11 years agonl80211: Add support for TDLS request event from the driver
Jouni Malinen [Mon, 19 Nov 2012 15:00:07 +0000 (17:00 +0200)] 
nl80211: Add support for TDLS request event from the driver

The NL80211_CMD_TDLS_OPER command can be used as an event based on a
recent cfg80211 commit, so add code to map that to internal
wpa_supplicant event to request TDLS link setup/teardown.

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

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>