]> git.ipfire.org Git - thirdparty/hostap.git/log
thirdparty/hostap.git
8 years agotests: hostapd and RADAR ctrl_iface command
Jouni Malinen [Tue, 27 Dec 2016 18:05:12 +0000 (20:05 +0200)] 
tests: hostapd and RADAR ctrl_iface command

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: WPS PIN provisioning with configured AP using dummy cred
Jouni Malinen [Tue, 27 Dec 2016 17:59:22 +0000 (19:59 +0200)] 
tests: WPS PIN provisioning with configured AP using dummy cred

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: More hostapd SET command coverage
Jouni Malinen [Tue, 27 Dec 2016 17:59:03 +0000 (19:59 +0200)] 
tests: More hostapd SET command coverage

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: More hostapd GET_CONFIG key_mgmt coverage
Jouni Malinen [Tue, 27 Dec 2016 17:24:34 +0000 (19:24 +0200)] 
tests: More hostapd GET_CONFIG key_mgmt coverage

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: More BSS_TM_REQ coverage
Jouni Malinen [Tue, 27 Dec 2016 17:20:42 +0000 (19:20 +0200)] 
tests: More BSS_TM_REQ coverage

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoFix memory leak in hostapd BSS_TM_REQ error path handling
Jouni Malinen [Tue, 27 Dec 2016 17:08:31 +0000 (19:08 +0200)] 
Fix memory leak in hostapd BSS_TM_REQ error path handling

The optional url=<URL> parameter was stored in allocated memory and that
memory was leaked if some following parameter parsing attempts failed.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: More hostapd ctrl_iface QoS Map error coverage
Jouni Malinen [Tue, 27 Dec 2016 15:22:11 +0000 (17:22 +0200)] 
tests: More hostapd ctrl_iface QoS Map error coverage

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: HS20_DEAUTH_REQ OOM
Jouni Malinen [Tue, 27 Dec 2016 15:17:43 +0000 (17:17 +0200)] 
tests: HS20_DEAUTH_REQ OOM

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Additional HS20_WNM_NOTIF coverage
Jouni Malinen [Tue, 27 Dec 2016 15:14:49 +0000 (17:14 +0200)] 
tests: Additional HS20_WNM_NOTIF coverage

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoRemove trailing whitespace
Jouni Malinen [Tue, 27 Dec 2016 15:11:27 +0000 (17:11 +0200)] 
Remove trailing whitespace

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Remove trailing whitespace
Jouni Malinen [Tue, 27 Dec 2016 15:07:11 +0000 (17:07 +0200)] 
tests: Remove trailing whitespace

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Additional hostapd WPS control interface coverage
Jouni Malinen [Tue, 27 Dec 2016 15:04:30 +0000 (17:04 +0200)] 
tests: Additional hostapd WPS control interface coverage

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Additional SA_QUERY coverage
Jouni Malinen [Tue, 27 Dec 2016 14:38:20 +0000 (16:38 +0200)] 
tests: Additional SA_QUERY coverage

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Additional hostapd NEW_STA coverage
Jouni Malinen [Tue, 27 Dec 2016 14:35:08 +0000 (16:35 +0200)] 
tests: Additional hostapd NEW_STA coverage

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: hostapd BSS config file
Jouni Malinen [Tue, 27 Dec 2016 12:50:56 +0000 (14:50 +0200)] 
tests: hostapd BSS config file

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agohostapd: Add TERMINATE as per-interface command
Jouni Malinen [Tue, 27 Dec 2016 12:50:14 +0000 (14:50 +0200)] 
hostapd: Add TERMINATE as per-interface command

This was already avaialble through the global control interface, but not
the per-interface one.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: hostapd -i command line argument
Jouni Malinen [Tue, 27 Dec 2016 12:27:03 +0000 (14:27 +0200)] 
tests: hostapd -i command line argument

This adds some more code coverage reachability testing.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: hostapd SIGUSR1
Jouni Malinen [Tue, 27 Dec 2016 12:23:46 +0000 (14:23 +0200)] 
tests: hostapd SIGUSR1

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Ignoring invalid hostapd configuration parameter updates
Jouni Malinen [Tue, 27 Dec 2016 10:39:44 +0000 (12:39 +0200)] 
tests: Ignoring invalid hostapd configuration parameter updates

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agohostapd: Do not update dtim_period with invalid value
Jouni Malinen [Tue, 27 Dec 2016 10:24:02 +0000 (12:24 +0200)] 
hostapd: Do not update dtim_period with invalid value

Previously, the update command was rejected, but the actual value was
updated.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoRADIUS server: Increase maximum number of sessions
Jouni Malinen [Tue, 27 Dec 2016 10:14:48 +0000 (12:14 +0200)] 
RADIUS server: Increase maximum number of sessions

It was possible to hit the previously used maximum of 100 active session
in some hwsim test case sequences like this one: eap_proto_pwd_errors
eap_proto_ikev2_errors eap_proto_sim_errors. This happened due to the
large number of RADIUS authentication iterations in short period of
time, i.e., within the 10 second timeout for expiring completed
sessions.

Increase RADIUS_MAX_SESSION from 100 to 1000 and also reduce the timeout
on expiring completed sessions from 10 to 5 seconds.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agohostapd: Do not update invalid wep_key_len_unicast
Jouni Malinen [Tue, 27 Dec 2016 10:02:53 +0000 (12:02 +0200)] 
hostapd: Do not update invalid wep_key_len_unicast

Previously, the update command was rejected, but the configuration
parameter value was updated anyway.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agohostapd: Do not update rejected wep_key_len_broadcast
Jouni Malinen [Tue, 27 Dec 2016 10:00:26 +0000 (12:00 +0200)] 
hostapd: Do not update rejected wep_key_len_broadcast

Previously, update command with invalid value got rejected, but the
actual configuration data was updated anyway.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agohostapd: Do not update eapol_version with rejected value
Jouni Malinen [Tue, 27 Dec 2016 09:46:04 +0000 (11:46 +0200)] 
hostapd: Do not update eapol_version with rejected value

Previously, an invalid eapol_version update command was rejected, but
the actual configuration value was updated.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agohostapd: Reject invalid macaddr_acl value
Jouni Malinen [Tue, 27 Dec 2016 09:43:13 +0000 (11:43 +0200)] 
hostapd: Reject invalid macaddr_acl value

Previously, this was noted in error log, but the invalid value was
stored in the configuration without rejecting it.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agohostapd: Check driver parameter before replacing previous value
Jouni Malinen [Tue, 27 Dec 2016 09:33:35 +0000 (11:33 +0200)] 
hostapd: Check driver parameter before replacing previous value

This leaves the previously configured value in place if "SET driver ..."
command fails.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: hostapd configuration reload
Jouni Malinen [Mon, 26 Dec 2016 22:56:46 +0000 (00:56 +0200)] 
tests: hostapd configuration reload

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoFix hostapd SIGHUP processing before interface is enabled
Jouni Malinen [Mon, 26 Dec 2016 22:55:32 +0000 (00:55 +0200)] 
Fix hostapd SIGHUP processing before interface is enabled

It was possible to try to do driver operations before the driver
interface had been initialized when processing a SIGHUP signal. This
would result in NULL pointer dereference. Fix this by skipping the steps
when SIGHUP is issued before the interface is enabled.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: IEEE 802.1X connection using static WEP104
Jouni Malinen [Mon, 26 Dec 2016 22:21:01 +0000 (00:21 +0200)] 
tests: IEEE 802.1X connection using static WEP104

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Invalid TX queue params set (cwmin/cwmax)
Jouni Malinen [Mon, 26 Dec 2016 22:17:34 +0000 (00:17 +0200)] 
tests: Invalid TX queue params set (cwmin/cwmax)

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: MBO and WPA2 without PMF
Jouni Malinen [Mon, 26 Dec 2016 22:07:29 +0000 (00:07 +0200)] 
tests: MBO and WPA2 without PMF

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: WPS getting disabled due to conflicting parameters
Jouni Malinen [Mon, 26 Dec 2016 20:05:10 +0000 (22:05 +0200)] 
tests: WPS getting disabled due to conflicting parameters

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: VHT and TKIP
Jouni Malinen [Mon, 26 Dec 2016 19:59:02 +0000 (21:59 +0200)] 
tests: VHT and TKIP

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Duplicate BSSID
Jouni Malinen [Mon, 26 Dec 2016 19:54:57 +0000 (21:54 +0200)] 
tests: Duplicate BSSID

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: WPA2-PSK AP and no PSK configured
Jouni Malinen [Mon, 26 Dec 2016 19:21:10 +0000 (21:21 +0200)] 
tests: WPA2-PSK AP and no PSK configured

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Invalid VLAN ID from RADIUS server for ACL
Jouni Malinen [Mon, 26 Dec 2016 16:39:49 +0000 (18:39 +0200)] 
tests: Invalid VLAN ID from RADIUS server for ACL

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Cover both binary search branches in hostapd_maclist_found()
Jouni Malinen [Mon, 26 Dec 2016 16:28:40 +0000 (18:28 +0200)] 
tests: Cover both binary search branches in hostapd_maclist_found()

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Make hostapd_oom_wpa2_psk catch cases more robustly
Jouni Malinen [Mon, 26 Dec 2016 15:53:07 +0000 (17:53 +0200)] 
tests: Make hostapd_oom_wpa2_psk catch cases more robustly

For some reason, a potential OOM in hostapd_config_read_wpa_psk() and
hostapd_derive_psk() were missed in --codecov runs during the main
iteration loop. Cover these specific cases with separate instances to
avoid missing coverage.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoRemove unnecessary NULL check from hostapd_config_read_wpa_psk() call
Jouni Malinen [Mon, 26 Dec 2016 15:42:41 +0000 (17:42 +0200)] 
Remove unnecessary NULL check from hostapd_config_read_wpa_psk() call

This function is already checking the fname argument against NULL, so
use that check on its own instead of duplicating the check in the only
caller.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: FILS SK authentication with SHA384
Jouni Malinen [Mon, 26 Dec 2016 12:50:28 +0000 (14:50 +0200)] 
tests: FILS SK authentication with SHA384

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: More ieee802_11_vendor_ie_concat() coverage
Jouni Malinen [Mon, 26 Dec 2016 12:44:44 +0000 (14:44 +0200)] 
tests: More ieee802_11_vendor_ie_concat() coverage

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: VHT with 160 MHz channel width and HT40 disabled
Jouni Malinen [Mon, 26 Dec 2016 11:12:06 +0000 (13:12 +0200)] 
tests: VHT with 160 MHz channel width and HT40 disabled

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: VHT 160 MHz tests with all different HT primary channels
Jouni Malinen [Mon, 26 Dec 2016 10:43:06 +0000 (12:43 +0200)] 
tests: VHT 160 MHz tests with all different HT primary channels

This extends previous ap_vht160_no_dfs test case coverage by running the
same test case with each of the possible HT primary channel
alternatives.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: SAE protocol testing with hostapd
Jouni Malinen [Mon, 26 Dec 2016 10:22:56 +0000 (12:22 +0200)] 
tests: SAE protocol testing with hostapd

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Remove src/common/cli.c from code coverage report
Jouni Malinen [Mon, 26 Dec 2016 10:09:53 +0000 (12:09 +0200)] 
tests: Remove src/common/cli.c from code coverage report

This file is used only by hostapd_cli and wpa_cli and neither of those
are currently included in code coverage reporting. Avoid dropping the
coverage numbers by code that cannot be reached due to not being
included in the programs that are covered.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: More ieee802_11_parse_elems() coverage for new elements
Jouni Malinen [Sun, 25 Dec 2016 22:48:34 +0000 (00:48 +0200)] 
tests: More ieee802_11_parse_elems() coverage for new elements

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Operating classes with HT20 and HT40 channels
Jouni Malinen [Sun, 25 Dec 2016 10:26:48 +0000 (12:26 +0200)] 
tests: Operating classes with HT20 and HT40 channels

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agomka: Make MKA actor priority configurable
Badrish Adiga H R [Mon, 5 Dec 2016 14:53:55 +0000 (06:53 -0800)] 
mka: Make MKA actor priority configurable

This adds a new wpa_supplicant network profile parameter
mka_priority=0..255 to set the priority of the MKA Actor.

Signed-off-by: Badrish Adiga H R <badrish.adigahr@gmail.com>
8 years agotests: Fix p2p_autogo_pref_chan_not_in_regulatory with new regdb
Jouni Malinen [Sat, 24 Dec 2016 23:09:06 +0000 (01:09 +0200)] 
tests: Fix p2p_autogo_pref_chan_not_in_regulatory with new regdb

5745 MHz was added as an allowed short range device range in
wireless-regdb for DE which made this test case fail. Fix it for now by
using SE instead of DE for the second part of the test case.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Fix mesh_open_vht_160 skipping
Jouni Malinen [Sat, 24 Dec 2016 22:47:01 +0000 (00:47 +0200)] 
tests: Fix mesh_open_vht_160 skipping

It is possible for wireless-regdb to include a 160 MHz channel, but with
DFS required. This test case need the regulatory information to allow
160 MHz channel without DFS. Fix false failures by skipping the test if
this exact combination is not found.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Fix peerkey_sniffer_check with newer Wireshark version
Jouni Malinen [Sat, 24 Dec 2016 22:38:52 +0000 (00:38 +0200)] 
tests: Fix peerkey_sniffer_check with newer Wireshark version

Wireshark renamed eapol.keydes.key_info to
wlan_rsna_eapol.keydes.key_info and that broke this test case when
upgrading Wireshark. Fix this by trying to use both the new and the old
name.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Fix eap_fast_tlv_nak_oom and eap_fast_proto_phase2
Jouni Malinen [Sat, 24 Dec 2016 22:15:58 +0000 (00:15 +0200)] 
tests: Fix eap_fast_tlv_nak_oom and eap_fast_proto_phase2

Something broke eap_fast_tlv_nak_oom when moving from Ubuntu 14.04 to
16.04. OpenSSL.SSL.Connection() state_string() returns None in these
cases and the debug log prints for that were causing the case to fail.
For now, work around this by checking whether the state string is None
before trying to print it.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Clear monitor socket within p2p_msg_unexpected_go_neg_resp
Jouni Malinen [Sat, 24 Dec 2016 11:09:23 +0000 (13:09 +0200)] 
tests: Clear monitor socket within p2p_msg_unexpected_go_neg_resp

This makes the debug log easier to understand and avoids leaving large
number of pending messages into the wpa_supplicant control interface
sockets.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoDocument new D-Bus WPS properties
Jouni Malinen [Fri, 23 Dec 2016 19:28:22 +0000 (21:28 +0200)] 
Document new D-Bus WPS properties

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Additional D-Bus WPS Get/Set properties
Jouni Malinen [Fri, 23 Dec 2016 11:11:29 +0000 (13:11 +0200)] 
tests: Additional D-Bus WPS Get/Set properties

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoD-Bus: Use a helper function to get possibly NULL strings
Jouni Malinen [Fri, 23 Dec 2016 09:22:00 +0000 (11:22 +0200)] 
D-Bus: Use a helper function to get possibly NULL strings

This type of check is used in quite a few getter functions, so add a
helper function to take care of it.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoD-Bus: Add DeviceType in WPS property
Avichal Agarwal [Wed, 21 Dec 2016 12:24:25 +0000 (17:54 +0530)] 
D-Bus: Add DeviceType in WPS property

Signed-off-by: Avichal Agarwal <avichal.a@samsung.com>
8 years agoD-Bus: Add device serial number in WPS property
Avichal Agarwal [Wed, 21 Dec 2016 12:24:24 +0000 (17:54 +0530)] 
D-Bus: Add device serial number in WPS property

Signed-off-by: Avichal Agarwal <avichal.a@samsung.com>
Signed-off-by: Mayank Haarit <mayank.h@samsung.com>
8 years agoD-Bus: Add model number in WPS property
Avichal Agarwal [Wed, 21 Dec 2016 12:24:23 +0000 (17:54 +0530)] 
D-Bus: Add model number in WPS property

Signed-off-by: Avichal Agarwal <avichal.a@samsung.com>
Signed-off-by: Mayank Haarit <mayank.h@samsung.com>
8 years agoD-Bus: Add WPS model name as property
Avichal Agarwal [Wed, 21 Dec 2016 12:24:22 +0000 (17:54 +0530)] 
D-Bus: Add WPS model name as property

Signed-off-by: Avichal Agarwal <avichal.a@samsung.com>
Signed-off-by: Kyeong-Chae Lim <kcya.lim@samsung.com>
8 years agoD-Bus: Add WPS manufacturer as property
Avichal Agarwal [Wed, 21 Dec 2016 12:24:21 +0000 (17:54 +0530)] 
D-Bus: Add WPS manufacturer as property

Signed-off-by: Avichal Agarwal <avichal.a@samsung.com>
Signed-off-by: Kyeong-Chae Lim <kcya.lim@samsung.com>
Signed-off-by: Mayank Haarit <mayank.h@samsung.com>
8 years agoD-Bus: Add WPS device name as property
Avichal Agarwal [Wed, 21 Dec 2016 12:24:20 +0000 (17:54 +0530)] 
D-Bus: Add WPS device name as property

Signed-off-by: Avichal Agarwal <avichal.a@samsung.com>
Signed-off-by: Kyeong-Chae Lim <kcya.lim@samsung.com>
Signed-off-by: Mayank Haarit <mayank.h@samsung.com>
8 years agotests: Check MESH flag in BSS output in wpas_mesh_mode_scan
Jouni Malinen [Thu, 22 Dec 2016 12:17:48 +0000 (14:17 +0200)] 
tests: Check MESH flag in BSS output in wpas_mesh_mode_scan

In addition, use a single channel scan to make the test case run faster.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agomesh: Show [MESH] flag in print_bss_info()
Sunil Dutt [Fri, 16 Dec 2016 12:50:15 +0000 (18:20 +0530)] 
mesh: Show [MESH] flag in print_bss_info()

This was previously done for SCAN_RESULTS, but the BSS control interface
command did not show a similar flag. In addition, change "WPA2" to "RSN"
for mesh BSS to be consistent with the SCAN_RESULTS output.

Commit 638d945679649da579c4ed734d4ebae87e2307de ('mesh: Show [MESH] flag
in scan results') did similar changes for SCAN_RESULTS.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agohostapd_cli: Add completion for get command
Mikael Kanstrup [Wed, 21 Dec 2016 10:27:20 +0000 (11:27 +0100)] 
hostapd_cli: Add completion for get command

Add command completion support for get command.

Signed-off-by: Mikael Kanstrup <mikael.kanstrup@sonymobile.com>
8 years agohostapd_cli: Add completion for set command
Mikael Kanstrup [Wed, 21 Dec 2016 10:27:19 +0000 (11:27 +0100)] 
hostapd_cli: Add completion for set command

Add command completion support for set command.

Signed-off-by: Mikael Kanstrup <mikael.kanstrup@sonymobile.com>
8 years agohostapd_cli: Completion for further commands with STA parameter
Mikael Kanstrup [Wed, 21 Dec 2016 10:27:18 +0000 (11:27 +0100)] 
hostapd_cli: Completion for further commands with STA parameter

Yet some more commands take STA address as the only parameter. Add
command completion support for the following commands:

signature, sa_query, send_qos_map_conf and req_lci

Signed-off-by: Mikael Kanstrup <mikael.kanstrup@sonymobile.com>
8 years agohostapd_cli: Use common completion for commands that use stations
Mikael Kanstrup [Wed, 21 Dec 2016 10:27:17 +0000 (11:27 +0100)] 
hostapd_cli: Use common completion for commands that use stations

More than one command takes STA address as the only parameter. Make use
of a common completion routine.

Signed-off-by: Mikael Kanstrup <mikael.kanstrup@sonymobile.com>
8 years agohostapd_cli: Add missing command help descriptions
Mikael Kanstrup [Wed, 21 Dec 2016 10:27:16 +0000 (11:27 +0100)] 
hostapd_cli: Add missing command help descriptions

Some commands are missing help description making them not show up in
the list of supported commands. Add command help description for all
missing commands.

Signed-off-by: Mikael Kanstrup <mikael.kanstrup@sonymobile.com>
8 years agoFix wpa_cipher_to_alg() return type
Joel Cunningham [Mon, 19 Dec 2016 22:34:24 +0000 (16:34 -0600)] 
Fix wpa_cipher_to_alg() return type

wpa_cipher_to_alg() returns enumerated values from enum wpa_alg and all
uses of the return value treat it as enum wpa_alg (by either assigning
it to a variable of type enum wpa_alg or passing to a function that
expects enum wpa_alg).

This commit updates the return value to match the expected usage
(enum  wpa_alg) rather than int. This ensures the return value is
of the proper type and eliminates the following compiler warnings:

ARM RVCT (2.2):
  'Warning: #188-D: enumerated type mixed with another type'

Signed-off-by: Joel Cunningham <joel.cunningham@me.com>
8 years agotests: wpa_supplicant BSS CURRENT command
Jouni Malinen [Wed, 21 Dec 2016 10:46:14 +0000 (12:46 +0200)] 
tests: wpa_supplicant BSS CURRENT command

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agowpa_supplicant: Add BSS CURRENT control interface command
Joel Cunningham [Mon, 19 Dec 2016 20:22:53 +0000 (14:22 -0600)] 
wpa_supplicant: Add BSS CURRENT control interface command

This commit extends the BSS commands to include "BSS CURRENT" as a way
to get the current BSS without having to walk the BSS list matching
against BSSID+SSID returned from the STATUS command.

This returns the BSS stored in wpa_s->current_bss.

Signed-off-by: Joel Cunningham <joel.cunningham@me.com>
8 years agotests: Skip eap_tls_pkcs8_pkcs5_v15 with BoringSSL
Jouni Malinen [Wed, 21 Dec 2016 10:31:20 +0000 (12:31 +0200)] 
tests: Skip eap_tls_pkcs8_pkcs5_v15 with BoringSSL

It does not look like BoringSSL allows pbeWithMD5AndDES-CBC to be used
to protect the local private key, so skip this test case.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoOpenSSL: Make sure local certificate auto chaining is enabled
Jouni Malinen [Wed, 21 Dec 2016 10:23:15 +0000 (12:23 +0200)] 
OpenSSL: Make sure local certificate auto chaining is enabled

Number of deployed use cases assume the default OpenSSL behavior of auto
chaining the local certificate is in use. BoringSSL removed this
functionality by default, so we need to restore it here to avoid
breaking existing use cases.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoOpenSSL: Remove SSL_{CTX_,}_clear_options ifdefs
Jouni Malinen [Wed, 21 Dec 2016 10:06:21 +0000 (12:06 +0200)] 
OpenSSL: Remove SSL_{CTX_,}_clear_options ifdefs

This simplifies the implementation since the SSL_clear_options() and
SSL_CTX_clear_options() are available in all supported versions of
OpenSSL. These were previously needed with older (now obsolete) versions
of OpenSSL, but the ifdefs were missed when removing the more explicit
version macro based backwards compatibility sections.

In practice, this reverts commit
d53d2596e4919bc2f7b6acfa6a9a9baba1d68360.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: P2P service discovery restarted immediately
Jouni Malinen [Tue, 20 Dec 2016 22:19:27 +0000 (00:19 +0200)] 
tests: P2P service discovery restarted immediately

This test case verifies that SD Response frame does not block the
following remain-on-channel operation unnecessarily long.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoP2P: Do not use wait_time for SD Response TX without fragmentation
Jouni Malinen [Tue, 20 Dec 2016 22:18:03 +0000 (00:18 +0200)] 
P2P: Do not use wait_time for SD Response TX without fragmentation

The full SD Response frame is not going to be followed by another Action
frame from the peer, so remove the 200 ms wait time from the offchannel
TX command in that case. This avoids leaving a 200 ms lock on the radio
to remain on the channel unnecessarily.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoFix race condition between AssocResp callback and 4addr event
Jouni Malinen [Mon, 19 Dec 2016 23:30:09 +0000 (01:30 +0200)] 
Fix race condition between AssocResp callback and 4addr event

It is apparently possible for the NL80211_CMD_UNEXPECTED_4ADDR_FRAME
event to be delivered to hostapd before the NL80211_CMD_FRAME_TX_STATUS
event for (Re)Association Response frame. This resulted in the 4-address
WDS mode not getting enabled for a STA. This could occur in particular
when operating under heavy load and the STA is reconnecting to the same
AP in a sequence where Deauthentication frame is followed immediately by
Authentication frame and the driver event processing gets delayed due to
removal of the previous netdev taking time in the middle of this
sequence.

Fix this by recording a pending item for 4-address WDS enabling if the
NL80211_CMD_UNEXPECTED_4ADDR_FRAME event would have been dropped due to
incompleted association and then process this pending item if the TX
status for the (Re)Association Response frame is received and it shows
that the frame was acknowledged.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: Disable HT in ap_wds_sta_wep
Jouni Malinen [Mon, 19 Dec 2016 20:47:07 +0000 (22:47 +0200)] 
tests: Disable HT in ap_wds_sta_wep

HT cannot be used with WEP-only network, so don't try to do that here.
This get rids of some unnecessary Beacon frame updates during
disassociation/association and can make the test case a bit more robust.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoeap_proxy: Add support for SIM state change indication from eap_proxy
Purushottam Kushwaha [Tue, 13 Dec 2016 13:00:21 +0000 (18:30 +0530)] 
eap_proxy: Add support for SIM state change indication from eap_proxy

This registers a new callback to indicate change in SIM state. This
helps to do some clean up (more specifically pmksa_flush) based on the
state change of the SIM. Without this, the reconnection using the cached
PMKSA could happen though the SIM is changed.

Currently eap_proxy_sim_state corresponds to only SIM_STATE_ERROR. This
can be further extended.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoeap_proxy: Fix eap_proxy_init() prototype to use const eapol_cb
Jouni Malinen [Mon, 19 Dec 2016 20:14:07 +0000 (22:14 +0200)] 
eap_proxy: Fix eap_proxy_init() prototype to use const eapol_cb

The eapol_cb structure was made const and that change resulted in a
compilation warning/error if CONFIG_EAP_PROXY=<name> is enabled in the
wpa_supplicant build configuration. Fix this by updating the function
prototype to match the change.

Note: This results in a change needed to external eap_proxy_*.c
implementations to match the change.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: WPS ER enrolling a new device to a configured AP
Jouni Malinen [Mon, 19 Dec 2016 15:44:51 +0000 (17:44 +0200)] 
tests: WPS ER enrolling a new device to a configured AP

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: D-Bus P2P discovery on a specific non-social channel
Jouni Malinen [Mon, 19 Dec 2016 11:18:05 +0000 (13:18 +0200)] 
tests: D-Bus P2P discovery on a specific non-social channel

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoD-Bus: Add 'freq' option to P2P Find method to specify starting channel
Amit Purwar [Mon, 19 Dec 2016 10:12:30 +0000 (15:42 +0530)] 
D-Bus: Add 'freq' option to P2P Find method to specify starting channel

This allows user to start P2P Find/Scan on a particular frequency and
then move to scanning social channels. This support is already present
on control socket.

Signed-off-by: Amit Purwar <amit.purwar@samsung.com>
8 years agotests: RSN AP and PeerKey between two STAs with sniffer check
Jouni Malinen [Sun, 18 Dec 2016 18:28:10 +0000 (20:28 +0200)] 
tests: RSN AP and PeerKey between two STAs with sniffer check

The previous PeerKey test cases did not actually verify in any way that
the SMK and STK exchanges were completed since mac80211 does not support
setting the key from STK. Use a sniffer check to confirm that the
exchanges complete to avoid PeerKey regressions like the ones fixed in
the last couple of commits.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoPeerKey: Fix STK 4-way handshake regression
Jouni Malinen [Sun, 18 Dec 2016 17:56:05 +0000 (19:56 +0200)] 
PeerKey: Fix STK 4-way handshake regression

Commit c93b7e18885b07bf198e230019185b50ed622d9f ('RSN: Check result of
EAPOL-Key frame send request') forgot to update two PeerKey users of
EAPOL-Key TX functions. That resulted in STK handshake failing since
message 2/4 and 4/4 TX calls were assumed to have failed when the return
value was changed from 0 to a positive value for success case. This
resulted in not updating nonce information properly and hitting
following error when processing STK 4-way handshake message 3/4:

RSN: INonce from message 1 of STK 4-Way Handshake differs from 3 of STK
4-Way Handshake - drop packet (src=<addr>)

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoPeerKey: Fix EAPOL-Key processing
Jouni Malinen [Sun, 18 Dec 2016 17:07:29 +0000 (19:07 +0200)] 
PeerKey: Fix EAPOL-Key processing

Commit 6d014ffc6e654e7e802263c55ce568df153a1e1c ('Make struct
wpa_eapol_key easier to use with variable length MIC') forgot to update
number of EAPOL-Key processing steps for SMK and STK exchanges and broke
PeerKey. Fix this by updating the Key Data field pointers to match the
new style with variable length Key MIC field.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoAndroid: Add p2p_add_cli_chan=1 option
Mikael Kanstrup [Tue, 6 Dec 2016 07:26:50 +0000 (16:26 +0900)] 
Android: Add p2p_add_cli_chan=1 option

Add p2p_add_cli_chan=1 option to p2p_supplicant.conf to allow Wi-Fi P2P
operating as P2P client on passive scan channels.

In addition, add p2p_add_cli_chan=1 option to wpa_supplicant.conf to
have consistency in P2P channel list. There is a case where P2P channel
list is updated with different channels from p2p0 and wlan0.

Signed-off-by: Tomoharu Hatano <tomoharu.hatano@sonymobile.com>
8 years agoPAE: Make KaY specific details available via control interface
Badrish Adiga H R [Thu, 15 Dec 2016 20:10:53 +0000 (01:40 +0530)] 
PAE: Make KaY specific details available via control interface

Add KaY details to the STATUS command output.

Signed-off-by: Badrish Adiga H R <badrish.adigahr@hpe.com>
8 years agotests: mac80211 and unknown Action frame rejection in STA mode
Jouni Malinen [Sun, 18 Dec 2016 10:23:02 +0000 (12:23 +0200)] 
tests: mac80211 and unknown Action frame rejection in STA mode

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Verify hostapd mgmt_tx() success
Jouni Malinen [Sun, 18 Dec 2016 10:22:13 +0000 (12:22 +0200)] 
tests: Verify hostapd mgmt_tx() success

Raise an exception if MGMT_TX command to hostapd fails. Previously, such
errors were ignored silently.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Update gas_anqp_capab_list and gas_anqp_extra_elements
Jouni Malinen [Sun, 18 Dec 2016 11:01:05 +0000 (13:01 +0200)] 
tests: Update gas_anqp_capab_list and gas_anqp_extra_elements

The FILS ANQP-element changes made couple of the generic ANQP test steps
fail. Update this to ignore the special FILS cases.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: FILS SK and multiple realms
Jouni Malinen [Sat, 17 Dec 2016 15:26:21 +0000 (17:26 +0200)] 
tests: FILS SK and multiple realms

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoFILS: Make FILS Indication element information available in BSS output
Jouni Malinen [Sat, 17 Dec 2016 20:45:32 +0000 (22:45 +0200)] 
FILS: Make FILS Indication element information available in BSS output

This extends wpa_supplicant BSS command to parse FILS Indication
element.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoFILS: Add support for building FILS Realm Information ANQP-element
Jouni Malinen [Sat, 17 Dec 2016 20:02:06 +0000 (22:02 +0200)] 
FILS: Add support for building FILS Realm Information ANQP-element

This allows full list of hashed realm names to be fetched from hostapd.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoFILS: Add Realm Information ANQP-element in BSS data
Jouni Malinen [Sat, 17 Dec 2016 20:01:02 +0000 (22:01 +0200)] 
FILS: Add Realm Information ANQP-element in BSS data

Add a named BSS command output entry for FILS Realm Information
ANQP-element (anqp_fils_realm_info).

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Add fils_realm for existing FILS test cases
Jouni Malinen [Sat, 17 Dec 2016 15:20:32 +0000 (17:20 +0200)] 
tests: Add fils_realm for existing FILS test cases

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoFILS: Separate FILS realm configuration from ERP domain
Jouni Malinen [Sat, 17 Dec 2016 15:19:34 +0000 (17:19 +0200)] 
FILS: Separate FILS realm configuration from ERP domain

The new hostapd configuration parameter fils_realm=<realm> can now be
used to configure one or more FILS realms to advertise for ERP domains
when using FILS. This replaces the use of erp_domain=<domain> parameter
for the FILS use case.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoFILS: Fix hashed realm name derivation
Jouni Malinen [Sat, 17 Dec 2016 19:59:40 +0000 (21:59 +0200)] 
FILS: Fix hashed realm name derivation

P802.11ai/D7.0 changed from CRC32 to SHA256 as the hash algorithm for
the FILS realm name. Update the implementation to match that change.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoUpdate various definitions based on IEEE Std 802.11-2016
Jouni Malinen [Sat, 17 Dec 2016 10:27:49 +0000 (12:27 +0200)] 
Update various definitions based on IEEE Std 802.11-2016

This updates definitions for Status Codes, Reason Codes,
Information Element IDs, Action frame categories, Public Action
codes, Protected Dual of Public Action codes, Advertisement
Protocol ID, and ANQP info IDs based on IEEE Std 802.11-2016.

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