mech_eap.git
11 years agoWPS: Remove duplicate networks after WPS
Vinayak Kamath [Tue, 30 Apr 2013 10:35:50 +0000 (13:35 +0300)]
WPS: Remove duplicate networks after WPS

Each attempt to connect to the same network using WPS would result
in the duplicate configuration getting added. Avoid such redundant
additions by comparing the network configuration with an already
existing one and remove the older network if the new credential
provisioned through WPS is identical.

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

11 years agowpa_supplicant: Default to nl80211 instead of wext
Jouni Malinen [Mon, 29 Apr 2013 13:55:44 +0000 (16:55 +0300)]
wpa_supplicant: Default to nl80211 instead of wext

nl80211 has obsoleted WEXT as the preferred kernel interface for
controlling wireless drivers. Update wpa_supplicant driver interface
list order so that nl80211 gets used first if both nl80211 and wext
interfaces are included in the build. In addition, update README to
reflect the fact that WEXT is obsolete.

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

11 years agohostapd: Add more messages for error paths
Jouni Malinen [Mon, 29 Apr 2013 10:52:34 +0000 (13:52 +0300)]
hostapd: Add more messages for error paths

Make hostapd more verbose if something goes wrong in interface
initialization.

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

11 years agohostapd: Reject configuration file without interface parameter
Jouni Malinen [Mon, 29 Apr 2013 10:50:02 +0000 (13:50 +0300)]
hostapd: Reject configuration file without interface parameter

Previously, this was initialized partially, but the interface was
not really started. That could result in eloop_run() returning
immediately and hostapd process getting stopped without any clear
indication of a failure. [Bug 479]

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

11 years agoClear extra_blacklist_count on FLUSH command
Jouni Malinen [Sun, 28 Apr 2013 19:35:15 +0000 (22:35 +0300)]
Clear extra_blacklist_count on FLUSH command

This is needed to avoid old blacklist failure counts from being valid
after state flush.

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

11 years agotests: Test WPS ER UPnP functionality to add Enrollees
Jouni Malinen [Sun, 28 Apr 2013 19:00:58 +0000 (22:00 +0300)]
tests: Test WPS ER UPnP functionality to add Enrollees

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

11 years agoWPS ER: Allow UPnP interface to be forced
Jouni Malinen [Sun, 28 Apr 2013 18:56:24 +0000 (21:56 +0300)]
WPS ER: Allow UPnP interface to be forced

"WPS_ER_START ifname=<interace>" can now be used to force a specific
interface to be used for UPnP operations. This is especially useful for
automated test cases where the lo interface can now be used easily to
perform ER operations.

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

11 years agoUse status code 17 (unable to handle new STA) on max-STA limitation
Ben Greear [Sun, 28 Apr 2013 13:45:55 +0000 (16:45 +0300)]
Use status code 17 (unable to handle new STA) on max-STA limitation

This is more useful information than the previously used value 1
(unspecified failure).

Signed-hostap: Ben Greear <greearb@candelatech.com>

11 years agoAdd dup_binstr() to help common binary string tasks
Jouni Malinen [Sat, 27 Apr 2013 20:44:59 +0000 (23:44 +0300)]
Add dup_binstr() to help common binary string tasks

There are quite a few places in the current implementation where a nul
terminated string is generated from binary data. Add a helper function
to simplify the code a bit.

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

11 years agoUse os_zalloc() instead of os_malloc() + os_memset()
Jouni Malinen [Sat, 27 Apr 2013 20:05:52 +0000 (23:05 +0300)]
Use os_zalloc() instead of os_malloc() + os_memset()

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

11 years agoFT RRB: Validate os_malloc() return value before using it
Jouni Malinen [Sat, 27 Apr 2013 20:05:15 +0000 (23:05 +0300)]
FT RRB: Validate os_malloc() return value before using it

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

11 years agoMake vlan_file optional if dynamic_vlan is used
Michael Braun [Sat, 27 Apr 2013 19:53:34 +0000 (22:53 +0300)]
Make vlan_file optional if dynamic_vlan is used

My APs generate their configuration on their own using a different
number of (vlan-enabled) bss. Currently, all my vlan_file files consist
of a single line: the wildcard line. Configuration file generation would
be easier, if the hostapd configuration file would not depend on those
simple vlan_file files.

This patch removes the need for those one-line files by using the
<device>.<vlan> naming scheme if no vlan_file is given (or that file is
empty). This should not break any existing setup, as using dynamic_vlan
with no vlan configured does not make sense anyway.

Signed-hostap: Michael Braun <michael-dev@fami-braun.de>

11 years agoAdd bitfield routines
Jouni Malinen [Sat, 16 Mar 2013 16:12:39 +0000 (18:12 +0200)]
Add bitfield routines

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

11 years agoNFC: Add no waiting and no multiple operations options for scripts
Jouni Malinen [Thu, 11 Apr 2013 15:18:39 +0000 (08:18 -0700)]
NFC: Add no waiting and no multiple operations options for scripts

The nfcpy script used to be run in a way that left them running for
multiple operations. This is not desired for some use cases, so provide
options to request only a single operation to be performed.

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

11 years agotests: Add a test case for AP auto configuration on config token build
Jouni Malinen [Thu, 4 Apr 2013 14:50:25 +0000 (17:50 +0300)]
tests: Add a test case for AP auto configuration on config token build

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

11 years agoWPS: Fix AP auto configuration on config token generation
Jouni Malinen [Thu, 4 Apr 2013 14:49:53 +0000 (17:49 +0300)]
WPS: Fix AP auto configuration on config token generation

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

11 years agoNFC: Increase wpa_cli command buffer size
Jouni Malinen [Fri, 15 Feb 2013 15:07:28 +0000 (17:07 +0200)]
NFC: Increase wpa_cli command buffer size

NFC connection handover messages may be longer than 100 octets, so
increase wpa_cli buffer size to allow longer messages to be reported.

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

11 years agoWPS NFC: Allow Device Password ID override for selected registrar
Jouni Malinen [Tue, 2 Apr 2013 15:27:36 +0000 (18:27 +0300)]
WPS NFC: Allow Device Password ID override for selected registrar

When a specific out-of-band Device Password is enabled, it can be useful
to be able to advertise that in the selected registrar information.

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

11 years agoWPS: Use generic MAC Address attribute builder
Jouni Malinen [Sat, 27 Apr 2013 19:13:36 +0000 (22:13 +0300)]
WPS: Use generic MAC Address attribute builder

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

11 years agotests: Use ignore_old_scan_res with some more WPS tests
Jouni Malinen [Tue, 2 Apr 2013 15:19:32 +0000 (18:19 +0300)]
tests: Use ignore_old_scan_res with some more WPS tests

The scan results from old test cases showing different SSID on the AP
can result in false failures, so avoid those by ignoring old scan
results from cfg80211.

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

11 years agoP2P: Clean up channel--frequency conversion functions
Jouni Malinen [Sat, 27 Apr 2013 18:03:16 +0000 (21:03 +0300)]
P2P: Clean up channel--frequency conversion functions

All P2P use cases are required to use the global operating table and
there is no need to need to try to maintain some backwards compatibility
with country code -specific values. Clean up the implementation by
removing the unnecessary country parameter.

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

11 years agoUse a common frequency to channel conversion function
Jouni Malinen [Sat, 27 Apr 2013 18:27:15 +0000 (21:27 +0300)]
Use a common frequency to channel conversion function

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

11 years agoFT: Reset FT flag upon STA deauthentication
Deepthi Gowri [Fri, 26 Apr 2013 14:56:24 +0000 (17:56 +0300)]
FT: Reset FT flag upon STA deauthentication

Reset ft_completed if STA receives deauthentication
between FT reassoc success and the subsequent initial
mobility authentication and association.

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

11 years agotests: Generate a tarball of test results if a test fails
Jouni Malinen [Fri, 26 Apr 2013 10:48:48 +0000 (13:48 +0300)]
tests: Generate a tarball of test results if a test fails

This makes it easier to collect failure data from test servers for
further analysis.

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

11 years agoP2P: Set P2P_DEV_PEER_WAITING_RESPONSE from TX status callback
Jouni Malinen [Fri, 26 Apr 2013 09:54:27 +0000 (12:54 +0300)]
P2P: Set P2P_DEV_PEER_WAITING_RESPONSE from TX status callback

Commit fb8984fd6f4b49d9178dd87a880dd7add514b7d1 added a mechanism to
skip the Listen state when the peer is expected to be waiting for us to
initiate a new GO Negotiation. However, this flag was set when building
the GO Negotiation Response frame with status 1 regardless of whether we
managed to send that frame or peer receive it. This could result in GO
Negotiation failures in cases where the peer did not receive the
response and Listen channels of the devices were different. Fix this by
setting the flag only after TX status indicating success has been
received.

This fixes frequent failures shown for the test_grpform_pbc hwsim test
case.

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

11 years agotests: Capture hwsim0 packet dump during test run
Jouni Malinen [Fri, 26 Apr 2013 09:36:56 +0000 (12:36 +0300)]
tests: Capture hwsim0 packet dump during test run

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

11 years agoEAP peer: Add check before calling getSessionId method
Shijie Zhang [Fri, 26 Apr 2013 09:30:01 +0000 (12:30 +0300)]
EAP peer: Add check before calling getSessionId method

We should not call getSessionID method if it's not provided. This fixes
a regression from commit 950c5630768285e460aa336c78a18162fb3e0434 where
EAP methods that did not implement getSessionId resulted in NULL pointer
dereference when deriving the key.

Signed-off-by: Shijie Zhang <shijiez@qca.qualcomm.com>
11 years agoDisable network temporarily on repeated connection failures
Jouni Malinen [Thu, 25 Apr 2013 14:28:50 +0000 (17:28 +0300)]
Disable network temporarily on repeated connection failures

Previously, only explicit indications of authentication failures were
used to disable a network block temporarily. Extend this to use multiple
failed connection attempts as a sign of a possible authentication or
authorization failure to reduce the frequency of connection attempts
with a network that does not seem to allow connection.

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

11 years agonl80211: Drop frame events that are for foreign address
Jouni Malinen [Tue, 23 Apr 2013 22:02:01 +0000 (01:02 +0300)]
nl80211: Drop frame events that are for foreign address

This avoids duplicate processing of events when multiple BSSes are
configured.

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

11 years agonl80211: Reduce debug on Probe Request frames
Jouni Malinen [Tue, 23 Apr 2013 22:01:21 +0000 (01:01 +0300)]
nl80211: Reduce debug on Probe Request frames

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

11 years agoP2P: Fix after_scan_tx processing during ongoing operations
Jouni Malinen [Tue, 23 Apr 2013 18:12:04 +0000 (21:12 +0300)]
P2P: Fix after_scan_tx processing during ongoing operations

When Action frame TX is postponed until a pending p2p_scan completes,
there may be additional operations that need to be continued after the
postponed Action frame TX operation completes. Fix this by starting
pending operation (if any) from TX status event for after_scan_tx
frames.

This fixes common errors seen with the test_discovery hwsim test case.

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

11 years agoRSN: Update preauth scan results only based on new scan results
Jouni Malinen [Tue, 23 Apr 2013 15:24:00 +0000 (18:24 +0300)]
RSN: Update preauth scan results only based on new scan results

The fast-connect optimization to skip a new scan did not update how the
RSN preauthentication callback is used. There is no point in trying to
add preauthentication candidates from cases where scan was skipped, so
skip this call, too, in such cases.

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

11 years agoMove wpa_s freeing into wpa_supplicant_deinit_iface()
Jouni Malinen [Tue, 23 Apr 2013 15:07:41 +0000 (18:07 +0300)]
Move wpa_s freeing into wpa_supplicant_deinit_iface()

All wpa_supplicant_deinit_iface() callers ended up freeing wpa_s
immediately after this call. Move os_free(wpa_s) into the deinit
function to share the same call and make the deinit sequence clearer.

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

11 years agodbus_new: Add EAP logon/logoff
Paul Stewart [Tue, 23 Apr 2013 14:57:55 +0000 (17:57 +0300)]
dbus_new: Add EAP logon/logoff

Add "EAPLogoff" and "EAPLogon" interface DBus commands which
parallel the "logoff" and "logon" wpa_ctrl commands which terminate
and restart EAP authentication.  Slightly enhance the "logon" case
by expiring any running "startWhile" timer.

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

11 years agohostapd: Add some testing options
Johannes Berg [Tue, 23 Apr 2013 14:51:28 +0000 (17:51 +0300)]
hostapd: Add some testing options

In order to test clients in scenarios where APs may (randomly)
drop certain management frames, introduce some testing options
into the hostapd configuration that can make it ignore certain
frames. For now, these are probe requests, authentication and
(re)association frames.

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

11 years agowpa_supplicant: Add option -I for additional config file
Dmitry Shmidt [Tue, 23 Apr 2013 14:38:57 +0000 (17:38 +0300)]
wpa_supplicant: Add option -I for additional config file

This option can be used only for global parameters that are not going
to be changed from settings.

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
Signed-off-by: Iliyan Malchev <malchev@google.com>
11 years agonl80211: Fix nla_nest_start conversion
Johannes Berg [Tue, 23 Apr 2013 14:19:20 +0000 (17:19 +0300)]
nl80211: Fix nla_nest_start conversion

Dmitry reported that the kernel could no longer parse the
scheduled scan attributes correctly after my patch to use
nla_nest_start/nla_nest_end. The reason is that the wrong
attribute is closed I accidentally made it close the full
scan config instead of just the SSID match set.

Reported-by: Dmitry Shmidt <dimitrysh@google.com>
Signed-hostap: Johannes Berg <johannes.berg@intel.com>

11 years agowpa_supplicant: Add get_capability freq
Bruno Randolf [Tue, 23 Apr 2013 13:55:54 +0000 (16:55 +0300)]
wpa_supplicant: Add get_capability freq

Add "get_capability freq" command to print a more verbose list of
channels and frequencies in MHz. The tag "NO_IBSS" is added, if IBSS
mode is not allowed on a channel. This allows userspace programs to get
the frequencies and limitations associated with each channel.

This extends the information already provided in "get_capability
channels" but a new interface is chosen because of backwards
compatibility considerations.

Signed-hostap: Bruno Randolf <br1@einfach.org>

11 years agoProvide TLS alerts to CLI/UI over control interface
Chris Hessing [Tue, 23 Apr 2013 13:46:02 +0000 (16:46 +0300)]
Provide TLS alerts to CLI/UI over control interface

Harmonize EAP status events over control interface to provide same
functionality as existing D-Bus callback.

Signed-hostap: Chris Hessing <chris.hessing@cloudpath.net>

11 years agoP2P: Increase GTK rekeying period to 24 hours
Jouni Malinen [Tue, 23 Apr 2013 11:11:10 +0000 (14:11 +0300)]
P2P: Increase GTK rekeying period to 24 hours

Strong ciphers do not need frequent rekeying, so increase the default
GTK rekeying period to 24 hours.

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

11 years agowlantest: Fix CCMP-256 cipher
Jouni Malinen [Fri, 5 Apr 2013 19:18:25 +0000 (22:18 +0300)]
wlantest: Fix CCMP-256 cipher

TK was incorrectly truncated in a way that resulted in CCMP (128-bit
key) encryption being used in practice.

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

11 years agoTDLS: Fix key configuration with current mac80211
Jouni Malinen [Wed, 3 Apr 2013 15:39:10 +0000 (18:39 +0300)]
TDLS: Fix key configuration with current mac80211

A kernel commit ("mac80211: fix FT roaming") started validating that the
STA entry is marked associated when adding a key. While this is needed
to fix some FT use cases with hardware crypto, it has a side effect of
breaking TDLS key configuration. Work around this by trying to
re-configure the key for the direct link after the STA entry has been
set with all information. In addition, try to tear down the link if
anything goes wrong in key configuration (if both attempts fail) or
enabling the link in the driver.

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

11 years agoWPS NFC: Allow configuration token to be built from network block
Jouni Malinen [Mon, 1 Apr 2013 18:28:57 +0000 (21:28 +0300)]
WPS NFC: Allow configuration token to be built from network block

"WPS_NFC_CONFIG_TOKEN <WPS/NDEF> <network id>" can now be used to build
an NFC configuration token from a locally configured network.

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

11 years agoWPS ER: Allow Enrollee to be specified with MAC address
Jouni Malinen [Mon, 1 Apr 2013 17:52:44 +0000 (20:52 +0300)]
WPS ER: Allow Enrollee to be specified with MAC address

wps_er_pbc and wps_er_pin can now be used with both the UUID and MAC
Address of the Enrollee.

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

11 years agoWPS ER: Document additional NFC command for ER operations
Jouni Malinen [Mon, 1 Apr 2013 17:36:15 +0000 (20:36 +0300)]
WPS ER: Document additional NFC command for ER operations

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

11 years agoWPS ER: Allow AP to be specified with BSSID
Jouni Malinen [Mon, 1 Apr 2013 17:32:09 +0000 (20:32 +0300)]
WPS ER: Allow AP to be specified with BSSID

This extends the WPS ER commands that previously accepted only UUID as
an identifier for an AP to use either UUID or BSSID for this.

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

11 years agotests: Add test cases for NFC+WPS
Jouni Malinen [Mon, 1 Apr 2013 14:48:22 +0000 (17:48 +0300)]
tests: Add test cases for NFC+WPS

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

11 years agoWPS: Fix use of pre-configured DH keys with multiple operations
Jouni Malinen [Mon, 1 Apr 2013 16:30:34 +0000 (19:30 +0300)]
WPS: Fix use of pre-configured DH keys with multiple operations

wps_build_public_key() takes the dh_ctx into use and another attempt to
use the same DH keys fails with wps->dh_ctx being set to NULL. Avoid
this by using the DH parameters only if dh_ctx is valid. This fixes
cases where a use of local pre-configured DH keys followed by an
operating using peer DH keys would faild due to unexpected attempt to
use local keys again.

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

11 years agoWPS: Be more careful with pre-configured DH parameters
Jouni Malinen [Mon, 1 Apr 2013 16:27:32 +0000 (19:27 +0300)]
WPS: Be more careful with pre-configured DH parameters

Make the implementation more robust against error cases with
pre-configured DH parameters.

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

11 years agohostapd: Show more helpful message for -g and -G errors
Jouni Malinen [Mon, 1 Apr 2013 15:17:24 +0000 (18:17 +0300)]
hostapd: Show more helpful message for -g and -G errors

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

11 years agoInterworking: Try to use same BSS entry for storing GAS results
Jouni Malinen [Mon, 1 Apr 2013 08:44:04 +0000 (11:44 +0300)]
Interworking: Try to use same BSS entry for storing GAS results

There may be cases where multiple BSS entries for a single BSSID are in
the table. This is mostly in automated test cases due to the AP
configuration changes, but something similar could potentially happen as
a corner case in more realistic networks, too, e.g., when an AP changes
its operating channel. Make network selection more robust by trying to
find the exact BSS entry instead of any BSS entry with a matching BSSID
when storing GAS/ANQP response.

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

11 years agotests: Use Wlantest class in test_autogo_tdls
Jouni Malinen [Mon, 1 Apr 2013 07:37:44 +0000 (10:37 +0300)]
tests: Use Wlantest class in test_autogo_tdls

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

11 years agotests: Add a test case for Hotspot 2.0 network selection
Jouni Malinen [Sun, 31 Mar 2013 22:01:24 +0000 (01:01 +0300)]
tests: Add a test case for Hotspot 2.0 network selection

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

11 years agotests: Stop wpa_supplicant before hostapd
Jouni Malinen [Sun, 31 Mar 2013 21:59:50 +0000 (00:59 +0300)]
tests: Stop wpa_supplicant before hostapd

Stopping the AP first was not ideal for the test cases since it could
result in wpa_supplicant trying to connect back and start a scan at the
end of a test case and cause problems for the following test case that
tried to scan in the beginning while the previously started scan was
still in progress.

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

11 years agoOptimize Extended Capabilities element to be of minimal length
Jouni Malinen [Sun, 31 Mar 2013 18:58:17 +0000 (21:58 +0300)]
Optimize Extended Capabilities element to be of minimal length

Leave out zero octets from the end of the element.

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

11 years agohostapd/wpa_s: Use driver's extended capabilities
Johannes Berg [Sun, 31 Mar 2013 18:51:44 +0000 (21:51 +0300)]
hostapd/wpa_s: Use driver's extended capabilities

Some extended capabilities (I'm currently interested in "Operating Mode
Notification" for VHT) are implemented by the kernel driver and exported
in nl80211. Use these in hostapd/wpa_supplicant.

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

11 years agotests: Use FLUSH command to clear wpa_supplicant state
Jouni Malinen [Sun, 31 Mar 2013 17:32:33 +0000 (20:32 +0300)]
tests: Use FLUSH command to clear wpa_supplicant state

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

11 years agoAdd ctrl_iface command FLUSH for clearing wpa_supplicant state
Jouni Malinen [Sun, 31 Mar 2013 17:31:07 +0000 (20:31 +0300)]
Add ctrl_iface command FLUSH for clearing wpa_supplicant state

This is mainly for testing purposes where it is convenient to have an
easy way of getting wpa_supplicant state cleared between test cases.

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

11 years agoWPS: Skip rescanning after provisioning if AP was configured
Masashi Honma [Sun, 31 Mar 2013 17:06:42 +0000 (20:06 +0300)]
WPS: Skip rescanning after provisioning if AP was configured

If WPS provisioning step is completed with an AP that is in WPS
configured state, we can skip a second scan after the provisioning step
since the AP is unlikely to change its configuration in such a case.
This can speed up WPS connection a bit by removing an unneeded scan.

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

11 years agotests: Ignore old scan results in couple more WPS test cases
Jouni Malinen [Sun, 31 Mar 2013 17:01:57 +0000 (20:01 +0300)]
tests: Ignore old scan results in couple more WPS test cases

These have shown failures due to obsolete scan results from previous
test cases being present.

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

11 years agotests: Use a more compact summary of test results
Jouni Malinen [Sun, 31 Mar 2013 15:10:17 +0000 (18:10 +0300)]
tests: Use a more compact summary of test results

Do not print the potentially long list of passed test cases. In case of
failure(s), make sure the failed test list is the last item in the
report.

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

11 years agotests: Fix BSS table flushing and old result ignoring for WPS tests
Jouni Malinen [Sun, 31 Mar 2013 14:55:16 +0000 (17:55 +0300)]
tests: Fix BSS table flushing and old result ignoring for WPS tests

The WPS tests are more prone to fail if scan results from the previous
test cases are allowed to remain in the wpa_supplicant BSS table during
the consecutive test since the test setup uses the same BSSID for the
test APs that change their configuration. Avoid these mostly bogus
issues by enforcing wpa_supplicant to drop and ignore old scan results
during the WPS test cases.

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

11 years agoAdd ignore_old_scan_res configuration parameter
Jouni Malinen [Sun, 31 Mar 2013 14:52:23 +0000 (17:52 +0300)]
Add ignore_old_scan_res configuration parameter

This can be used to configure wpa_supplicant to ignore old scan results
from the driver cache in cases where such results were not updated after
the scan trigger from wpa_supplicant. This can be useful in some cases
where the driver may cache information for a significant time and the AP
configuration is changing. Many such cases are for testing scripts, but
this could potentially be useful for some WPS use cases, too.

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

11 years agoWPS: Clear after_wps on new WPS connection
Jouni Malinen [Sun, 31 Mar 2013 14:17:08 +0000 (17:17 +0300)]
WPS: Clear after_wps on new WPS connection

The after_wps counter could have potentially be left in its old non-zero
value in some WPS sequences which could result in a single-channel scan
being used based on obsolete information. Clear after_wps in
wpas_wps_reassoc() to make sure this does not happen.

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

11 years agoWPS: Use latest updated BSS entry if multiple BSSID matches found
Jouni Malinen [Sun, 31 Mar 2013 14:15:39 +0000 (17:15 +0300)]
WPS: Use latest updated BSS entry if multiple BSSID matches found

If the AP (P2P GO) has changes its channel of SSID recently, the BSS
table may have multiple entries for a BSSID. Select the one which was
most recently updated for WPS/P2P operations in such case to increase
the likelihood of using current information.

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

11 years agotests: Remove obsolete test script
Jouni Malinen [Sun, 31 Mar 2013 13:30:51 +0000 (16:30 +0300)]
tests: Remove obsolete test script

The generic test cases and run-tests.py have removed need of this
separate test script.

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

11 years agotests: Add command line argument -f for specifying a test file
Jouni Malinen [Sun, 31 Mar 2013 13:29:16 +0000 (16:29 +0300)]
tests: Add command line argument -f for specifying a test file

This can be used to run all test cases from a single test file.

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

11 years agotests: Use a single set of scripts for running both P2P and AP tests
Jouni Malinen [Sun, 31 Mar 2013 13:22:28 +0000 (16:22 +0300)]
tests: Use a single set of scripts for running both P2P and AP tests

This removes the unnecessary separation of P2P (no hostapd) and AP
tests. The same scripts can be used to prepare for these tests and to
execute the tests.

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

11 years agotests: Make hostapd test setup more similar to the P2P tests
Jouni Malinen [Sun, 31 Mar 2013 13:19:12 +0000 (16:19 +0300)]
tests: Make hostapd test setup more similar to the P2P tests

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

11 years agotests: Pass AP devices to test cases
Jouni Malinen [Sun, 31 Mar 2013 13:16:37 +0000 (16:16 +0300)]
tests: Pass AP devices to test cases

This removes hardcoded assumptions about AP interfaces from test_*.py.

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

11 years agotests: Add test cases for WPS operations
Jouni Malinen [Sun, 31 Mar 2013 09:33:49 +0000 (12:33 +0300)]
tests: Add test cases for WPS operations

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

11 years agoWPS: Add more helpful debug for invalid WPS_REG command parsing
Jouni Malinen [Sun, 31 Mar 2013 09:20:35 +0000 (12:20 +0300)]
WPS: Add more helpful debug for invalid WPS_REG command parsing

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

11 years agoWPS: Allow hostapd process to control independent WPS interfaces
Jouni Malinen [Sun, 31 Mar 2013 08:48:52 +0000 (11:48 +0300)]
WPS: Allow hostapd process to control independent WPS interfaces

The new wps_independent=1 configuration parameter can be used to remove
interfaces from the shared hostapd process WPS control (i.e., to apply
WPS operations only to a subset of interfaces instead of all).

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

11 years agoWPS AP: Add support for reconfiguration with in-memory config
Jouni Malinen [Sun, 31 Mar 2013 08:26:29 +0000 (11:26 +0300)]
WPS AP: Add support for reconfiguration with in-memory config

This allows WPS to update AP configuration in the case no hostapd
configuration file is used (i.e., dynamic configuration through the
control interface).

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

11 years agonl80211: Use nla_nest_start/end instead of nla_put_nested
Johannes Berg [Sat, 30 Mar 2013 18:37:44 +0000 (20:37 +0200)]
nl80211: Use nla_nest_start/end instead of nla_put_nested

Instead of allocating a new message and then moving that into
the message being built, use nla_nest_start() and put the data
into the message directly.

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

11 years agotests: Fix test_discovery to force full device discovery
Jouni Malinen [Sat, 30 Mar 2013 18:31:22 +0000 (20:31 +0200)]
tests: Fix test_discovery to force full device discovery

P2P_PROV_DISC fails if the peer is not fully discovered and the previous
version of the test cases did not force this (i.e., it could have
started PD just based on having seen a Probe Request frame from the
peer).

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

11 years agoP2P: Add a test case for discovering a P2P client in a group
Jouni Malinen [Sat, 30 Mar 2013 18:16:30 +0000 (20:16 +0200)]
P2P: Add a test case for discovering a P2P client in a group

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

11 years agoP2P: Omit P2P Group Info in case of no connected peers
Chaitanya TK [Sat, 30 Mar 2013 18:08:42 +0000 (20:08 +0200)]
P2P: Omit P2P Group Info in case of no connected peers

As per P2P specification v1.2: "The P2P Group Info attribute shall be
omitted if there are zero connected P2P Clients."

Do not add the attribute if there are not connected peers.

Signed-hostap: Chaitanya T K <chaitanya.mgit@gmail.com>

11 years agoAP: Fix infinite loop in WPA state machine when out of random bytes
Michael Braun [Sat, 30 Mar 2013 17:53:22 +0000 (19:53 +0200)]
AP: Fix infinite loop in WPA state machine when out of random bytes

When the OS is out of random bytes in SM_STATE(WPA_PTK, AUTHENTICATION2)
in ap/wpa_auth.c, hostapd sends the sm to state DISCONNECT without
clearing ReAuthenticationRequest, resulting in an infinite loop.
Clearing sm->ReAuthenticationRequest using gdb fixes the running hostapd
instance for me. Also sm->Disconnect = TRUE should be used instead of
wpa_sta_disconnect() to make sure that the incomplete ANonce does not
get used.

Fix this issue by resetting sm->ReAuthenticationRequest even if the STA
gets disconnected and use sm->Disconnect instead of
wpa_sta_disconnect().

Signed-hostap: Michael Braun <michael-dev@fami-braun.de>

11 years agoFix OLBC non-HT AP detection to check channel
Jouni Malinen [Sat, 30 Mar 2013 16:05:18 +0000 (18:05 +0200)]
Fix OLBC non-HT AP detection to check channel

A non-HT capable AP on any channel could have triggered us to enable
protection regardless of own operating channel if the driver delivered
Beacon frames from other channels. The channel detection in ap_list is
not exactly ideal, but most cases can be handled by checking ap->channel
against the currently configured channel (or secondary channel in case
of HT40).

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

11 years agoap_list: Remove unused functions
Jouni Malinen [Sat, 30 Mar 2013 15:06:50 +0000 (17:06 +0200)]
ap_list: Remove unused functions

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

11 years agoap_list: Remove unused iteration list pointers
Jouni Malinen [Sat, 30 Mar 2013 15:02:06 +0000 (17:02 +0200)]
ap_list: Remove unused iteration list pointers

This iter_next/iter_prev pointers were not really used for anything, so
get rid of the unnecessary complexity in the AP list maintenance.

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

11 years agoap_list: Remove unused fields
Jouni Malinen [Sat, 30 Mar 2013 14:58:58 +0000 (16:58 +0200)]
ap_list: Remove unused fields

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

11 years agoP2P: Fix provision discovery response handling in some cases
Jouni Malinen [Sat, 30 Mar 2013 14:10:43 +0000 (16:10 +0200)]
P2P: Fix provision discovery response handling in some cases

Commit 6b56cc2d97fe9efd1feea8d418714b4658b056f1 added a possible call to
p2p_reset_pending_pd() prior to checking config_methods match between
our request and peer response. That reset call could clear
dev->req_config_methods and as such, result in unexpected
P2P-PROV-DISC-FAILURE report here even in cases where the peer accepts
the provision discovery. Fix this by using a local copy of the
req_config_methods variable.

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

11 years agotests: Make test_discovery report PD failures with more detail
Jouni Malinen [Sat, 30 Mar 2013 14:10:04 +0000 (16:10 +0200)]
tests: Make test_discovery report PD failures with more detail

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

11 years agotests: Add SA Query test with PMF
Jouni Malinen [Sat, 30 Mar 2013 13:31:50 +0000 (15:31 +0200)]
tests: Add SA Query test with PMF

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

11 years agotests: Add test cases for PMF
Jouni Malinen [Sat, 30 Mar 2013 11:47:22 +0000 (13:47 +0200)]
tests: Add test cases for PMF

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

11 years agoExtend ROAM command to handle multiple SSIDs per BSS
Jouni Malinen [Sat, 30 Mar 2013 09:49:05 +0000 (11:49 +0200)]
Extend ROAM command to handle multiple SSIDs per BSS

Select the BSS entry based on BSSID,SSID pairs instead of just BSSID to
avoid selecting an unexpected SSID for the ROAM command.

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

11 years agotests: Add roaming test cases
Jouni Malinen [Sat, 30 Mar 2013 09:28:39 +0000 (11:28 +0200)]
tests: Add roaming test cases

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

11 years agotests: Set umask to avoid unexpected issues with hostapd sockets
Jouni Malinen [Sat, 30 Mar 2013 09:11:55 +0000 (11:11 +0200)]
tests: Set umask to avoid unexpected issues with hostapd sockets

buildbot seems to be running with more limited umask by default and that
prevented the hostapd per-interface socket from being accessed.

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

11 years agotests: Use the ap_ifname variable instead of hardcoding ifname
Jouni Malinen [Sat, 30 Mar 2013 08:31:18 +0000 (10:31 +0200)]
tests: Use the ap_ifname variable instead of hardcoding ifname

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

11 years agowlantest: Get rid of compiler warning
Jouni Malinen [Fri, 29 Mar 2013 19:24:10 +0000 (21:24 +0200)]
wlantest: Get rid of compiler warning

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

11 years agotests: Get rid of the unnecessary add_tests() functions
Jouni Malinen [Fri, 29 Mar 2013 19:03:55 +0000 (21:03 +0200)]
tests: Get rid of the unnecessary add_tests() functions

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

11 years agotests: Add helper functions for connection to an AP
Jouni Malinen [Fri, 29 Mar 2013 18:41:33 +0000 (20:41 +0200)]
tests: Add helper functions for connection to an AP

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

11 years agotests: Add helper functions for starting hostapd AP
Jouni Malinen [Fri, 29 Mar 2013 18:33:25 +0000 (20:33 +0200)]
tests: Add helper functions for starting hostapd AP

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

11 years agotests: Add TDLS test cases for WEP and open network
Jouni Malinen [Fri, 29 Mar 2013 17:15:43 +0000 (19:15 +0200)]
tests: Add TDLS test cases for WEP and open network

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

11 years agowlantest: Add wlantest_cli command add_wep
Jouni Malinen [Fri, 29 Mar 2013 17:12:35 +0000 (19:12 +0200)]
wlantest: Add wlantest_cli command add_wep

This can be used to configure a known WEP key for decrypting WEP frames.

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

11 years agotests: Add TDLS test cases with WPA-PSK and WPA+WPA2-PSK
Jouni Malinen [Fri, 29 Mar 2013 16:51:48 +0000 (18:51 +0200)]
tests: Add TDLS test cases with WPA-PSK and WPA+WPA2-PSK

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

11 years agotests: Configure hostapd dynamically during the tests
Jouni Malinen [Fri, 29 Mar 2013 16:37:03 +0000 (18:37 +0200)]
tests: Configure hostapd dynamically during the tests

This makes it more convenient to change hostapd parameters between the
test cases.

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

11 years agotests: Rename AP testing scripts to be more generic
Jouni Malinen [Fri, 29 Mar 2013 15:19:47 +0000 (17:19 +0200)]
tests: Rename AP testing scripts to be more generic

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