]> git.ipfire.org Git - thirdparty/hostap.git/log
thirdparty/hostap.git
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>
8 years agotests: wpa_supplicant and concurrent NEIGHBOR_REP_REQUEST commands
Jouni Malinen [Tue, 3 Jan 2017 15:28:20 +0000 (17:28 +0200)] 
tests: wpa_supplicant and concurrent NEIGHBOR_REP_REQUEST commands

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: NEIGHBOR_REP_REQUEST for AP not supporting neighbor report
Jouni Malinen [Tue, 3 Jan 2017 15:26:02 +0000 (17:26 +0200)] 
tests: NEIGHBOR_REP_REQUEST for AP not supporting neighbor report

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: wpa_supplicant and disconnection during NEIGHBOR_REP_REQUEST
Jouni Malinen [Tue, 3 Jan 2017 15:20:16 +0000 (17:20 +0200)] 
tests: wpa_supplicant and disconnection during NEIGHBOR_REP_REQUEST

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: wpa_supplicant ctrl_iface NEIGHBOR_REP_REQUEST OOM
Jouni Malinen [Tue, 3 Jan 2017 15:17:58 +0000 (17:17 +0200)] 
tests: wpa_supplicant ctrl_iface NEIGHBOR_REP_REQUEST OOM

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoFix OOM handling in neighbor report response handling
Jouni Malinen [Tue, 3 Jan 2017 15:31:32 +0000 (17:31 +0200)] 
Fix OOM handling in neighbor report response handling

The pending neighbor report state needs to be cleared on error path here
to avoid getting stuck with being unable to perform any additional
neighbor reports during the association.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: wpa_supplicant behavior on NEIGHBOR_REP_REQUEST response timeout
Jouni Malinen [Tue, 3 Jan 2017 15:13:55 +0000 (17:13 +0200)] 
tests: wpa_supplicant behavior on NEIGHBOR_REP_REQUEST response timeout

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: Radio measurement request - protocol testing
Jouni Malinen [Tue, 3 Jan 2017 13:07:41 +0000 (15:07 +0200)] 
tests: Radio measurement request - protocol testing

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoAllow LCI request with no subelements
Jouni Malinen [Tue, 3 Jan 2017 12:58:14 +0000 (14:58 +0200)] 
Allow LCI request with no subelements

Allow shorter request since the subelements are optional to include.
Also print the hexdump of the subelements into debug log.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: RRM beacon report with active and passive scan
Jouni Malinen [Mon, 2 Jan 2017 21:03:49 +0000 (23:03 +0200)] 
tests: RRM beacon report with active and passive scan

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoRRM: Enable beacon report with active/passive scan for all drivers
Jouni Malinen [Mon, 2 Jan 2017 21:04:02 +0000 (23:04 +0200)] 
RRM: Enable beacon report with active/passive scan for all drivers

The requested behavior can be approximated for most use cases even if
the driver does not support reporting exact TSF values for frames.
Enable this capability for all drivers to make beacon report processing
more useful for a common use case.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Beacon request - beacon table mode
Jouni Malinen [Sun, 1 Jan 2017 22:42:25 +0000 (00:42 +0200)] 
tests: Beacon request - beacon table mode

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoReport received beacon report with BEACON-RESP-RX event
Jouni Malinen [Sun, 1 Jan 2017 23:08:01 +0000 (01:08 +0200)] 
Report received beacon report with BEACON-RESP-RX event

The new hostapd control interface event "BEACON-RESP-RX <STA address>
<dialog token> <report mode> <beacon report>" is now used to report
received beacon reports as a reponse to the REQ_BEACON operation.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoReport beacon request TX status as control interface event
Jouni Malinen [Sun, 1 Jan 2017 22:54:44 +0000 (00:54 +0200)] 
Report beacon request TX status as control interface event

The new BEACON-REQ-TX-STATUS control interface event is now used to
report whether a beacon request (from REQ_BEACON command) was delivered
successfully. This event has the following parameters: <STA address>
<dialog token> <ack=0/1>.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoBeacon request through hostapd control interface
Jouni Malinen [Sun, 1 Jan 2017 22:31:11 +0000 (00:31 +0200)] 
Beacon request through hostapd control interface

The new control interface command "REQ_BEACON <STA addr>
[req_mode=<mode>] <beacon request>" can now be used to request hostapd
to transmit a measurement request to request a beacon report from an
associated STA. This command returns the assigned dialog token (1-255)
or FAIL on failure.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoAdd hostapd configuration parameter rrm_beacon_report
Jouni Malinen [Sun, 1 Jan 2017 22:29:30 +0000 (00:29 +0200)] 
Add hostapd configuration parameter rrm_beacon_report

rrm_beacon_report=1 can now be used to make hostapd advertise capability
for beacon reports (passive, active, table). Actual mechanism for
sending out beacon requests will be added in separate commits.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoEnable Beacon Report using beacon table for all drivers
Jouni Malinen [Sun, 1 Jan 2017 22:27:58 +0000 (00:27 +0200)] 
Enable Beacon Report using beacon table for all drivers

The special parameters for beacon report scan are not needed for the
beacon report when using the beacon table measurement mode. Advertise
support for this case regardless of whether the driver supports the scan
parameters.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoUpdate copyright notices for the new year 2017
Jouni Malinen [Mon, 2 Jan 2017 23:32:09 +0000 (01:32 +0200)] 
Update copyright notices for the new year 2017

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoDo not add own BSS in neighbor report with invalid op_class/channel
Jouni Malinen [Mon, 2 Jan 2017 22:21:11 +0000 (00:21 +0200)] 
Do not add own BSS in neighbor report with invalid op_class/channel

Verify that ieee80211_freq_to_channel_ext() succeeds before adding the
own BSS in the neighbor report.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoFILS: Fix FILS Realm Information ANQP-element construction
Jouni Malinen [Mon, 2 Jan 2017 22:15:59 +0000 (00:15 +0200)] 
FILS: Fix FILS Realm Information ANQP-element construction

The loop to add hash values was supposed to be limited to at most 10000
values, but the count variable was not being decremented in the loop.
Fix this by decrementing counting for each iteration. This fixes
ANQP-element format in the unlikely case of there being more than 10000
configuration realms.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agowpa_supplicant: Add support for Beacon Report Radio Measurement
Avraham Stern [Wed, 28 Dec 2016 13:06:47 +0000 (15:06 +0200)] 
wpa_supplicant: Add support for Beacon Report Radio Measurement

Beacon Report Radio Measurement is defined in IEEE Std 802.11-2016,
11.11.9.1. Beacon Report is implemented by triggering a scan on the
requested channels with the requested parameters.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
8 years agocommon: Add helper function to convert RSSI to RCPI
Avraham Stern [Wed, 28 Dec 2016 13:06:45 +0000 (15:06 +0200)] 
common: Add helper function to convert RSSI to RCPI

This conversion will be done several times in the code, so add a helper
function that does this conversion.

Signed-off-by: Avrahams Stern <avraham.stern@intel.com>
8 years agowpa_supplicant: Extend verify_channel() and make it global
Avraham Stern [Wed, 28 Dec 2016 13:06:44 +0000 (15:06 +0200)] 
wpa_supplicant: Extend verify_channel() and make it global

Extend verify_channel() to return whether IR is allowed on the channel
or not, and make it a global function so it can be used in other files,
too. This makes this function useful for checking not only if a channel
is supported but also if it is allowed for active and passive scan.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>