]> git.ipfire.org Git - thirdparty/hostap.git/log
thirdparty/hostap.git
8 years agotests: Clear monitor socket within p2p_msg_unexpected_go_neg_resp
Jouni Malinen [Sat, 24 Dec 2016 11:09:23 +0000 (13:09 +0200)] 
tests: Clear monitor socket within p2p_msg_unexpected_go_neg_resp

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Add command completion support for get command.

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

Add command completion support for set command.

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

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

signature, sa_query, send_qos_map_conf and req_lci

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

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

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

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

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

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

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

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

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

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

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

This returns the BSS stored in wpa_s->current_bss.

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

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

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

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

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

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

In practice, this reverts commit
d53d2596e4919bc2f7b6acfa6a9a9baba1d68360.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Add KaY details to the STATUS command output.

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

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

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

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

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

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

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

This extends wpa_supplicant BSS command to parse FILS Indication
element.

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

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

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

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

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

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

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

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

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

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

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

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Fix FST scanning for non-FST APs
Jouni Malinen [Thu, 15 Dec 2016 12:10:17 +0000 (14:10 +0200)] 
tests: Fix FST scanning for non-FST APs

The sta2.scan() calls were performing full scan of all channels and
reporting only the BSS entry that happened to be the first one in the
wpa_supplicant list. This is problematic since it is possible that the
target AP was not found and incorrect BSS was selected and used for
setting scan_freq which made the connection fail. Furthermore, there is
no need to use full scan for these test cases, so use a single channel
scan instead.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoFix preauth_test build by updating add_pmkid/remove_pmkid callbacks
Jouni Malinen [Wed, 14 Dec 2016 14:38:44 +0000 (16:38 +0200)] 
Fix preauth_test build by updating add_pmkid/remove_pmkid callbacks

Commit c579312736163d8d038542408daaefad9659815d ('Add
PMKSA-CACHE-ADDED/REMOVED events to wpa_supplicant') added new arguments
to these callback functions, but forgot to update the implementations in
preauth_test.c.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoFix wpa_supplicant build error with IEEE8021X_EAPOL unset
Felix Fietkau [Wed, 14 Dec 2016 11:33:33 +0000 (12:33 +0100)] 
Fix wpa_supplicant build error with IEEE8021X_EAPOL unset

Add missing inline stubs for newly added functions.

Fixes: 3459381dd260 ("External persistent storage for PMKSA cache entries")
Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years agotests: Make p2p_ext_vendor_elem_go_neg_conf more robust
Jouni Malinen [Wed, 14 Dec 2016 14:32:05 +0000 (16:32 +0200)] 
tests: Make p2p_ext_vendor_elem_go_neg_conf more robust

Use P2P listen mode on dev[1] to speed up GO Negotiation and explicitly
wait for successfully completed GO Negotiation to make the failure cases
clearer. Previously, it was possible for the GO Negotiation to fail and
execution to go to the tshark check even when no GO Negotiation Confirm
frame was sent.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: Do not attach wpa_supplicant monitor interface unnecessarily
Jouni Malinen [Wed, 14 Dec 2016 11:56:15 +0000 (13:56 +0200)] 
tests: Do not attach wpa_supplicant monitor interface unnecessarily

There is no need to attach the monitor interface was events when issuing
only a single INTERFACES command.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: Use longer timeout in p2p_go_neg_auth_result()
Jouni Malinen [Wed, 14 Dec 2016 10:45:37 +0000 (12:45 +0200)] 
tests: Use longer timeout in p2p_go_neg_auth_result()

It is possible for the P2P-GROUP-STARTED event to get delayed more than
one second especially when the GO Negotiation responder becomes the P2P
Client and the system is heavily loaded. Increase the default timeout
for the expected success case from 1 to 5 seconds to avoid failing test
cases that would have succeeded if given a bit more time to complete the
exchange.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: Properly skip pmksa_cache_ctrl_ext if PMKSA_GET is not supported
Jouni Malinen [Tue, 13 Dec 2016 18:13:42 +0000 (20:13 +0200)] 
tests: Properly skip pmksa_cache_ctrl_ext if PMKSA_GET is not supported

Mark the test as skipped instead of failed if wpa_supplicant is built
without PMKSA_GET support.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: Make dbus_p2p_go_neg_init more robust
Jouni Malinen [Tue, 13 Dec 2016 17:39:34 +0000 (19:39 +0200)] 
tests: Make dbus_p2p_go_neg_init more robust

It was apparently possible to get a propertiesChanged event from an
earlier test case with an empty Groups property. That ended up this case
exiting immediately before running through the steps and consequently,
failing due to missed operations. Make this less likely to happen by
accepting the Groups property emptying event only after a group has been
added for a peer first.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: Fix scan_reqs_with_non_scan_radio_work error reporting
Jouni Malinen [Tue, 13 Dec 2016 14:48:53 +0000 (16:48 +0200)] 
tests: Fix scan_reqs_with_non_scan_radio_work error reporting

Raise an exception instead of printing out to stdout if scan fails to
complete.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: Scan and both Beacon and Probe Response frame IEs
Jouni Malinen [Tue, 13 Dec 2016 14:45:51 +0000 (16:45 +0200)] 
tests: Scan and both Beacon and Probe Response frame IEs

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoMake Beacon IEs available in wpa_supplicant BSS command
Jouni Malinen [Tue, 13 Dec 2016 13:49:22 +0000 (15:49 +0200)] 
Make Beacon IEs available in wpa_supplicant BSS command

This makes both the Probe Response and Beacon frame IEs available to
upper layers if scan results include both IE sets. When the BSS command
mask includes WPA_BSS_MASK_BEACON_IE, a new beacon_ie=<hexdump> entry
will be included in output if the BSS entry has two separate sets of IEs
(ie=<hexdump> showing the Probe Response frame contents and
beacon_ie=<hexdump> the Beacon rame contents).

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: Make ap_track_sta_no_probe_resp more robust
Jouni Malinen [Tue, 13 Dec 2016 13:47:50 +0000 (15:47 +0200)] 
tests: Make ap_track_sta_no_probe_resp more robust

Check whether the unexpected BSS entry is based on having received a
Beacon frame instead of Probe Response frame. While this test case is
using a huge beacon_int value, it is still possible for mac80211_hwsim
timing to work in a way that a Beacon frame is sent. That made this test
case fail in some rare cases. Fix this by ignoring the BSS entry if it
is based on Beacon frame instead of Probe Response frame.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: Mesh network on 5 GHz band and 20/40 coex change
Jouni Malinen [Tue, 13 Dec 2016 13:28:41 +0000 (15:28 +0200)] 
tests: Mesh network on 5 GHz band and 20/40 coex change

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agomesh: Fix channel configuration in pri/sec switch case
Jouni Malinen [Tue, 13 Dec 2016 13:25:52 +0000 (15:25 +0200)] 
mesh: Fix channel configuration in pri/sec switch case

If 20/40 MHz co-ex scan resulted in switching primary and secondary
channels, mesh setup failed to update the frequency parameters for
hostapd side configuration and that could result in invalid secondary
channel configuration preventing creating of the mesh network. This
could happen, e.g., when trying to set up mesh on 5 GHz channel 36 and
co-ex scan finding a BSS on channel 40. Switching the pri/sec channels
resulted in hostapd code trying to check whether channel 32 is
available. Fix this by swapping the channels for hostapd configuration
when needed.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoMake debug print clearer for AP/mesh mode secondary channel issues
Jouni Malinen [Tue, 13 Dec 2016 13:09:15 +0000 (15:09 +0200)] 
Make debug print clearer for AP/mesh mode secondary channel issues

If the secondary channel was not found at all, no debug print was shown
to indicate that the channel was rejected due to that problem. Print a
clearer message indicating which channel was behind the reason to reject
channel configuration as unsuitable for AP mode.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: Remove pmk_r1_push parameter from ap_ft_local_key_gen
Jouni Malinen [Tue, 13 Dec 2016 11:57:39 +0000 (13:57 +0200)] 
tests: Remove pmk_r1_push parameter from ap_ft_local_key_gen

Local key generation for FT-PSK does not use the AP-to-AP protocol and
as such, setting pmk_r1_push=1 is a bit confusing here since it gets
ignored in practice. Remove it to keep the test case easier to
understand.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: Clear scan cache at the end of ap_wps_per_station_psk_failure
Jouni Malinen [Tue, 13 Dec 2016 11:03:52 +0000 (13:03 +0200)] 
tests: Clear scan cache at the end of ap_wps_per_station_psk_failure

It was possible for ap_wps_per_station_psk_failure to leave behind scan
entries with active PBC mode if cfg80211 BSS table. This could result in
a following test case failing due PBC overlap. Fix this by clearing the
cfg80211 BSS table explicitly.

This was found with the following test case sequence:
ap_wps_per_station_psk_failure autogo_pbc

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: PMKSA cache control interface for external management
Jouni Malinen [Mon, 12 Dec 2016 21:56:57 +0000 (23:56 +0200)] 
tests: PMKSA cache control interface for external management

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoExternal persistent storage for PMKSA cache entries
Jouni Malinen [Mon, 12 Dec 2016 21:47:04 +0000 (23:47 +0200)] 
External persistent storage for PMKSA cache entries

This adds new wpa_supplicant control interface commands PMKSA_GET and
PMKSA_ADD that can be used to store PMKSA cache entries in an external
persistent storage when terminating a wpa_supplicant process and then
restore those entries when starting a new process. The previously added
PMKSA-CACHE-ADDED/REMOVED events can be used to help in synchronizing
the external storage with the memory-only volatile storage within
wpa_supplicant.

"PMKSA_GET <network_id>" fetches all stored PMKSA cache entries bound to
a specific network profile. The network_id of the current profile is
available with the STATUS command (id=<network_id). In addition, the
network_id is included in the PMKSA-CACHE-ADDED/REMOVED events. The
output of the PMKSA_GET command uses the following format:

<BSSID> <PMKID> <PMK> <reauth_time in seconds> <expiration in seconds>
<akmp> <opportunistic>

For example:

02:00:00:00:03:00 113b8b5dc8eda16594e8274df4caa3d4 355e98681d09e0b69d3a342f96998aa765d10c4459ac592459b5efc6b563eff6 30240 43200 1 0
02:00:00:00:04:00 bbdac8607aaaac28e16aacc9152ffe23 e3dd6adc390e685985e5f40e6fe72df846a0acadc59ba15c208d9cb41732a663 30240 43200 1 0

The PMKSA_GET command uses the following format:

<network_id> <BSSID> <PMKID> <PMK> <reauth_time in seconds> <expiration
in seconds> <akmp> <opportunistic>

(i.e., "PMKSA_ADD <network_id> " prefix followed by a line of PMKSA_GET
output data; however, the reauth_time and expiration values need to be
updated by decrementing them by number of seconds between the PMKSA_GET
and PMKSA_ADD commands)

For example:

PMKSA_ADD 0 02:00:00:00:03:00 113b8b5dc8eda16594e8274df4caa3d4 355e98681d09e0b69d3a342f96998aa765d10c4459ac592459b5efc6b563eff6 30140 43100 1 0
PMKSA_ADD 0 02:00:00:00:04:00 bbdac8607aaaac28e16aacc9152ffe23 e3dd6adc390e685985e5f40e6fe72df846a0acadc59ba15c208d9cb41732a663 30140 43100 1 0

This functionality is disabled be default and can be enabled with
CONFIG_PMKSA_CACHE_EXTERNAL=y build configuration option. It should be
noted that this allows any process that has access to the wpa_supplicant
control interface to use PMKSA_ADD command to fetch keying material
(PMK), so this is for environments in which the control interface access
is restricted.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: PMKSA cache control interface events
Jouni Malinen [Mon, 12 Dec 2016 19:02:49 +0000 (21:02 +0200)] 
tests: PMKSA cache control interface events

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoAdd PMKSA-CACHE-ADDED/REMOVED events to wpa_supplicant
Jouni Malinen [Mon, 12 Dec 2016 18:59:41 +0000 (20:59 +0200)] 
Add PMKSA-CACHE-ADDED/REMOVED events to wpa_supplicant

These allow external program to monitor PMKSA cache updates in
preparation to enable external persistent storage of PMKSA cache.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoSend "TERMINATING" event from hostapd
Daisuke Niwa [Mon, 12 Dec 2016 13:13:51 +0000 (22:13 +0900)] 
Send "TERMINATING" event from hostapd

hostapd didn't send "TERMINATING" event when stopped by
SIGTERM. Android handles this event to stop monitor thread.

This commit adds "TERMINATING" event same as with wpa_supplicant.

Signed-off-by: Tomoharu Hatano <tomoharu.hatano@sonymobile.com>
8 years agoP2P: Set p2p_persistent_group=1 at the time of reading disabled=2
Avichal Agarwal [Mon, 12 Dec 2016 11:38:48 +0000 (17:08 +0530)] 
P2P: Set p2p_persistent_group=1 at the time of reading disabled=2

Configuration file network block with disabled=2 is used for storing
information about a persistent group, so p2p_persitent_group should be
updated according to this when creating a struct wpa_ssid instance. This
will end up using D-Bus persistent network object path for the network.

Signed-off-by: Avichal Agarwal <avichal.a@samsung.com>
Signed-off-by: Kyeong-Chae Lim <kcya.lim@samsung.com>
8 years agotests: Fix wpas_ap_acs after 5 GHz use
Jouni Malinen [Sun, 11 Dec 2016 22:58:00 +0000 (00:58 +0200)] 
tests: Fix wpas_ap_acs after 5 GHz use

Work around the mac80211_hwsim limitation on channel survey by forcing
the last connection to be on 2.4 GHz band. Without this, wpas_ap_acs
would have failed to start the AP if the previous test case used the 5
GHz band.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoRemove MBO dependency from Supported Operating Classes element
vamsi krishna [Fri, 2 Dec 2016 08:54:39 +0000 (14:24 +0530)] 
Remove MBO dependency from Supported Operating Classes element

Supported Operating Classes element and its use is define in the IEEE
802.11 standard and can be sent even when MBO is disabled in the build.
As such, move this functionality out from the CONFIG_MBO=y only mbo.c.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agonl80211: Specify the BSSID in the QCA vendor scan
Sunil Dutt [Mon, 5 Dec 2016 11:22:20 +0000 (16:52 +0530)] 
nl80211: Specify the BSSID in the QCA vendor scan

This allows the vendor scan to be optimized when a response is needed
only from a single, known BSS.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoDefine an attribute to do a specific BSSID QCA vendor scan
Sunil Dutt [Mon, 5 Dec 2016 11:21:20 +0000 (16:51 +0530)] 
Define an attribute to do a specific BSSID QCA vendor scan

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoAdd QCA vendor command definitions for IDs 61-73
Sunil Dutt [Thu, 8 Dec 2016 13:28:42 +0000 (18:58 +0530)] 
Add QCA vendor command definitions for IDs 61-73

This commit documents the QCA vendor commands 61-73 and the
corresponding definitions of the attributes. This set of commands were
previously reserved for QCA without documentation here.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoDefine QCA Beacon miss threshold attributes for 2.4 and 5 GHz bands
Sunil Dutt [Fri, 9 Dec 2016 12:08:26 +0000 (17:38 +0530)] 
Define QCA Beacon miss threshold attributes for 2.4 and 5 GHz bands

These thresholds values indicate how many Beacon frames can be missed
before before disconnecting from the AP.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoFix QCA vendor command values for SAR power limits
Jouni Malinen [Sun, 11 Dec 2016 19:08:25 +0000 (21:08 +0200)] 
Fix QCA vendor command values for SAR power limits

Commit c79238b6a460ab6bc6ebc5e2453fd94716393105 ('Define a QCA vendor
command to configure SAR Power limits') had a mismatch between the enum
qca_vendor_attr_sar_limits_selections documentations and actual values.
The BDF SAR profiles are 0-based, so rename the enum values and reorder
the values keep the actual values more convenient. While this changes
values over the interface, this is justifiable since the new command was
introduced only recently and it had not been released in any driver.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: Increase timeout in wpas_mesh_password_mismatch
Jouni Malinen [Sun, 11 Dec 2016 18:08:39 +0000 (20:08 +0200)] 
tests: Increase timeout in wpas_mesh_password_mismatch

There has been number of failures from this test case due to the
MESH-SAE-AUTH-FAILURE event from dev[0] and dev[1] arriving couple of
seconds after the one second timeout after the dev[2] events. This does
not look like a real issue, so increase the timeout to five seconds to
make this less likely to show false failures during testing.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Verify wpa_state after INTERWORKING_SELECT
Jouni Malinen [Sun, 11 Dec 2016 17:51:09 +0000 (19:51 +0200)] 
tests: Verify wpa_state after INTERWORKING_SELECT

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Make scan_trigger_failure more informative
Jouni Malinen [Sun, 11 Dec 2016 16:41:04 +0000 (18:41 +0200)] 
tests: Make scan_trigger_failure more informative

If wpa_state is left to SCANNING by a previously executed test case,
scan_trigger_failure will fail. Instead of waiting for that failure,
check for wpa_state at the beginning of the test case and report a more
helpful error message if the test case would fail due to a previously
executed test case.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoInterworking: Clear SCANNING state if no network selected
Jouni Malinen [Sun, 11 Dec 2016 16:39:12 +0000 (18:39 +0200)] 
Interworking: Clear SCANNING state if no network selected

Commit 192ad3d7307473f14c049c1ea724e292a3f8ae24 ('Interworking: Clear
SCANNING state if no match found') did this for the case where no
network matched credentials, but left the SCANNING state in place if
there were a match, but automatic connection was not enabled. Extend
this to cover the case where INTERWORKING_SELECT is not followed by a
connection attempt so that wpa_state is not left indefinitely to
SCANNING.

This fixes a hwsim test case failure in the following sequence:
ap_anqp_sharing scan_trigger_failure

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoSME: Fix IBSS setup after shared key/FT/FILS association
Jouni Malinen [Sun, 11 Dec 2016 16:23:13 +0000 (18:23 +0200)] 
SME: Fix IBSS setup after shared key/FT/FILS association

wpa_s->sme.auth_alg could have been left to a previously value other
than WPA_AUTH_ALG_OPEN if IBSS network is used after an association that
used shared key, FT, or FILS authentication algorithm. This could result
in the IBSS setup failing due to incorrect authentication processing
steps.

Fix this by setting wpa_s->sme.auth_alg = WPA_AUTH_ALG_OPEN whenever
starting an IBSS (or mesh, for that matter) network.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoP2P: Fix a theoretical out of bounds read in wpas_p2p_select_go_freq()
Amit Purwar [Fri, 9 Dec 2016 13:29:16 +0000 (18:59 +0530)] 
P2P: Fix a theoretical out of bounds read in wpas_p2p_select_go_freq()

Commit 8e84921efe652233703588852bc43c36ccb241df ('P2P: Support driver
preferred freq list for Autonomous GO case') introduced this loop to go
through preferred channel list from the driver. The loop does bounds
checking of the index only after having read a value from the array.
That could in theory read one entry beyond the end of the stack buffer.

Fix this by moving the index variable check to be done before using it
to fetch a value from the array.

This code is used only if wpa_supplicant is build with
CONFIG_DRIVER_NL80211_QCA=y and if the driver supports the vendor
extension (get_pref_freq_list() driver op). In addition, the driver
would need to return more than P2P_MAX_PREF_CHANNELS (= 100) preferred
channels for this to actually be able to read beyond the buffer. No
driver is known to return that many preferred channels, so this does not
seem to be reachable in practice.

Signed-off-by: Amit Purwar <amit.purwar@samsung.com>
Signed-off-by: Mayank Haarit <mayank.h@samsung.com>
8 years agoP2P: Fix a theoretical out of bounds read in wpas_p2p_setup_freqs()
Amit Purwar [Fri, 9 Dec 2016 13:25:59 +0000 (18:55 +0530)] 
P2P: Fix a theoretical out of bounds read in wpas_p2p_setup_freqs()

Commit 370017d968e071522357ea88c0c6aaed02853222 ('P2P: Use preferred
frequency list from the local driver') introduced this loop to go
through preferred channel list from the driver. The loop does bounds
checking of the index only after having read a value from the array.
That could in theory read one entry beyond the end of the stack buffer.

Fix this by moving the index variable check to be done before using it
to fetch a value from the array.

This code is used only if wpa_supplicant is build with
CONFIG_DRIVER_NL80211_QCA=y and if the driver supports the vendor
extension (get_pref_freq_list() driver op). In addition, the driver
would need to return more than P2P_MAX_PREF_CHANNELS (= 100) preferred
channels for this to actually be able to read beyond the buffer. No
driver is known to return that many preferred channels, so this does not
seem to be reachable in practice.

Signed-off-by: Amit Purwar <amit.purwar@samsung.com>
Signed-off-by: Mayank Haarit <mayank.h@samsung.com>
8 years agotests: Add kernel BSS leak tests
Johannes Berg [Thu, 8 Dec 2016 16:29:43 +0000 (17:29 +0100)] 
tests: Add kernel BSS leak tests

Add two tests that check if the kernel BSS leak (when we get a deauth or
otherwise abandon an association attempt) is present in the kernel. This
is for a long-standing cfg80211/mac80211 issue that got fixed with the
kernel commit 'cfg80211/mac80211: fix BSS leaks when abandoning assoc
attempts'.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agotests: P2P device discovery and peer changing device name
Jouni Malinen [Sat, 10 Dec 2016 20:35:49 +0000 (22:35 +0200)] 
tests: P2P device discovery and peer changing device name

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoP2P: Send P2P-DEVICE-FOUND event on peer changing device name
Mayank Haarit [Wed, 7 Dec 2016 16:46:04 +0000 (22:16 +0530)] 
P2P: Send P2P-DEVICE-FOUND event on peer changing device name

This is to handle the case when peer changes device name and same needs
to be updated to upper layers by P2P-DEVICE-FOUND event. It is similar
to the case when a peer changes wfd_subelems and P2P-DEVICE-FOUND event
goes to upper layers.

Signed-off-by: Mayank Haarit <mayank.h@samsung.com>
Signed-off-by: Avichal Agarwal <avichal.a@samsung.com>
8 years agotests: Peer disabling Wi-Fi Display advertisement
Jouni Malinen [Sat, 10 Dec 2016 17:30:12 +0000 (19:30 +0200)] 
tests: Peer disabling Wi-Fi Display advertisement

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoWFD: Clear wfd_subelems when P2P peer stops sending them
Mayank Haarit [Wed, 7 Dec 2016 15:17:16 +0000 (20:47 +0530)] 
WFD: Clear wfd_subelems when P2P peer stops sending them

When a peer device stops sending wfd_subelems, wpa_supplicant should
remove dev->info.wfd_subelems from peer's properties. Previously,
wpa_supplicant left the previously learned dev->info.wfd_subelems in
place whenever the new message did not include wfd_subelems.

In addition to fixing the clearing of the old wfd_subelems, this
resolves another issue. As "wfd_changed" variable becomes true even when
peer stops sending wfd_subelems and dev->info.wfd_subelems has an old
value, a new P2P-DEVICE-FOUND event notification was sent again and
again to upper layers whenever a new discovery response was received
from the peer that previously advertised WFD subelements.

Signed-off-by: Mayank Haarit <mayank.h@samsung.com>
8 years agotests: Ongoing scan and FLUSH
Jouni Malinen [Sat, 10 Dec 2016 17:03:07 +0000 (19:03 +0200)] 
tests: Ongoing scan and FLUSH

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoIgnore scan results from ongoing scan when FLUSH command is issued
Jouni Malinen [Sat, 10 Dec 2016 17:00:47 +0000 (19:00 +0200)] 
Ignore scan results from ongoing scan when FLUSH command is issued

This makes wpa_supplicant behavior more consistent with FLUSH command to
clear all state. Previously, it was possible for an ongoing scan to be
aborted when the FLUSH command is issued and the scan results from that
aborted scan would still be processed and that would update the BSS
table which was supposed to cleared by the FLUSH command.

This could result in hwsim test case failures due to unexpected BSS
table entries being present after the FLUSH command.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Scan and only_new=1 multiple times
Jouni Malinen [Sat, 10 Dec 2016 15:04:08 +0000 (17:04 +0200)] 
tests: Scan and only_new=1 multiple times

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoMake update_idx available in BSS control interface command
Jouni Malinen [Sat, 10 Dec 2016 15:03:24 +0000 (17:03 +0200)] 
Make update_idx available in BSS control interface command

This can be used to perform more accurate tests on BSS entry updates.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Make p2ps_wildcard_p2ps more robust
Jouni Malinen [Fri, 9 Dec 2016 22:33:33 +0000 (00:33 +0200)] 
tests: Make p2ps_wildcard_p2ps more robust

The final check in this test case was issuing a new P2P_FIND command
immediately after the P2P_SERVICE_DEL command on the peer. It looked
like it was possible for the scan timing to go in a sequence that made
the new P2P_FIND operation eventually accept a cfg80211 BSS entry from
the very end of the previous P2P_FIND. This resulted in unexpected
P2P-DEVICE-FOUND event even though there was no new Probe Response frame
from the peer at that point in time.

Make this less likely to show unrelated failures by waiting a bit before
starting a new P2P_FIND operation after having changes peer
configuration.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoP2P: Clear PEER_WAITING_RESPONSE on GO Negotiation success
Jouni Malinen [Fri, 9 Dec 2016 22:16:33 +0000 (00:16 +0200)] 
P2P: Clear PEER_WAITING_RESPONSE on GO Negotiation success

Previously, this flag was cleared only in case of failed GO Negotiation.
That could leave the flag set for a peer and if a new group formation
was performed with the same peer before the entry expired, there was
increased risk of getting stuck in a state where neither peer replied to
a GO Negotiation Request frame if a GO Negotiation Response frame with
Status 1 was dropped.

The error sequence could happen in the go_neg_with_bss_connected test
case when timing was suitable to make the second GO negotiation drop a
pending TX Action frame if the GO Negotiation Response with Status 1 was
scheduled for transmission during a P2P scan and P2P_CONNECT was issued
before that scan got aborted.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoDefine a QCA vendor command to configure SAR Power limits
Jeff Johnson [Tue, 6 Dec 2016 00:13:36 +0000 (16:13 -0800)] 
Define a QCA vendor command to configure SAR Power limits

There is a regulatory requirement for Specific Absorption Rate (SAR)
whereby the device transmit power is reduced when it is determined that
the device is in close proximity to the body. Implement a vendor command
interface to allow a userspace entity to dynamically control the SAR
power limits.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoUse eloop timeout for post-EAP-Failure wait before disconnection
Jouni Malinen [Tue, 6 Dec 2016 16:12:11 +0000 (18:12 +0200)] 
Use eloop timeout for post-EAP-Failure wait before disconnection

Previously, os_sleep() was used to block the hostapd (or wpa_supplicant
AP/P2P GO mode) processing between sending out EAP-Failure and
disconnecting the STA. This is not ideal for couple of reasons: it
blocks all other parallel operations in the process and it leaves a
window during which the station might deauthenticate and the AP would
have no option for reacting to that before forcing out its own
Deauthentication frame which could go out after the STA has already
started new connection attempt.

Improve this design by scheduling an eloop timeout of 10 ms instead of
the os_sleep() call and perform the delayed operations from the eloop
callback function. This eloop timeout is cancelled if the STA
disconnects or initiates a new connection attempt before the 10 ms time
is reached. This gets rid of the confusing extra Deauthentication frame
in cases where the STA reacts to EAP-Failure by an immediate
deauthentication.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: WEP to WPA2-PSK configuration change in hostapd
Jouni Malinen [Mon, 5 Dec 2016 19:30:17 +0000 (21:30 +0200)] 
tests: WEP to WPA2-PSK configuration change in hostapd

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoAllow hostapd wep_key# parameters to be cleared
Jouni Malinen [Mon, 5 Dec 2016 19:28:50 +0000 (21:28 +0200)] 
Allow hostapd wep_key# parameters to be cleared

Setting wep_key# to an empty string will now clear a previously
configured key. This is needed to be able to change WEP configured AP to
using WPA/WPA2 through the hostapd control interface SET commands.

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