mech_eap.git
10 years agotests: Show missing descriptions in more helpful format
Jouni Malinen [Sun, 5 Jan 2014 11:10:29 +0000 (13:10 +0200)]
tests: Show missing descriptions in more helpful format

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

10 years agotests: Add forgotten test_wifi_display description
Jouni Malinen [Sun, 5 Jan 2014 11:10:10 +0000 (13:10 +0200)]
tests: Add forgotten test_wifi_display description

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

10 years agotests: Optimize Interworking test cases with single-channel scans
Jouni Malinen [Sun, 5 Jan 2014 10:26:20 +0000 (12:26 +0200)]
tests: Optimize Interworking test cases with single-channel scans

Leave couple of cases to use full scan for better test coverage, but
change all other places to use a single channel scan with
INTERWORKING_SELECT to reduce the time it takes to execute the tests.

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

10 years agotests: Avoid unnecessary wlantest failures
Jouni Malinen [Sun, 5 Jan 2014 10:35:13 +0000 (12:35 +0200)]
tests: Avoid unnecessary wlantest failures

It is possible that wlantest has not yet created the BSS entry in all
cases, so interpret failures (no BSS entry being the most likely cause)
as zero counters. Similarly, ignore clear_bss_counters errors since they
are most likely reporting that the BSS was not found and as such, there
was no need to clear the counters anyway.

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

10 years agoInterworking: Add optional freq argument to INTERWORKING_SELECT
Jouni Malinen [Sun, 5 Jan 2014 10:25:13 +0000 (12:25 +0200)]
Interworking: Add optional freq argument to INTERWORKING_SELECT

This can be used to limit which channels are scanned using the specified
list of frequency ranges in the same format that the SCAN command uses.

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

10 years agoFix req_scan-deplete-timeout and update eloop API for this
Jouni Malinen [Sun, 5 Jan 2014 07:59:38 +0000 (09:59 +0200)]
Fix req_scan-deplete-timeout and update eloop API for this

Commit e2f5a9889a3a2bb8f1eed0cf274c7fbbabe3e9de was supposed to prevent
new scan request from pushing out the old one. However, it did not
really do that since eloop_deplete_timeout() returned 0 both for the
case where the old timeout existed (and was sooner) and if the old
timeout did not exist. It returned 1 only for the case where an old
timeout did exist and was larger than the new requested value. That case
used to result in wpa_supplicant_req_scan() rescheduling the timeout,
but hew code in eloop_deplete_timeout() did the exact same thing and as
such, did not really change anything apart from the debug log message.

Extend the eloop_deplete_timeout() (and eloop_replenish_timeout() for
that matter since it is very similar) to return three different values
based on whether the timeout existed or not and if yes, whether it was
modified. This allows wpa_supplicant_req_scan() to schedule a new
timeout only in the case there was no old timeout.

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

10 years agotests: Use ctrl_iface event for EAP reauth instead of STATUS poll
Jouni Malinen [Sun, 5 Jan 2014 07:23:46 +0000 (09:23 +0200)]
tests: Use ctrl_iface event for EAP reauth instead of STATUS poll

This speeds up the EAP test cases a bit by avoiding polling for
wpa_supplicant status.

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

10 years agotests: Remove unnecessary reset() steps
Jouni Malinen [Sun, 5 Jan 2014 06:51:23 +0000 (08:51 +0200)]
tests: Remove unnecessary reset() steps

The FLUSH command clears disallow_aps, p2p_disabled, and
p2p_per_sta_psk, so there is no need to clear them separately.

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

10 years agoP2P: Clear p2p_disabled and p2p_per_sta_psk on FLUSH command
Jouni Malinen [Sun, 5 Jan 2014 06:56:36 +0000 (08:56 +0200)]
P2P: Clear p2p_disabled and p2p_per_sta_psk on FLUSH command

The control interface FLUSH command now includes clearing of
"P2P_SET disabled 1" and "P2P_SET per_sta_psk 1".

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

10 years agoP2P: Clear services on FLUSH command
Jouni Malinen [Sun, 5 Jan 2014 06:53:35 +0000 (08:53 +0200)]
P2P: Clear services on FLUSH command

The control interface FLUSH command now includes the step executed by
the P2P_SERVICE_FLUSH command.

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

10 years agotests: Optimize wait_event()
Jouni Malinen [Sun, 5 Jan 2014 06:02:06 +0000 (08:02 +0200)]
tests: Optimize wait_event()

Replace the fixed 100 ms waits with a select()-based wait and timeout
for full wait based on monotonic time to optimize wait_event().

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

10 years agowpaspy: Add optional timeout argument for pending()
Jouni Malinen [Sun, 5 Jan 2014 06:46:45 +0000 (08:46 +0200)]
wpaspy: Add optional timeout argument for pending()

This can be used to wait for up to the specified limit on new event
messages.

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

10 years agotests: Minor clean up for GAS test cases
Jouni Malinen [Sun, 5 Jan 2014 06:19:08 +0000 (08:19 +0200)]
tests: Minor clean up for GAS test cases

Do not run a full scan in gas_generic since this is not really needed.
Dump pending event messages after long wait to make logs clearer.

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

10 years agotests: Clean up hostapd ctrl_iface debug logging
Jouni Malinen [Sun, 5 Jan 2014 05:47:42 +0000 (07:47 +0200)]
tests: Clean up hostapd ctrl_iface debug logging

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

10 years agotests: Write debug logs into the database for failed test cases
Jouni Malinen [Sat, 4 Jan 2014 14:36:10 +0000 (16:36 +0200)]
tests: Write debug logs into the database for failed test cases

This makes it easier to build a web page for analyzing failures without
having to fetch the log files themselves from the test server.

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

10 years agotests: Radio work items
Jouni Malinen [Sat, 4 Jan 2014 11:20:46 +0000 (13:20 +0200)]
tests: Radio work items

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

10 years agoAllow external programs to request wpa_radio work items
Jouni Malinen [Sat, 4 Jan 2014 11:10:41 +0000 (13:10 +0200)]
Allow external programs to request wpa_radio work items

The new control interface command RADIO_WORK can be used by external
programs to request radio allocation slots from wpa_supplicant if
exclusive radio control is needed, e.g., for offchannel operations. If
such operations are done directly to the driver, wpa_supplicant may not
have enough information to avoid conflicting operations. This new
command can be used to provide enough information and radio scheduling
to avoid issues with such cases.

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

10 years agotests: Verify behavior during externally triggered scan
Jouni Malinen [Sat, 4 Jan 2014 08:35:01 +0000 (10:35 +0200)]
tests: Verify behavior during externally triggered scan

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

10 years agoDo not start wpa_radio work during externally triggered scan
Jouni Malinen [Sat, 4 Jan 2014 08:33:14 +0000 (10:33 +0200)]
Do not start wpa_radio work during externally triggered scan

If an external program triggers a scan, wpa_supplicant does not have a
wpa_radio work item for this operation to protect against other
offchannel operations. This can result in operations failing, so try to
avoid damage by not starting any new wpa_radio work items during a scan
that was started by another process.

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

10 years agotests: Verify cfg80211 connect API with concurrent operation
Jouni Malinen [Sat, 4 Jan 2014 06:28:02 +0000 (08:28 +0200)]
tests: Verify cfg80211 connect API with concurrent operation

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

10 years agoRemove unneeded scan delay on connection-in-progress
Jouni Malinen [Fri, 3 Jan 2014 14:57:01 +0000 (16:57 +0200)]
Remove unneeded scan delay on connection-in-progress

This type of protection against concurrent connection and scan
operations is now enforced through the wpa_radio work mechanism, so this
separate protection mechanism is not needed anymore.

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

10 years agoRemove unneeded GAS query delay on connection-in-progress
Jouni Malinen [Fri, 3 Jan 2014 14:54:10 +0000 (16:54 +0200)]
Remove unneeded GAS query delay on connection-in-progress

This type of protection against concurrent connection and offchannel GAS
operations is now enforced through the wpa_radio work mechanism, so this
separate protection mechanism is not needed anymore.

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

10 years agoUse wpa_radio work for connection
Jouni Malinen [Fri, 3 Jan 2014 14:50:32 +0000 (16:50 +0200)]
Use wpa_radio work for connection

This protects against conflicting offchannel operations during
connection (authentication, association, EAP exchanges, 4-way
handshake).

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

10 years agoUse radio work for GAS requests
Jouni Malinen [Fri, 3 Jan 2014 13:09:50 +0000 (15:09 +0200)]
Use radio work for GAS requests

Avoid concurrent GAS operations with any other exclusive use of the
radio by using the radio work queuing mechanism. This replaces some of
the earlier constraints on concurrent operations with the more generic
wpa_radio work concept.

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

10 years agoP2P: Use radio work to protect offchannel Action frame exchanges
Jouni Malinen [Tue, 7 Jan 2014 07:39:30 +0000 (09:39 +0200)]
P2P: Use radio work to protect offchannel Action frame exchanges

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

10 years agoUse radio work for P2P Listen requests
Jouni Malinen [Sat, 4 Jan 2014 07:36:13 +0000 (09:36 +0200)]
Use radio work for P2P Listen requests

Avoid concurrent P2P Listen operations with any other exclusive use of
the radio by using the radio work queuing mechanism. This removes some
of the earlier workarounds that postponed scans depending on other
operations.

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

10 years agoUse radio work for P2P scan requests
Jouni Malinen [Fri, 3 Jan 2014 09:57:57 +0000 (11:57 +0200)]
Use radio work for P2P scan requests

Avoid concurrent P2P scan requests with any other exclusive use of the
radio by using the radio work queuing mechanism. This removes some of
the earlier workarounds that postponed scans depending on other
operations.

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

10 years agoUse radio work for scan requests
Jouni Malinen [Sun, 24 Nov 2013 20:07:05 +0000 (22:07 +0200)]
Use radio work for scan requests

Avoid concurrent scan requests by using the radio work queuing
mechanism.

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

10 years agoAdd framework for exclusive radio operations
Jouni Malinen [Sun, 24 Nov 2013 19:42:17 +0000 (21:42 +0200)]
Add framework for exclusive radio operations

The new radio work item concept can be used to request time for an
operation that requires exclusive radio control, e.g., a scan. Once the
radio is available, the registered callback function will be called.
radio_work_done() must be called once the exclusive radio operation has
been completed, so that the radio is freed for other operations. The
special case of deinit=1 is used to free the context data during
interface removal. That does not allow the callback function to start
the radio operation, i.e., it needs to free the allocated resources
and return.

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

10 years agoAdd helper functions for cloning and freeing scan parameters
Jouni Malinen [Fri, 3 Jan 2014 07:48:00 +0000 (09:48 +0200)]
Add helper functions for cloning and freeing scan parameters

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

10 years agoIgnore externally triggered scan results with scan_res_handler
Jouni Malinen [Fri, 3 Jan 2014 10:00:13 +0000 (12:00 +0200)]
Ignore externally triggered scan results with scan_res_handler

wpa_s->scan_res_handler is set only for cases where a scan operation is
requested for a specific purpose. As such, this callback should only be
called when a scan result from a scan that was triggered by
wpa_supplicant is processed.

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

10 years agoClean up ctrl_iface debug prints for monitor events
Jouni Malinen [Sat, 4 Jan 2014 05:32:08 +0000 (07:32 +0200)]
Clean up ctrl_iface debug prints for monitor events

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

10 years agoUse cleaner debug print for ctrl_iface commands with private info
Jouni Malinen [Sat, 4 Jan 2014 05:40:46 +0000 (07:40 +0200)]
Use cleaner debug print for ctrl_iface commands with private info

Convert this to a text string instead of ASCII hexdump to make the
debug log more convenient to use.

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

10 years agoRemove duplicated RX ctrl_iface hexdump
Jouni Malinen [Sat, 4 Jan 2014 05:16:32 +0000 (07:16 +0200)]
Remove duplicated RX ctrl_iface hexdump

The newer wpa_dbg() print includes the same information in a more
convenient form, so remove the duplicate RX ctrl_iface hexdump in the
cases where there is no key material in the control interface commands
(the possible-key-material case is still using wpa_hexdump_ascii_key).

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

10 years agotests: Fix unit test linking after reltime changes
Jouni Malinen [Fri, 3 Jan 2014 15:41:16 +0000 (17:41 +0200)]
tests: Fix unit test linking after reltime changes

librt needs to be linked in with older glibc versions.

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

10 years agotests: Clean up and optimize gas_concurrent_scan and _connect
Jouni Malinen [Fri, 3 Jan 2014 12:34:59 +0000 (14:34 +0200)]
tests: Clean up and optimize gas_concurrent_scan and _connect

No need to run a full scan as the first step since it only needs to find
the AP from a known channel for the GAS operation.

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

10 years agotests: Remove ignore_old_scan_res workaround
Jouni Malinen [Fri, 3 Jan 2014 06:59:59 +0000 (08:59 +0200)]
tests: Remove ignore_old_scan_res workaround

Now that wpa_supplicant requests the driver (cfg80211) to clear its scan
cache automatically after each BSS_FLUSH/FLUSH command, the previously
used ignore_old_scan_res workaround should not be needed for the hwsim
test cases anymore.

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

10 years agoFix scan-cache-clearing operation to avoid unnecessary cases
Jouni Malinen [Fri, 3 Jan 2014 06:55:51 +0000 (08:55 +0200)]
Fix scan-cache-clearing operation to avoid unnecessary cases

wpa_drv_scan() success case was supposed to clear
wpa_s->clear_driver_scan_cache, not params->only_new_results (which
would do nothing here).

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

10 years agoAvoid unnecessary key clearing operations
Jouni Malinen [Thu, 2 Jan 2014 21:46:21 +0000 (23:46 +0200)]
Avoid unnecessary key clearing operations

Track set_key operations per-key index and clear keys on disconnection
only if the key was set (or may have been set which is the case for the
first operation after wpa_supplicant start).

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

10 years agoRemove some unnecessary EAPOL port (un)authorized callbacks
Jouni Malinen [Thu, 2 Jan 2014 21:28:28 +0000 (23:28 +0200)]
Remove some unnecessary EAPOL port (un)authorized callbacks

If the port status did not change or would not need to get an update
after portEnabled changes, there is no need to try to set the driver to
use the same value it is already using based on the previous state.
Remove such calls to reduce number of operations during reassociation.
In addition, this cleans up the debug log by removing unnecessary
duplicated entries.

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

10 years agoAsk driver to report only new scan results if requested
Jouni Malinen [Thu, 2 Jan 2014 21:03:31 +0000 (23:03 +0200)]
Ask driver to report only new scan results if requested

If the BSS table within wpa_supplicant is flushed, request the driver to
flush its own scan result table during the next scan. This can avoid
unexpected old BSS entries showing up after BSS_FLUSH or FLUSH command
in cases where the driver may maintain its internal cache of scan
results (e.g., cfg80211 BSS table persists at least for 15 seconds).

In addition to doing this automatically on BSS_FLUSH/FLUSH, a new SCAN
command argument, only_new=1, can be used to request a manual scan
request to do same. Though, it should be noted that this maintains the
BSS table within wpa_supplicant. BSS_FLUSH followed by SCAN command can
be used to clear all BSS entries from both the driver and
wpa_supplicant.

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

10 years agoRemove hostapd dump_file functionality
Jouni Malinen [Thu, 2 Jan 2014 16:15:07 +0000 (18:15 +0200)]
Remove hostapd dump_file functionality

This debugging mechanism has now been deprecated by the control
interface commands that can be used to fetch same internal information
from hostapd in a more convenient way. Leave the empty USR1 signal
handler and configuration file parameter for backwards compatibility.
They can be removed in future versions of hostapd.

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

10 years agotests: Verify STA command output and EAPOL state
Jouni Malinen [Thu, 2 Jan 2014 16:10:30 +0000 (18:10 +0200)]
tests: Verify STA command output and EAPOL state

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

10 years agoMake EAPOL dump data available through ctrl_iface STA command
Jouni Malinen [Thu, 2 Jan 2014 15:49:48 +0000 (17:49 +0200)]
Make EAPOL dump data available through ctrl_iface STA command

The per-STA/Supplicant state information from the EAPOL authenticator
is now available through "STA <MAC Address> eapol" command.

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

10 years agoConvert EAPOL authenticator dump into easier to parse format
Jouni Malinen [Thu, 2 Jan 2014 15:37:21 +0000 (17:37 +0200)]
Convert EAPOL authenticator dump into easier to parse format

Use name=value entries one per each line and rename the state
entries to have unique names.

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

10 years agoRemove hostapd dump_file data that is available through ctrl_iface
Jouni Malinen [Thu, 2 Jan 2014 15:20:51 +0000 (17:20 +0200)]
Remove hostapd dump_file data that is available through ctrl_iface

There is no need to maintain two interfaces for fetching debug
information about hostapd state. The control interface is more
convenient for number of use cases, so prefer that over the dump_file
mechanism.

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

10 years agoMake RADIUS server MIB available through control interface
Jouni Malinen [Thu, 2 Jan 2014 15:19:04 +0000 (17:19 +0200)]
Make RADIUS server MIB available through control interface

"MIB radius_server" control interface can now be used to fetch the
RADIUS server MIB data from hostapd.

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

10 years agoAdd more STA information into the ctrl_iface STA command
Jouni Malinen [Thu, 2 Jan 2014 14:31:46 +0000 (16:31 +0200)]
Add more STA information into the ctrl_iface STA command

This adds TX/RX statistics and information about association into the
per-STA data that is available through the hostapd control interface. In
addition, information about the EAP method is now included with the IEEE
802.1X data.

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

10 years agoRemove forgotten notes about already removed driver wrappers
Jouni Malinen [Thu, 2 Jan 2014 08:23:30 +0000 (10:23 +0200)]
Remove forgotten notes about already removed driver wrappers

These old driver wrappers have been removed quite some time ago, but
some of the build configuration notes were still describing how they
are configured.

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

10 years agoUpdate EAP-FAST note regarding OpenSSL support
Jouni Malinen [Thu, 2 Jan 2014 08:13:11 +0000 (10:13 +0200)]
Update EAP-FAST note regarding OpenSSL support

This is now supported in the current OpenSSL version.

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

10 years agonl80211: Initial support for vendor commands and events
Jouni Malinen [Wed, 1 Jan 2014 21:30:23 +0000 (23:30 +0200)]
nl80211: Initial support for vendor commands and events

Print into the debug log the list of vendor commands and events that the
driver supports. In addition, add a generic handler for vendor events.
This can be extended for each vendor/subcmd.

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

10 years agotests: Verify GET_CONFIG ctrl_iface command on hostapd
Jouni Malinen [Wed, 1 Jan 2014 20:15:36 +0000 (22:15 +0200)]
tests: Verify GET_CONFIG ctrl_iface command on hostapd

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

10 years agotests: Add more thorough WPS_AP_PIN validation
Jouni Malinen [Wed, 1 Jan 2014 20:11:46 +0000 (22:11 +0200)]
tests: Add more thorough WPS_AP_PIN validation

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

10 years agoWPS: Fix clear-from-timeout handling to avoid race condition
Jouni Malinen [Wed, 1 Jan 2014 20:00:09 +0000 (22:00 +0200)]
WPS: Fix clear-from-timeout handling to avoid race condition

The 100 ms timeout to clear WPS state after EAP-Failure has been
received worked otherwise fine, but it opened a race condition on
another WPS operation starting within that wait. If that happens, the
timeout will cancel that new operation unexpectedly. Fix this by
cancelling the timeout from wpas_clear_wps().

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

10 years agotests: Verify WPS_CHECK_PIN functionality
Jouni Malinen [Wed, 1 Jan 2014 19:30:57 +0000 (21:30 +0200)]
tests: Verify WPS_CHECK_PIN functionality

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

10 years agotests: P2P SD using per-peer query
Jouni Malinen [Wed, 1 Jan 2014 18:01:00 +0000 (20:01 +0200)]
tests: P2P SD using per-peer query

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

10 years agotests: Verify P2P SD request cancel
Jouni Malinen [Wed, 1 Jan 2014 17:56:24 +0000 (19:56 +0200)]
tests: Verify P2P SD request cancel

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

10 years agotests: P2P service discovery with GAS fragmentation
Jouni Malinen [Wed, 1 Jan 2014 16:56:20 +0000 (18:56 +0200)]
tests: P2P service discovery with GAS fragmentation

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

10 years agotests: P2P Presence Request
Jouni Malinen [Wed, 1 Jan 2014 16:46:28 +0000 (18:46 +0200)]
tests: P2P Presence Request

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

10 years agoP2P: Send received Presence Response information to ctrl_iface monitors
Jouni Malinen [Wed, 1 Jan 2014 16:44:44 +0000 (18:44 +0200)]
P2P: Send received Presence Response information to ctrl_iface monitors

The P2P_PRESENCE_REQ command did not give any easily available
indication of the response received from the GO. Make this more useful
by providing such response (if received) as a ctrl_iface monitor event
(P2P-PRESENCE-RESPONSE).

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

10 years agotests: Add some coverage for Device Discoverability exchange
Jouni Malinen [Wed, 1 Jan 2014 15:37:08 +0000 (17:37 +0200)]
tests: Add some coverage for Device Discoverability exchange

This is not really perfect, but something to get a bit more testing
coverage.. For proper discoverability mechanism validation, the P2P
client would need to go to sleep to avoid acknowledging the GO
Negotiation Request frame. Offchannel Listen mode operation on the P2P
Client with mac80211_hwsim is apparently not enough to avoid the
acknowledgement on the operating channel, so need to disconnect from the
group which removes the GO-to-P2P Client part of the discoverability
exchange in practice.

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

10 years agoACS: Mark acs_fail() static
Jouni Malinen [Tue, 31 Dec 2013 20:30:49 +0000 (22:30 +0200)]
ACS: Mark acs_fail() static

This function is not used outside acs.c.

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

10 years agoOpenSSL: Include sha1/sha256 header files to verify declarations
Jouni Malinen [Tue, 31 Dec 2013 17:58:16 +0000 (19:58 +0200)]
OpenSSL: Include sha1/sha256 header files to verify declarations

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

10 years agoWNM: Clean up le16 variable use to avoid sparse warnings
Jouni Malinen [Tue, 31 Dec 2013 17:41:47 +0000 (19:41 +0200)]
WNM: Clean up le16 variable use to avoid sparse warnings

intval is marked le16 and should be used through proper byte order
conversion functions even if it ended up getting set correctly due to
the two operations cancelling each other.

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

10 years agoMark wpas_wps_er_nfc_handover_sel() static
Jouni Malinen [Tue, 31 Dec 2013 17:37:15 +0000 (19:37 +0200)]
Mark wpas_wps_er_nfc_handover_sel() static

This is not used outside wps_supplicant.c.

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

10 years agoMove declaration of hostapd_acs_completed() into correct header file
Jouni Malinen [Tue, 31 Dec 2013 17:34:43 +0000 (19:34 +0200)]
Move declaration of hostapd_acs_completed() into correct header file

This function is in hw_features.c and as such, should be declared in
hw_features.h.

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

10 years agoDeclare wpa_debug_* variables in src/utils/wpa_debug.h
Jouni Malinen [Tue, 31 Dec 2013 17:29:52 +0000 (19:29 +0200)]
Declare wpa_debug_* variables in src/utils/wpa_debug.h

These were somewhat more hidden to avoid direct use, but there are now
numerous places where these are needed and more justification to make
the extern int declarations available from wpa_debug.h. In addition,
this avoids some warnings from sparse.

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

10 years agoDeclare wpa_drivers in src/drivers/driver.h
Jouni Malinen [Tue, 31 Dec 2013 17:19:37 +0000 (19:19 +0200)]
Declare wpa_drivers in src/drivers/driver.h

This avoids some warnings from sparse.

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

10 years agotests: RADIUS
Jouni Malinen [Tue, 31 Dec 2013 11:57:49 +0000 (13:57 +0200)]
tests: RADIUS

This adds initial set of test cases to increase RADIUS testing coverage.

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

10 years agotests: SSID contents and encoding
Jouni Malinen [Tue, 31 Dec 2013 11:21:18 +0000 (13:21 +0200)]
tests: SSID contents and encoding

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

10 years agotests: Add IEEE 802.1X and dynamic WEP test cases
Jouni Malinen [Tue, 31 Dec 2013 10:07:33 +0000 (12:07 +0200)]
tests: Add IEEE 802.1X and dynamic WEP test cases

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

10 years agoClear EAPOL Logoff state on FLUSH command
Jouni Malinen [Tue, 31 Dec 2013 10:07:11 +0000 (12:07 +0200)]
Clear EAPOL Logoff state on FLUSH command

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

10 years agotests: Verify mixed mode WPA+WPA2 operation
Jouni Malinen [Tue, 31 Dec 2013 09:32:48 +0000 (11:32 +0200)]
tests: Verify mixed mode WPA+WPA2 operation

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

10 years agotests: Verify WMM AC configuration and ACM=1 downgrade VO/VI->BE
Jouni Malinen [Tue, 31 Dec 2013 09:20:44 +0000 (11:20 +0200)]
tests: Verify WMM AC configuration and ACM=1 downgrade VO/VI->BE

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

10 years agotests: WEXT functionality
Jouni Malinen [Tue, 31 Dec 2013 08:49:26 +0000 (10:49 +0200)]
tests: WEXT functionality

It did not look like open mode association completed with WEXT.. I'm
commenting that test case out for now since WPA2-PSK worked. If you care
about WEXT, feel free to fix it and submit a patch to remove the
"REMOVED_" prefix here..

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

10 years agotests: Increase nl80211 test coverage with monitor/connect
Jouni Malinen [Mon, 30 Dec 2013 22:17:02 +0000 (00:17 +0200)]
tests: Increase nl80211 test coverage with monitor/connect

Add test cases to use connect command instead of auth+assoc commands and
AP mode operations using the old monitor interface design.

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

10 years agonl80211: Add driver param for forcing monitor and connect APIs
Jouni Malinen [Mon, 30 Dec 2013 22:07:23 +0000 (00:07 +0200)]
nl80211: Add driver param for forcing monitor and connect APIs

use_monitor=1 and force_connect_cmd=1 driver parameters can now be used
to force older monitor interface design and the connect API (SME in
driver) to increase hwsim testing coverage.

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

10 years agotests: Verify cfg80211 P2P Device use
Jouni Malinen [Mon, 30 Dec 2013 21:36:10 +0000 (23:36 +0200)]
tests: Verify cfg80211 P2P Device use

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

10 years agonl80211: Fix nl_mgmt handling in partial error case
Jouni Malinen [Tue, 31 Dec 2013 08:17:53 +0000 (10:17 +0200)]
nl80211: Fix nl_mgmt handling in partial error case

If Action frame registration in nl80211_mgmt_subscribe_non_ap() failed
for any frame type, the previous implementation skipped
nl80211_mgmt_handle_register_eloop() call. This is not desirable since
none of the Action frame types could be received and even worse, the
following nl80211_destroy_eloop_handle() call for nl_mgmt would likely
result in crashing the process due to the ELOOP_SOCKET_INVALID XOR
operation. This could be triggered at least in a P2P group interface
startup failure case.

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

10 years agonl80211: Prefer newer scan result over older during duplicate removal
Jouni Malinen [Tue, 31 Dec 2013 07:38:55 +0000 (09:38 +0200)]
nl80211: Prefer newer scan result over older during duplicate removal

Previously, it was possible for bss_info_handler() to end up dropping a
newer scan result entry if there were two entries with the same BSSID
and SSID (i.e., only frequency was different) and we were not associated
with either. This could happen, e.g., in some P2P use cases where device
discovery may happen on different channels. Fix this by checking the age
of the scan entries as well to prefer the most recent response.

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

10 years agotests: Verify dynamic wpa_supplicant interface addition/removal
Jouni Malinen [Mon, 30 Dec 2013 21:08:25 +0000 (23:08 +0200)]
tests: Verify dynamic wpa_supplicant interface addition/removal

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

10 years agowpaspy: Do not leave socket files behind if connection fails
Jouni Malinen [Tue, 31 Dec 2013 13:43:17 +0000 (15:43 +0200)]
wpaspy: Do not leave socket files behind if connection fails

Ctrl::__init__ needs to handle socket.connect() exceptions and unlink
the client socket file on failures.

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

10 years agowpaspy: Fix tracking of attached status
Jouni Malinen [Mon, 30 Dec 2013 20:23:18 +0000 (22:23 +0200)]
wpaspy: Fix tracking of attached status

The attached variable was initialized and checked, but never updated.
Fix that by updating it on successful ATTACH/DETACH command.

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

10 years agonl80211: Report set_supp_port failures in debug log
Jouni Malinen [Mon, 30 Dec 2013 20:11:40 +0000 (22:11 +0200)]
nl80211: Report set_supp_port failures in debug log

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

10 years agonl80211: Share a helper function for connect and associate commands
Jouni Malinen [Mon, 30 Dec 2013 18:34:57 +0000 (20:34 +0200)]
nl80211: Share a helper function for connect and associate commands

Most of the attributes to these commands are identical and there is no
need to maintain two copies of the same functionality.

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

10 years agoRemove unnecessary build #ifdef from definitions
Jouni Malinen [Mon, 30 Dec 2013 17:36:29 +0000 (19:36 +0200)]
Remove unnecessary build #ifdef from definitions

This type of definition by itself does not change the binary at all.

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

10 years agoGet rid of duplicated cipher suite and AKM definitions
Jouni Malinen [Mon, 30 Dec 2013 17:33:39 +0000 (19:33 +0200)]
Get rid of duplicated cipher suite and AKM definitions

WPA_CIPHER_* and CIPHER_* are used for the exact same set of cipher
suites with the main difference being that the WPA_CIPHER_* version is
suitable to be used as a bitfield. Similarly, WPA_KEY_MGMT_* and
KEY_MGMT_* have similar design for AKMs. There is no need to maintain
two separate copies of the definitions since the bitfield compatible
version can be used for both needs. Get rid of the CIPHER_* and
KEY_MGMT_* versions to clean up the implementation by getting rid of
unnecessary mapping functions.

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

10 years agonl80211: Use helper functions for cipher suite mapping
Jouni Malinen [Mon, 30 Dec 2013 16:59:29 +0000 (18:59 +0200)]
nl80211: Use helper functions for cipher suite mapping

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

10 years agonl80211: Set control port for NL80211_CMD_COMMAND
Jouni Malinen [Mon, 30 Dec 2013 16:21:04 +0000 (18:21 +0200)]
nl80211: Set control port for NL80211_CMD_COMMAND

NL80211_ATTR_CONTROL_PORT was previously set only for
NL80211_CMD_ASSOCIATE, but it should also be set when using
NL80211_CMD_COMMAND (driver-based SME) even though none of the current
non-mac80211 drivers use this.

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

10 years agoWPS: Clean up UUID debug print
Jouni Malinen [Mon, 30 Dec 2013 14:50:08 +0000 (16:50 +0200)]
WPS: Clean up UUID debug print

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

10 years agonl80211: Clean up regulatory rule debug prints
Jouni Malinen [Mon, 30 Dec 2013 14:41:51 +0000 (16:41 +0200)]
nl80211: Clean up regulatory rule debug prints

Combine maximum bandwidth and EIRP into a single debug print.

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

10 years agonl80211: Print frame registration match on same debug line
Jouni Malinen [Mon, 30 Dec 2013 13:50:09 +0000 (15:50 +0200)]
nl80211: Print frame registration match on same debug line

This makes debug log a bit more readable.

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

10 years agoInterworking: Allow cred blocks not to be saved to a file
Jouni Malinen [Mon, 30 Dec 2013 13:43:55 +0000 (15:43 +0200)]
Interworking: Allow cred blocks not to be saved to a file

The new cred block parameter 'temporary' can be used to indicate that a
cred block is not to be saved to wpa_supplicant configuration file
(e.g., "SET_CRED 0 temporary 1"). This is similar to the concept of
temporary network blocks and allows cred blocks to be managed outside
the wpa_supplicant config file when other parameters are still saved to
the file written by wpa_supplicant.

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

10 years agotests: Verify PMKSA caching
Jouni Malinen [Sun, 29 Dec 2013 17:25:42 +0000 (19:25 +0200)]
tests: Verify PMKSA caching

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

10 years agoReset WPA parameters to default values on FLUSH command
Jouni Malinen [Sun, 29 Dec 2013 17:25:05 +0000 (19:25 +0200)]
Reset WPA parameters to default values on FLUSH command

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

10 years agotests: Point to the main hwsim page instead of directly to buildbot
Jouni Malinen [Sun, 29 Dec 2013 16:37:40 +0000 (18:37 +0200)]
tests: Point to the main hwsim page instead of directly to buildbot

This page provides more helpful information than the buildbot UI.

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

10 years agoP2P: Remove WPA_DRIVER_FLAGS_P2P_MGMT option
Jouni Malinen [Sun, 29 Dec 2013 16:20:47 +0000 (18:20 +0200)]
P2P: Remove WPA_DRIVER_FLAGS_P2P_MGMT option

The option of handling upper layer P2P management operations within the
driver/firmware was originally planned to be used with wpa_supplicant,
but this has not really happened and there is no clear sign of this
being needed in the near term either. This functionality has not been
completed and it is certainly not being kept up-to-date or tested. As
such, it is best to remove it for now and if this or something similar
is needed in the future, it can be brought back once a clear need for it
has been demonstrated first.

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

10 years agoWPS: Use shorter scan interval during pre-provisioning search
Jouni Malinen [Sun, 29 Dec 2013 16:02:05 +0000 (18:02 +0200)]
WPS: Use shorter scan interval during pre-provisioning search

Previously, the shorter scan interval was already in use for the
connection following the provisioning step, but same optimization can
also be used for the pre-provisioning scan.

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

10 years agoWPS: Replace wpas_wps_in_progress with identical wpas_wps_searching
Jouni Malinen [Sun, 29 Dec 2013 15:59:12 +0000 (17:59 +0200)]
WPS: Replace wpas_wps_in_progress with identical wpas_wps_searching

There is no point in maintaining two different functions that do
practically the same check of WPS state.

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

10 years agotests: Verify hostapd WPS_GET_STATUS command
Jouni Malinen [Sun, 29 Dec 2013 15:49:21 +0000 (17:49 +0200)]
tests: Verify hostapd WPS_GET_STATUS command

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