]> git.ipfire.org Git - thirdparty/hostap.git/log
thirdparty/hostap.git
8 years agotests: Step-by-step guide for testing in VM
Jouni Malinen [Sat, 28 Jan 2017 22:49:54 +0000 (00:49 +0200)] 
tests: Step-by-step guide for testing in VM

This describes example steps on how to get the VM testing setup with
parallel VMs configured with Ubuntu Server 16.04.1.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Skip rrm_link_measurement tests if kernel support is not available
Jouni Malinen [Sat, 28 Jan 2017 22:48:16 +0000 (00:48 +0200)] 
tests: Skip rrm_link_measurement tests if kernel support is not available

rrm_link_measurement and rrm_link_measurement_oom test cases were
causing incorrect failures when executed with a kernel version that does
not modify mac80211_hwsim to support TX power insertion. Fix this by
checking for that capability and skipping the test cases if the kernel
does not support this.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Update example VM kernel config
Jouni Malinen [Sat, 28 Jan 2017 20:15:59 +0000 (22:15 +0200)] 
tests: Update example VM kernel config

This is now based on Linux 4.10.0-rc5.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoRemove unused WLAN_CIPHER_SUITE_* definitions
Jouni Malinen [Sat, 28 Jan 2017 12:05:44 +0000 (14:05 +0200)] 
Remove unused WLAN_CIPHER_SUITE_* definitions

This gets rid of an unnecessary duplication of the definitions since all
the code has now been moved to using the earlier RSN_CIPHER_SUITE_*
definitions.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agonl80211: Use RSN_CIPHER_SUITE_* instead of WLAN_CIPHER_SUITE_*
Jouni Malinen [Sat, 28 Jan 2017 12:04:44 +0000 (14:04 +0200)] 
nl80211: Use RSN_CIPHER_SUITE_* instead of WLAN_CIPHER_SUITE_*

This is a step towards getting rid of the unnecessary duplication of
definitions.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoDefine all RSN_CIPHER_SUITE_* values
Jouni Malinen [Sat, 28 Jan 2017 12:03:34 +0000 (14:03 +0200)] 
Define all RSN_CIPHER_SUITE_* values

This adds the cipher suite selector values for ciphers that are not
really used with RSN, but are needed to be able to replace
WLAN_CIPHER_SUITE_* definitions with RSN_CIPHER_SUITE_*.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoRemove unused WLAN_AKM_SUITE_* definitions
Jouni Malinen [Sat, 28 Jan 2017 10:36:13 +0000 (12:36 +0200)] 
Remove unused WLAN_AKM_SUITE_* definitions

This gets rid of an unnecessary duplication of the definitions since all
the code has now been moved to using the earlier RSN_AUTH_KEY_MGMT_*
definitions.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoUse RSN_AUTH_KEY_MGMT_* instead of WLAN_AKM_SUITE_* for wpa_akm_to_suite()
Jouni Malinen [Sat, 28 Jan 2017 10:34:49 +0000 (12:34 +0200)] 
Use RSN_AUTH_KEY_MGMT_* instead of WLAN_AKM_SUITE_* for wpa_akm_to_suite()

This is a step towards getting rid of the unnecessary duplication of
definitions.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agonl80211: Use RSN_AUTH_KEY_MGMT_* instead of WLAN_AKM_SUITE_*
Jouni Malinen [Sat, 28 Jan 2017 10:27:48 +0000 (12:27 +0200)] 
nl80211: Use RSN_AUTH_KEY_MGMT_* instead of WLAN_AKM_SUITE_*

This is a step towards getting rid of the unnecessary duplication of
definitions.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoRemove unnecessary ifdef from RSN_AUTH_KEY_MGMT_* definitions
Jouni Malinen [Sat, 28 Jan 2017 10:26:25 +0000 (12:26 +0200)] 
Remove unnecessary ifdef from RSN_AUTH_KEY_MGMT_* definitions

These FT AKM suite selectors might be needed in code even if
CONFIG_IEEE80211R is not defined.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoFix CONFIG_SAE build without CONFIG_SME
Jouni Malinen [Sat, 28 Jan 2017 09:58:26 +0000 (11:58 +0200)] 
Fix CONFIG_SAE build without CONFIG_SME

The control interface code was using wpa_s->sme in an area that was not
within ifdef CONFIG_SME.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoSkip EVENT_ACS_CHANNEL_SELECTED also without CONFIG_AP
Jouni Malinen [Sat, 28 Jan 2017 09:57:23 +0000 (11:57 +0200)] 
Skip EVENT_ACS_CHANNEL_SELECTED also without CONFIG_AP

CONFIG_ACS alone should not refer to wpa_s->ap_iface to avoid potential
compilation issues.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoFix AKM suite selectors for FILS and Suite B
Jouni Malinen [Fri, 27 Jan 2017 20:55:14 +0000 (22:55 +0200)] 
Fix AKM suite selectors for FILS and Suite B

IEEE 802.11 standard defines the suite selectors in <OUI>:<subtype>
format where OUI uses hexadecimal format and subtype decimal format.
These WLAN_AKM_SUITE_* definitions ended up getting written incorrectly
by interpretting the decimal part as hexadecimal and as such, by having
an incorrect value. However, the older RSN_AUTH_KEY_MGMT_* values were
defined with correct values and those definitions were used in most
locations.

This commit fixes the AKM suite selector values in RADIUS WLAN-AKM-Suite
attribute for FILS and Suite B. In addition, the AKM values used in
nl80211 driver configuration (NL80211_ATTR_AKM_SUITES) are fixed for the
Suite B cases.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoQCA vendor command to carry the reason for power save failure
Sunil Dutt [Thu, 19 Jan 2017 14:31:06 +0000 (20:01 +0530)] 
QCA vendor command to carry the reason for power save failure

This commit defines a QCA vendor command
QCA_NL80211_VENDOR_SUBCMD_CHIP_PWRSAVE_FAILURE that carries required
information leading to the power save failure. This will be an event
from the host driver.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: GAS comeback delay that is longer than query timeout
Jouni Malinen [Mon, 23 Jan 2017 04:55:31 +0000 (06:55 +0200)] 
tests: GAS comeback delay that is longer than query timeout

This is a regression test for comeback delay values larger than
GAS_QUERY_TIMEOUT_PERIOD causing timeouts for the query.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoGAS: Cancel gas_query_timeout when AP responds with comeback delay
vamsi krishna [Thu, 19 Jan 2017 09:43:44 +0000 (15:13 +0530)] 
GAS: Cancel gas_query_timeout when AP responds with comeback delay

When AP responds with comeback delay for initial GAS query sent by STA,
gas_query_timeout should be cancelled to avoid GAS failures when
comeback delay is more than GAS_QUERY_TIMEOUT_PERIOD. The
gas_query_timeout is getting registered again when tx_status is received
for GAS comeback request.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoMBO: Silence a compiler warning when building without CONFIG_MBO
Jouni Malinen [Mon, 23 Jan 2017 04:41:47 +0000 (06:41 +0200)] 
MBO: Silence a compiler warning when building without CONFIG_MBO

The fail label is used only within ifdef CONFIG_MBO, so declare it in
the same manner.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoQCA vendor command to enable host driver offload ACS to user space
Purushottam Kushwaha [Fri, 6 Jan 2017 11:27:55 +0000 (16:57 +0530)] 
QCA vendor command to enable host driver offload ACS to user space

This commit introduces the QCA vendor command and the attributes which
facilitate the host driver to use an external user space entity for
performing automatic channel selection.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: Secure mesh network and PMKSA caching and external storage
Jouni Malinen [Sat, 14 Jan 2017 16:27:19 +0000 (18:27 +0200)] 
tests: Secure mesh network and PMKSA caching and external storage

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agomesh: Add MESH_PMKSA_GET/ADD commands
Masashi Honma [Mon, 2 Jan 2017 10:32:07 +0000 (19:32 +0900)] 
mesh: Add MESH_PMKSA_GET/ADD commands

These commnds are mesh version of PMKSA_GET/ADD commands. So the usage
and security risk is similar to them. Refer to
commit 3459381dd260e15e7bf768a75cb0b799cc1db33a ('External persistent
storage for PMKSA cache entries') also.

The MESH_PMKSA_GET command requires peer MAC address or "any" as an
argument and outputs appropriate stored PMKSA cache. And the
MESH_PMKSA_ADD command receives an output of MESH_PMKSA_GET and re-store
the PMKSA cache into wpa_supplicant. By using re-stored PMKSA cache,
wpa_supplicant can skip commit message creation which can use
significant CPU resources.

The output of the MESH_PMKSA_GET command uses the following format:
<BSSID> <PMKID> <PMK> <expiration in seconds>

The example of MESH_PMKSA_ADD command is this.
MESH_PMKSA_ADD 02:00:00:00:03:00 231dc1c9fa2eed0354ea49e8ff2cc2dc cb0f6c9cab358a8146488566ca155421ab4f3ea4a6de2120050c149b797018fe 42930
MESH_PMKSA_ADD 02:00:00:00:04:00 d7e595916611640d3e4e8eac02909c3c eb414a33c74831275f25c2357b3c12e3d8bd2f2aab6cf781d6ade706be71321a 43180

This functionality is disabled by default and can be enabled with
CONFIG_PMKSA_CACHE_EXTERNAL=y build configuration option.

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
8 years agoD-Bus: Add GroupMgmt entry into the interface Capabilities dict
Jouni Malinen [Sat, 14 Jan 2017 15:41:20 +0000 (17:41 +0200)] 
D-Bus: Add GroupMgmt entry into the interface Capabilities dict

This can be used to determine whether the driver supports PMF and if so,
with which group management cipher suites. In addition, add the missing
pairwise and group cipher suite values to the documentation while adding
this new entry there as well.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoD-Bus: Add pmf to global capabilities
Stijn Tintel [Thu, 5 Jan 2017 15:06:33 +0000 (16:06 +0100)] 
D-Bus: Add pmf to global capabilities

This indicates that the wpa_supplicant binary has been compiled with PMF
support.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
8 years agotests: D-Bus Get/Set Pmf
Jouni Malinen [Sat, 14 Jan 2017 15:28:25 +0000 (17:28 +0200)] 
tests: D-Bus Get/Set Pmf

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoD-Bus: Implement Pmf property
Stijn Tintel [Thu, 12 Jan 2017 16:13:26 +0000 (17:13 +0100)] 
D-Bus: Implement Pmf property

The Pmf property is documented in doc/dbus.doxygen, but does not exist,
so implement it.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
8 years agoRSN IBSS: Fix TK clearing on Authentication frame RX
Jouni Malinen [Sat, 14 Jan 2017 11:56:18 +0000 (13:56 +0200)] 
RSN IBSS: Fix TK clearing on Authentication frame RX

When wpa_supplicant was processing a received Authentication frame (seq
1) from a peer STA for which there was already a TK configured to the
driver, debug log claimed that the PTK gets cleared, but the actual
call to clear the key was actually dropped due to AUTH vs. SUPP set_key
selection. Fix this by explicitly clearing the TK in case it was set
and an Authentication frame (seq 1) is received.

This fixes some cases where EAPOL-Key frames were sent encrypted using
the old key when a peer STA restarted itself and lost the key and had to
re-join the IBSS. Previously, that state required timing out the 4-way
handshake and Deauthentication frame exchange to recover.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Disable HT in ibss_rsn to avoid a strange issue with mac80211
Jouni Malinen [Sat, 14 Jan 2017 11:54:02 +0000 (13:54 +0200)] 
tests: Disable HT in ibss_rsn to avoid a strange issue with mac80211

When fixing the TK clearing on Authentication frame RX, an issue in
getting unicast frames through after re-joining the IBSS was hit. It is
not exactly clear why this happens, but the unicast frame from the STA
that re-joined the network gets lost in the frame reorder buffer of the
STA that remains in the network.

For now, this disables HT to avoid a strange issue with mac80211
frame reordering during the final test_connectivity() call. Once that is
figured out, these disable_ht=1 calls should be removed from the test
case.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: AP dropping duplicate management frames
Jouni Malinen [Fri, 13 Jan 2017 23:10:32 +0000 (01:10 +0200)] 
tests: AP dropping duplicate management frames

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoFix duplicate Reassociation Request frame dropping
Jouni Malinen [Fri, 13 Jan 2017 23:04:31 +0000 (01:04 +0200)] 
Fix duplicate Reassociation Request frame dropping

Relational operators (==) have higher precedence than the ternary
conditional in C. The last_subtype check for association/reassociation
was broken due to incorrect assumption about the precedence. Fix this by
adding parenthesis around the ternary conditional.

The previous implementation worked for Association Request frames by
accident since WLAN_FC_STYPE_ASSOC_REQ happens to have value 0 and when
the last receive frame was an Association Request frame, the
sta->last_subtype == reassoc check was true and non-zero
WLAN_FC_STYPE_REASSOC_REQ was interpreted as true. However, this was
broken for Reassociation Request frame. reassoc == 1 in that case could
have matched received Association Response frame (subtype == 1), but
those are not received in AP mode and as such, this did not break other
behavior apart from not being able to drop duplicated Reassociation
Request frames.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agowext: Cancel send_rfkill timeout in deinit
Slava Monich [Fri, 13 Jan 2017 15:37:47 +0000 (17:37 +0200)] 
wext: Cancel send_rfkill timeout in deinit

Signed-off-by: Slava Monich <slava.monich@jolla.com>
8 years agotests: Fix peerkey_sniffer_check with tshark 1.10.6
Jouni Malinen [Fri, 13 Jan 2017 22:05:47 +0000 (00:05 +0200)] 
tests: Fix peerkey_sniffer_check with tshark 1.10.6

It looks like the previous mechanism for catching older tshark versions
for EAPOL-Key key info field was not sufficient. Fix that to cover the
version used in Ubuntu 14.04.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: Mesh with two stations that can't reach each other directly (RSN)
Jouni Malinen [Fri, 13 Jan 2017 21:26:20 +0000 (23:26 +0200)] 
tests: Mesh with two stations that can't reach each other directly (RSN)

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoFILS: Fix PMK and PMKID derivation from ERP
Jouni Malinen [Fri, 13 Jan 2017 19:06:21 +0000 (21:06 +0200)] 
FILS: Fix PMK and PMKID derivation from ERP

This adds helper functions for deriving PMK and PMKID from ERP exchange
in FILS shared key authentication as defined in IEEE Std 802.11ai-2016,
12.12.2.5.2 (PMKSA key derivation with FILS authentication). These
functions is used to fix PMK and PMKID derivation which were previously
using the rMSK directly as PMK instead of following the FILS protocol to
derive PMK with HMAC from nonces and rMSK.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoOpenSSL: Implement sha384_vector()
Jouni Malinen [Fri, 13 Jan 2017 19:05:19 +0000 (21:05 +0200)] 
OpenSSL: Implement sha384_vector()

This was forgotten from the addition of SHA384 support and is now needed
for FILS.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agonl80211: Don't register for Beacon frames for IEEE 802.11ad AP
Dedy Lansky [Tue, 27 Dec 2016 09:25:00 +0000 (11:25 +0200)] 
nl80211: Don't register for Beacon frames for IEEE 802.11ad AP

Beacon frames are not supported in IEEE 802.11ad network (DMG-beacons
used instead). To allow hostapd to manage IEEE 802.11ad AP with
device_ap_sme disabled, skip nl80211_register_beacons() for IEEE
802.11ad AP.

Signed-off-by: Dedy Lansky <qca_dlansky@qca.qualcomm.com>
8 years agoAssign additional vendor specific elements for early HE testing
Jouni Malinen [Mon, 9 Jan 2017 15:56:46 +0000 (17:56 +0200)] 
Assign additional vendor specific elements for early HE testing

These elements can be used for pre-standard publication testing of HE
before P802.11ax draft assigns the element ID extension. The payload of
these vendor specific elements is defined by the latest P802.11ax draft.
Please note that the draft is still work in progress and the element
payload is subject to change.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: Add a test for mesh forwarding
Johannes Berg [Wed, 11 Jan 2017 08:44:07 +0000 (09:44 +0100)] 
tests: Add a test for mesh forwarding

Add a new test that tests connectivity between two stations that
can't reach each other directly in the mesh, but need forwarding
on another station to talk to each other.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agowpa_supplicant: Clarify group_rekey documentation
Johannes Berg [Tue, 10 Jan 2017 11:36:37 +0000 (12:36 +0100)] 
wpa_supplicant: Clarify group_rekey documentation

This is also used in mesh and AP modes.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agonl80211: Set NL80211_ATTR_IFACE_SOCKET_OWNER for connect and associate
Jouni Malinen [Fri, 13 Jan 2017 10:01:20 +0000 (12:01 +0200)] 
nl80211: Set NL80211_ATTR_IFACE_SOCKET_OWNER for connect and associate

This allows kernel to force disconnection if something kills the
wpa_supplicant process in a manner that does not allow proper cleanup to
be performed. The association is not supposed to be allowed to continue
after process has ended since there are number of operations that
wpa_supplicant may need to do during the association.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoSync with mac80211-next.git include/uapi/linux/nl80211.h
Jouni Malinen [Fri, 13 Jan 2017 09:58:45 +0000 (11:58 +0200)] 
Sync with mac80211-next.git include/uapi/linux/nl80211.h

This brings in nl80211 definitions as of 2017-01-06.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoFix country code in wpa_supplicant AP mode Country element
Jouni Malinen [Thu, 12 Jan 2017 10:24:08 +0000 (12:24 +0200)] 
Fix country code in wpa_supplicant AP mode Country element

country[2] needs to be set to ' ' instead of left to '\0' for the case
where wpa_supplicant sets up AP mode operations and includes the Country
element. Currently, this would be only for DFS channels. Without this,
the Beacon frames would go out with incorrect third octet in the country
code.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: Scan result parsing
Jouni Malinen [Sun, 8 Jan 2017 16:30:03 +0000 (18:30 +0200)] 
tests: Scan result parsing

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Add DRIVER_EVENT SCAN_RES for scan result testing
Jouni Malinen [Sun, 8 Jan 2017 16:28:47 +0000 (18:28 +0200)] 
tests: Add DRIVER_EVENT SCAN_RES for scan result testing

This control interface command can be used to inject scan results from
test scripts to make it easier to test various scan result processing
operations.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoD-Bus: Fix BSS Mode getter for invalid DMG BSS
Jouni Malinen [Sun, 8 Jan 2017 16:38:06 +0000 (18:38 +0200)] 
D-Bus: Fix BSS Mode getter for invalid DMG BSS

Previous version could have used uninitialized char* when a DMG with
invalid capabilities were added to BSS table from scan results.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: WPS_AP_PIN failure
Jouni Malinen [Sun, 8 Jan 2017 15:36:57 +0000 (17:36 +0200)] 
tests: WPS_AP_PIN failure

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: WPS_PIN start failure
Jouni Malinen [Sun, 8 Jan 2017 15:28:15 +0000 (17:28 +0200)] 
tests: WPS_PIN start failure

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: PIN generation failure
Jouni Malinen [Sun, 8 Jan 2017 15:24:12 +0000 (17:24 +0200)] 
tests: PIN generation failure

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Invalid WMM_AC_ADDTS parameter
Jouni Malinen [Sun, 8 Jan 2017 15:20:02 +0000 (17:20 +0200)] 
tests: Invalid WMM_AC_ADDTS parameter

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: TDLS_CHAN_SWITCH error case
Jouni Malinen [Sun, 8 Jan 2017 15:16:01 +0000 (17:16 +0200)] 
tests: TDLS_CHAN_SWITCH error case

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: TDLS and tdls_external_control
Jouni Malinen [Sun, 8 Jan 2017 15:12:55 +0000 (17:12 +0200)] 
tests: TDLS and tdls_external_control

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agonl80211: Debug prints for TDLS_OPER command and result
Jouni Malinen [Sun, 8 Jan 2017 15:12:24 +0000 (17:12 +0200)] 
nl80211: Debug prints for TDLS_OPER command and result

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: More GET wifi_display coverage
Jouni Malinen [Sun, 8 Jan 2017 14:52:56 +0000 (16:52 +0200)] 
tests: More GET wifi_display coverage

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: wpa_supplicant SET tdls_trigger_control
Jouni Malinen [Sun, 8 Jan 2017 14:48:59 +0000 (16:48 +0200)] 
tests: wpa_supplicant SET tdls_trigger_control

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: wpa_supplicant SET radio_disabled
Jouni Malinen [Sun, 8 Jan 2017 12:54:01 +0000 (14:54 +0200)] 
tests: wpa_supplicant SET radio_disabled

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: wpa_supplicant SET lci error cases
Jouni Malinen [Sun, 8 Jan 2017 12:51:09 +0000 (14:51 +0200)] 
tests: wpa_supplicant SET lci error cases

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Additional bgscan test coverage
Jouni Malinen [Sun, 8 Jan 2017 10:44:36 +0000 (12:44 +0200)] 
tests: Additional bgscan test coverage

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agobgscan: Remove unnecessary NULL check
Jouni Malinen [Sun, 8 Jan 2017 12:43:48 +0000 (14:43 +0200)] 
bgscan: Remove unnecessary NULL check

The name argument to bgscan_init() cannot be NULL since the only caller
already checks this before the call.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agobgscan: Remove unnecessary NULL check
Jouni Malinen [Sun, 8 Jan 2017 10:43:33 +0000 (12:43 +0200)] 
bgscan: Remove unnecessary NULL check

bgscan_init() is the only caller for the init() function and the
parameters argument is never NULL.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agobgscan: Deliver beacon loss event to bgscan modules
Jouni Malinen [Sun, 8 Jan 2017 10:17:58 +0000 (12:17 +0200)] 
bgscan: Deliver beacon loss event to bgscan modules

This adds a call to the notify_beacon_loss() callback functions when
beacon loss is detected. In addition, a new CTRL-EVENT-BEACON-LOSS event
is made available through the wpa_supplicant control interface.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agonl80211: More complete processing of connection quality monitor events
Jouni Malinen [Sun, 8 Jan 2017 10:08:04 +0000 (12:08 +0200)] 
nl80211: More complete processing of connection quality monitor events

This adds processing of beacon loss events and generation of an internal
EVENT_BEACON_LOSS event based on them for wpa_supplicant processing. In
addition, number of consecutively lost (not acknowledged) packets is now
reported and TXE events are noted in the debug log.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Add more wpas_config_file variable coverage
Jouni Malinen [Sat, 7 Jan 2017 20:33:56 +0000 (22:33 +0200)] 
tests: Add more wpas_config_file variable coverage

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Use logdir for config file in wpas_config_file
Jouni Malinen [Sat, 7 Jan 2017 20:30:50 +0000 (22:30 +0200)] 
tests: Use logdir for config file in wpas_config_file

This reduces use of /tmp for test case specific dynamically created
files.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoStore FST parameters to configuration file
Jouni Malinen [Sat, 7 Jan 2017 22:09:11 +0000 (00:09 +0200)] 
Store FST parameters to configuration file

This was forgotten when the parameters were added.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoStore osu_dir to configuration file
Jouni Malinen [Sat, 7 Jan 2017 22:07:14 +0000 (00:07 +0200)] 
Store osu_dir to configuration file

This was forgotten when the parameter was added.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoStore autoscan to configuration file
Jouni Malinen [Sat, 7 Jan 2017 22:02:13 +0000 (00:02 +0200)] 
Store autoscan to configuration file

This was forgotten when the parameter was added.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoStore filter_rssi to configuration file
Jouni Malinen [Sat, 7 Jan 2017 21:57:39 +0000 (23:57 +0200)] 
Store filter_rssi to configuration file

This was forgotten when the parameter was added.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoWrite sec_device_type to configuration file
Jouni Malinen [Sat, 7 Jan 2017 21:54:03 +0000 (23:54 +0200)] 
Write sec_device_type to configuration file

This is more consistent with other global configuration parameters.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoMake "SET" behavior more consistent for dot11RSNA parameters
Jouni Malinen [Sat, 7 Jan 2017 21:44:09 +0000 (23:44 +0200)] 
Make "SET" behavior more consistent for dot11RSNA parameters

These parameters are global configuration parameters for wpa_supplicant
and the special control interface SET command handlers for them were
preventing the configuration update. Make this more consistent by
updating the configuration parameter as well since that is what all the
other SET <global config param> commands do.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoMake "SET non_pref_chan .." behavior more consistent
Jouni Malinen [Sat, 7 Jan 2017 21:35:48 +0000 (23:35 +0200)] 
Make "SET non_pref_chan .." behavior more consistent

non_pref_chan is a global configuration parameter for wpa_supplicant and
the special control interface SET command handler for it was preventing
the configuration update. Make this more consistent by updating the
configuration parameter as well since that is what all the other SET
<global config param> commands do.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoFix cert_in_cb parsing in wpa_supplicant.conf
Jouni Malinen [Sat, 7 Jan 2017 21:20:35 +0000 (23:20 +0200)] 
Fix cert_in_cb parsing in wpa_supplicant.conf

Commit 483dd6a5e0069d0646505c26a5194eda15472858 ('Include peer
certificate always in EAP events') added this wpa_supplicant global
configuration parameter, but forgot to add the actual parsing of it, so
there was no way of setting the value.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoFix writing of wpa_supplicant sae_groups configuration parameter
Jouni Malinen [Sat, 7 Jan 2017 21:09:34 +0000 (23:09 +0200)] 
Fix writing of wpa_supplicant sae_groups configuration parameter

This integer array is zero terminated, so need to check the value is
greater than 0 when writing the parameter.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoSend BEACON-REQ-TX-STATUS event only for beacon reports
Jouni Malinen [Sat, 7 Jan 2017 20:23:13 +0000 (22:23 +0200)] 
Send BEACON-REQ-TX-STATUS event only for beacon reports

Check the action TX status callback contents more thoroughly and report
the BEACON-REQ-TX-STATUS event only if the Measurement Type indicates
beacon report.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: LCI report generation and os_get_reltime() failure
Jouni Malinen [Sat, 7 Jan 2017 20:16:24 +0000 (22:16 +0200)] 
tests: LCI report generation and os_get_reltime() failure

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: TEST_FAIL() support for os_get_random()
Jouni Malinen [Sat, 7 Jan 2017 20:15:41 +0000 (22:15 +0200)] 
tests: TEST_FAIL() support for os_get_random()

This allows more testing for rarely executed error paths.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoRRM: Use wpa_hexdump_buf() instead of wpa_hexdump()
Jouni Malinen [Sat, 7 Jan 2017 16:47:37 +0000 (18:47 +0200)] 
RRM: Use wpa_hexdump_buf() instead of wpa_hexdump()

Simplify the code a bit by using the appropriate debugging function to
dump a wpabuf contents.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Radio measurement request - link measurement
Jouni Malinen [Sat, 7 Jan 2017 16:46:57 +0000 (18:46 +0200)] 
tests: Radio measurement request - link measurement

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agonl80211: Register for Link Measurement Report frames in AP mode
Jouni Malinen [Sat, 7 Jan 2017 16:46:10 +0000 (18:46 +0200)] 
nl80211: Register for Link Measurement Report frames in AP mode

This is needed to be able to get the response to a link measurement
request.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoRRM: Document Link Measurement Report frame construction steps
Jouni Malinen [Sat, 7 Jan 2017 16:17:59 +0000 (18:17 +0200)] 
RRM: Document Link Measurement Report frame construction steps

Add a comment to note which fields are expected to be updated by the
driver. In addition, reorder subfield writing to match the order in
which the fields are in the frame.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Radio/link measurement request for non-RRM association
Jouni Malinen [Sat, 7 Jan 2017 16:00:50 +0000 (18:00 +0200)] 
tests: Radio/link measurement request for non-RRM association

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Radio measurement request - OOM while rejecting a request
Jouni Malinen [Sat, 7 Jan 2017 15:52:51 +0000 (17:52 +0200)] 
tests: Radio measurement request - OOM while rejecting a request

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Fix rrm_beacon_req_passive_ap_channels to use passive scan
Jouni Malinen [Sat, 7 Jan 2017 15:47:12 +0000 (17:47 +0200)] 
tests: Fix rrm_beacon_req_passive_ap_channels to use passive scan

The request from the AP was encoded incorrectly for this test case and
an active scan was requested instead of the passive one that was
supposed to be used here.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Beacon request - active scan mode os_get_random failure
Jouni Malinen [Sat, 7 Jan 2017 15:46:18 +0000 (17:46 +0200)] 
tests: Beacon request - active scan mode os_get_random failure

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Check rrm capabilities with a helper function
Jouni Malinen [Sat, 7 Jan 2017 11:39:49 +0000 (13:39 +0200)] 
tests: Check rrm capabilities with a helper function

And also move couple of these checks to the beginning of the test case.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Remove write-only bssid assignments from rrm test cases
Jouni Malinen [Sat, 7 Jan 2017 11:34:19 +0000 (13:34 +0200)] 
tests: Remove write-only bssid assignments from rrm test cases

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Beacon request - passive scan mode - VHT
Jouni Malinen [Sat, 7 Jan 2017 10:50:35 +0000 (12:50 +0200)] 
tests: Beacon request - passive scan mode - VHT

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoRRM: Fix beacon report scan channels for VHT 80, 80+80, 160 MHz cases
Jouni Malinen [Sat, 7 Jan 2017 10:49:48 +0000 (12:49 +0200)] 
RRM: Fix beacon report scan channels for VHT 80, 80+80, 160 MHz cases

ieee80211_chan_to_freq() is not really meant for conversion of 20 MHz
primary channel numbers for wider VHT channels, so handle those as
special cases here for now.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoRRM: Move wpabuf_resize() call into wpas_rrm_report_elem()
Jouni Malinen [Sat, 7 Jan 2017 10:04:43 +0000 (12:04 +0200)] 
RRM: Move wpabuf_resize() call into wpas_rrm_report_elem()

wpabuf_resize() can handle the initial allocation of a wpabuf and all
the other callers of wpas_rrm_report_elem() were already using a pointer
to a pointer and a wpabuf_resize() call. Simplify this by resizing the
wpabuf (if needed) within wpas_rrm_report_elem() instead of having to
calculate the needed size in all the callers. Thsi is also fixing one of
the allocation sizes to use the correct size instead of a size of a
struct that has nothing to do with the allocation (but is larger than
the needed five octets, so does not break anything).

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Prepare rrm_beacon_req_passive_no_match_oom for code change
Jouni Malinen [Sat, 7 Jan 2017 10:12:22 +0000 (12:12 +0200)] 
tests: Prepare rrm_beacon_req_passive_no_match_oom for code change

Replace the TEST_ALLOC function wpas_beacon_rep_no_results with an
earlier function in the backtrace and wpabuf_resize() in preparation to
a code change that allows the compiler to optimize out
wpas_beacon_rep_no_results().

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoRRM: Remove unnecessary cb check
Jouni Malinen [Sat, 7 Jan 2017 09:52:18 +0000 (11:52 +0200)] 
RRM: Remove unnecessary cb check

There is only a single caller for wpas_rrm_send_neighbor_rep_request()
and it unconditionally uses a callback function, so cb cannot be NULL
here and there is no need for additional complexity and extra code size
to check for it explicitly.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoAP: Skip authentication/deauthentication phase for DMG/IEEE 802.11ad
Dedy Lansky [Mon, 26 Dec 2016 19:00:51 +0000 (21:00 +0200)] 
AP: Skip authentication/deauthentication phase for DMG/IEEE 802.11ad

Authentication and Deauthentication frames are not used in DMG/IEEE
802.11ad networks. For DMG/IEEE 802.11ad the following was implemented:
Upon receiving association request, allocate the sta object and
initialize it as if authentication took place. Upon receiving
disassociation, deallocate the sta object.
ap_sta_disassociate/ap_sta_deauthenticate/ap_sta_disconnect all use
disassociation instead of deauthentication. In driver_nl80211,
i802_sta_deauth() is routed to i802_sta_disassoc().

Signed-off-by: Dedy Lansky <qca_dlansky@qca.qualcomm.com>
8 years agoAP: Do not look for supported rates in DMG/IEEE 802.11ad
Dedy Lansky [Tue, 20 Dec 2016 15:04:43 +0000 (17:04 +0200)] 
AP: Do not look for supported rates in DMG/IEEE 802.11ad

Supported Rates element is not present in DMG/IEEE 802.11ad frames. Make
copy_supp_rates() immediately return with success if hardware mode is
IEEE 802.11ad.

Signed-off-by: Dedy Lansky <qca_dlansky@qca.qualcomm.com>
8 years agobgscan_simple: Fix short_scan_count comparison
Beni Lev [Mon, 2 Jan 2017 14:26:26 +0000 (16:26 +0200)] 
bgscan_simple: Fix short_scan_count comparison

Previously, the check was done after we reached the maximum and another
scan was already triggered.

While at it, remove an irrelevant comment that the previous change in
the logic here missed.

Signed-off-by: Beni Lev <beni.lev@intel.com>
8 years agonl80211: Zero num_modes if nl80211_get_hw_feature_data() fails
Andrei Otcheretianski [Wed, 28 Dec 2016 13:47:07 +0000 (15:47 +0200)] 
nl80211: Zero num_modes if nl80211_get_hw_feature_data() fails

It was possible that nl80211_get_hw_feature_data() function would return
NULL when num_modes is not set to zero. This might result in a later crash
when accessing hw.modes. This may be reproduced with hwsim oom tests, for
example, dbus_connect_oom.
Fix that by zeroing num_modes if NULL is returned.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
8 years agotests: P2P autonomous GO switching channels (separate group interface)
Jouni Malinen [Thu, 5 Jan 2017 14:11:31 +0000 (16:11 +0200)] 
tests: P2P autonomous GO switching channels (separate group interface)

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: Use group control interface for GO commands in autogo_chan_switch
Avraham Stern [Thu, 29 Dec 2016 09:37:58 +0000 (11:37 +0200)] 
tests: Use group control interface for GO commands in autogo_chan_switch

The channel switch command is intended for the GO interface, but
it was not sent on the group control interface. For configurations
that use a separate interface for P2P groups, this will fail the test.

Fix this by sending the channel switch command on the group control
interface and waiting for the channel switch event on the group
control interface.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
8 years agonl80211: Use correct attribute for scan flags in vendor scan
Kanchanapally, Vidyullatha [Wed, 4 Jan 2017 13:30:00 +0000 (19:00 +0530)] 
nl80211: Use correct attribute for scan flags in vendor scan

This fixes the netlink attribute identifier for the scan flags when
using QCA_NL80211_VENDOR_SUBCMD_TRIGGER_SCAN.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoeap_proxy: On SIM error flush PMKSAs only for SIM/AKA/AKA' networks
Purushottam Kushwaha [Thu, 29 Dec 2016 06:51:33 +0000 (12:21 +0530)] 
eap_proxy: On SIM error flush PMKSAs only for SIM/AKA/AKA' networks

Previously, SIM state change with SIM_STATE_ERROR cleared all PMKSA
entries (including non-SIM networks). Limit this to networks which use
SIM-based authentication methods to avoid unnecessarily removal of PMKSA
entries.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: Beacon request - active scan mode and old scan result
Jouni Malinen [Tue, 3 Jan 2017 17:15:12 +0000 (19:15 +0200)] 
tests: Beacon request - active scan mode and old scan result

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: Beacon request - passive scan mode and no matching BSS
Jouni Malinen [Tue, 3 Jan 2017 17:10:20 +0000 (19:10 +0200)] 
tests: Beacon request - passive scan mode and no matching BSS

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: Beacon request - active scan mode and many BSSs
Jouni Malinen [Tue, 3 Jan 2017 16:24:24 +0000 (18:24 +0200)] 
tests: Beacon request - active scan mode and many BSSs

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: LCI report generation OOM
Jouni Malinen [Tue, 3 Jan 2017 15:46:52 +0000 (17:46 +0200)] 
tests: LCI report generation OOM

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