]> git.ipfire.org Git - thirdparty/hostap.git/log
thirdparty/hostap.git
9 years agotests: DFS with wpa_supplicant AP mode
Jouni Malinen [Thu, 5 Mar 2015 14:23:33 +0000 (16:23 +0200)] 
tests: DFS with wpa_supplicant AP mode

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agoDFS: Allow wpa_supplicant AP mode to use non-offloaded DFS
Jouni Malinen [Thu, 5 Mar 2015 14:20:03 +0000 (16:20 +0200)] 
DFS: Allow wpa_supplicant AP mode to use non-offloaded DFS

This extends the hostapd-like setup of DFS-in-userspace for
wpa_supplicant AP mode operations.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agonl80211: Add vendor event parsing for DFS offload events
Ahmad Kholaif [Thu, 5 Mar 2015 02:16:10 +0000 (18:16 -0800)] 
nl80211: Add vendor event parsing for DFS offload events

This converts the QCA vendor event to EVENT_DFS_* events for the case
of DFS offloaded to the driver.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agoDFS: wpa_supplicant event processing
Ahmad Kholaif [Thu, 5 Mar 2015 02:03:39 +0000 (18:03 -0800)] 
DFS: wpa_supplicant event processing

Add radar event processing logic for AP/P2P GO. The DFS processing
functions from hostapd are now used for these wpa_supplicant cases as
well for both offloaded and non-offloaded DFS.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agoDFS offload: P2P changes for autonomous GO
Ahmad Kholaif [Thu, 5 Mar 2015 01:31:25 +0000 (17:31 -0800)] 
DFS offload: P2P changes for autonomous GO

Add P2P changes to allow bringing up P2P autonomous GO on a DFS channel
if DFS functionality is offloaded to the driver.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agoDFS offload: Indicate AP-CSA-FINISHED for DFS offloaded case
Ahmad Kholaif [Thu, 5 Mar 2015 01:04:09 +0000 (17:04 -0800)] 
DFS offload: Indicate AP-CSA-FINISHED for DFS offloaded case

Modify the string for AP-CSA-FINISHED event indication to include a flag
which tells the framework whether the new channel is a DFS channel.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agoDFS offload: Add main DFS handler for offloaded case
Ahmad Kholaif [Thu, 5 Mar 2015 01:24:36 +0000 (17:24 -0800)] 
DFS offload: Add main DFS handler for offloaded case

Add handling logic for DFS offloaded case, and add a helper function
that takes the frequency (MHz) as a param and returns 1 if given channel
requires DFS, or 0 otherwise.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agoDFS offload: Skip user space processing for CAC operations
Ahmad Kholaif [Thu, 5 Mar 2015 00:56:44 +0000 (16:56 -0800)] 
DFS offload: Skip user space processing for CAC operations

If DFS is offloaded to the driver, hostapd should not be performing
these operations. Send the relevant control interface events to provide
information to upper layer software that may use such events to track
DFS/CAC state. This makes the offloaded DFS implementation more
consistent with the DFS-in-hostapd behavior.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agoInterworking: Clear SCANNING state if no match found
Jouni Malinen [Tue, 3 Mar 2015 15:03:25 +0000 (17:03 +0200)] 
Interworking: Clear SCANNING state if no match found

Previously, it was possible for wpa_state to be left at SCANNING if
INTERWORKING_SELECT command failed to find any match. Now the state is
set to DISCONNECTED if the operation terminates because of no matching
networks.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agotests: Fix workaround for limited channel survey in mac80211_hwsim
Jouni Malinen [Tue, 3 Mar 2015 14:01:52 +0000 (16:01 +0200)] 
tests: Fix workaround for limited channel survey in mac80211_hwsim

The way the current channel survey is implemented in mac80211_hwsim
requires for the ACS test cases to be run immediately after the same
radio has been on the expected operating band. This was worked around in
one of the test cases and errors ignored in couple. Extend this
workaround to cover all the test cases.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agotests: Fix ap_vlan_wpa2_radius_id_change exception
Jouni Malinen [Tue, 3 Mar 2015 13:40:19 +0000 (15:40 +0200)] 
tests: Fix ap_vlan_wpa2_radius_id_change exception

This was supposed to be Exception("string") not "string".

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agotests: Fix python typo
Johannes Berg [Tue, 3 Mar 2015 13:19:34 +0000 (14:19 +0100)] 
tests: Fix python typo

Clearly that should spell Exception.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agotests: Allow --shuffle-tests to be used with parallel-vm.py
Jouni Malinen [Tue, 3 Mar 2015 07:47:03 +0000 (09:47 +0200)] 
tests: Allow --shuffle-tests to be used with parallel-vm.py

This can be used to get more random sequence of test case execution
into use when running multiple VMs.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: P2P GO start with only 5 GHz band allowed
Jouni Malinen [Mon, 2 Mar 2015 15:00:20 +0000 (17:00 +0200)] 
tests: P2P GO start with only 5 GHz band allowed

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agoP2P: Consider 5 GHz channels also for auto GO
Krishna Vamsi [Tue, 24 Feb 2015 06:43:33 +0000 (12:13 +0530)] 
P2P: Consider 5 GHz channels also for auto GO

When there is no channel preference mentioned by user, auto GO
can be started on any of the 5 GHz channels supported for P2P.
Consider operating classes 115 and 124 which do not require DFS.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agoP2P: Fix regression in start-GO/AP through a "fake" scan
Jouni Malinen [Mon, 2 Mar 2015 14:45:51 +0000 (16:45 +0200)] 
P2P: Fix regression in start-GO/AP through a "fake" scan

Commit 3f9ebc439c9468bf51219c931a05028aa8a3d3a7 ('P2P: Allow AP/GO
interface to be started while P2P-in-progress') moved the
wpa_s->connect_without_scan and wpa_s->last_scan_req checks to an
earlier place within the wpa_supplicant_scan() function without
adjusting wpa_s->last_scan_req. This variable was set between the old
and new location, so the new location needs to use wpa_s->scan_req.

This fixes an issue where AP/GO operations were not properly started in
some operation sequence. Instead, a station mode scan was executed. This
issue could be triggered, e.g., by running the no_go_freq test case
followed by autogo_random_channel.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agotests: Skip radius_acct_unreachable3 when not running under VM
Jouni Malinen [Mon, 2 Mar 2015 14:30:13 +0000 (16:30 +0200)] 
tests: Skip radius_acct_unreachable3 when not running under VM

It looks like the IP routing table changes used here to trigger
unreachability and following reachability of the server do not work very
well with full IP routing configuration, so run this test case only when
executed under vm-run.sh.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agoeap_proxy: Callback to notify any updates from eap_proxy
Sunil Dutt [Thu, 26 Feb 2015 10:24:37 +0000 (15:54 +0530)] 
eap_proxy: Callback to notify any updates from eap_proxy

This commit introduces a callback to notify any configuration updates
from the eap_proxy layer. This is used to trigger re-reading of IMSI and
MNC length.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agoatheros: Add a new flag for OSEN support
Vivek Natarajan [Mon, 2 Mar 2015 04:59:07 +0000 (10:29 +0530)] 
atheros: Add a new flag for OSEN support

Signed-off-by: Vivek Natarajan <nataraja@qti.qualcomm.com>
9 years agoRemove unnecessary NULL check to make function more consistent
Jouni Malinen [Sun, 1 Mar 2015 20:15:44 +0000 (22:15 +0200)] 
Remove unnecessary NULL check to make function more consistent

Static analyzers may warn about dereference before NULL check in
wpas_network_disabled() due to the new code added to check
wpa_s->p2p_mgmt. wpa_s cannot be NULL here, so remove the unneeded check
for it later in the function. (CID 106124)

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: P2P autonomous GO with large number of GO instances
Jouni Malinen [Sun, 1 Mar 2015 18:54:21 +0000 (20:54 +0200)] 
tests: P2P autonomous GO with large number of GO instances

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agoP2P: Fix interface deinit for failed group interface initialization
Jouni Malinen [Sun, 1 Mar 2015 19:50:34 +0000 (21:50 +0200)] 
P2P: Fix interface deinit for failed group interface initialization

wpa_supplicant_deinit_iface() ends up removing all P2P groups if the
removed interface is the parent interface. This is correct behavior in
general, but this resulted in issues in the new group interface
initialization error path since wpa_s->parent was not assigned before
hitting this check. Fix this by assigning wpa_s->parent as part of
wpa_supplicant_add_iface().

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agoP2P: Allow AP/GO interface to be started while P2P-in-progress
Jouni Malinen [Sun, 1 Mar 2015 18:53:32 +0000 (20:53 +0200)] 
P2P: Allow AP/GO interface to be started while P2P-in-progress

Do not delay the "station mode scan" that is not really a scan, but a
request to start AP/GO mode operation.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: RADIUS server failure cases
Jouni Malinen [Sun, 1 Mar 2015 17:54:17 +0000 (19:54 +0200)] 
tests: RADIUS server failure cases

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: hostapd and get_station in multi-BSS configuration
Jouni Malinen [Sun, 1 Mar 2015 17:15:19 +0000 (19:15 +0200)] 
tests: hostapd and get_station in multi-BSS configuration

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: RADIUS failover and failed attempt to return to primary server
Jouni Malinen [Sun, 1 Mar 2015 16:38:47 +0000 (18:38 +0200)] 
tests: RADIUS failover and failed attempt to return to primary server

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agoRADIUS client: Fix server failover on return-to-primary on error case
Jouni Malinen [Sun, 1 Mar 2015 16:38:00 +0000 (18:38 +0200)] 
RADIUS client: Fix server failover on return-to-primary on error case

If a connection with the primary server cannot be established, restore
connection to the previously used server.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: RADIUS client address specified
Jouni Malinen [Sun, 1 Mar 2015 15:50:17 +0000 (17:50 +0200)] 
tests: RADIUS client address specified

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agoAdd option to force a specific RADIUS client address to be used
Jouni Malinen [Sun, 1 Mar 2015 15:49:22 +0000 (17:49 +0200)] 
Add option to force a specific RADIUS client address to be used

The new hostapd.conf parameter radius_client_addr can now be used to
select a specific local IP address to be used as the RADIUS client
address.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: RADIUS Accounting server unreachable and multiple STAs
Jouni Malinen [Sun, 1 Mar 2015 15:35:06 +0000 (17:35 +0200)] 
tests: RADIUS Accounting server unreachable and multiple STAs

This verifies behavior on reaching RADIUS_CLIENT_MAX_ENTRIES.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: RADIUS Accounting server initially unreachable, but then available
Jouni Malinen [Sun, 1 Mar 2015 15:20:47 +0000 (17:20 +0200)] 
tests: RADIUS Accounting server initially unreachable, but then available

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agoRADIUS client: Fix a copy-paste error in accounting server failover
Jouni Malinen [Sun, 1 Mar 2015 15:19:23 +0000 (17:19 +0200)] 
RADIUS client: Fix a copy-paste error in accounting server failover

Commit 347c55e216f22002246e378097a16ecb24b7c106 ('RADIUS client: Re-try
connection if socket is closed on retransmit') added a new option for
initialing RADIUS server failover from radius_client_retransmit(), but
ended up trying to change authentication servers when accounting server
was supposed to be changed due to a copy-paste issue.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: Not ready for GO Negotiation (listen/search)
Jouni Malinen [Sun, 1 Mar 2015 14:30:51 +0000 (16:30 +0200)] 
tests: Not ready for GO Negotiation (listen/search)

These test cases verify that P2P_FIND and P2P_LISTEN operation continues
after having replied to GO Negotiation Request frame for which we are
not yet ready (i.e., GO Negotiation Response with status=1).

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agoP2P: Continue find in GO-Neg-Resp-fail status corner cases
Jouni Malinen [Sun, 1 Mar 2015 20:35:21 +0000 (22:35 +0200)] 
P2P: Continue find in GO-Neg-Resp-fail status corner cases

It was possible for the GO Negotiation Response (failure) TX status to
be processed at a point where there is no P2P timeout to continue
search. Avoid stopping the ongoing search operation by explicitly
restarting it from this callback.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: Open mode connection and SELECT_NETWORK to change network
Jouni Malinen [Sun, 1 Mar 2015 13:56:11 +0000 (15:56 +0200)] 
tests: Open mode connection and SELECT_NETWORK to change network

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agoDo not add blacklist entries based on normal disconnect request cases
Jouni Malinen [Sun, 1 Mar 2015 13:54:24 +0000 (15:54 +0200)] 
Do not add blacklist entries based on normal disconnect request cases

There are number of cases where wpa_supplicant requests the current
connection to be disconnected before starting a new operation. Such
cases do not really indicate that there was an error in connecting or a
disconnection initiated by the AP, so do not add a temporary blacklist
entry in such sequences.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: cfg80211 P2P Device and P2P_* command on incorrect interface
Jouni Malinen [Sun, 1 Mar 2015 09:57:44 +0000 (11:57 +0200)] 
tests: cfg80211 P2P Device and P2P_* command on incorrect interface

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agoP2P: Direct P2P_CONNECT command to proper interface
Jouni Malinen [Sun, 1 Mar 2015 09:54:39 +0000 (11:54 +0200)] 
P2P: Direct P2P_CONNECT command to proper interface

It is possible for the P2P_CONNECT control interface command to be
issued on an incorrect interface. While the upper layer component should
really use global control interface for this, make this work by
redirecting the command to the correct context if needed.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: cfg80211 P2P Device misuses
Jouni Malinen [Sun, 1 Mar 2015 09:24:41 +0000 (11:24 +0200)] 
tests: cfg80211 P2P Device misuses

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agoP2P: Do not allow scan or normal association on cfg80211 P2P Device
Jouni Malinen [Sun, 1 Mar 2015 09:23:09 +0000 (11:23 +0200)] 
P2P: Do not allow scan or normal association on cfg80211 P2P Device

The dedicated P2P management instance (wpas->p2p_mgmt == 1) using
cfg80211 P2P Device cannot be used for non-P2P uses or connection (there
is no netdev). Reject or ignore such operations to avoid unexpected
operations if enabled network blocks are configured in the
wpa_supplicant instance used to control this interface.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: P2P_FIND with freq parameter to scan a single channel
Jouni Malinen [Sat, 28 Feb 2015 20:06:24 +0000 (22:06 +0200)] 
tests: P2P_FIND with freq parameter to scan a single channel

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agoClean up p2p_find command parsing and execution
Jouni Malinen [Sat, 28 Feb 2015 19:58:38 +0000 (21:58 +0200)] 
Clean up p2p_find command parsing and execution

There is no need to maintain three almost identical copies of the
wpas_p2p_find() call.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agoP2P: Allow a specific channel to be specified in P2P_FIND
Daisuke Niwa [Wed, 5 Nov 2014 11:35:09 +0000 (20:35 +0900)] 
P2P: Allow a specific channel to be specified in P2P_FIND

The optional freq=<MHz> can now be used with the P2P_FIND command to
specify a single channel to scan during the first round of P2P search.
For example, this can be used to replace the full initial scan with a
single channel scan of a known operation channel.

Signed-off-by: Daichi Ueura <daichi.ueura@sonymobile.com>
9 years agoP2P: Restore P2P_SCAN_SPECIFIC
Daichi Ueura [Wed, 5 Nov 2014 11:35:08 +0000 (20:35 +0900)] 
P2P: Restore P2P_SCAN_SPECIFIC

This reverts commit 3df2f4fe99e18f7fb449477a63d13abb3ad4c891 ('P2P:
Remove unused P2P_SCAN_SPECIFIC') with a modification to fit the current
code base.

Signed-off-by: Daichi Ueura <daichi.ueura@sonymobile.com>
9 years agohostapd: Disable VHT caps for STAs when no valid VHT MCS found
Rajkumar Manoharan [Sat, 28 Feb 2015 09:07:31 +0000 (14:37 +0530)] 
hostapd: Disable VHT caps for STAs when no valid VHT MCS found

Disable VHT caps for STAs for which there is not even a single
allowed MCS in any supported number of streams. i.e STA is
advertising 3 (not supported) as VHT MCS rates for all supported
streams.

Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
9 years agoRADIUS client: Fix previous failover change
Jouni Malinen [Sat, 28 Feb 2015 18:52:08 +0000 (20:52 +0200)] 
RADIUS client: Fix previous failover change

Commit 347c55e216f22002246e378097a16ecb24b7c106 ('RADIUS client: Re-try
connection if socket is closed on retransmit') added a possibility of
executing RADIUS server failover change within
radius_client_retransmit() without taking into account that this
operation may end up freeing the pending message that is being
processed. This could result in use of freed memory. Avoid this by
checking whether any pending messages have been removed and if so, do
not try to retransmit the potentially freed message.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: Make grpform_no_wsc_done more robust
Jouni Malinen [Sat, 28 Feb 2015 14:57:03 +0000 (16:57 +0200)] 
tests: Make grpform_no_wsc_done more robust

It was possible for this test case to start a new group formation on
dev[1] while the first round was still going through the process of
processing group termination indication. That could result in the second
round failing unexpectedly.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agoFix merge issue with IBSS VHT support
Janusz Dziedzic [Sat, 28 Feb 2015 14:48:22 +0000 (16:48 +0200)] 
Fix merge issue with IBSS VHT support

Commit 563ee1832bf3256f64d76ecb231c5a986eb98a77 ('IBSS: Add support for
VHT80 configuration') got merged in incorrectly with one i/j swap
missed.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
9 years agoFix minor issue in HT40 max rate determination
Jouni Malinen [Sat, 28 Feb 2015 14:35:07 +0000 (16:35 +0200)] 
Fix minor issue in HT40 max rate determination

Commit a1b790eb9d7514d1a6e0582a07f695a1564caa59 ('Select AP based on
estimated maximum throughput') had a copy-paste bug than ended up
leaving one of the max_ht40_rate() cases unreachable. (CID 106087)

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agoRADIUS client: Re-try connection if socket is closed on retransmit
Jouni Malinen [Sat, 28 Feb 2015 13:43:26 +0000 (15:43 +0200)] 
RADIUS client: Re-try connection if socket is closed on retransmit

Previously, send() was called with invalid fd = -1 in some error cases
for retransmission and this could even result in a loop of multiple such
attempts. This is obviously not going to work, so drop such attempts and
instead, try to reconnect a socket to the server if the current socket
is not valid.

In addition, initiate server failover immediately if the current socket
is not valid instead of waiting for a timeout.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: RADIUS server connect() failing during startup
Jouni Malinen [Sat, 28 Feb 2015 12:00:58 +0000 (14:00 +0200)] 
tests: RADIUS server connect() failing during startup

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agoRADIUS client: Fix server connection recovery after initial failure
Jouni Malinen [Sat, 28 Feb 2015 11:57:57 +0000 (13:57 +0200)] 
RADIUS client: Fix server connection recovery after initial failure

If the initial attempt at opening the socket connection to the RADIUS
server failed due to missing IP connectivity during startup, e.g., with
"connect[radius]: Network is unreachable", hostapd did not try to
reconnect when RADIUS messages were sent. Instead, it only reported "No
authentication server configured" even if the configuration did have a
server entry.

This was broken by commit 9ed40766735a9628cc6c936076b175e6f66534bb
('RADIUS client: Do not try to send message without socket') for the
initial case and the more recent fixes in RADIUS server failover cases
did not cover the initial failure case.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agoAllow RADIUS server address to be replaced
Jouni Malinen [Sat, 28 Feb 2015 11:55:12 +0000 (13:55 +0200)] 
Allow RADIUS server address to be replaced

The new hostapd parameters auth_server_addr_replace and
acct_server_addr_replace can now be used to replace the configured IP
address instead of adding a new RADIUS server. This is mainly useful for
testing purposes where the address can be changed over control interface
during AP operation.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agoTLS: Remove placeholders for SIGN_ALG_DSA support
Jouni Malinen [Sat, 28 Feb 2015 13:32:18 +0000 (15:32 +0200)] 
TLS: Remove placeholders for SIGN_ALG_DSA support

It does not look likely that the old DSA design would be added into the
internal TLS implement, so remove this otherwise dead code.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: Module tests for common.c
Jouni Malinen [Sat, 28 Feb 2015 10:19:13 +0000 (12:19 +0200)] 
tests: Module tests for common.c

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: Increase bitfield module test coverage
Jouni Malinen [Sat, 28 Feb 2015 09:46:29 +0000 (11:46 +0200)] 
tests: Increase bitfield module test coverage

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: Add module tests for base64
Jouni Malinen [Sat, 28 Feb 2015 09:25:48 +0000 (11:25 +0200)] 
tests: Add module tests for base64

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: Increase default VM memory from 128M to 192M
Jouni Malinen [Wed, 25 Feb 2015 17:02:43 +0000 (19:02 +0200)] 
tests: Increase default VM memory from 128M to 192M

It looks like the 128M default memory size for the hwsim test setup was
not large enough to cover all the needs anymore. Some of the test cases
using tshark could hit OOM with that size. Increase the default
allocation to 192M to avoid this type of issues.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agotests: 4-way handshake and the first msg 4/4 getting lost
Jouni Malinen [Mon, 23 Feb 2015 13:36:11 +0000 (15:36 +0200)] 
tests: 4-way handshake and the first msg 4/4 getting lost

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agonl80211: Resubscribe to nl80211 events on global nl_event socket
Jouni Malinen [Sun, 22 Feb 2015 16:03:42 +0000 (18:03 +0200)] 
nl80211: Resubscribe to nl80211 events on global nl_event socket

This allows wpa_supplicant to recover from some of the cases where
cfg80211 is unloaded and reloaded without restarting wpa_supplicant. The
netlink socket used for nl80211 events (global->nl_event) seemed to end
up in otherwise functionality state, but with all the event memberships
lost when cfg80211 gets reloaded.

There does not seem to be any clear way of determining when this has
happened, so it looks simplest to just try to re-subscribe to all the
events whenever an interface is re-enabled or added.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: Linux packet socket workaround and EAPOL RX in operational state
Jouni Malinen [Sun, 22 Feb 2015 14:06:23 +0000 (16:06 +0200)] 
tests: Linux packet socket workaround and EAPOL RX in operational state

This verifies that the packet socket workaround does not get disabled if
EAPOL frames are processed during operation state (i.e., when processing
reauthentication/rekeying on a functional association).

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agoFix Linux packet socket workaround to not close the socket too easily
Jouni Malinen [Sun, 22 Feb 2015 14:00:34 +0000 (16:00 +0200)] 
Fix Linux packet socket workaround to not close the socket too easily

Commit e6dd8196e5daf39e4204ef8ecd26dd50fdca6040 ('Work around Linux
packet socket regression') closed the workaround socket on the first
received EAPOL frame from the main packet socket. This can result in
closing the socket in cases where the kernel does not really work in the
expected way during the following initial association since
reauthentication/rekeying using EAPOL frames happens while operstate is
not dormant and as such, the frames can get delivered through the main
packet socket.

Fix this by closing the workaround socket only in case the first EAPOL
frame is received through the main packet socket. This case happens
while the interface is in dormant state and as such, is more likely to
show the more restricted case of kernel functionality.

In order to avoid processing the received EAPOL frames twice, verify a
checksum of the frame contents when receiving frames alternatively from
the main packet socket and the workaround socket.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: VHT/HT preference in BSS selection
Jouni Malinen [Sun, 22 Feb 2015 09:09:32 +0000 (11:09 +0200)] 
tests: VHT/HT preference in BSS selection

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agoUse estimated throughput to improve roaming selection
Jouni Malinen [Sun, 22 Feb 2015 09:28:27 +0000 (11:28 +0200)] 
Use estimated throughput to improve roaming selection

Previously, within-ESS roaming was skipped if the selected BSS did not
have a higher signal strength than the current BSS regardless of AP
capabilities. This could result in not moving to a BSS that would
provide higher throughput, e.g., due to larger channel bandwidth or
higher rates (HT/VHT MCS).

Use estimated throughput information from scan result processing to
allow within-ESS roaming if the selected BSS is likely to provide better
throughput even if the current BSS has larger RSSI.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agoAdd snr and est_throughput to the BSS entries
Jouni Malinen [Sun, 22 Feb 2015 08:50:55 +0000 (10:50 +0200)] 
Add snr and est_throughput to the BSS entries

These values were previously used only for sorting the scan results, but
it may be useful to provide access to the used values through the BSS
entries.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agoSelect AP based on estimated maximum throughput
Jouni Malinen [Sat, 21 Feb 2015 20:53:42 +0000 (22:53 +0200)] 
Select AP based on estimated maximum throughput

This modifies the BSS selection routines to calculate SNR and estimated
throughput for each scan result and then use the estimated throughput as
a criteria for sorting the results. This extends the earlier design by
taking into account higher throughput rates if both the AP and local
device supports HT20, HT40, or VHT80. In addition, the maximum rate is
restricted based on SNR.

In practice, this gives significantly higher probability of selecting
HT/VHT APs when there are multiple BSSes in the same ESS and SNR is not
low enough to prevent higher MCS use.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agoAdd wpa_supplicant Makefile target libwpa_ctrl.a
Jouni Malinen [Sat, 21 Feb 2015 15:39:08 +0000 (17:39 +0200)] 
Add wpa_supplicant Makefile target libwpa_ctrl.a

"make -C wpa_supplicant libwpa_ctrl.a" can now be used to build a static
library that can be linked with external programs using wpa_ctrl.h. This
makes it easier to create a separate library package that does not
depend in any other hostap.git file other than src/common/wpa_ctrl.h and
the libwpa_ctrl.a built with this new make target.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotrace: Initialize alloc_list even without os_program_init() call
Jouni Malinen [Sat, 21 Feb 2015 15:32:47 +0000 (17:32 +0200)] 
trace: Initialize alloc_list even without os_program_init() call

This makes it somewhat easier to use CONFIG_WPA_TRACE=y build with
external programs that might not be aware of the initialization
requirement, e.g., when linking wpa_ctrl.c with a program that does not
use the os_*() wrappers.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agoAdd helper function to clear and free wpa_psk list
Stefan Tomanek [Mon, 19 Jan 2015 22:57:41 +0000 (23:57 +0100)] 
Add helper function to clear and free wpa_psk list

This change adds the function hostapd_config_clear_wpa_psk() that
deletes an entire wpa_psk structure, making sure to follow the linked
list and to free the allocated memory of each PSK node. This helps to
prevent memory leaks when using PSKs from multiple sources and
reconfiguring the AP during runtime.

Signed-off-by: Stefan Tomanek <stefan.tomanek@wertarbyte.de>
9 years agotests: Rename dmesg files to a unique name
Jouni Malinen [Sat, 21 Feb 2015 14:06:57 +0000 (16:06 +0200)] 
tests: Rename dmesg files to a unique name

This allows multiple dmesg files to be saved if a test case is executed
multiple times similarly to the other logfiles.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agoUpdate current BSS level when signal change event occurs
Matthieu Mauger [Wed, 18 Feb 2015 02:35:15 +0000 (21:35 -0500)] 
Update current BSS level when signal change event occurs

When an EVENT_SIGNAL_CHANGE occurs the bgscan is informed about this
change but the new RSSI value is not stored. In consequence, when
roaming candidates are evaluated, the RSSI value of the current BSS used
to compare is an old one obtained during the last scan rather than the
new one given by the signal change event. This leads sometimes to bad
decision when selecting a new BSS for roaming.

This patch solves the issue by updating the current BSS level when
receiving a signal change event in order to have a very up-to-date
current signal value when choosing an new BSS.

Signed-off-by: Matthieu Mauger <matthieux.mauger@intel.com>
9 years agowpa_supplicant: Cancel sched_scan when stopping countermeasures
Ilan Peer [Wed, 18 Feb 2015 02:35:14 +0000 (21:35 -0500)] 
wpa_supplicant: Cancel sched_scan when stopping countermeasures

When stopping the TKIP countermeasures, it would be preferable to
connect immediately. However if scheduled scan is in progress,
a connection attempt will be done only when scan results are received,
so cancel the scheduled scan to allow immediate scan and connection
attempt.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
9 years agonl80211: Add support for configuring P2P GO CTWindow
Eliad Peller [Wed, 18 Feb 2015 02:35:13 +0000 (21:35 -0500)] 
nl80211: Add support for configuring P2P GO CTWindow

Configure the GO CTWindow on APstart if the driver supports it and this
parameter is set in wpa_supplicant configuration.

Signed-off-by: Eliad Peller <eliadx.peller@intel.com>
9 years agoP2P: Allow configuring CTWindow when working as GO
Eliad Peller [Wed, 18 Feb 2015 02:35:12 +0000 (21:35 -0500)] 
P2P: Allow configuring CTWindow when working as GO

Read p2p_go_ctwindow (0-127 TUs) from the config file, and pass it to
the driver on GO start.

Use p2p_go_ctwindow=0 (no CTWindow) by default.

Signed-off-by: Eliad Peller <eliadx.peller@intel.com>
9 years agoTDLS: Ignore extra padding in all packets
Arik Nemtsov [Wed, 18 Feb 2015 02:35:11 +0000 (21:35 -0500)] 
TDLS: Ignore extra padding in all packets

Some APs (e.g., Cisco 1260) sometimes add padding to the end of short
TDLS management packets and that can look like invalid IEs. This was
allowed on M3 and discovery packets, but not in others. Allow it for the
other packets as well, since required IEs are verified in the code
anyway.

Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
9 years agoInteworking: Add support to update the ANQP Capability List into the BSS
ASHUTOSH NARAYAN [Wed, 18 Feb 2015 02:35:10 +0000 (21:35 -0500)] 
Inteworking: Add support to update the ANQP Capability List into the BSS

In addition, add support for returning the capability list through
the BSS control interface command.

Signed-off-by: ASHUTOSH NARAYAN <ashutoshx.narayan@intel.com>
9 years agoHS 2.0: Add support to update the HS20 Capability List into the BSS
ASHUTOSH NARAYAN [Wed, 18 Feb 2015 02:35:09 +0000 (21:35 -0500)] 
HS 2.0: Add support to update the HS20 Capability List into the BSS

In addition, add support for returning the capability list through the
BSS control interface command.

Signed-off-by: ASHUTOSH NARAYAN <ashutoshx.narayan@intel.com>
9 years agowpa_gui: Debug enhancement
Arkadiusz (Arkq) Bokowy [Sat, 14 Feb 2015 16:32:02 +0000 (17:32 +0100)] 
wpa_gui: Debug enhancement

Instead of calling a dummy printf function use preprocessor to determine
if debugging mode is enabled. Also use native Qt debug function.

Signed-off-by: Arkadiusz Bokowy <arkadiusz.bokowy@gmail.com>
9 years agoAdd forgotten network profile parameters to config file writing
Jouni Malinen [Sat, 21 Feb 2015 10:48:16 +0000 (12:48 +0200)] 
Add forgotten network profile parameters to config file writing

Number of network profile parameters were not written to the
configuration file.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agoIBSS: Add support for VHT80 configuration
Janusz Dziedzic [Thu, 19 Feb 2015 06:15:48 +0000 (07:15 +0100)] 
IBSS: Add support for VHT80 configuration

Configure VHT80 based on driver capabilities.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
9 years agoMake hostapd_set_freq_params() common
Janusz Dziedzic [Thu, 19 Feb 2015 06:15:47 +0000 (07:15 +0100)] 
Make hostapd_set_freq_params() common

Now this function can also be used from wpa_supplicant.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
9 years agoIBSS: Update operating frequency if joining an existing IBSS
Janusz Dziedzic [Thu, 19 Feb 2015 06:15:46 +0000 (07:15 +0100)] 
IBSS: Update operating frequency if joining an existing IBSS

If a matching IBSS is found in scan results, change requested frequency
to match and disable OBSS scan.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
9 years agoIBSS: Add fixed_freq network parameter
Janusz Dziedzic [Thu, 19 Feb 2015 06:15:45 +0000 (07:15 +0100)] 
IBSS: Add fixed_freq network parameter

Add fixed_freq=<0/1> network block parameter and pass it to the driver
when starting or joining an IBSS. If this flag is set, IBSS should not
try to look for other IBSS networks to merge with on different channels.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
9 years agoUse priority list instead of global for PNO
Dmitry Shmidt [Thu, 12 Feb 2015 18:25:15 +0000 (10:25 -0800)] 
Use priority list instead of global for PNO

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
9 years agotests: Add test to check disconnect in powersave
Johannes Berg [Fri, 9 Jan 2015 18:55:45 +0000 (19:55 +0100)] 
tests: Add test to check disconnect in powersave

The kernel had two bugs (one in hwsim and one more important one in
mac80211) in this area, add a test to make sure we can disconnect
without any kernel issues while in powersave.

Also make sure that the TIM bit gets set and cleared again (by checking
with tshark.)

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agoAllow libnl-3.0 include path be specified
Romain Naour [Mon, 29 Dec 2014 20:54:02 +0000 (21:54 +0100)] 
Allow libnl-3.0 include path be specified

The '/usr/include/libnl3' header path is unsafe for cross-compilation.
Use pkg-config to find libnl-3.0 headers by default and alternatively,
allow LIBNL_INC=<path> to be used in .config to override.

Signed-off-by: Romain Naour <romain.naour@openwide.fr>
9 years agoP2PS: Add P2PS interface info
Rajiv Ranjan [Tue, 13 Jan 2015 05:18:17 +0000 (10:48 +0530)] 
P2PS: Add P2PS interface info

This adds documentation on P2PS related interface commands and events.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agotests: Re-association to same BSS to toggle PMF status
Jouni Malinen [Thu, 19 Feb 2015 14:37:12 +0000 (16:37 +0200)] 
tests: Re-association to same BSS to toggle PMF status

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agoAdd optional reassoc-to-same-BSS optimization
Jouni Malinen [Thu, 19 Feb 2015 14:35:39 +0000 (16:35 +0200)] 
Add optional reassoc-to-same-BSS optimization

The new reassoc_same_bss_optim=1 configuration parameter can now be used
to request wpa_supplicant to bypass the unnecessary Authentication frame
exchange when reassociating back to the same BSS with which the device
is already associated. This functionality is disabled by default since
it may cause undesired interoperability issues with some APs.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agoFix passive_scan config parameter writing
Jouni Malinen [Thu, 19 Feb 2015 14:22:47 +0000 (16:22 +0200)] 
Fix passive_scan config parameter writing

Commit c35e35ed8133bb6d7b96765c5f0b1d41efe09fc5 ('Add passive_scan
configuration parameter') used incorrect parameter name when writing the
passive_scan parameter into a configuration file.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agotests: Re-sign expired test certificates
Jouni Malinen [Thu, 19 Feb 2015 12:18:57 +0000 (14:18 +0200)] 
tests: Re-sign expired test certificates

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agohs20-osu-client: Ensure NULL checks are done before dereferencing
Subhani Shaik [Wed, 18 Feb 2015 00:06:35 +0000 (16:06 -0800)] 
hs20-osu-client: Ensure NULL checks are done before dereferencing

In some error cases, pointers were dereferenced before NULL check is
done. Fix this by adding checks before the dereference.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agoFix OCSP debug messages
Jouni Malinen [Thu, 19 Feb 2015 11:33:33 +0000 (13:33 +0200)] 
Fix OCSP debug messages

These were not supposed to include a newline at the end of the message
text since such formatting gets handled by tls_show_errors(). In
addition, change the message about the issuer's issuer to be more
accurate.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agoOpenSSL: Fix OCSP error path
Jouni Malinen [Thu, 19 Feb 2015 11:32:05 +0000 (13:32 +0200)] 
OpenSSL: Fix OCSP error path

If addition of a peer issuer certificate fails, the certs pointer would
be NULL when being passed to sk_X509_push() for peer issuer's issuer.
Fix this by skipping addition of issuer's issue if issuer addition
fails.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agoHTTP: Fix OCSP error path
Subhani Shaik [Tue, 17 Feb 2015 19:29:06 +0000 (11:29 -0800)] 
HTTP: Fix OCSP error path

If addition of a peer issuer certificate fails, the certs pointer would
be NULL when being passed to sk_X509_push() for peer issuer's issuer.
Fix this by skipping addition of issuer's issue if issuer addition
fails.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agoAndroid: Remove commented out non-Android build parameters
Jouni Malinen [Thu, 19 Feb 2015 10:55:19 +0000 (12:55 +0200)] 
Android: Remove commented out non-Android build parameters

These hs20-osu-client parameters were never applicable for Android
builds and were just copied from the non-Android Makefile as a reminder,
but not removed once rest of the Android build was fixed.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agoAndroid: Remove libxml2 config defines
Jouni Malinen [Thu, 19 Feb 2015 10:53:03 +0000 (12:53 +0200)] 
Android: Remove libxml2 config defines

These need to be done in the libxml2 build, not in hs20-osu-client. This
workaround was previously used to allow parts of the build to go
through, but that was not a complete fix and resulted in warnings now
that external/libxml2 in Android 5.0 is defining the same parameters.
Remove these from hs20-osu-client Android.mk to avoid that warning.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agoAndroid: Silence unused function parameter warnings
Jouni Malinen [Thu, 19 Feb 2015 10:48:51 +0000 (12:48 +0200)] 
Android: Silence unused function parameter warnings

Numbers of hs20-osu-client functions do not use all of the parameters
currently. This makes the compiler output difficult to read due to
undesired warning messages. Get rid of those specific warnings for now.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agoAndroid: Fix hs20-osu-client build on Android 5.0
Jouni Malinen [Thu, 19 Feb 2015 10:48:00 +0000 (12:48 +0200)] 
Android: Fix hs20-osu-client build on Android 5.0

The LOCAL_EXPORT_C_INCLUDE_DIRS from ICU did not seem to fully resolve
the build (e.g., "mm -B" failed to build, but following that with "mm"
allowed the build to complete). For now, add the include directory
manually here for Android 5.0.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agoHS 2.0R2: Fix permissions for SP/<fqdn> directory on Android
Neelansh Mittal [Mon, 16 Feb 2015 14:29:46 +0000 (19:59 +0530)] 
HS 2.0R2: Fix permissions for SP/<fqdn> directory on Android

As part of OSU, the AAA TrustRoot cert is downloaded into SP/<fqdn>
directory. On Android, wpa_supplicant runs with Wifi uid privileges, and
hence might not have read access to the AAA TrustRoot present SP/<fqdn>
directory. Hence, make AID_WIFI as the group owner of SP/<fqdn>
directory and allow the members of AID_WIFI group to read files present
in this directory.

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