]> git.ipfire.org Git - thirdparty/hostap.git/log
thirdparty/hostap.git
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 years agoWPA: Add debug print for not-update-own-IEs case
Jouni Malinen [Sat, 22 Oct 2016 19:47:30 +0000 (22:47 +0300)] 
WPA: Add debug print for not-update-own-IEs case

This makes it easier to understand debug logs related to own WPA/RSN IE
selection.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoFILS: Include wpa_insert_pmkid() in non-FT builds
Jouni Malinen [Sat, 22 Oct 2016 19:46:48 +0000 (22:46 +0300)] 
FILS: Include wpa_insert_pmkid() in non-FT builds

This function is needed for FILS as well as FT.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoERP: Make eap_peer_finish() callable
Jouni Malinen [Thu, 10 Sep 2015 18:34:15 +0000 (21:34 +0300)] 
ERP: Make eap_peer_finish() callable

This is needed for FILS to process EAP-Finish/Re-auth.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoERP: Make eap_peer_erp_reauth_start() available
Jouni Malinen [Wed, 9 Sep 2015 20:39:48 +0000 (23:39 +0300)] 
ERP: Make eap_peer_erp_reauth_start() available

This needs to be callable through the EAPOL supplicant wrappers to allow
FILS implementation to use ERP.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agonl80211: Make full (Re)Association Response frame available
Jouni Malinen [Wed, 9 Sep 2015 14:32:56 +0000 (17:32 +0300)] 
nl80211: Make full (Re)Association Response frame available

This is needed for FILS processing since AAD includes data before the
first element.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoFILS: Do not clear PTK on FILS Auth/Assoc (AP)
Jouni Malinen [Tue, 8 Sep 2015 22:17:30 +0000 (01:17 +0300)] 
FILS: Do not clear PTK on FILS Auth/Assoc (AP)

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoFILS: Key-Auth derivation function for FILS SK
Jouni Malinen [Tue, 8 Sep 2015 17:39:46 +0000 (20:39 +0300)] 
FILS: Key-Auth derivation function for FILS SK

This implements Key-Auth derivation for (Re)Association Request frames
(see P802.11ai/D11.0 12.12.2.6.2) and (Re)Association Response frames
(see P802.11ai/D11.0 12.12.2.6.3).

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoFILS: PMK-to-PTK key derivation for FILS authentication
Jouni Malinen [Mon, 7 Sep 2015 21:58:11 +0000 (00:58 +0300)] 
FILS: PMK-to-PTK key derivation for FILS authentication

This is the PTKSA key derivation used as part of the FILS authentication
exchange. See P802.11ai/D11.0 12.12.2.5.3.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoRename sae_data to more generic auth_data
Jouni Malinen [Sat, 22 Oct 2016 14:11:11 +0000 (17:11 +0300)] 
Rename sae_data to more generic auth_data

This makes it cleaner for the FILS implementation to use the same design
for setting Authentication frame elements as was already done with SAE.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoAdd QCA vendor command/attr for low level DMG(11ad) RF sector control
Lior David [Mon, 26 Sep 2016 21:09:36 +0000 (00:09 +0300)] 
Add QCA vendor command/attr for low level DMG(11ad) RF sector control

Add operations to allow low level control over RF sectors in QCA DMG
(11ad) chipsets. Operations include getting/setting the configuration of
a specific sector, as well as getting/setting the selected sector which
the HW uses to communicate with a specific station.

Signed-off-by: Lior David <qca_liord@qca.qualcomm.com>
8 years agowpa_cli: Mark number of char *cmd constant
Jouni Malinen [Sun, 16 Oct 2016 09:21:25 +0000 (12:21 +0300)] 
wpa_cli: Mark number of char *cmd constant

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agohostapd_cli: Mark number of char *cmd constant
Jouni Malinen [Sun, 16 Oct 2016 09:21:07 +0000 (12:21 +0300)] 
hostapd_cli: Mark number of char *cmd constant

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agowpa_cli: Add completion for ssid config commands
Mikael Kanstrup [Wed, 12 Oct 2016 12:19:01 +0000 (14:19 +0200)] 
wpa_cli: Add completion for ssid config commands

Add network id command completion support for identity, password,
new_password, pin, otp, passphrase, sim and bssid commands.

Signed-off-by: Mikael Kanstrup <mikael.kanstrup@sonymobile.com>
8 years agowpa_cli: Add completion for sta, deauthenticate and disassociate
Mikael Kanstrup [Wed, 12 Oct 2016 12:19:00 +0000 (14:19 +0200)] 
wpa_cli: Add completion for sta, deauthenticate and disassociate

Signed-off-by: Mikael Kanstrup <mikael.kanstrup@sonymobile.com>
8 years agocli: Add list_sta command
Mikael Kanstrup [Wed, 12 Oct 2016 12:18:59 +0000 (14:18 +0200)] 
cli: Add list_sta command

Add list_sta command to print addresses of all stations. Command
added to both wpa_cli and hostapd_cli.

Signed-off-by: Mikael Kanstrup <mikael.kanstrup@sonymobile.com>
8 years agohostapd_cli: Process events received following control iface commands
Mikael Kanstrup [Wed, 12 Oct 2016 12:18:58 +0000 (14:18 +0200)] 
hostapd_cli: Process events received following control iface commands

Events received as an immediate result of control interface commands
end up on the control request message callback function instead of
the registered read socket. This makes for example the station list
used for complete functions for disassociate and deauthenticate out
of sync. Process events in the message callback function too to ensure
no events are missed.

Signed-off-by: Mikael Kanstrup <mikael.kanstrup@sonymobile.com>
8 years agohostapd_cli: Refactor control iface reconnects with common helper
Mikael Kanstrup [Wed, 12 Oct 2016 12:18:57 +0000 (14:18 +0200)] 
hostapd_cli: Refactor control iface reconnects with common helper

Code for connecting/reconnecting to the hostapd control interface
is found duplicated a number of times. Create a common reconnect
helper function to avoid code duplication.

Signed-off-by: Mikael Kanstrup <mikael.kanstrup@sonymobile.com>
8 years agohostapd_cli: Refresh stations list on control interface reconnect
Mikael Kanstrup [Wed, 12 Oct 2016 12:18:56 +0000 (14:18 +0200)] 
hostapd_cli: Refresh stations list on control interface reconnect

Whenever reconnecting the control interface the hostapd station list
is unknown as stations might have dropped or connected. Refresh the
list of stations used for command completion on cli connect, reconnect
and interface change.

Signed-off-by: Mikael Kanstrup <mikael.kanstrup@sonymobile.com>
8 years agohostapd_cli: Add completion for sta command
Mikael Kanstrup [Wed, 12 Oct 2016 12:18:55 +0000 (14:18 +0200)] 
hostapd_cli: Add completion for sta command

Signed-off-by: Mikael Kanstrup <mikael.kanstrup@sonymobile.com>
8 years agohostapd_cli: Enable command completion and history for Android
Mikael Kanstrup [Wed, 12 Oct 2016 12:18:54 +0000 (14:18 +0200)] 
hostapd_cli: Enable command completion and history for Android

Signed-off-by: Mikael Kanstrup <mikael.kanstrup@sonymobile.com>
8 years agohostapd_cli: Add support for cli history file
Mikael Kanstrup [Wed, 12 Oct 2016 12:18:53 +0000 (14:18 +0200)] 
hostapd_cli: Add support for cli history file

Signed-off-by: Mikael Kanstrup <mikael.kanstrup@sonymobile.com>
8 years agohostapd: Add CONFIG_WPA_CLI_EDIT to defconfig
Mikael Kanstrup [Wed, 12 Oct 2016 12:18:52 +0000 (14:18 +0200)] 
hostapd: Add CONFIG_WPA_CLI_EDIT to defconfig

As hostapd_cli now supports command completion add documentation
of the config option to defconfig. Disabled per default.

Signed-off-by: Mikael Kanstrup <mikael.kanstrup@sonymobile.com>
8 years agowpa_supplicant: Restore permanent MAC address on reassociation
Benjamin Richter [Tue, 11 Oct 2016 03:57:38 +0000 (05:57 +0200)] 
wpa_supplicant: Restore permanent MAC address on reassociation

With mac_addr=0 and preassoc_mac_addr=1, the permanent MAC address
should be restored for association. Previously this did not happen when
reassociating to the same ESS.

Signed-off-by: Benjamin Richter <br@waldteufel.eu>
8 years agoAlways propagate scan results to all interfaces
Avraham Stern [Mon, 10 Oct 2016 15:22:09 +0000 (18:22 +0300)] 
Always propagate scan results to all interfaces

Scan results were not propagated to all interfaces if scan results
started a new operation, in order to prevent concurrent operations. But
this can cause other interfaces to trigger a new scan when scan results
are already available. Instead, always notify other interfaces of the
scan results, but note that new operations are not allowed.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
8 years agoCheck for NULL qsort() base pointers
Joel Cunningham [Sat, 8 Oct 2016 17:04:15 +0000 (12:04 -0500)] 
Check for NULL qsort() base pointers

There are a couple of places in wpa_supplicant/hostapd where qsort() can
be called with a NULL base pointer. This results in undefined behavior
according to the C standard and with some standard C libraries (ARM RVCT
2.2) results in a data abort/memory exception. Fix this by skipping such
calls since there is nothing needing to be sorted.

Signed-off-by: Joel Cunningham <joel.cunningham@me.com>
8 years agotests: WPS PBC with two APs advertising same SSID
Jouni Malinen [Mon, 10 Oct 2016 21:30:15 +0000 (00:30 +0300)] 
tests: WPS PBC with two APs advertising same SSID

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoWPS: Force BSSID for WPS provisioning step connection
Jouni Malinen [Mon, 10 Oct 2016 21:25:20 +0000 (00:25 +0300)] 
WPS: Force BSSID for WPS provisioning step connection

This was already done for most driver cases, but it is possible that the
BSSID/frequency is not forced if the driver reports BSS selection
capability (e.g., NL80211_ATTR_ROAM_SUPPORT). That could potentially
result in the driver ignoring the BSSID/frequency hint and associating
with another (incorrect) AP for the WPS provisioning step if that
another AP in the same ESS is more preferred (e.g., better signal
strength) by the driver and only one of the APs (the not preferred one)
is in active WPS registrar state.

While most drivers follow the BSSID hint for the initial connection to
an ESS, not doing it here for the WPS provisioning would break the
protocol. Fix this by enforcing a single BSSID/frequency to disallow the
driver from selecting an incorrect AP for the WPS provisioning
association.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoERP: Do not pass full EAP header to eap_peer_erp_reauth_start()
Jouni Malinen [Wed, 9 Sep 2015 18:34:36 +0000 (21:34 +0300)] 
ERP: Do not pass full EAP header to eap_peer_erp_reauth_start()

That function does not need the full EAP header -- it only needs to know
which EAP identifier to use in the message. Make this usable for cases
where the previous EAP message may not exist (FILS).

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoFILS: Update EAPOL-Key Descriptor Version RX rules (AP)
Jouni Malinen [Thu, 3 Sep 2015 17:45:02 +0000 (20:45 +0300)] 
FILS: Update EAPOL-Key Descriptor Version RX rules (AP)

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoFILS: Handle Group Key msg 1/2 without MIC when using AEAD cipher (STA)
Jouni Malinen [Thu, 3 Sep 2015 15:26:25 +0000 (18:26 +0300)] 
FILS: Handle Group Key msg 1/2 without MIC when using AEAD cipher (STA)

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoFILS: Perform AEAD processing after PTK has been confirmed
Jouni Malinen [Thu, 3 Sep 2015 15:18:53 +0000 (18:18 +0300)] 
FILS: Perform AEAD processing after PTK has been confirmed

This covers EAPOL-Key frames other than 2/4 that needed special handling
to confirm PTK.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoFILS: Use AEAD cipher to check received EAPOL-Key frames (STA)
Jouni Malinen [Thu, 3 Sep 2015 14:57:09 +0000 (17:57 +0300)] 
FILS: Use AEAD cipher to check received EAPOL-Key frames (STA)

This changes 4-way handshake authenticator processing to decrypt the
EAPOL-Key frames using an AEAD cipher (AES-SIV with FILS AKMs) before
processing the Key Data field. This replaces Key MIC validation for the
cases where AEAD cipher is used.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoFILS: Use AEAD cipher to protect EAPOL-Key frames (AP)
Jouni Malinen [Thu, 3 Sep 2015 14:24:37 +0000 (17:24 +0300)] 
FILS: Use AEAD cipher to protect EAPOL-Key frames (AP)

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoFILS: Use AEAD cipher to check received EAPOL-Key frames (AP)
Jouni Malinen [Thu, 3 Sep 2015 12:59:44 +0000 (15:59 +0300)] 
FILS: Use AEAD cipher to check received EAPOL-Key frames (AP)

This changes 4-way handshake authenticator processing to decrypt the
EAPOL-Key frames using an AEAD cipher (AES-SIV with FILS AKMs) before
processing the Key Data field. This replaces Key MIC validation for the
cases where AEAD cipher is used. This needs to move the EAPOL-Key msg
2/4 RSN element processing to happen only after the PTK has been derived
and validated. That is done for all AKMs to avoid extra complexity with
having to maintain two code paths for this.

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