mech_eap.git
9 years agonl80211: Fix no-encrypt for IEEE 802.1X WEP EAPOL
Jouni Malinen [Sat, 20 Dec 2014 15:35:03 +0000 (17:35 +0200)]
nl80211: Fix no-encrypt for IEEE 802.1X WEP EAPOL

Commit 9f12614b8cad55e5ec0a50e04d9d3e090df666fd ('nl80211: Do not
encrypt IEEE 802.1X WEP EAPOL') tried to use
NL80211_ATTR_CONTROL_PORT_NO_ENCRYPT to disable encryption of EAPOL
frames for WEP IEEE 802.1X. However, it used incorrect key management
suite (IEEE 802.1X with WPA/WPA2 while the non-WPA version is needed
here). Consequently, the no-encrypt flag was never set to the driver
(WPA/WPA2 cases do not meet the WEP as pairwise criteria).

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: cfg80211 scan-for-auth workaround with WEP keys
Jouni Malinen [Sat, 20 Dec 2014 15:28:53 +0000 (17:28 +0200)]
tests: cfg80211 scan-for-auth workaround with WEP keys

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: cfg80211 scan-for-auth workaround failing
Jouni Malinen [Sat, 20 Dec 2014 15:22:18 +0000 (17:22 +0200)]
tests: cfg80211 scan-for-auth workaround failing

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: Large number of BSS add operations with hostapd
Jouni Malinen [Sat, 20 Dec 2014 15:13:00 +0000 (17:13 +0200)]
tests: Large number of BSS add operations with hostapd

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: rfkill block prior to wpa_supplicant start
Jouni Malinen [Sat, 20 Dec 2014 14:46:39 +0000 (16:46 +0200)]
tests: rfkill block prior to wpa_supplicant start

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agonl80211: Remove send_and_recv_msgs_global() wrapper
Jouni Malinen [Sat, 20 Dec 2014 13:45:28 +0000 (15:45 +0200)]
nl80211: Remove send_and_recv_msgs_global() wrapper

There was only a single user for this and calling send_and_recv()
directly is as simple as using this wrapper.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agonl80211: Remove unnecessary function declarations
Jouni Malinen [Sat, 20 Dec 2014 13:37:16 +0000 (15:37 +0200)]
nl80211: Remove unnecessary function declarations

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: Radar detection on non-HT and on HT40- channels
Jouni Malinen [Sat, 20 Dec 2014 11:50:19 +0000 (13:50 +0200)]
tests: Radar detection on non-HT and on HT40- channels

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: Report ROAM failure in pmksa_cache_opportunistic_multiple_sta
Jouni Malinen [Sat, 20 Dec 2014 11:37:08 +0000 (13:37 +0200)]
tests: Report ROAM failure in pmksa_cache_opportunistic_multiple_sta

There is no need to wait for the timeout if the ROAM command itself
failed. This could happen if an earlier test case had left hidden SSIDs
in the cfg80211 BSS table.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: Clear cfg80211 scan results after wext_hidden
Jouni Malinen [Sat, 20 Dec 2014 11:36:01 +0000 (13:36 +0200)]
tests: Clear cfg80211 scan results after wext_hidden

Leaving hidden SSIDs in the cfg80211 BSS table can result in errors in
the following test cases, so use special care to clear all BSS entries
at the end of the wext_hidden test case.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: Add wait_connected() and wait_disconnected() helpers
Jouni Malinen [Sat, 20 Dec 2014 09:51:30 +0000 (11:51 +0200)]
tests: Add wait_connected() and wait_disconnected() helpers

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: Add --codecov support to parallel-vm.py
Jouni Malinen [Fri, 19 Dec 2014 22:51:55 +0000 (00:51 +0200)]
tests: Add --codecov support to parallel-vm.py

This allows code coverage report to be generated must faster with the
help of parallel VMs executing test cases.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: Connection with large number of scan_ssid=1 network blocks
Jouni Malinen [Fri, 19 Dec 2014 21:30:58 +0000 (23:30 +0200)]
tests: Connection with large number of scan_ssid=1 network blocks

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: P2P_LISTEN and scan
Jouni Malinen [Fri, 19 Dec 2014 21:17:06 +0000 (23:17 +0200)]
tests: P2P_LISTEN and scan

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: setband and scans
Jouni Malinen [Fri, 19 Dec 2014 21:08:10 +0000 (23:08 +0200)]
tests: setband and scans

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agoAdd possibility to set the setband parameter
Jouni Malinen [Fri, 19 Dec 2014 20:56:41 +0000 (22:56 +0200)]
Add possibility to set the setband parameter

Commit faf9a8585d3e187074c7991e1cd7fb3792baf53e added mechanism for
selecting 2.4 or 5 GHz band for scan operation. However, no mechanism
for setting the setband value was added at that time. This commit adds a
new SET ctrl_iface parameter to allow the setband functionality to be
used. "SET setband <AUTO/5G/2G>" can be used to select all bands, 5 GHz
band only, or 2.4 GHz band only.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: Additional coverage for filter_ssids=1
Jouni Malinen [Fri, 19 Dec 2014 18:26:07 +0000 (20:26 +0200)]
tests: Additional coverage for filter_ssids=1

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: AP_SCAN 2 operation
Jouni Malinen [Fri, 19 Dec 2014 18:08:58 +0000 (20:08 +0200)]
tests: AP_SCAN 2 operation

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agoDo not trigger the scan during initialization on Android platforms
Sunil Dutt [Wed, 17 Dec 2014 07:17:10 +0000 (12:47 +0530)]
Do not trigger the scan during initialization on Android platforms

Android framework maintains a state to process the scan results after
the scan is issued. If wpa_supplicant issues the scan during the
initialization, the one issued by the framework may fail (with EBUSY) if
the host driver is already processing the scan. Thus, the scan results
returned for the first scan triggered by wpa_supplicant are not
processed for getting displayed resulting in delay for the display of
the first scan results after the Wi-Fi subsystem initialization. Thus,
trigger the scan only based on the framework request on Android.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agotests: SCAN requests while in non-scan radio work
Jouni Malinen [Fri, 12 Dec 2014 10:07:09 +0000 (12:07 +0200)]
tests: SCAN requests while in non-scan radio work

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agoReject new SCAN commands if there is a pending request
Jouni Malinen [Fri, 12 Dec 2014 10:11:14 +0000 (12:11 +0200)]
Reject new SCAN commands if there is a pending request

FAIL-BUSY was already returned for the case where a scan had been
started, but with the radio work design, it would have been possible to
schedule multiple scan requests if a non-scan radio work was in
progress. Multiple back-to-back scans are not usually very helpful, so
reject this type of cases where the SCAN command would be used to build
such a sequence.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agohostapd: Make install path configurable
Prashanth Bhatta [Fri, 6 Sep 2013 17:05:40 +0000 (10:05 -0700)]
hostapd: Make install path configurable

Makefile always installs to /usr/local/bin and on some platforms,
/usr/local/bin is not in default search path. Modify the Makefile such
that bin path can be configurable so that build system can pass
appropriate path for installation. If bin path is not specified then by
default binaries are installed in /usr/local/bin.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agotests: P2P_LISTEN behavior with offchannel TX
Jouni Malinen [Thu, 18 Dec 2014 13:42:21 +0000 (15:42 +0200)]
tests: P2P_LISTEN behavior with offchannel TX

This verifies that offchannel TX (PD in this specific case) does not
stop ongoing long P2P_LISTEN operation.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agoP2P: Avoid truncation of long listen operation due to offchan tx
Jithu Jance [Wed, 20 Aug 2014 16:25:06 +0000 (21:55 +0530)]
P2P: Avoid truncation of long listen operation due to offchan tx

On receiving the cancel remain on channel event, the pending_tx
is scheduled immediately and returned. This was preventing
the wpas_p2p_listen_start function from execution thereby resulting
in termination of the long listen operation.

Signed-off-by: Jithu Jance <jithu@broadcom.com>
9 years agotests: Fix proxyarp_open IPv4-from-bridge
Jouni Malinen [Tue, 16 Dec 2014 22:41:18 +0000 (00:41 +0200)]
tests: Fix proxyarp_open IPv4-from-bridge

There were couple of typos in the IP addresses and there was no coverage
for the normal unicast ARP response from the bridge (since non-wireless
device does not get proxied by the AP). In addition, it is better to
change the IP address used here to be unique to make the sniffer logs
easier to interpret.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: Use send_ns() helper for the earlier proxyarp_open NS packets
Jouni Malinen [Tue, 16 Dec 2014 22:06:50 +0000 (00:06 +0200)]
tests: Use send_ns() helper for the earlier proxyarp_open NS packets

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agotests: Add traffic test to proxyarp_open
Jouni Malinen [Tue, 16 Dec 2014 21:46:19 +0000 (23:46 +0200)]
tests: Add traffic test to proxyarp_open

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agotests: ProxyARP behavior with IPv6 frames
Jouni Malinen [Mon, 15 Dec 2014 20:54:21 +0000 (22:54 +0200)]
tests: ProxyARP behavior with IPv6 frames

This adds transmission of number of NS/NA frames to test ProxyARP
behavior. The actual validation of the AP behavior is still manual,
i.e., a separate inspectation of the capture files is needed.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agotests: Add ebtables rules for ProxyARP
Jouni Malinen [Mon, 15 Dec 2014 22:41:52 +0000 (00:41 +0200)]
tests: Add ebtables rules for ProxyARP

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agotests: Use non-promiscuous mode and packet-buffered tcpdump capture
Jouni Malinen [Tue, 16 Dec 2014 21:44:52 +0000 (23:44 +0200)]
tests: Use non-promiscuous mode and packet-buffered tcpdump capture

This helps in avoiding truncated capture files in the proxyarp_open test
case.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agotests: Dump monitor messages before hwsim_utils test
Jouni Malinen [Tue, 16 Dec 2014 21:42:38 +0000 (23:42 +0200)]
tests: Dump monitor messages before hwsim_utils test

This may be needed in some corner cases where broadcast frames with two
associated stations are received by both devices.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agotests: Fix wifi_display_persistent_group event checks
Jouni Malinen [Thu, 18 Dec 2014 14:18:54 +0000 (16:18 +0200)]
tests: Fix wifi_display_persistent_group event checks

The final invitation case in this test was verified incorrectly. The GO
was already operatign in that case, so there was not supposed to be a
new P2P-GROUP-STARTED message from GO. That happened to be show up in
the pending event messages from the last instance, but that was just by
accident and any additional dump_monitor() operation added here would
cause this test to fail. Fix this by handling the final invitation
separately and verifying that only the client side indicates
P2P-GROUP-STARTED.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agotests: Allow dump_monitor() to be used without global monitor interface
Jouni Malinen [Thu, 18 Dec 2014 14:00:25 +0000 (16:00 +0200)]
tests: Allow dump_monitor() to be used without global monitor interface

It is possible for WpaSupplicant instance to be used without the global
control socket, so allow dump_monitor() to handle this case cleanly.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agotests: Try to clear scan results after regulatory domain changes
Jouni Malinen [Sun, 14 Dec 2014 23:32:01 +0000 (01:32 +0200)]
tests: Try to clear scan results after regulatory domain changes

It was possible for regulatory domain changes to "leak" into following
test cases in number of cases where the cfg80211 BSS table remained
after regulatory domain had been restored to world roaming. Try to make
this less likely to occur by explicitly clearing BSS table at the end of
test cases that use different regulatory domain. This makes P2P test
cases that verify channel selection based on world roaming rules more
robust.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: Make flush_scan_cache() more robust
Jouni Malinen [Sun, 14 Dec 2014 23:13:03 +0000 (01:13 +0200)]
tests: Make flush_scan_cache() more robust

It was possible for BSS entries on the scanned channel (2412 MHz) to be
left behind after flush_scan_cache() call. Use a less likely channel
2417 MHz as the default channel to scan. This will hopefully get rid of
most problematic BSS entries from previous test cases. For example,
ap_hs20_oen followed by ap_hs20_random_mac could fail due to
INTERWORKING_CONNECT seeing non-RSN scan result from the previous test
case.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agoDo not allow network block scan_freq override SCAN command frequencies
Jouni Malinen [Sun, 14 Dec 2014 22:55:56 +0000 (00:55 +0200)]
Do not allow network block scan_freq override SCAN command frequencies

The manual scan operations with the SCAN command are supposed to have
independent set of scan frequencies, so do not allow scan_freq
parameters to override scanned frequencies for scans that were triggered
with a SCAN command.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agoSAE: Check Status Code in Authentication frames
Jouni Malinen [Sun, 14 Dec 2014 21:52:02 +0000 (23:52 +0200)]
SAE: Check Status Code in Authentication frames

While other authentication algorithms mark Status Code as being Reserved
in the case of the transaction number 1, SAE does not. Check that the
Status Code indicates success before creating SAE state. In addition,
fix the mesh anti-clogging token request parsing on big endian CPUs.

Transaction number 2 (confirm) can also have non-zero Status Code to
report an error. Those should be processed, but not replied to with yet
another error message. This could happen in mesh case. Avoid a loop of
error messages by dropping the non-success case without additional
response.

In addition, don't reply to unknown transaction numbers if the status
code is non-zero. This avoids a loop of error messages if an invalid
frame where to be injected (or unlikely corruption were to occur).

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: Use helper function for adding open mesh network
Jouni Malinen [Sun, 14 Dec 2014 21:34:43 +0000 (23:34 +0200)]
tests: Use helper function for adding open mesh network

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: Mesh with dynamic interface
Jouni Malinen [Sun, 14 Dec 2014 21:28:36 +0000 (23:28 +0200)]
tests: Mesh with dynamic interface

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agomesh: Add mesh interface creation command for mesh gate
Masashi Honma [Sat, 15 Nov 2014 01:35:23 +0000 (10:35 +0900)]
mesh: Add mesh interface creation command for mesh gate

The mesh gate is used to bridge (or route) between mesh network and
another network. For example, mesh gate acts as router between mesh
network and IEEE 802.11 BSS network.

This command makes a virtual mesh interface to be used for mesh gate.

This command expects to be used like this.

wpa_cli -i wlan0 MESH_INTERFACE_ADD ifname=mesh0
wpa_cli -i mesh0 add_network
wpa_cli -i mesh0 set_network 0 ssid '"commell_2X_mmm"'
wpa_cli -i mesh0 set_network 0 mode 5
wpa_cli -i mesh0 set_network 0 frequency 2412
wpa_cli -i mesh0 set_network 0 key_mgmt SAE
wpa_cli -i mesh0 set_network 0 psk '"01234567"'
wpa_cli -i mesh0 mesh_group_add 0
wpa_cli -i wlan0 mesh_group_remove mesh0

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
9 years agoSAE: Add sae_group to AP/mesh mode STA ctrl_iface data
Jouni Malinen [Sun, 14 Dec 2014 18:13:22 +0000 (20:13 +0200)]
SAE: Add sae_group to AP/mesh mode STA ctrl_iface data

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agoExtend wpa_supplicant STA* ctrl_iface commands for mesh
Jouni Malinen [Sun, 14 Dec 2014 18:03:54 +0000 (20:03 +0200)]
Extend wpa_supplicant STA* ctrl_iface commands for mesh

Since mesh functionality uses struct hostapd_data to maintain peer
state, the existing STA* control interface commands can be used to
display information about the peers.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: Make pmksa_cache_opportunistic_connect more robust
Jouni Malinen [Sun, 14 Dec 2014 17:15:48 +0000 (19:15 +0200)]
tests: Make pmksa_cache_opportunistic_connect more robust

Use scan_for_bss() instead of scan(freq) to avoid false positives due to
active scan failing under heavy load.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agoRemove unused find_first_bit()
Jouni Malinen [Sun, 14 Dec 2014 17:01:25 +0000 (19:01 +0200)]
Remove unused find_first_bit()

This was used only for the VHT capability checks for determining bit
offset for right shift. That was replaced with a constant defines since
there is no need to calculate this at runtime.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agoClean up VHT configuration validation
Jouni Malinen [Sun, 14 Dec 2014 17:00:38 +0000 (19:00 +0200)]
Clean up VHT configuration validation

There is no need to use runtime call to find_first_bit() to determine
shift amount for a constant integer.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agoClean up VHT override max A-MPDU override calculation
Jouni Malinen [Sun, 14 Dec 2014 16:44:10 +0000 (18:44 +0200)]
Clean up VHT override max A-MPDU override calculation

There is no need to use runtime call to find_first_bit() to determine
shift amount for a constant integer.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agoFix bashisms in wps-ap-cli script
Led [Sun, 14 Dec 2014 15:19:57 +0000 (17:19 +0200)]
Fix bashisms in wps-ap-cli script

Option '-p' of 'read' command may be unsupported in some POSIX-complete
shells. So replace 'read -p' with 'echo -n'/'read' pair.

Signed-off-by: Oleksandr Chumachenko <ledest@gmail.com>
9 years agowext: Fix musl build error
Jörg Krause [Wed, 3 Dec 2014 21:43:44 +0000 (22:43 +0100)]
wext: Fix musl build error

Building wpa_supplicant with the musl C library fails since musl does
not define type names such as '__uint32_t'. To support building
wpa_supplicant with the musl C library use the integer types declared in
the ISO C standard header file <stdint.h>.

Signed-off-by: Jörg Krause <jkrause@posteo.de>
9 years agonl80211: Report new station / assoc event for the correct BSS
Rafał Miłecki [Sat, 6 Dec 2014 15:06:35 +0000 (16:06 +0100)]
nl80211: Report new station / assoc event for the correct BSS

drv->ctx always points to the first BSS and we should report event using
BSS related to the interface we got NL80211_CMD_NEW_STATION from.
This fixes STA association for drivers using NL80211_CMD_NEW_STATION and
multiple virtual interfaces.

Before:
nl80211: Drv Event 19 (NL80211_CMD_NEW_STATION) received for wlan0-1 (ifindex:7)
nl80211: New station 02:00:00:00:01:00
wlan0: STA 02:00:00:00:01:00 IEEE 802.11: associated

After:
nl80211: Drv Event 19 (NL80211_CMD_NEW_STATION) received for wlan0-1 (ifindex:7)
nl80211: New station 02:00:00:00:01:00
wlan0-1: STA 02:00:00:00:01:00 IEEE 802.11: associated

This is not applicable to the cases where authentication (AP SME & MLME)
is in hostapd and hostapd_assoc_cb() instead of hostapd_notif_assoc()
handles BSS selection.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
9 years agowpa_gui: Quiet mode - disable tray icon messages
Arkadiusz (Arkq) Bokowy [Sat, 6 Dec 2014 16:05:09 +0000 (17:05 +0100)]
wpa_gui: Quiet mode - disable tray icon messages

If tray icon messages are perceived as disturbing, one can pass `-q`
parameter on the command line to disable them permanently.

Signed-off-by: Arkadiusz Bokowy <arkadiusz.bokowy@gmail.com>
9 years agowpa_gui: More informative tray icon tool tip message
Arkadiusz (Arkq) Bokowy [Sat, 6 Dec 2014 16:02:18 +0000 (17:02 +0100)]
wpa_gui: More informative tray icon tool tip message

Show associated network SSID in the tool tip message of the
application's tray icon. When network is not associated, then simple
"(not-associated)" message is shown.

Signed-off-by: Arkadiusz Bokowy <arkadiusz.bokowy@gmail.com>
9 years agotests: SAE with missing password
Jouni Malinen [Sun, 14 Dec 2014 14:50:05 +0000 (16:50 +0200)]
tests: SAE with missing password

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agoSAE: Report connection failure if SME cannot build auth frame
Jouni Malinen [Sun, 14 Dec 2014 14:48:38 +0000 (16:48 +0200)]
SAE: Report connection failure if SME cannot build auth frame

Instead of just stopping connection process and network discovery,
report SAE failures to build Authentication frames (e.g., due to missing
password) as a connection failure to get the normal retry mechanism into
use.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: ERP when server has dropped the keys
Jouni Malinen [Sun, 14 Dec 2014 11:52:33 +0000 (13:52 +0200)]
tests: ERP when server has dropped the keys

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agoERP: Drop ERP keys on failure on the peer
Jouni Malinen [Sun, 14 Dec 2014 11:51:55 +0000 (13:51 +0200)]
ERP: Drop ERP keys on failure on the peer

This allows recovery through fallback to full EAP authentication if the
server rejects us, e.g., due to having dropped ERP state.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agoERP: Add ERP_FLUSH for hostapd
Jouni Malinen [Sun, 14 Dec 2014 11:31:12 +0000 (13:31 +0200)]
ERP: Add ERP_FLUSH for hostapd

This can be used to drop any pending ERP key from both the internal AP
authentication server and RADIUS server use of hostapd.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: P2P_PRESENCE_REQ on group interface
Jouni Malinen [Sun, 14 Dec 2014 11:16:05 +0000 (13:16 +0200)]
tests: P2P_PRESENCE_REQ on group interface

This ends up using the special offchannel.c code path where a different
interface is selected for TX. In addition, the P2P-PRESENCE-RESPONSE
event is verified to be delivered on the group interface.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agooffchannel: Use wpas_get_tx_interface() src parameter more consistently
Jouni Malinen [Sun, 14 Dec 2014 11:06:41 +0000 (13:06 +0200)]
offchannel: Use wpas_get_tx_interface() src parameter more consistently

Both the wpa_s->pending_action_src and src argument to
wpas_get_tx_interface() were used somewhat randomly. Make this more
consistent since these values are pointing to the same address and the
implementation is easier to understand when it is obvious that there is
only one address being used.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: Mesh and missing SAE password
Jouni Malinen [Sun, 14 Dec 2014 11:02:04 +0000 (13:02 +0200)]
tests: Mesh and missing SAE password

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: Mesh BSS data
Jouni Malinen [Sun, 14 Dec 2014 10:53:57 +0000 (12:53 +0200)]
tests: Mesh BSS data

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: Mesh sae_groups configuration
Jouni Malinen [Sun, 14 Dec 2014 10:48:30 +0000 (12:48 +0200)]
tests: Mesh sae_groups configuration

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: Extra coverage for command line arguments
Jouni Malinen [Sun, 14 Dec 2014 10:24:15 +0000 (12:24 +0200)]
tests: Extra coverage for command line arguments

The results for these are not currently verified, but this allows
--codecov runs to get more coverage for the command line argument
parsers.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: DEAUTHENTICATE/DISASSCIATE/CHAN_SWITCH error cases
Jouni Malinen [Sun, 14 Dec 2014 00:20:50 +0000 (02:20 +0200)]
tests: DEAUTHENTICATE/DISASSCIATE/CHAN_SWITCH error cases

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: Additional FETCH_OSU and CANCEL_FETCH_OSU coverage
Jouni Malinen [Sun, 14 Dec 2014 00:15:30 +0000 (02:15 +0200)]
tests: Additional FETCH_OSU and CANCEL_FETCH_OSU coverage

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agoHS 2.0: Allow CANCEL_FETCH_OSU to stop at scan completion
Jouni Malinen [Sun, 14 Dec 2014 00:14:29 +0000 (02:14 +0200)]
HS 2.0: Allow CANCEL_FETCH_OSU to stop at scan completion

There is no need to start the GAS/ANQP fetch if the FETCH_OSU operation
has already been canceled.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: STOP_FETCH_ANQP
Jouni Malinen [Sat, 13 Dec 2014 23:08:18 +0000 (01:08 +0200)]
tests: STOP_FETCH_ANQP

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: P2P_UNAUTHORIZE to unauthorize a peer
Jouni Malinen [Sat, 13 Dec 2014 23:01:56 +0000 (01:01 +0200)]
tests: P2P_UNAUTHORIZE to unauthorize a peer

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: Move 'SET pmf 0' from reset() to test cases
Jouni Malinen [Sat, 13 Dec 2014 22:46:46 +0000 (00:46 +0200)]
tests: Move 'SET pmf 0' from reset() to test cases

This avoids one more cleanup step between most test cases by clearing
the default PMF behavior change only in case it was actually modified
during a test.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: Move WPS_ER_STOP from reset() to test cases
Jouni Malinen [Sat, 13 Dec 2014 18:31:44 +0000 (20:31 +0200)]
tests: Move WPS_ER_STOP from reset() to test cases

This avoids one more cleanup step between most test cases by stopping ER
only in case it was actually used during a test.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: WPS_ER_PBC error cases
Jouni Malinen [Sat, 13 Dec 2014 18:19:41 +0000 (20:19 +0200)]
tests: WPS_ER_PBC error cases

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: WPS ER restart and stop
Jouni Malinen [Sat, 13 Dec 2014 17:51:03 +0000 (19:51 +0200)]
tests: WPS ER restart and stop

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agoWPS ER: Remove unnecessary return value
Jouni Malinen [Sat, 13 Dec 2014 17:50:16 +0000 (19:50 +0200)]
WPS ER: Remove unnecessary return value

wps_er_deinit() cannot fail and it does not return anything, so neither
should wpas_wps_er_stop().

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: wpa_supplicant AP mode and PBC session overlap
Jouni Malinen [Sat, 13 Dec 2014 17:41:26 +0000 (19:41 +0200)]
tests: wpa_supplicant AP mode and PBC session overlap

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: Additional coverage for miscellaneous ctrl_iface commands
Jouni Malinen [Sat, 13 Dec 2014 17:30:21 +0000 (19:30 +0200)]
tests: Additional coverage for miscellaneous ctrl_iface commands

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agoRemove unnecessary STA_AUTOCONNECT handler function
Jouni Malinen [Sat, 13 Dec 2014 17:27:41 +0000 (19:27 +0200)]
Remove unnecessary STA_AUTOCONNECT handler function

This function could not fail and it can be replaced with a single
line variable update that takes less code than the function call.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agoRemove unnecessary return value
Jouni Malinen [Sat, 13 Dec 2014 17:22:23 +0000 (19:22 +0200)]
Remove unnecessary return value

wpa_bss_flush*() cannot fail and as such, there is no need for
wpa_supplicant_ctrl_iface_bss_flush() to return a value either.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agoSimplify eapol_sm_get_mib() result handling
Jouni Malinen [Sat, 13 Dec 2014 17:15:38 +0000 (19:15 +0200)]
Simplify eapol_sm_get_mib() result handling

This function cannot return negative value, so no need to check for
that. If there is not enough room in the buffer or if something
unexpected happens, 0 is returned.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: Extend RRM neighbor request testing
Jouni Malinen [Fri, 12 Dec 2014 19:09:32 +0000 (21:09 +0200)]
tests: Extend RRM neighbor request testing

This uses a new testing mode in hostapd to allow RRM neighbor request
transmittion to be tested. For the second part of the test case to be
executed, mac80211_hwsim needs to be modified to claim support for the
required RRM capabilities (that change is not yet in Linux kernel).

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agonl80211: Add rrm_flags to STATUS-DRIVER
Jouni Malinen [Fri, 12 Dec 2014 19:09:11 +0000 (21:09 +0200)]
nl80211: Add rrm_flags to STATUS-DRIVER

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agoRRM: Add AP mode minimal advertisement support for testing
Jouni Malinen [Fri, 12 Dec 2014 18:45:31 +0000 (20:45 +0200)]
RRM: Add AP mode minimal advertisement support for testing

The new hostapd.conf radio_measurements parameter can now be used to
configure a test build to advertise support for radio measurements with
neighbor report enabled. There is no real functionality that would
actually process the request, i.e., this only for the purpose of minimal
STA side testing for now.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: Additional VENDOR_ELEM coverage
Jouni Malinen [Fri, 12 Dec 2014 18:12:24 +0000 (20:12 +0200)]
tests: Additional VENDOR_ELEM coverage

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: DATA_TEST_* error cases
Jouni Malinen [Fri, 12 Dec 2014 17:33:54 +0000 (19:33 +0200)]
tests: DATA_TEST_* error cases

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: EAPOL_RX failure cases
Jouni Malinen [Fri, 12 Dec 2014 17:16:34 +0000 (19:16 +0200)]
tests: EAPOL_RX failure cases

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: DRIVER_EVENT failure case
Jouni Malinen [Fri, 12 Dec 2014 17:08:24 +0000 (19:08 +0200)]
tests: DRIVER_EVENT failure case

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: Additional MGMT_TX coverage
Jouni Malinen [Fri, 12 Dec 2014 17:05:00 +0000 (19:05 +0200)]
tests: Additional MGMT_TX coverage

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: A single BSS with multiple key management options
Jouni Malinen [Fri, 12 Dec 2014 12:05:43 +0000 (14:05 +0200)]
tests: A single BSS with multiple key management options

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agoFix AP IE in EAPOL-Key 3/4 for WPA + FT combination
Jouni Malinen [Fri, 12 Dec 2014 12:03:36 +0000 (14:03 +0200)]
Fix AP IE in EAPOL-Key 3/4 for WPA + FT combination

Previously, only WPA + WPA2 was covered. If FT is enabled in addition to
WPA, MDIE is included in the buffer between RSN and WPA elements. The
previous version ended up leaving only the MDIE after having skipped RSN
element. Fix this to skip MDIE as well to leave only WPA IE regardless
of whether FT is enabled in AP configuration.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agoAdd text names for number of the key_mgmt values
Jouni Malinen [Fri, 12 Dec 2014 11:40:07 +0000 (13:40 +0200)]
Add text names for number of the key_mgmt values

This completes STATUS command key_mgmt output for the missing values,
like SAE.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agotests: SCAN error cases
Jouni Malinen [Thu, 11 Dec 2014 23:13:35 +0000 (01:13 +0200)]
tests: SCAN error cases

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agoFix SCAN control interface command error cases
Jouni Malinen [Thu, 11 Dec 2014 23:12:15 +0000 (01:12 +0200)]
Fix SCAN control interface command error cases

Update the scan parameters in wpa_s only in case the scan command is
going to be executed. In other words, do not change the parameters for
an ongoing scan (the SCAN command is rejected with FAIL-BUSY) or if any
of the parameters is invalid.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: RADIO_WORK error cases
Jouni Malinen [Thu, 11 Dec 2014 22:27:06 +0000 (00:27 +0200)]
tests: RADIO_WORK error cases

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: Invalid VENDOR command
Jouni Malinen [Thu, 11 Dec 2014 22:10:52 +0000 (00:10 +0200)]
tests: Invalid VENDOR command

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: SIGNAL_POLL in 160 and 80+80 MHz channels
Jouni Malinen [Thu, 11 Dec 2014 21:37:02 +0000 (23:37 +0200)]
tests: SIGNAL_POLL in 160 and 80+80 MHz channels

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: WNM_SLEEP error cases
Jouni Malinen [Thu, 11 Dec 2014 21:03:10 +0000 (23:03 +0200)]
tests: WNM_SLEEP error cases

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: AUTOSCAN reconfiguration while in SCANNING state
Jouni Malinen [Thu, 11 Dec 2014 20:57:36 +0000 (22:57 +0200)]
tests: AUTOSCAN reconfiguration while in SCANNING state

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: Additional HS20_ICON_REQUEST coverage
Jouni Malinen [Thu, 11 Dec 2014 14:14:24 +0000 (16:14 +0200)]
tests: Additional HS20_ICON_REQUEST coverage

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: Additional coverage for HS20_GET_NAI_HOME_REALM_LIST
Jouni Malinen [Thu, 11 Dec 2014 14:12:59 +0000 (16:12 +0200)]
tests: Additional coverage for HS20_GET_NAI_HOME_REALM_LIST

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agoRemove unused send_eapol() driver op
Jouni Malinen [Thu, 11 Dec 2014 13:40:07 +0000 (15:40 +0200)]
Remove unused send_eapol() driver op

The send_eapol() callback was used by driver_test.c, but with that
removed, there is no remaining users of the alternative EAPOL frame
transmitting mechanism in wpa_supplicant, i.e., all remaining driver
interfaces use l2_packet instead. Remove the send_eapol() to get rid of
unused code.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: Additiona GAS_REQUEST/GAS_RESPONSE_GET coverage
Jouni Malinen [Thu, 11 Dec 2014 11:44:52 +0000 (13:44 +0200)]
tests: Additiona GAS_REQUEST/GAS_RESPONSE_GET coverage

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: Make wep_open_auth less likely to fail due to old scan entry
Jouni Malinen [Thu, 11 Dec 2014 11:04:08 +0000 (13:04 +0200)]
tests: Make wep_open_auth less likely to fail due to old scan entry

Flush cfg80211 cached scan results to avoid getting any non-WEP matches
for the BSS.

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