]> git.ipfire.org Git - thirdparty/hostap.git/log
thirdparty/hostap.git
7 years agonl80211: Enhance abort scan to also abort the vendor scan
Sunil Dutt [Wed, 30 Nov 2016 04:34:38 +0000 (10:04 +0530)] 
nl80211: Enhance abort scan to also abort the vendor scan

This commit enhances the abort scan implementation to also abort the
vendor scan, if one was used to trigger the scan.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoDefine a QCA vendor command to abort vendor scan
Sunil Dutt [Tue, 22 Nov 2016 15:20:08 +0000 (20:50 +0530)] 
Define a QCA vendor command to abort vendor scan

The new QCA_NL80211_VENDOR_SUBCMD_ABORT_SCAN command can be used to
abort an ongoing scan that was started with
QCA_NL80211_VENDOR_SUBCMD_TRIGGER_SCAN.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agotests: PMF and Authentication frame injection
Jouni Malinen [Tue, 29 Nov 2016 14:07:25 +0000 (16:07 +0200)] 
tests: PMF and Authentication frame injection

Verify that AP does not break PMF-enabled connection due to injected
Authentication frame. This is a regression test for
NL80211_FEATURE_FULL_AP_CLIENT_STATE changes resulting in dropping the
key in such a case.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoAdd MGMT_RX_PROCESS test command for hostapd
Jouni Malinen [Tue, 29 Nov 2016 13:57:22 +0000 (15:57 +0200)] 
Add MGMT_RX_PROCESS test command for hostapd

This makes it easier to write hwsim test cases to verify management
frame processing sequences with dropped or modified frames. When
ext_mgmt_frame_handling is used, this new command can be used to request
hostapd to process a received a management frame, e.g., based on
information reported in the MGMT-RX events.

This is more or less identical to the earlier wpa_supplicant commit
4de70e2330c54c32f42a5fc93517d65c0a2c3be9 ('Add MGMT_RX_PROCESS test
command for wpa_supplicant'), but for hostapd.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoAP: Do not drop STA entry if PMF is used with full AP client state
Jouni Malinen [Tue, 29 Nov 2016 14:15:31 +0000 (16:15 +0200)] 
AP: Do not drop STA entry if PMF is used with full AP client state

This fixes a regression from commit
bb598c3bdd0616f0c15e1a42e99591d8f3ff3323 ('AP: Add support for full
station state'). That commit added code to remove and re-add the kernel
STA entry when processing Authentication frames with a driver that
advertises support for full AP client state. That resulted in bypassing
PMF protections for unprotected Authentication frames with such drivers
since the TK was lost in this operation.

It is simplest to skip the STA entry clearing in this type of case
completely to leave the TK in place and to process the new
authentication exchange otherwise normally. This matches the behavior
used with the drivers that do not implement full AP client state.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agotests: WPA2-PSK-FT AP with WPA2-PSK enabled and unexpected MDE
Jouni Malinen [Sat, 26 Nov 2016 09:30:26 +0000 (11:30 +0200)] 
tests: WPA2-PSK-FT AP with WPA2-PSK enabled and unexpected MDE

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoFT: Explicitly check for MDE not present in non-FT association
Will Glynn [Sat, 26 Nov 2016 02:39:12 +0000 (02:39 +0000)] 
FT: Explicitly check for MDE not present in non-FT association

IEEE Std 802.11-2012, 12.4.2 states that if an MDE is present in an
(Re)Association Request frame but the RSNE uses a non-FT AKM suite, the
AP shall reject the association using status code 43 ("Invalid AKMP").

wpa_validate_wpa_ie() now explicitly checks for this condition to meet
this requirement instead of simply ignoring the MDE based on non-FT AKM.

Signed-off-by: Will Glynn <will@willglynn.com>
7 years agotests: Beacon frame TX rate configuration
Jouni Malinen [Fri, 25 Nov 2016 22:36:50 +0000 (00:36 +0200)] 
tests: Beacon frame TX rate configuration

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agonl80211: Configure Beacon frame TX rate if driver advertises support
Purushottam Kushwaha [Thu, 24 Nov 2016 15:09:47 +0000 (20:39 +0530)] 
nl80211: Configure Beacon frame TX rate if driver advertises support

If the driver advertises support for setting Beacon frame data rate,
allow the user to configure this rate as part of starting the AP. Only
one Beacon frame TX rate is allowed.

Drivers advertising such support should set corresponding flag via the
NL80211_ATTR_EXT_FEATURES attribute.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoAdd support for user configurable Beacon frame data rate for AP mode
Purushottam Kushwaha [Tue, 22 Nov 2016 09:10:35 +0000 (14:40 +0530)] 
Add support for user configurable Beacon frame data rate for AP mode

Allow configuration of Beacon frame TX rate from hostapd.conf with
"beacon_rate=xx" option. The following format is used to set
legacy/HT/VHT beacon rates:

Legacy (CCK/OFDM rates):
beacon_rate=<legacy rate in 100 kbps>
HT:
beacon_rate=ht:<HT MCS>
VHT:
beacon_rate=vht:<VHT MCS>

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agotests: Random MAC address in scans while connected
Jouni Malinen [Fri, 25 Nov 2016 20:48:26 +0000 (22:48 +0200)] 
tests: Random MAC address in scans while connected

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoUse random MAC address for scanning only in non-connected state
Srinivas Dasari [Mon, 21 Nov 2016 12:10:36 +0000 (17:40 +0530)] 
Use random MAC address for scanning only in non-connected state

cfg80211 rejects the scans issued with random MAC address if the STA is
in connected state. This resulted in failures when using MAC_RAND_SCAN
while connected (CTRL-EVENT-SCAN-FAILED ret=-95). Enable random MAC
address functionality only if the STA is not in connected state to avoid
this. The real MAC address of the STA is already revealed in the
association, so this is an acceptable fallback mechanism for now.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agotests: D-Bus P2P and IP address parameters
Jouni Malinen [Mon, 21 Nov 2016 11:57:21 +0000 (13:57 +0200)] 
tests: D-Bus P2P and IP address parameters

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoD-Bus: Send P2P IP address assignment info with GroupStarted event
Nishant Chaprana [Wed, 2 Nov 2016 10:20:28 +0000 (15:50 +0530)] 
D-Bus: Send P2P IP address assignment info with GroupStarted event

This commit adds IP address information into GroupStarted event on the
P2P client side like it is sent over the control interface.

Signed-off-by: Nishant Chaprana <n.chaprana@samsung.com>
7 years agoD-Bus: Add getter and setter for P2P IP address config parameters
Nishant Chaprana [Thu, 3 Nov 2016 10:52:43 +0000 (16:22 +0530)] 
D-Bus: Add getter and setter for P2P IP address config parameters

This patch adds setter and getter for P2P IP address config parameters:
1. ip_addr_go
2. ip_addr_mask
3. ip_addr_start
4. ip_addr_end

Signed-off-by: Nishant Chaprana <n.chaprana@samsung.com>
7 years agoFT: Complete CONFIG_IEEE80211R_AP renaming for hostapd
Jouni Malinen [Sat, 19 Nov 2016 21:54:50 +0000 (23:54 +0200)] 
FT: Complete CONFIG_IEEE80211R_AP renaming for hostapd

Commit 4ec1fd8e42bad9390f14a58225b6e5f6fb691950 ('FT: Differentiate
between FT for station and for AP in build') renamed all
CONFIG_IEEE80211R instances within src/ap/* to CONFIG_IEEE80211R_AP, but
it did not change hostapd/* files to match. While this does not cause
much harm for normal use cases, this broke some test builds where
wpa_supplicant build is used to build in hostapd/*.c files for analysis.
Fix this by completing CONFIG_IEEE80211R_AP renaming.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agowpa_supplicant: Allow configuring the MACsec port for MKA
Sabrina Dubroca [Wed, 2 Nov 2016 15:38:39 +0000 (16:38 +0100)] 
wpa_supplicant: Allow configuring the MACsec port for MKA

Previously, wpa_supplicant only supported hardcoded port == 1 in the
SCI, but users may want to choose a different port.

Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
7 years agomka: Add enable_encrypt op and call it from CP state machine
Sabrina Dubroca [Wed, 2 Nov 2016 15:38:38 +0000 (16:38 +0100)] 
mka: Add enable_encrypt op and call it from CP state machine

This allows MKA to turn encryption on/off down to the driver.

Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
7 years agowpa_supplicant: Add macsec_integ_only setting for MKA
Sabrina Dubroca [Wed, 2 Nov 2016 15:38:37 +0000 (16:38 +0100)] 
wpa_supplicant: Add macsec_integ_only setting for MKA

So that the user can turn encryption on (MACsec provides
confidentiality+integrity) or off (MACsec provides integrity only). This
commit adds the configuration parameter while the actual behavior change
to disable encryption in the driver is handled in the following commit.

Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
7 years agomka: Disable peer detection timeout for PSK mode
Sabrina Dubroca [Wed, 2 Nov 2016 15:38:36 +0000 (16:38 +0100)] 
mka: Disable peer detection timeout for PSK mode

The first peer may take a long time to come up. In PSK mode we are
basically in a p2p system, and we cannot know when a peer will join the
key exchange. Wait indefinitely, and let the administrator decide if
they want to abort.

Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
7 years agowpa_supplicant: Allow pre-shared (CAK,CKN) pair for MKA
Sabrina Dubroca [Wed, 2 Nov 2016 15:38:35 +0000 (16:38 +0100)] 
wpa_supplicant: Allow pre-shared (CAK,CKN) pair for MKA

This enables configuring key_mgmt=NONE + mka_ckn + mka_cak.
This allows wpa_supplicant to work in a peer-to-peer mode, where peers
are authenticated by the pre-shared (CAK,CKN) pair. In this mode, peers
can act as key server to distribute keys for the MACsec instances.

This is what some MACsec switches support, and even without HW
support, it's a convenient way to setup a network.

Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
7 years agoFix hostapd usage entry style for -T
Jouni Malinen [Sat, 19 Nov 2016 20:20:14 +0000 (22:20 +0200)] 
Fix hostapd usage entry style for -T

Remove the extra equals sign from the line since hostapd usage text does
not have it for other entries either (while wpa_supplicant does and this
was likely copy-pasted from there).

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoAdd doxygen ref to eap_method structure
Sergei Sinyak [Thu, 10 Nov 2016 15:34:34 +0000 (18:34 +0300)] 
Add doxygen ref to eap_method structure

doc/eap.doxygen was mentioning eap_method structure, but there was no
reference as in doc/eap_server.doxygen on a similar paragraph

Signed-off-by: Sergei Sinyak <serega.belarus@gmail.com>
7 years agoAndroid: Remove BoringSSL guard
Kenny Root [Thu, 10 Nov 2016 21:05:01 +0000 (21:05 +0000)] 
Android: Remove BoringSSL guard

BoringSSL is the only supported version of SSL, so remove this guard so
we can continue to compile when the flavor.mk is removed.

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
7 years agonl80211: Fix get_inact_sec() returning -1 on failure
Joel Cunningham [Thu, 10 Nov 2016 19:24:41 +0000 (13:24 -0600)] 
nl80211: Fix get_inact_sec() returning -1 on failure

This commit fixes the nl80211 driver call get_inact_sec() to return -1
when STA inactivity time retrieval fails in i802_read_sta_data().

This was intended to be handled by initalizing the inactive_msec member
to -1 but i802_read_sta_data() assumes the data parameter is
uninitialized and memsets the entire structure, neutralizing the attempt
to distinguish between no value (-1) and a time value of 0.

This is fixed by now requiring i802_read_sta_data() callers to
initialize the data structure first (allowing get_inact_sec() to use
-1). This is a safe change because it does not change any driver API
behavior and only affects one other static function in driver_nl80211.c

Signed-off-by: Joel Cunningham <joel.cunningham@me.com>
7 years agomka: Fix getting capabilities from the driver
Sabrina Dubroca [Tue, 15 Nov 2016 17:06:23 +0000 (18:06 +0100)] 
mka: Fix getting capabilities from the driver

In commit a25e4efc9e428d968e83398bd8c9c94698ba5851 ('mka: Add driver op
to get macsec capabilities') I added some code to check the driver's
capabilities. This commit has two problems:
 - wrong enum type set in kay->macsec_confidentiality
 - ignores that drivers could report MACSEC_CAP_NOT_IMPLEMENTED, in
   which case the MKA would claim that MACsec is supported.

Fix this by interpreting MACSEC_CAP_NOT_IMPLEMENTED in the same way as a
DO_NOT_SECURE policy, and set the correct value in
kay->macsec_confidentiality.

Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
7 years agotests: GAS/ANQP and Capability List ANQP-element
Jouni Malinen [Thu, 17 Nov 2016 14:00:10 +0000 (16:00 +0200)] 
tests: GAS/ANQP and Capability List ANQP-element

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoReserve QCA vendor specific nl80211 command 144
Peng Xu [Wed, 9 Nov 2016 22:51:20 +0000 (14:51 -0800)] 
Reserve QCA vendor specific nl80211 command 144

This is reserved for QCA use.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agotests: GAS/ANQP and Venue URL
Jouni Malinen [Wed, 16 Nov 2016 18:32:42 +0000 (20:32 +0200)] 
tests: GAS/ANQP and Venue URL

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoGAS: Add Capability List ANQP-element support for Info ID 270, 280..299
Jouni Malinen [Wed, 16 Nov 2016 18:13:53 +0000 (20:13 +0200)] 
GAS: Add Capability List ANQP-element support for Info ID 270, 280..299

This extends the anqp_elem configuration parameter support for new Info
IDs (270 (TDLS Capability) was previously missed from the list of
defined values, 280 has already been assigned in REVmc/D8.0; 281..299
are yet to be assigned). No additional source code changes are needed to
allow hostapd to advertise support for these if the ANQP-element value
is set with the anqp_elem parameter.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agotests: Allow multiple management frames to be used with ap-mgmt-fuzzer
Jouni Malinen [Wed, 16 Nov 2016 16:17:08 +0000 (18:17 +0200)] 
tests: Allow multiple management frames to be used with ap-mgmt-fuzzer

The optional "-m <multi.dat>" command line option can now be used to
specify a data file that can include multiple management frames with
each one prefixed with a 16-bit big endian length field. This allows a
single fuzzer run to be used to go through multi-frame exchanges. The
multi.dat file shows an example of this with Probe Request frame,
Authentication frame, Association Request frame, and an Action frame.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoFix libap.a build
Jouni Malinen [Wed, 16 Nov 2016 11:26:23 +0000 (13:26 +0200)] 
Fix libap.a build

Add the new defines and files to allow src/ap/libap.a to be build with
all the needed functions.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoDebug print scan results matching the currently selected network
Jouni Malinen [Sun, 13 Nov 2016 16:22:38 +0000 (18:22 +0200)] 
Debug print scan results matching the currently selected network

This provides more details on BSS selection process in the debug log.
Previously, the BSSs that were not either the current or the selected
one were not necessarily printed at all. Now all BSSs that match the
currently selected network are listed with their frequency and signal
strength details.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoUse estimated throughput to avoid signal based roaming decision
Jouni Malinen [Sun, 13 Nov 2016 15:46:00 +0000 (17:46 +0200)] 
Use estimated throughput to avoid signal based roaming decision

Previously, the estimated throughput was used to enable roaming to a
better AP. However, this information was not used when considering a
roam to an AP that has better signal strength, but smaller estimated
throughput. This could result in allowing roaming from 5 GHz band to 2.4
GHz band in cases where 2.4 GHz band has significantly higher signal
strength, but still a lower throughput estimate.

Make this less likely to happen by increasing/reducing the minimum
required signal strength difference based on the estimated throughputs
of the current and selected AP. In addition, add more details about the
selection process to the debug log to make it easier to determine whaty
happened and why.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoRename a function argument to avoid shadowing a variable in global scope
Jouni Malinen [Sat, 12 Nov 2016 17:26:47 +0000 (19:26 +0200)] 
Rename a function argument to avoid shadowing a variable in global scope

Do not use optarg as a function argument since a variable with that name
is in the global scope.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agotests: Make ap_interworking_scan_filtering more robust
Jouni Malinen [Sat, 29 Oct 2016 19:23:53 +0000 (22:23 +0300)] 
tests: Make ap_interworking_scan_filtering more robust

It was possible for the first wt.clear_bss_counters(bssid) call to fail
the test if timing worked out in a way that the wlantest process had not
received any Beacon frames from the first AP. Run a directed scan for
both of the BSSs before starting the test validation steps to make sure
such a case cannot fail this test case.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoFT: Differentiate between FT for station and for AP in build
Ilan Peer [Thu, 27 Oct 2016 12:18:32 +0000 (15:18 +0300)] 
FT: Differentiate between FT for station and for AP in build

Previously, CONFIG_IEEE80211R enabled build that supports FT for both
station mode and AP mode. However, in most wpa_supplicant cases only
station mode FT is required and there is no need for AP mode FT.

Add support to differentiate between station mode FT and AP mode FT in
wpa_supplicant builds by adding CONFIG_IEEE80211R_AP that should be used
when AP mode FT support is required in addition to station mode FT. This
allows binary size to be reduced for builds that require only the
station side FT functionality.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
7 years agohostapd: Fix own wide bandwidth subelement generation (neighbor report)
Beni Lev [Thu, 27 Oct 2016 12:18:31 +0000 (15:18 +0300)] 
hostapd: Fix own wide bandwidth subelement generation (neighbor report)

The Channel Center Frequency Segment subfields use the channel index
instead of frequency in MHz.

Signed-off-by: Beni Lev <beni.lev@intel.com>
Signed-off-by: David Spinadel <david.spinadel@intel.com>
7 years agoAP: Use valid status code in wpa_ft_send_rrb_auth_resp()
Ilan Peer [Thu, 27 Oct 2016 12:18:30 +0000 (15:18 +0300)] 
AP: Use valid status code in wpa_ft_send_rrb_auth_resp()

The return value from this function may be used in an outgoing message,
so use a valid status code instead of -1.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
7 years agoExtend ieee80211_freq_to_channel_ext() to cover channels 52-64
Avraham Stern [Thu, 27 Oct 2016 12:18:29 +0000 (15:18 +0300)] 
Extend ieee80211_freq_to_channel_ext() to cover channels 52-64

Add frequency to channel conversion for the 5 GHz channels 52-64.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
7 years agowpa_supplicant: Make CONFIG_MBO independent of CONFIG_AP
Avrahams Stern [Thu, 27 Oct 2016 12:18:27 +0000 (15:18 +0300)] 
wpa_supplicant: Make CONFIG_MBO independent of CONFIG_AP

CONFIG_MBO was defined inside ifdef CONFIG_AP, so when AP support
was not compiled, MBO was not compiled either. However, CONFIG_MBO
is not related AP support, so it should not depend on CONFIG_AP.

Fix this by moving CONFIG_MBO outside of ifdef CONFIG_AP.

Signed-off-by: Avrahams Stern <avraham.stern@intel.com>
7 years agowpa_supplicant: Get scan_result IE also from Beacon frames
Eliad Peller [Thu, 27 Oct 2016 12:18:26 +0000 (15:18 +0300)] 
wpa_supplicant: Get scan_result IE also from Beacon frames

No reason to require ie_len if only beacon_ie_len is given.

Signed-off-by: Eliad Peller <eliadx.peller@intel.com>
7 years agotests: hostapd stationary_ap=1 in neighbor DB
Jouni Malinen [Sat, 29 Oct 2016 16:25:39 +0000 (19:25 +0300)] 
tests: hostapd stationary_ap=1 in neighbor DB

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agohostapd: Add a configuration to set an AP as stationary
David Spinadel [Thu, 27 Oct 2016 12:18:25 +0000 (15:18 +0300)] 
hostapd: Add a configuration to set an AP as stationary

Add a configuration option in hostapd.conf and in neighbor report that
sets an AP as stationary. To enable this option on the current AP set
the config option stationary_ap to 1. To set a neighbor entry to be
marked as stationary add the word stat to the SET_NEIGHBOR command. This
option tells hostapd to send LCI data even if it is older than requested
by max age subelement in RRM request.

Signed-off-by: David Spinadel <david.spinadel@intel.com>
7 years agohostapd: Clear location configuration when it is reset
Ilan Peer [Thu, 27 Oct 2016 12:18:24 +0000 (15:18 +0300)] 
hostapd: Clear location configuration when it is reset

In case that LCI or location civic configuration is cleared,
free the buffer holding the corresponding information to avoid
cases that the information is considered as valid/useful.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
7 years agohostapd: Fix adding neighbor entry
Ilan Peer [Thu, 27 Oct 2016 12:18:23 +0000 (15:18 +0300)] 
hostapd: Fix adding neighbor entry

It is possible that a LCI or location civic configuration buffer
is valid but contains no data. In such a case do not add the LCI
and location civic information to the entry in the neighbor
data base.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
7 years agomka: Implement reference counting on data_key
Sabrina Dubroca [Fri, 21 Oct 2016 12:45:29 +0000 (14:45 +0200)] 
mka: Implement reference counting on data_key

struct data_key already had a 'user' field for reference counting, but
it was basically unused.

Add an ieee802_1x_kay_use_data_key() function to take a reference on a
key, and use ieee802_1x_kay_deinit_data_key() to release the reference.

Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
7 years agomka: Add support for removing SAs
Sabrina Dubroca [Fri, 21 Oct 2016 12:45:28 +0000 (14:45 +0200)] 
mka: Add support for removing SAs

So that the core can notify drivers that need to perform some operations
when an SA is deleted.

Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
7 years agomka: Sync structs definitions with IEEE Std 802.1X-2010
Sabrina Dubroca [Fri, 21 Oct 2016 12:45:27 +0000 (14:45 +0200)] 
mka: Sync structs definitions with IEEE Std 802.1X-2010

Document some data structures from IEEE Std 802.1X-2010, and add the
(not used yet) struct ieee802_1x_mka_dist_cak_body.

Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
7 years agomka: Remove "channel" hacks from the stack and the macsec_qca driver
Sabrina Dubroca [Fri, 21 Oct 2016 12:45:26 +0000 (14:45 +0200)] 
mka: Remove "channel" hacks from the stack and the macsec_qca driver

This is specific to the macsec_qca driver. The core implementation
shouldn't care about this, and only deal with the complete secure
channel, and pass this down to the driver.

Drivers that have such limitations should take care of these in their
->create functions and throw an error.

Since the core MKA no longer saves the channel number, the macsec_qca
driver must be able to recover it. Add a map (which is just an array
since it's quite short) to match SCIs to channel numbers, and lookup
functions that will be called in every place where functions would get
the channel from the core code. Getting an available channel should be
part of channel creation, instead of being a preparation step.

Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
7 years agoFix typo in DigestAlgorithn
Sergei Sinyak [Sat, 29 Oct 2016 07:53:31 +0000 (10:53 +0300)] 
Fix typo in DigestAlgorithn

Replace n with m in DigestAlgorithn, i.e., DigestAlgorithm.

Signed-off-by: Sergei Sinyak <serega.belarus@gmail.com>
7 years agoFix typo in eap_example_server.c
Sergei Sinyak [Sat, 29 Oct 2016 07:53:30 +0000 (10:53 +0300)] 
Fix typo in eap_example_server.c

The server sends only requests to the peer,
and the peer sends only responses to the server.

Signed-off-by: Sergei Sinyak <serega.belarus@gmail.com>
7 years agoAP: Disable VHT in TKIP-only configuration
Filip Matusiak [Mon, 17 Oct 2016 14:53:09 +0000 (16:53 +0200)] 
AP: Disable VHT in TKIP-only configuration

This has already been done for WEP, but there's same constraint for not
allowing VTH rates in case of TKIP.

Signed-off-by: Filip Matusiak <filip.matusiak@tieto.com>
7 years agowpa_supplicant: Use correct interface type when creating P2P interface
Avrahams Stern [Tue, 18 Oct 2016 09:44:17 +0000 (12:44 +0300)] 
wpa_supplicant: Use correct interface type when creating P2P interface

When starting ASP provisioning with connection capability set to NEW,
don't create the pending P2P interface as a GO interface because
Go negotiation will determine which side will be the GO and it is
possible that eventually this interface will become the client.
In this case, when the P2P client is started it will start scanning
and do other station specific operations while the interface type
is AP.

Instead, use type WPA_IF_P2P_GROUP when creating the interface which
means the interface type will be determined later.

Signed-off-by: Avrahams Stern <avraham.stern@intel.com>
7 years agoP2P: Clear old P2PS provision data
Avrahams Stern [Tue, 18 Oct 2016 09:44:16 +0000 (12:44 +0300)] 
P2P: Clear old P2PS provision data

Receiving a provision discovery request for an ASP service that
has auto accept set to false should result in a provision discovery
response with the status field set to "currently unavailable".
Having stale P2PS provision data, results in sending a response with
the status set to success because it is mistakenly referred to as the
follow-on provision discovery request.

Fix that by clearing stale P2PS provision data in the following cases:
 1. When provision discovery is complete
 2. When ASP services are flushed (in which case old ASP provisioning
    is no longer valid).

Signed-off-by: Avrahams Stern <avraham.stern@intel.com>
7 years agoP2P: Clear listen state during PD-in-FIND
Arik Nemtsov [Tue, 18 Oct 2016 09:44:15 +0000 (12:44 +0300)] 
P2P: Clear listen state during PD-in-FIND

drv->in_listen should be cleared whenever the state timeout is cleared,
if they were set together. If the flag is not cleared, the
p2p_listen_end() called during cancel-remain-on-channel will not restart
the search, relying on the state timeout function to do it. Use the
p2p_stop_listen_for_freq() function to clear the listen state properly.

Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
7 years agoP2P: Clear P2PS provision state on P2P flush
Arik Nemtsov [Tue, 18 Oct 2016 09:44:14 +0000 (12:44 +0300)] 
P2P: Clear P2PS provision state on P2P flush

Otherwise, if a P2PS provision is incomplete before the flush, it can
cause incorrect provision responses to be sent out.

Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
7 years agohostapd: Added signal level to STA tracking
Kevin Mahoney [Tue, 18 Oct 2016 22:07:13 +0000 (22:07 +0000)] 
hostapd: Added signal level to STA tracking

Add signal level information to the station tracking information. Also
make it available via the "TRACK_STA_LIST" control command.

Signed-off-by: Kevin Mahoney <k.mahoney@cablelabs.com>
7 years agoRemove duplicate dl_list_init() for global_ctrl_dst
Michael Braun [Fri, 21 Oct 2016 11:11:56 +0000 (13:11 +0200)] 
Remove duplicate dl_list_init() for global_ctrl_dst

Commit 56885eecf4026b0199d5ba75bd50395a17d323cc ('hostapd: Add UDP
support for ctrl_iface') added dl_list_init() for global_ctrl_dst to
hostapd_global_ctrl_iface_init().

Though, hostapd_global_ctrl_iface_init() is only called from
main.c:main(), which already initializes global_ctrl_dst unconditionally
before. Same with global_ctrl_sock.

Remove this duplicate initialization.

Signed-off-by: Michael Braun <michael-dev@fami-braun.de>
7 years agohostapd_cli: Remove duplicate const in hostapd_cli_cmd()
Dmitry Shmidt [Mon, 24 Oct 2016 19:41:47 +0000 (19:41 +0000)] 
hostapd_cli: Remove duplicate const in hostapd_cli_cmd()

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
7 years agotests: Open AP and TDLS prohibited
Jouni Malinen [Fri, 28 Oct 2016 21:25:17 +0000 (00:25 +0300)] 
tests: Open AP and TDLS prohibited

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoTDLS: Fix checks on prohibit bits
Cedric Izoard [Mon, 24 Oct 2016 11:05:11 +0000 (11:05 +0000)] 
TDLS: Fix checks on prohibit bits

ext_capab/ext_capab_len do not include ID and Length so no extra +2
offset should be used. This fixes a regression from commit
faf427645aa79a32ebd8093ff676abfc9d36e951 ('TDLS: Use proper IE parsing
routine for non-EAPOL-Key cases') that replaced the IE parser without
noticing the difference in the pointer offset.

Signed-off-by: Flavia Vanetti <flavia.vanetti@ceva-dsp.com>
7 years agonl80211: Update channel information after channel switch notification
Peng Xu [Mon, 24 Oct 2016 23:54:36 +0000 (16:54 -0700)] 
nl80211: Update channel information after channel switch notification

When channel switch happens, driver wrapper's internal channel
information needs to be updated so that the new frequency will be used
in operations using drv->assoc_freq. Previously, only bss->freq was
updated and the new frequency was also indicated in the EVENT_CH_SWITCH
event. This could potentially leave out couple of cases that use
drv->assoc_freq at least as a fallback mechanism for getting the current
operating frequency.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoAdd CONFIG_IBSS_RSN=y into wpa_supplicant defconfig
Jouni Malinen [Fri, 28 Oct 2016 16:39:13 +0000 (19:39 +0300)] 
Add CONFIG_IBSS_RSN=y into wpa_supplicant defconfig

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoDo not try to start/join RSN IBSS without CONFIG_IBSS_RSN=y
Jouni Malinen [Fri, 28 Oct 2016 16:33:20 +0000 (19:33 +0300)] 
Do not try to start/join RSN IBSS without CONFIG_IBSS_RSN=y

Previously, a build without IBSS RSN support tried to start/join an IBSS
even if the profile was configured with RSN parameters. This does not
work and resulted in quite confusing debug log. Make this clearer by
explicitly checking for this case and reject the connection attempt with
a clearer debug log entry instead of trying something that is known to
fail.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoHS 2.0 server: Remove redundant NULL check
Maneesh Jain [Fri, 28 Oct 2016 06:16:27 +0000 (11:46 +0530)] 
HS 2.0 server: Remove redundant NULL check

Both devinfo and devdetail are non-NULL here due to the earlier check
within the same function.

Signed-off-by: Maneesh Jain <maneesh.jain@samsung.com>
7 years agoRemoved redundant NULL check for sta in hostapd_event_sta_low_ack()
Nishant Chaprana [Fri, 28 Oct 2016 06:29:42 +0000 (11:59 +0530)] 
Removed redundant NULL check for sta in hostapd_event_sta_low_ack()

Signed-off-by: Nishant Chaprana <n.chaprana@samsung.com>
7 years agoRemoved redundant NULL check for b in wpabuf_concat()
Nishant Chaprana [Fri, 28 Oct 2016 06:42:04 +0000 (12:12 +0530)] 
Removed redundant NULL check for b in wpabuf_concat()

Signed-off-by: Nishant Chaprana <n.chaprana@samsung.com>
7 years agodriver.h: Fix a typo in a comment
Maneesh Jain [Fri, 28 Oct 2016 07:28:46 +0000 (12:58 +0530)] 
driver.h: Fix a typo in a comment

Signed-off-by: Maneesh Jain <maneesh.jain@samsung.com>
7 years agonl80211: Allow TDLS trigger modes to be configured to the host driver
Sunil Dutt [Tue, 25 Oct 2016 15:41:04 +0000 (21:11 +0530)] 
nl80211: Allow TDLS trigger modes to be configured to the host driver

This commit adds a control interface command to configure the TDLS
trigger mode to the host driver. This TDLS mode is configured through
the "SET tdls_trigger_control" control interface command.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoQCA vendor command to configure the TDLS behavior in the host driver
Sunil Dutt [Tue, 25 Oct 2016 10:50:46 +0000 (16:20 +0530)] 
QCA vendor command to configure the TDLS behavior in the host driver

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoExtend QCA vendor attribute link layer statistics attribute
lifeng [Mon, 17 Oct 2016 07:37:22 +0000 (15:37 +0800)] 
Extend QCA vendor attribute link layer statistics attribute

This adds new statistics attributes to support channel hopping feature.

Signed-off-by: Li Feng <lifeng@qti.qualcomm.com>
7 years agoAdd more QCA vendor attribute definitions into qca-vendor.h
lifeng [Mon, 17 Oct 2016 07:27:53 +0000 (15:27 +0800)] 
Add more QCA vendor attribute definitions into qca-vendor.h

These attributes were previously maintained elsewhere. This commit moves
them to follow the standard assignment process through the qca-vendor.h
file in hostap.git.

Signed-off-by: Li Feng <lifeng@qti.qualcomm.com>
7 years agoQCA vendor attribute to report frame aggregation failure
lifeng [Wed, 26 Oct 2016 13:20:46 +0000 (21:20 +0800)] 
QCA vendor attribute to report frame aggregation failure

Add a new vendor attribute config to set the reorder blocksize and
timeout in 4 ACs, and then report the frame aggregation failure
statistics in QCA_NL80211_VENDOR_SUBCMD_STATS_EXT command. In addition,
fix the spelling of the enum value for this subcommand.

Signed-off-by: Li Feng <lifeng@qti.qualcomm.com>
7 years agotests: Avoid failures in ap_vlan_without_station with new kernel
Jouni Malinen [Thu, 27 Oct 2016 18:37:19 +0000 (21:37 +0300)] 
tests: Avoid failures in ap_vlan_without_station with new kernel

The kernel commit 'mac80211: filter multicast data packets on AP /
AP_VLAN' started filtering out the test frame used in
ap_vlan_without_station and that resulted in false failures. For now,
ignore that "error" case to avoid claiming failures when the kernel is
doing what it is expected to do.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agotests: Enable FILS in the example hwsim build configurations
Jouni Malinen [Thu, 27 Oct 2016 11:58:02 +0000 (14:58 +0300)] 
tests: Enable FILS in the example hwsim build configurations

This allows the new FILS test cases to be executed automatically when a
recent enough kernel version is used.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agonl80211: Check driver FILS capability
Jouni Malinen [Tue, 25 Oct 2016 20:45:20 +0000 (23:45 +0300)] 
nl80211: Check driver FILS capability

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agonl80211: FILS KEK and nonces for NL80211_CMD_ASSOCIATE
Jouni Malinen [Sun, 23 Oct 2016 09:33:05 +0000 (12:33 +0300)] 
nl80211: FILS KEK and nonces for NL80211_CMD_ASSOCIATE

This sends the FILS KEK and AAD context (nonces) to the driver with the
NL80211_CMD_ASSOCIATE messages when using FILS.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agonl80211: Add support for setting FILS authentication algorithm
Jouni Malinen [Fri, 4 Sep 2015 11:59:34 +0000 (14:59 +0300)] 
nl80211: Add support for setting FILS authentication algorithm

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoSync with mac80211-next.git include/uapi/linux/nl80211.h
Jouni Malinen [Thu, 27 Oct 2016 12:01:44 +0000 (15:01 +0300)] 
Sync with mac80211-next.git include/uapi/linux/nl80211.h

This brings in nl80211 definitions as of 2016-10-27.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoNote set_key(WPA_ALG_NONE) failure in debug log
Jouni Malinen [Tue, 25 Oct 2016 21:22:49 +0000 (00:22 +0300)] 
Note set_key(WPA_ALG_NONE) failure in debug log

This makes wpa_remove_ptk() call to wpa_auth_set_key() more consistent
with all the other calls that verify the return value to keep static
analyzers happier.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agotests: FILS
Jouni Malinen [Tue, 1 Sep 2015 17:37:52 +0000 (20:37 +0300)] 
tests: FILS

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoFILS: Claim FILS capability only if driver supports it
Jouni Malinen [Tue, 25 Oct 2016 20:44:00 +0000 (23:44 +0300)] 
FILS: Claim FILS capability only if driver supports it

"GET_CAPABILITY fils" used to return "FILS" based on wpa_supplicant
configuration. This can be made more useful by checking both for
wpa_supplicant and driver support for FILS.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoFILS: Setup EAPOL state machines properly after FILS association (AP)
Jouni Malinen [Thu, 10 Sep 2015 18:33:40 +0000 (21:33 +0300)] 
FILS: Setup EAPOL state machines properly after FILS association (AP)

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoFILS: Set TK after association (AP)
Jouni Malinen [Wed, 9 Sep 2015 16:32:44 +0000 (19:32 +0300)] 
FILS: Set TK after association (AP)

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoFILS: Mark connection fully authorized after FILS Association (AP)
Jouni Malinen [Wed, 9 Sep 2015 15:56:57 +0000 (18:56 +0300)] 
FILS: Mark connection fully authorized after FILS Association (AP)

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoFILS: Association Response processing (STA)
Jouni Malinen [Wed, 9 Sep 2015 14:34:13 +0000 (17:34 +0300)] 
FILS: Association Response processing (STA)

Decrypt the AES-SIV protected elements and verify Key-Auth. Parse and
configure keys to the driver.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoFILS: Add Association Response frame elements and encrypt them (AP)
Jouni Malinen [Wed, 9 Sep 2015 12:43:53 +0000 (15:43 +0300)] 
FILS: Add Association Response frame elements and encrypt them (AP)

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoFILS: Decrypt Association Request elements and check Key-Auth (AP)
Jouni Malinen [Tue, 8 Sep 2015 22:27:22 +0000 (01:27 +0300)] 
FILS: Decrypt Association Request elements and check Key-Auth (AP)

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoFILS: Add elements to FILS Association Request frame
Jouni Malinen [Tue, 8 Sep 2015 17:58:53 +0000 (20:58 +0300)] 
FILS: Add elements to FILS Association Request frame

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agodriver: Add option to pass FILS KEK/AAD to the driver for association
Jouni Malinen [Sun, 23 Oct 2016 09:31:55 +0000 (12:31 +0300)] 
driver: Add option to pass FILS KEK/AAD to the driver for association

This allows the FILS KEK and AAD data (nonces) to be configured to the
driver for association so that the driver can encrypt the
(Re)Association Request frame and decrypt the (Re)Association Response
frame.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoP2P: Check if the pref_freq reported by the driver supports P2P
Sunil Dutt [Fri, 21 Oct 2016 06:43:16 +0000 (12:13 +0530)] 
P2P: Check if the pref_freq reported by the driver supports P2P

Filter out get_pref_freq_list() (i.e.,
QCA_NL80211_VENDOR_SUBCMD_GET_PREFERRED_FREQ_LIST) output in case of
channel negotiation by removing channels that do not allow P2P operation
at all. Previously, only the explicitly disallowed channels were removed
and that could have resulted in selecting an operating channel that is
not allowed for P2P and failing to complete the operation to start the
group.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoFILS: Authentication frame processing (STA)
Jouni Malinen [Mon, 7 Sep 2015 21:14:13 +0000 (00:14 +0300)] 
FILS: Authentication frame processing (STA)

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoFILS: Process FILS Authentication frame (AP)
Jouni Malinen [Fri, 4 Sep 2015 21:04:21 +0000 (00:04 +0300)] 
FILS: Process FILS Authentication frame (AP)

This implements processing of FILS Authentication frame for FILS shared
key authentication with ERP and PMKSA caching.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoFILS: Add a helper function for status code conversion
Jouni Malinen [Fri, 4 Sep 2015 21:04:21 +0000 (00:04 +0300)] 
FILS: Add a helper function for status code conversion

This will allow the existing code to be reused for FILS needs.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoFILS: Extend wpa_auth_pmksa_get() to support PMKID matching
Jouni Malinen [Fri, 4 Sep 2015 21:04:21 +0000 (00:04 +0300)] 
FILS: Extend wpa_auth_pmksa_get() to support PMKID matching

This is needed for FILS processing to enable PMKSA caching.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoFILS: Export IEEE 802.1X helper functions
Jouni Malinen [Fri, 4 Sep 2015 21:04:21 +0000 (00:04 +0300)] 
FILS: Export IEEE 802.1X helper functions

ieee802_1x_encapsulate_radius() and ieee802_1x_alloc_eapol_sm() need to
be called from FILS processing.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoERP: Update client identity based on EAP-Initiate/Re-auth
Jouni Malinen [Fri, 4 Sep 2015 21:04:21 +0000 (00:04 +0300)] 
ERP: Update client identity based on EAP-Initiate/Re-auth

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoFILS: Try to use FILS authentication if PMKSA or ERP entry is available
Jouni Malinen [Fri, 4 Sep 2015 12:32:07 +0000 (15:32 +0300)] 
FILS: Try to use FILS authentication if PMKSA or ERP entry is available

If a PMKSA cache entry for the target AP is available, try to use FILS
with PMKSA caching.

If an ERP key for the target AP is available, try to use FILS with
EAP-Initiate/Re-auth added as Wrapper Data element.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoSME: Clear possibly used WPA/RSN IE for new connection
Jouni Malinen [Sat, 22 Oct 2016 19:48:25 +0000 (22:48 +0300)] 
SME: Clear possibly used WPA/RSN IE for new connection

This was already done in the case SME in the driver is used, but the SME
code path was resetting the local WPA/RSN IE only for association. While
that was fine for existing use cases, FILS needs a new RSN IE to be set
for PMKSA caching case in Authentication frames, so clear the local IE
before starting new authentication.

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