]> git.ipfire.org Git - thirdparty/hostap.git/log
thirdparty/hostap.git
8 years agoP2P: Clear the discovery state incase of deffered GO Neg response android-l
Jithu Jance [Tue, 19 Aug 2014 21:19:38 +0000 (14:19 -0700)] 
P2P: Clear the discovery state incase of deffered GO Neg response

Bug: 17027752

Change-Id: I7d16080864264b838169f7b477598353c5d61d37
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
8 years agoUpdate AP IE regardless WPA_DRIVER_FLAGS_BSS_SELECTION flag
Dmitry Shmidt [Fri, 15 Feb 2013 00:44:44 +0000 (16:44 -0800)] 
Update AP IE regardless WPA_DRIVER_FLAGS_BSS_SELECTION flag

Change-Id: Ia2b0aea81e250cfd989861ed37551ca8c41f7a66
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
(cherry picked from commit 18306c6ac9281cca7d986a0d780047df0f32675f)

8 years agoAOSP: Android: Add src directory symlinks
Dmitry Shmidt [Tue, 15 Nov 2011 14:00:34 +0000 (16:00 +0200)] 
AOSP: Android: Add src directory symlinks

These are from Android wpa_supplicant_8.git initial 0.8.X commit
8d520ff1dc2da35cdca849e982051b86468016d8.

Change-Id: I26aec5afbbd4f4a1f5fd900912545b6f5050de64
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
(cherry picked from commit 05d4c3aec6024ed308d640d68f91ab4e926fd79d)

8 years agoAOSP: Add CleanSpec.mk
Jouni Malinen [Fri, 1 Nov 2013 09:11:11 +0000 (11:11 +0200)] 
AOSP: Add CleanSpec.mk

This is a snapshot from AOSP commit
0a67fb8a30fa69ee3b158f981bb1f6865bfbdef5

8 years agoAOSP: Android: Add MODULE_LICENSE_BSD_LIKE
Dmitry Shmidt [Tue, 15 Nov 2011 13:58:56 +0000 (15:58 +0200)] 
AOSP: Android: Add MODULE_LICENSE_BSD_LIKE

These are from Android wpa_supplicant_8.git initial 0.8.X commit
8d520ff1dc2da35cdca849e982051b86468016d8.

Change-Id: I26aec5afbbd4f4a1f5fd900912545b6f5050de64
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
(cherry picked from commit a6df7575b64ef902ae27d17769a3cf7e6056a975)

8 years agoAndroid: Fix keystore-backed keys with BoringSSL
Adam Langley [Tue, 6 Oct 2015 18:05:53 +0000 (11:05 -0700)] 
Android: Fix keystore-backed keys with BoringSSL

The switch to BoringSSL broke keystore-backed keys because
wpa_supplicant was using the dynamic ENGINE loading to load
the keystore module.
The ENGINE-like functionality in BoringSSL is much simpler
and this change should enable it.

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
8 years agoSync with mac80211-next.git include/uapi/linux/nl80211.h
Jouni Malinen [Tue, 6 Oct 2015 16:06:30 +0000 (19:06 +0300)] 
Sync with mac80211-next.git include/uapi/linux/nl80211.h

This brings in nl80211 definitions as of 2015-05-06.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoFix couple of typos in hostapd.conf file
Maneesh Jain [Tue, 6 Oct 2015 07:54:18 +0000 (13:24 +0530)] 
Fix couple of typos in hostapd.conf file

Signed-off-by: Maneesh Jain <maneesh.jain@samsung.com>
8 years agoWait longer for inactive client probe (empty data frame)
Dmitry Ivanov [Tue, 6 Oct 2015 13:26:58 +0000 (16:26 +0300)] 
Wait longer for inactive client probe (empty data frame)

Some devices cannot respond to inactive client probe (empty data frame)
within one second. For example, iPhone may take up to 3 secs. This
becomes a significant problem when ap_max_inactivity is set to lower
value such as 10 secs. iPhone can lose Wi-Fi connection after ~1 min
of user inactivity.

Signed-off-by: Dmitry Ivanov <dima@ubnt.com>
8 years agohostapd: Force RADIUS socket renewal on RADIUS auth failures
Helmut Schaa [Wed, 16 Sep 2015 12:04:56 +0000 (14:04 +0200)] 
hostapd: Force RADIUS socket renewal on RADIUS auth failures

On RADIUS auth/acct failures hostapd will try a new server if one is
available. Reuse the failover logic to force a socket renewal if only
one RADIUS server is configured.

This fixes problems when a route for the RADIUS server gets added after
the socket was "connected". The RADIUS socket is still sending the
RADIUS requests out using the previous route.

Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
8 years agomesh: Generate proper AID for peer
Bob Copeland [Mon, 5 Oct 2015 12:16:40 +0000 (08:16 -0400)] 
mesh: Generate proper AID for peer

IEEE Std 802.11-2012 13.3.1 states that the AID should be generated on
the local node for each peer. Previously, we were using the peer link ID
(generated by the peer) which may not be unique among all peers. Correct
this by reusing the AP AID generation code.

Signed-off-by: Bob Copeland <me@bobcopeland.com>
8 years agoRemove WEP support from VLAN
Michael Braun [Mon, 5 Oct 2015 14:14:27 +0000 (16:14 +0200)] 
Remove WEP support from VLAN

Commit d66dcb0d0b584afdbaba00adcfe661741703094d ('WEP: Remove VLAN
support from hostapd') already removed VLAN support for WEP encryption,
so vlan_setup_encryption_dyn() is no longer needed.

Signed-off-by: Michael Braun <michael-dev@fami-braun.de>
8 years agotests: Verify group encryption is set up for VLANs early
Michael Braun [Mon, 5 Oct 2015 14:14:25 +0000 (16:14 +0200)] 
tests: Verify group encryption is set up for VLANs early

Check that there are no unencrypted frames when using hostapd with VLANs
and WPA before the first station connects to the VLAN.

Signed-off-by: Michael Braun <michael-dev@fami-braun.de>
8 years agoFix init of group state machine for static VLANs
Michael Braun [Mon, 5 Oct 2015 14:14:26 +0000 (16:14 +0200)] 
Fix init of group state machine for static VLANs

This ensures that group key is set as long as the interface exists.

Additionally, ifconfig_up is needed as wpa_group will enter
FATAL_FAILURE if the interface is still down. Also vlan_remove_dynamic()
is moved after wpa_auth_sta_deinit() so vlan_remove_dynamic() can check
it was the last user of the wpa_group.

Signed-off-by: Michael Braun <michael-dev@fami-braun.de>
8 years agotests: Read monitor messages more frequently
Jouni Malinen [Sun, 4 Oct 2015 17:45:20 +0000 (20:45 +0300)] 
tests: Read monitor messages more frequently

These test cases left at least one of the attached monitor sockets
blocking for excessive time: ap_wpa2_eap_aka_ext,
ap_hs20_req_conn_capab_and_roaming_partner_preference,
ap_hs20_min_bandwidth_and_roaming_partner_preference, ap_wpa_ie_parsing.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Speed up hostapd_oom_loop tests
Jouni Malinen [Sun, 4 Oct 2015 15:27:54 +0000 (18:27 +0300)] 
tests: Speed up hostapd_oom_loop tests

At some point, these hostapd_oom_* test cases started to fail with
wpa_msg() allocation failure for the AP-ENABLED event. This resulted in
unnecessary long test execution (waiting 30 seconds for an event that
was dropped). Speed this up by using a shorter timeout.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Read monitor events explicitly in wpas_ctrl_interface_add_many
Jouni Malinen [Sun, 4 Oct 2015 09:22:02 +0000 (12:22 +0300)] 
tests: Read monitor events explicitly in wpas_ctrl_interface_add_many

This test case ended up hitting control socket output queue limit
unnecessarily due to the test script not reading pending event messages.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoAdd forgotten list entry removal for control interface deinit
Jouni Malinen [Sun, 4 Oct 2015 08:58:24 +0000 (11:58 +0300)] 
Add forgotten list entry removal for control interface deinit

dl_list_del() must be called before freeing the list entries. Neither of
these cases caused problems because the full list data structure was
freed, but still, it is better to do this properly.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: wpa_supplicant control socket and event burst
Jouni Malinen [Sun, 4 Oct 2015 08:46:02 +0000 (11:46 +0300)] 
tests: wpa_supplicant control socket and event burst

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoThrottle control interface event message bursts
Jouni Malinen [Sun, 4 Oct 2015 08:53:26 +0000 (11:53 +0300)] 
Throttle control interface event message bursts

Some operations like a new scan result processing can result in large
number of wpa_supplicant control interface messages being generated.
Especially with multiple control interface monitors, this could result
in hitting the output queue length maximum and event messages getting
dropped. In worst case, that could even result in hitting ten
consecutive sendto() errors which could result in an attached monitor
socket getting detached.

Avoid this type of issues by throttling monitor event transmission based
on the output queue length. If more than half of the maximum send buffer
is used, postpone sending of following event messages until the pending
output queue has dropped below the limit.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoAdd wpa_supplicant EVENT_TEST control interface command
Jouni Malinen [Sun, 4 Oct 2015 08:45:13 +0000 (11:45 +0300)] 
Add wpa_supplicant EVENT_TEST control interface command

This testing command makes it easier to debug bursts of event message.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Make it less likely to overflow wlan5 control iface socket
Jouni Malinen [Sat, 3 Oct 2015 22:42:42 +0000 (01:42 +0300)] 
tests: Make it less likely to overflow wlan5 control iface socket

Number of test cases did not read all control interface socket events
from the dynamically added wlan5 interface. This could result in hitting
maximum socket TX queue length and failures in the following test cases.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Fix connect_cmd_roam with old scan results
Jouni Malinen [Sat, 3 Oct 2015 21:35:12 +0000 (00:35 +0300)] 
tests: Fix connect_cmd_roam with old scan results

connect_cmd_roam did not force a new scan to find the second AP. This
could result in failures due to the ROAM command getting rejected, e.g.,
in the following test case sequence: wext_pmksa_cache connect_cmd_roam.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Modify p2p_channel to also support CSA
Ilan Peer [Tue, 8 Sep 2015 09:46:33 +0000 (12:46 +0300)] 
tests: Modify p2p_channel to also support CSA

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
8 years agotests: AP Channel Switch, one switch with only ECSA IE
Johannes Berg [Tue, 8 Sep 2015 09:46:32 +0000 (12:46 +0300)] 
tests: AP Channel Switch, one switch with only ECSA IE

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agohostapd: Add testing option to use only ECSA
Johannes Berg [Tue, 8 Sep 2015 09:46:32 +0000 (12:46 +0300)] 
hostapd: Add testing option to use only ECSA

Some APs don't include a CSA IE when an ECSA IE is generated,
and mac80211 used to fail following their channel switch. Add
a testing option to hostapd to allow reproducing the behavior.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agoHandle VHT operating classes correctly
Andrei Otcheretianski [Tue, 8 Sep 2015 09:46:31 +0000 (12:46 +0300)] 
Handle VHT operating classes correctly

Fix and extend the ieee80211_freq_to_channel_ext() function to deal
correctly with VHT operating classes (128, 129, 130).

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
8 years agoSet channel and operating class in hostapd_fill_csa_settings()
Luciano Coelho [Tue, 8 Sep 2015 09:46:30 +0000 (12:46 +0300)] 
Set channel and operating class in hostapd_fill_csa_settings()

The CSA channel and operating class values need to be set for all types
of channel switch (i.e., either if it's triggered by the control
interfaces or due to the GO-follows-STA flow). To do so, move the code
that sets them from the GO-follows-STA flow to the more generic
hostapd_fill_csa_settings() function.

Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
8 years agoUse ieee80211_freq_to_chan() when getting segment indices
Luciano Coelho [Tue, 8 Sep 2015 09:46:29 +0000 (12:46 +0300)] 
Use ieee80211_freq_to_chan() when getting segment indices

The hostapd_hw_get_channel() function can't be used to convert center
frequencies to channel numbers, because the hw mode lists don't have all
the center frequencies. The hw mode lists have the main channel
frequencies and flags to indicate the channel topography.

For instance, channel 5805 with VHT80- has the channel center frequency
segment 0 at 5775. This segment is only indicated indirectly in the hw
mode list by the HOSTAPD_CHAN_VHT_50_30 flag. The hw mode list doesn't
have any elements with frequency 5775 to allow the conversion to a
channel number. Thus, we need to use ieee80211_freq_to_chan() instead.

Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
8 years agoProvide an offset to CSA counters in Probe Response frames
Andrei Otcheretianski [Tue, 8 Sep 2015 09:46:27 +0000 (12:46 +0300)] 
Provide an offset to CSA counters in Probe Response frames

Pass to the driver a list of CSA counter offsets when sending Probe
Response frames during a CSA period. This allows the kernel to correctly
update the CSA/eCSA elements.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
8 years agonl80211: Specify CSA offsets in send_mlme() driver op
Andrei Otcheretianski [Tue, 8 Sep 2015 09:46:26 +0000 (12:46 +0300)] 
nl80211: Specify CSA offsets in send_mlme() driver op

Some management frames contain CSA counters which should be updated by
kernel. Change driver op send_mlme() allowing to send a frame,
specifying an array of offsets to the CSA counters which should be
updated. For example, CSA offsets parameters should be specified when
sending Probe Response frames during CSA period.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
8 years agoAdvertise Supported Operating Classes elements in Beacon/Probe Response
Andrei Otcheretianski [Tue, 8 Sep 2015 09:46:25 +0000 (12:46 +0300)] 
Advertise Supported Operating Classes elements in Beacon/Probe Response

Advertise current operating class in Beacon and Probe Response frames.
This Supported Operating Classes element is required by the standard
when extended channel switch is supported. However, since this element
doesn't reflect correctly the sub-band spectrum breakdown and can't be
effectively used by clients, publish only the minimal required part
which is the current operating class.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
8 years agoHandle channel switch notification for other interface types
Ilan Peer [Tue, 8 Sep 2015 09:46:24 +0000 (12:46 +0300)] 
Handle channel switch notification for other interface types

Channel switch notification was handled only for AP/GO interfaces. As
the notification can be sent on other interface types as well, extend
the handling to handle other interface types.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
8 years agoFix CSA related IEs order
Andrei Otcheretianski [Tue, 8 Sep 2015 09:46:22 +0000 (12:46 +0300)] 
Fix CSA related IEs order

Fix the order of CSA, eCSA, Secondary Channel Offset, and Wide Bandwidth
Channel Switch Wrapper elements in Beacon and Probe Response frames.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
8 years agoMove HT CSA related IE function
Andrei Otcheretianski [Tue, 8 Sep 2015 09:46:21 +0000 (12:46 +0300)] 
Move HT CSA related IE function

Move Secondary Channel element function to ieee802_11_ht.c.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
8 years agoP2P: Implement P2P_GO_FREQ_MOVE_SCM_ECSA policy
Andrei Otcheretianski [Tue, 8 Sep 2015 09:46:20 +0000 (12:46 +0300)] 
P2P: Implement P2P_GO_FREQ_MOVE_SCM_ECSA policy

Add new GO frequency move policy. The P2P_GO_FREQ_MOVE_SCM_ECSA prefers
SCM if all the clients advertise eCSA support and the candidate
frequency is one of the group common frequencies.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
8 years agoP2P: Trigger channel selection correctly during CSA
Andrei Otcheretianski [Tue, 8 Sep 2015 09:46:19 +0000 (12:46 +0300)] 
P2P: Trigger channel selection correctly during CSA

Do not consider moving GOs to a new channel if one of them is in the
middle of CSA. In addition, call wpas_p2p_update_channel_list() after
EVENT_CH_SWITCH is handled.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
8 years agoMove hostapd_csa_in_progress() to hostapd.c
Ilan Peer [Tue, 8 Sep 2015 09:46:18 +0000 (12:46 +0300)] 
Move hostapd_csa_in_progress() to hostapd.c

Move hostapd_csa_in_progress() to hostapd.{h,c} so it can be used
for contexts other than DFS.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
8 years agoP2P: Relax wpas_p2p_init_go_params() for P2P GO CSA
Ilan Peer [Tue, 8 Sep 2015 09:46:17 +0000 (12:46 +0300)] 
P2P: Relax wpas_p2p_init_go_params() for P2P GO CSA

wpas_p2p_move_go_csa() uses wpas_p2p_init_p2p_params() to select the
frequency to move to. However, it is possible that all the channels are
already used, so the selection of a new frequency would fail, although
the frequency used by the P2P GO should not be considered as used if it
is the only one using it.

To overcome this, allow the frequency selection to continue even if all
the frequencies are in use, but the frequency used by the P2P GO is not
used by any station interface.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
8 years agoP2P: Implement wpas_p2p_move_go_csa()
Andrei Otcheretianski [Tue, 8 Sep 2015 09:46:16 +0000 (12:46 +0300)] 
P2P: Implement wpas_p2p_move_go_csa()

Use channel switch mechanism to move a P2P GO to a new channel,
when required. In order to be able to reconfigure the GO channel,
split wpa_supplicant_conf_ap() function, so the frequency
configuration part can be reused to find additional CSA settings.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
8 years agoAdd support for eCSA
Andrei Otcheretianski [Tue, 8 Sep 2015 09:46:15 +0000 (12:46 +0300)] 
Add support for eCSA

Extended channel switch provides an ability to switch between operating
classes and is required for P2P Devices by the P2P specification when
switching in 5 GHz.

When the operating class is provided for channel switch, the AP/P2P GO
will use eCSA IE in addition to the regular CSA IE both on 2.4 GHz and 5
GHz bands.

Transitions between different hw_modes are not supported.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
8 years agonl80211: Suppport multiple CSA counters
Andrei Otcheretianski [Tue, 8 Sep 2015 09:46:14 +0000 (12:46 +0300)] 
nl80211: Suppport multiple CSA counters

Channel switch may be performed using both CSA and eCSA IEs together.
This may happen, for example with a P2P GO on band A with legacy
clients. Extend driver API to support up to 2 CSA counters.

This patch also includes the required implementation for nl80211.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
8 years agoSupport VHT channel width change for CSA
Andrei Otcheretianski [Tue, 8 Sep 2015 09:46:13 +0000 (12:46 +0300)] 
Support VHT channel width change for CSA

When building Beacon and Probe Response frames for the target channel,
consider bandwidth parameter for VHT channels. In addition, add support
for updating vht_oper_centr_freq_seg0_idx and
vht_oper_centr_freq_seg1_idx.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
8 years agoAdd Wide Bandwidth Channel Switch element
Andrei Otcheretianski [Tue, 8 Sep 2015 09:46:12 +0000 (12:46 +0300)] 
Add Wide Bandwidth Channel Switch element

When switching to a VHT channel with width greater than 20 MHz, add Wide
Bandwidth Channel Switch element. This element is added in Beacon and
Probe Response frames inside Channel Switch Wrapper element.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
8 years agoUse previously computed channel in cs_freq_params for Beacon frames
Andrei Otcheretianski [Tue, 8 Sep 2015 09:46:11 +0000 (12:46 +0300)] 
Use previously computed channel in cs_freq_params for Beacon frames

When CSA is started, hostapd_change_config_freq() computes the channel
from the provided frequency. Use this stored channel to add CSA IE in
Beacon frames, instead of recomputing the channel each time.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
8 years agotests: hostapd WPS UPnP web OOM
Jouni Malinen [Sat, 3 Oct 2015 13:27:01 +0000 (16:27 +0300)] 
tests: hostapd WPS UPnP web OOM

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoWPS: Mark web_connection_parse_get() argument filename const
Jouni Malinen [Sat, 3 Oct 2015 13:26:10 +0000 (16:26 +0300)] 
WPS: Mark web_connection_parse_get() argument filename const

All the other web_connection_parse_*() functions were already doing
this, so make the GET handler consistent as well.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Fix OCSP response for ap_wpa2_eap_ttls_ocsp_revoked
Jouni Malinen [Fri, 2 Oct 2015 16:16:04 +0000 (19:16 +0300)] 
tests: Fix OCSP response for ap_wpa2_eap_ttls_ocsp_revoked

Due to a serial number mismatch, the correct "revoked" status was not
used; instead "unknown" was used. While the test case would not fail for
this, incorrect code path was checked.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agowpa_cli: Fix static linking with readline
David du Colombier [Thu, 1 Oct 2015 08:26:43 +0000 (11:26 +0300)] 
wpa_cli: Fix static linking with readline

The readline library depends on ncurses, so it should be set before
ncurses on the linker command line to be able to be statically linked
successfully.

Signed-off-by: David du Colombier <0intro@gmail.com>
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
8 years agotests: WPA2-PSK and retry for EAPOL-Key msg 3/4
Jouni Malinen [Thu, 1 Oct 2015 15:43:21 +0000 (18:43 +0300)] 
tests: WPA2-PSK and retry for EAPOL-Key msg 3/4

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoFix TK configuration to the driver in EAPOL-Key 3/4 retry case
Jouni Malinen [Thu, 1 Oct 2015 15:51:04 +0000 (18:51 +0300)] 
Fix TK configuration to the driver in EAPOL-Key 3/4 retry case

Commit 7d711541dced759b34313477d5d163e65c5b0131 ('Clear TK part of PTK
after driver key configuration') started clearing TK from memory
immediately after having configured it to the driver when processing
EAPOL-Key message 3/4. While this covered the most common case, it did
not take into account the possibility of the authenticator having to
retry EAPOL-Key message 3/4 in case the first EAPOL-Key message 4/4
response is lost. That case ended up trying to reinstall the same TK to
the driver, but the key was not available anymore.

Fix the EAPOL-Key message 3/4 retry case by configuring TK to the driver
only once. There was no need to try to set the same key after each
EAPOL-Key message 3/4 since TK could not change. If actual PTK rekeying
is used, the new TK will be configured once when processing the new
EAPOL-Key message 3/4 for the first time.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoRemove obsolete mac80211_hwsim tests
Jouni Malinen [Thu, 1 Oct 2015 09:46:10 +0000 (12:46 +0300)] 
Remove obsolete mac80211_hwsim tests

The tests/hwsim framework has obsoleted these separate configuration
files for manual mac80211_hwsim testing.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agonl80211: Add build option for QCA vendor extensions
Jouni Malinen [Tue, 29 Sep 2015 14:11:21 +0000 (17:11 +0300)] 
nl80211: Add build option for QCA vendor extensions

This allows the binary sizes to be reduced if no support for nl80211
vendor extensions are needed.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoParallelize distinct radio work operations
Kanchanapally, Vidyullatha [Fri, 25 Sep 2015 11:36:27 +0000 (17:06 +0530)] 
Parallelize distinct radio work operations

This commit contains the necessary changes to parallelize
distinct radio work operations which are different in type and
the band used, only when the underlying driver is capable of
supporting such simultaneous offchannel operations.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agonl80211: Extract driver offchannel simultaneous capability
Kanchanapally, Vidyullatha [Tue, 22 Sep 2015 10:49:02 +0000 (16:19 +0530)] 
nl80211: Extract driver offchannel simultaneous capability

Make the driver offchannel simultaneous capability available to
wpa_supplicant.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoAdd QCA vendor definitions for simultaneous offchannel
Kanchanapally, Vidyullatha [Tue, 15 Sep 2015 13:21:07 +0000 (18:51 +0530)] 
Add QCA vendor definitions for simultaneous offchannel

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agonl80211: Support vendor scan together with normal scan
Kanchanapally, Vidyullatha [Wed, 16 Sep 2015 12:15:05 +0000 (17:45 +0530)] 
nl80211: Support vendor scan together with normal scan

Allow wpa_supplicant to use vendor scan (if supported by the driver)
together with the normal nl80211 scan and handling external scan events.
Since this results in possibility of concurrent scan operations, some of
the operations related to scan results need to check more carefully when
an event is relevant for a specific interface.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agonl80211: Driver interaction for QCA vendor scan
Kanchanapally, Vidyullatha [Tue, 15 Sep 2015 13:54:43 +0000 (19:24 +0530)] 
nl80211: Driver interaction for QCA vendor scan

This commit contains the necessary changes for supporting the QCA vendor
scan implementation, i.e., sending the vendor scan command to underlying
driver and handling the vendor scan events from the driver.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoAdd QCA vendor definitions for vendor scan support
Kanchanapally, Vidyullatha [Tue, 15 Sep 2015 13:21:07 +0000 (18:51 +0530)] 
Add QCA vendor definitions for vendor scan support

Introduce definitions for QCA vendor specific subcommands
and attributes to support vendor scan request.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: Update server and user certificates (2015)
Jouni Malinen [Wed, 30 Sep 2015 22:37:47 +0000 (01:37 +0300)] 
tests: Update server and user certificates (2015)

The previous versions expired, so need to re-sign these to fix number of
the EAP test cases.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoThe master branch is now used for v2.6 development
Jouni Malinen [Sun, 27 Sep 2015 17:48:54 +0000 (20:48 +0300)] 
The master branch is now used for v2.6 development

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agodoc: Update version to 2.5
Jouni Malinen [Sun, 27 Sep 2015 19:07:22 +0000 (22:07 +0300)] 
doc: Update version to 2.5

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoChange version information for the 2.5 release hostap_2_5
Jouni Malinen [Sun, 27 Sep 2015 17:48:25 +0000 (20:48 +0300)] 
Change version information for the 2.5 release

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoAdd ChangeLog entries for v2.5
Jouni Malinen [Sun, 27 Sep 2015 17:13:59 +0000 (20:13 +0300)] 
Add ChangeLog entries for v2.5

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Add test for hostapd cli ordering
Johannes Berg [Tue, 15 Sep 2015 15:09:22 +0000 (17:09 +0200)] 
tests: Add test for hostapd cli ordering

When the 'SET wpa 2' command is executed last, it seems to somehow
reset parts of the settings, causing hostapd to beacon with the
pairwise cipher suite selector set to 00-0F-AC:0 (none/use-group).
This is not permitted and should be rejected; wpa_supplicant also
cannot connect.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agoDo not clear RSN parameters before full configuration
Jouni Malinen [Sun, 27 Sep 2015 10:25:00 +0000 (13:25 +0300)] 
Do not clear RSN parameters before full configuration

This fixes an issue where hostapd SET command is used to configure RSN
parameters and the wpa parameter is sent after the other parameters.
Previously, the default case here ended up clearing rsn_pairwise and
wpa_pairwise values and once wpa=2 was finally set, the cipher
configuration had already been lost.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoD-Bus: Add InvitationReceived Signal
Maneesh Jain [Thu, 18 Jun 2015 04:16:34 +0000 (09:46 +0530)] 
D-Bus: Add InvitationReceived Signal

This is equivalent to the P2P_EVENT_INVITATION_RECEIVED signal on the
control interface. It can be used to sent the Invitation Received signal
to applications written using D-Bus.

Signed-off-by: Maneesh Jain <maneesh.jain@samsung.com>
8 years agoD-Bus: Add Signal to notify WPS PBC Overlap event
Saurav Babu [Thu, 28 May 2015 03:53:07 +0000 (09:23 +0530)] 
D-Bus: Add Signal to notify WPS PBC Overlap event

Signed-off-by: Saurav Babu <saurav.babu@samsung.com>
8 years agoD-Bus: Add signal to notify WPS timeout event
Saurav Babu [Thu, 28 May 2015 03:53:06 +0000 (09:23 +0530)] 
D-Bus: Add signal to notify WPS timeout event

Signed-off-by: Saurav Babu <saurav.babu@samsung.com>
8 years agowpa_supplicant: Fix channel switch notification with VHT
Andrei Otcheretianski [Tue, 8 Sep 2015 09:46:23 +0000 (12:46 +0300)] 
wpa_supplicant: Fix channel switch notification with VHT

Fix a bug in wpas_ap_ch_switch() function, which didn't pass VHT
frequencies correctly to hostapd_event_ch_switch().

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
8 years agoUpdate wpa_s->current_ssid->frequency on CS event
Andrei Otcheretianski [Tue, 8 Sep 2015 09:46:10 +0000 (12:46 +0300)] 
Update wpa_s->current_ssid->frequency on CS event

Update wpa_s->current_ssid->frequency when EVENT_CH_SWITCH is received.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
8 years agoP2P: Fix the calculation of group common freqs
Ilan Peer [Tue, 8 Sep 2015 09:46:09 +0000 (12:46 +0300)] 
P2P: Fix the calculation of group common freqs

Previously, the calculation allowed for the same frequency to appear
several times in the result.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
8 years agoFix get_shared_radio_freqs_data() used-by flags setting
Andrei Otcheretianski [Tue, 8 Sep 2015 09:46:08 +0000 (12:46 +0300)] 
Fix get_shared_radio_freqs_data() used-by flags setting

Fix an iteration bug in get_shared_radio_freqs_data when building
freqs_data array. Only the last used-by flag was maintained instead of
making this a bitfield of all found uses.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
8 years agomesh: Add support for scanning only the current frequency
Masashi Honma [Tue, 8 Sep 2015 06:10:13 +0000 (15:10 +0900)] 
mesh: Add support for scanning only the current frequency

This patch enables scan_cur_freq=1 on VIF based mesh network.

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
8 years agoD-BUS: dev_passwd_id should be "q" because it uses DBUS_TYPE_UINT16
Nishant Chaprana [Thu, 17 Sep 2015 12:46:03 +0000 (18:16 +0530)] 
D-BUS: dev_passwd_id should be "q" because it uses DBUS_TYPE_UINT16

This corrects the type of dev_passwd_id in GONegotiationRequest event.
This field is packed as DBUS_TYPE_UINT16 but in
wpas_dbus_interface_signals it was "i" which is DBUS_TYPE_INT32.

Signed-off-by: Nishant Chaprana <n.chaprana@samsung.com>
8 years agoFix EAP-EKE peer build rules
Jouni Malinen [Fri, 25 Sep 2015 16:43:44 +0000 (19:43 +0300)] 
Fix EAP-EKE peer build rules

NEED_AES_CBC is needed for EAP-EKE builds.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoLinker changes for building eapol_test on OS X
Alan T. DeKok [Tue, 22 Sep 2015 15:24:12 +0000 (11:24 -0400)] 
Linker changes for building eapol_test on OS X

Signed-off-by: Alan DeKok <aland@freeradius.org>
8 years agoPortability fixes for OS X
Alan T. DeKok [Tue, 22 Sep 2015 14:56:51 +0000 (10:56 -0400)] 
Portability fixes for OS X

Fix os_get_reltime() and os_fdatasync() for OS X.

Signed-off-by: Alan DeKok <aland@freeradius.org>
8 years agoAndroid: Set ctrl_iface client socket group (AID_WIFI) separately
Amarnath Hullur Subramanyam [Wed, 23 Sep 2015 19:39:41 +0000 (12:39 -0700)] 
Android: Set ctrl_iface client socket group (AID_WIFI) separately

Split chown() call in wpa_ctrl_open() and wpa_ctrl_open2() to allow the
group id to be set even if the process does not have privileges to
change the owner. This is needed for modules that need to communicate
with wpa_supplicant since without the group change, wpa_supplicant may
not have privileges to send the response to a control interface command.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoAndroid: Avoid same per-iface and global ctrl socket
Sunil Dutt [Wed, 23 Sep 2015 15:51:49 +0000 (21:21 +0530)] 
Android: Avoid same per-iface and global ctrl socket

Android platform assigns the same socket id if the socket identifier in
conf->ctrl_interface and global->params.ctrl_interface (parameter for
android_get_control_socket) point to the same Android specific control
socket. This ends up having two eloop socket handlers registered for the
same file descriptor and thus, two attempt to receive and process each
command. This can result in unexpected failure, e.g., the prefix IFNAME=
for any command is valid for global socket handler, but results in
UNKNOWN COMMAND response from the per-interface ctrl socket handler).

Since it might be possible to end up with this type of invalid
configuration in OTA upgrade, compare the socket identifiers and do not
open the ctrl socket on the respective interface if both point to same.
This allows the Wi-Fi framework to use the global control interface.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoDo not copy STA VHT capabilities if VHT is not enabled for AP
Ashok Raj Nagarajan [Tue, 22 Sep 2015 13:56:00 +0000 (19:26 +0530)] 
Do not copy STA VHT capabilities if VHT is not enabled for AP

Previously, station's VHT information elements were copied and passed
regardless of the AP's VHT configuration. As a result, AP with VHT
disabled in configuration could have ended up transmitting packets in
VHT rates though AP is not advertising VHT support. Fix this by copying
the station's VHT capabilities only when AP supports VHT (both hardware
and configuration).

Signed-off-by: Ashok Raj Nagarajan <arnagara@qti.qualcomm.com>
8 years agotests: WPA2-Enterprise interactive identity entry and ENABLE_NETWORK
Jouni Malinen [Tue, 22 Sep 2015 09:03:53 +0000 (12:03 +0300)] 
tests: WPA2-Enterprise interactive identity entry and ENABLE_NETWORK

This verifies that ENABLE_NETWORK does not trigger reconnection if
already connected. The previous commit fixed a case where it was
possible for that to happen.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoAvoid reconnection on ENABLE_NETWORK if already connected
Jouni Malinen [Tue, 22 Sep 2015 08:55:54 +0000 (11:55 +0300)] 
Avoid reconnection on ENABLE_NETWORK if already connected

This was already the case for most command sequences, but it was
possible for wpa_s->reassociate to be set to 1 when CTRL-RSP-* commands
were used to set identity, password, or passphrase for EAP
authentication. In such cases, ENABLE_NETWORK issued after the
connection was completed could result in a new connection attempt
(likely reconnection back to the same BSS).

Fix this by checking whether an actual connection is already present
even if wpa_s->reassociate is set when processing the ENABLE_NETWORK
command.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoUpdate AP WPA/RSN IE on all associations if driver can select BSS
Sunil Dutt [Thu, 17 Sep 2015 10:30:42 +0000 (10:30 +0000)] 
Update AP WPA/RSN IE on all associations if driver can select BSS

It is possible for driver-based BSS selection to end up reassociating
back to the current AP. If wpa_supplicant preferred another BSS, it
would have updated the internal knowledge of the AP's WPA/RSN IE when
requesting a new connection. In the special case of existing association
and new association being with the same BSS that is different from the
wpa_supplicant preference, association event processing skipped the
WPA/RSN IE update. This could result in the following 4-way handshake
getting rejected due to incorrectly detected mismatch with AP's RSN/WPA
IE between Beacon/Probe Response frame and EAPOL-Key msg 3/4.

Fix this by updating the AP WPA/RSN IE on all association events when
driver-based BSS selection is used regardless of whether the BSSID
changes. This could also cover a theoretical case of the AP changing its
RSN/WPA IE at the very moment we try to reassociate back to the same
BSS.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoDrop some control interface debug print verbosity for send operations
Jouni Malinen [Thu, 10 Sep 2015 08:19:44 +0000 (11:19 +0300)] 
Drop some control interface debug print verbosity for send operations

These prints were at DEBUG level (-d), but they can be very frequent, so
drop them to MSGDUMP (-dd). This allows the prints to be suppressed in
common debugging cases while still leaving them easily enablable to
debug control interface issues without having to enable excessive
debugging.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoReduce debug verbosity for read-only control interface commands
Jouni Malinen [Thu, 10 Sep 2015 08:17:19 +0000 (11:17 +0300)] 
Reduce debug verbosity for read-only control interface commands

Commands like BSS and GET_NETWORK are used in some cases very frequently
and those can increase the amount of debug information from
wpa_supplicant without significant benefit. These were logged at the
DEBUG level (-d). Move logging of such read-only commands (i.e., no new
wpa_supplicant operation is started based on it) to EXCESSIVE level
(-ddd) which was already used for the PING command.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoWPA: Do not print GTK in debug log unless requested
Jouni Malinen [Wed, 9 Sep 2015 14:35:06 +0000 (17:35 +0300)] 
WPA: Do not print GTK in debug log unless requested

The GTK value received in RSN (WPA2) group rekeying did not use the
wpa_hexdump_key() version of debug printing that is conditional on -K
being included on the command line.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoWPS: Reduce struct wps_parse_attr size
Jouni Malinen [Mon, 7 Sep 2015 19:56:40 +0000 (22:56 +0300)] 
WPS: Reduce struct wps_parse_attr size

Use shorter variables for storing the attribute lengths and group these
variables together to allow compiler to pack them more efficiently. This
reduces the struct size from 960 bytes to 760 bytes in 64-bit builds.
This reduces stack use in number of functions.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoWPS: Reduce wps_ap_priority_compar() stack use
Jouni Malinen [Mon, 7 Sep 2015 19:52:45 +0000 (22:52 +0300)] 
WPS: Reduce wps_ap_priority_compar() stack use

There is no need to maintain two concurrent instances of struct
wps_parse_attr in this function. Share a single structure for parsing
both IEs.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: WPS and DISABLE/ENABLE AP
Jouni Malinen [Mon, 7 Sep 2015 17:53:23 +0000 (20:53 +0300)] 
tests: WPS and DISABLE/ENABLE AP

This is a regression test case for the issue fixed by the previous
commit (hapd->num_probereq_cb not getting cleared on deinit).

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoWPS: Fix num_probereq_cb clearing on DISABLE to avoid segfault
Chen, Yi [Wed, 2 Sep 2015 15:55:01 +0000 (21:25 +0530)] 
WPS: Fix num_probereq_cb clearing on DISABLE to avoid segfault

Reset hapd->num_probereq_cb to 0 on an interface deinit to avoid
unexpected behavior if the same interface is enabled again without fully
freeing the data structures. hostapd_register_probereq_cb() increments
hapd->num_probereq_cb by one and leaves all old values unchanged. In
this deinit+init case, that would result in the first entry in the list
having an uninitialized pointer and the next Probe Request frame
processing would likely cause the process to terminate on segmentation
fault.

This issue could be hit when hostapd was used with WPS enabled (non-zero
wps_state configuration parameter) and control interface command DISABLE
and ENABLE were used.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: WPS ER learn OOM
Jouni Malinen [Mon, 7 Sep 2015 14:46:40 +0000 (17:46 +0300)] 
tests: WPS ER learn OOM

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoWPS ER: Clean up WPS session on PutMessage error cases
Jouni Malinen [Mon, 7 Sep 2015 14:45:53 +0000 (17:45 +0300)] 
WPS ER: Clean up WPS session on PutMessage error cases

This is needed to allow new operation to be started after an error
without having to wait for the AP entry to time out.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: WPS ER SetSelectedRegistrar OOM
Jouni Malinen [Mon, 7 Sep 2015 14:24:29 +0000 (17:24 +0300)] 
tests: WPS ER SetSelectedRegistrar OOM

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: WPS ER OOM in PutWLANResponse generation
Jouni Malinen [Mon, 7 Sep 2015 14:08:52 +0000 (17:08 +0300)] 
tests: WPS ER OOM in PutWLANResponse generation

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: WPS ER OOM in STA add
Jouni Malinen [Mon, 7 Sep 2015 14:04:57 +0000 (17:04 +0300)] 
tests: WPS ER OOM in STA add

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: WPS ER and OOM in HTTP response generation
Jouni Malinen [Mon, 7 Sep 2015 13:59:19 +0000 (16:59 +0300)] 
tests: WPS ER and OOM in HTTP response generation

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Use sqlite3.Binary() with the log files
Jouni Malinen [Mon, 7 Sep 2015 13:53:23 +0000 (16:53 +0300)] 
tests: Use sqlite3.Binary() with the log files

This is needed to avoid issues in some cases where 8-bit bytestrings may
be present in the otherwise text debug log.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: WPS ER subscribe OOM
Jouni Malinen [Mon, 7 Sep 2015 13:38:38 +0000 (16:38 +0300)] 
tests: WPS ER subscribe OOM

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: WPS ER caching AP settings (OOM)
Jouni Malinen [Mon, 7 Sep 2015 13:31:38 +0000 (16:31 +0300)] 
tests: WPS ER caching AP settings (OOM)

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