]> git.ipfire.org Git - thirdparty/hostap.git/log
thirdparty/hostap.git
7 years agoSAE: Add testing code for reflection attack
Jouni Malinen [Fri, 1 Sep 2017 22:31:47 +0000 (01:31 +0300)] 
SAE: Add testing code for reflection attack

Allow hostapd to be configured to perform SAE reflection attack for SAE
testing purposes with sae_reflection_attack=1 configuration parameter.
This is included only in CONFIG_TESTING_OPTIONS=y builds.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoSAE: Fix PMKSA caching behavior in AP mode
Jouni Malinen [Fri, 1 Sep 2017 22:02:15 +0000 (01:02 +0300)] 
SAE: Fix PMKSA caching behavior in AP mode

Add PMKID into EAPOL-Key 1/4 when using SAE and fix the PMK-from-PMKSA
selection in some cases where PSK (from passphrase) could have been
used.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoDPP: Add base64 dependency in makefiles
Jouni Malinen [Fri, 1 Sep 2017 18:15:34 +0000 (21:15 +0300)] 
DPP: Add base64 dependency in makefiles

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoDPP: Derive PMKID using SHA256() for all curves
Jouni Malinen [Thu, 24 Aug 2017 20:59:44 +0000 (23:59 +0300)] 
DPP: Derive PMKID using SHA256() for all curves

This was previously defined inconsistently (H() vs. SHA256()), but it is
now clarified in the draft tech spec to use SHA256(), so update
implementation to do that.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agotests: Verify data connectivity with DPP AKM
Jouni Malinen [Thu, 24 Aug 2017 20:47:58 +0000 (23:47 +0300)] 
tests: Verify data connectivity with DPP AKM

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agotests: DPP association with nl80211 connect command
Jouni Malinen [Thu, 24 Aug 2017 20:31:46 +0000 (23:31 +0300)] 
tests: DPP association with nl80211 connect command

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agonl80211: Fix auth_alg selection with FILS in the connect command
Jouni Malinen [Thu, 24 Aug 2017 20:30:20 +0000 (23:30 +0300)] 
nl80211: Fix auth_alg selection with FILS in the connect command

NL80211_ATTR_AUTH_TYPE needs to be skipped if multiple auth_alg options
are included. The previous list missed the new FILS auth_alg here and
ended up not doing so if OPEN and FILS were included.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoFILS: Fix wpa_supplicant AP build without CONFIG_IEEE80211W
Jouni Malinen [Thu, 24 Aug 2017 14:31:56 +0000 (17:31 +0300)] 
FILS: Fix wpa_supplicant AP build without CONFIG_IEEE80211W

CONFIG_FILS was missed as one of items requiring the p pointer in
hostapd_notif_assoc().

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agotests: Make dpp_qr_code_auth_initiator_enrollee more robust
Jouni Malinen [Wed, 23 Aug 2017 12:55:46 +0000 (15:55 +0300)] 
tests: Make dpp_qr_code_auth_initiator_enrollee more robust

Wait for the configuration step to complete before forcefully
terminating DPP listen. Previous version was causing failures for this
test case sequence:
dpp_qr_code_auth_initiator_enrollee dpp_pkex_config2

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoDPP: Use Transaction ID in Peer Discovery Request/Response frames
Jouni Malinen [Wed, 23 Aug 2017 09:49:22 +0000 (12:49 +0300)] 
DPP: Use Transaction ID in Peer Discovery Request/Response frames

DPP tech spec changed the contents of these frames by replacing the
public key hash attributes with a Transaction ID attribute that gets
copied from the request to the response to identify the transaction in a
simpler manner.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agohs20-osu-client: Fix build with new OpenSSL and BoringSSL
Hu Wang [Wed, 23 Aug 2017 08:40:10 +0000 (11:40 +0300)] 
hs20-osu-client: Fix build with new OpenSSL and BoringSSL

Use the SSL_get_SSL_CTX() helper instead of dereferencing SSL* since
struct ssl_st is not exposed in public header files anymore.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoIntroduce QCA_NL80211_VENDOR_SUBCMD_HANG
Sunil Dutt [Wed, 23 Aug 2017 04:35:21 +0000 (10:05 +0530)] 
Introduce QCA_NL80211_VENDOR_SUBCMD_HANG

This is an event indicating to the user space that the driver has
detected an internal failure. The driver is expected to recover from
such a failure automatically, e.g., by resetting the device. This event
carries the information indicating the reason that triggered this
detection.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agotests: Update DPP discovery override value format
Jouni Malinen [Tue, 22 Aug 2017 21:31:30 +0000 (00:31 +0300)] 
tests: Update DPP discovery override value format

This changed in the DPP tech spec, so update the test case to match the
current encoding.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agotests: JSON module tests for additional array parsing
Jouni Malinen [Tue, 22 Aug 2017 21:29:52 +0000 (00:29 +0300)] 
tests: JSON module tests for additional array parsing

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoJSON: Fix parsing of arrays of numbers, strings, literals
Jouni Malinen [Tue, 22 Aug 2017 21:28:55 +0000 (00:28 +0300)] 
JSON: Fix parsing of arrays of numbers, strings, literals

The previous implementation was able to parse arrays of objects, but not
arrays of other types of items.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoDPP: Remove devices object from the connector
Jouni Malinen [Tue, 22 Aug 2017 20:46:27 +0000 (23:46 +0300)] 
DPP: Remove devices object from the connector

This was removed from the draft DPP tech spec, so remove it from the
implementation as well.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agotests: Remove use of dpp_devices_override
Jouni Malinen [Tue, 22 Aug 2017 20:45:46 +0000 (23:45 +0300)] 
tests: Remove use of dpp_devices_override

The devices object was removed, so this parameter will disappear as
well.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agotests: sigma_dut tests for SAE
Jouni Malinen [Tue, 22 Aug 2017 18:23:04 +0000 (21:23 +0300)] 
tests: sigma_dut tests for SAE

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoQCA vendor attribute to configure beacon miss penalize count for BTC
Sachin Ahuja [Tue, 1 Aug 2017 09:48:53 +0000 (15:18 +0530)] 
QCA vendor attribute to configure beacon miss penalize count for BTC

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoQCA vendor attribute to configure beacon miss count
Sachin Ahuja [Wed, 26 Jul 2017 07:33:20 +0000 (13:03 +0530)] 
QCA vendor attribute to configure beacon miss count

This can be used to dynamically enable/disable beacon miss count.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoQCA vendor attribute to enable/disable scan
Sandeep Puligilla [Tue, 25 Jul 2017 19:30:55 +0000 (12:30 -0700)] 
QCA vendor attribute to enable/disable scan

This commit introduces QCA vendor attribute to
disable/enable scan.

Signed-off-by: Sandeep Puligilla <spuligil@qti.qualcomm.com>
7 years agotests: hostapd with zero length ap_pin parameter
Jouni Malinen [Mon, 14 Aug 2017 18:12:33 +0000 (21:12 +0300)] 
tests: hostapd with zero length ap_pin parameter

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoWPS: Interpret zero length ap_pin hostapd.conf parameter as "unset"
Jouni Malinen [Mon, 14 Aug 2017 18:07:09 +0000 (21:07 +0300)] 
WPS: Interpret zero length ap_pin hostapd.conf parameter as "unset"

hostapd allows arbitrary AP PIN to be used in WPS. This means that
setting ap_pin to a zero length string ends up enabling AP PIN so that
external registrars can use this specific zero lenth ap_pin value. There
are apparently some APs that have used this invalid configuration with
unintended results. While the proper fix for that is to fix the
component that generates the invalid configuration, hostapd can also
reject such values since the likelihood of a real world use case for
zero length AP PIN (Device Password) is minimal.

Start interpreting zero length ap_pin parameter value as a request to
"unset" the previously set value in hostapd.conf (or if not previously
set, leave it unset). With this, a hostapd.conf file including the
"ap_pin=" line will end up getting interpretted just like that same file
with the ap_pin parameter completely removed, i.e., with AP PIN being
disabled.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoRemove some obsolete information from hostapd README file
Jouni Malinen [Wed, 2 Aug 2017 09:01:08 +0000 (12:01 +0300)] 
Remove some obsolete information from hostapd README file

Number of the URLs were not valid anymore and some of the notes have
been obsolete for years.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agohw_features: Fix check of supported 802.11ac channel width
Sven Eckelmann [Fri, 9 Jun 2017 09:39:51 +0000 (11:39 +0200)] 
hw_features: Fix check of supported 802.11ac channel width

The two channel width bits in the VHT capability field can be decoded in
following values (IEEE Std 802.11ac-2013 8.4.2.160.2 VHT Capabilities
Info field):

 * 0: no 160 or 80+80 MHz support
 * 1: 160 MHz support
 * 2: 160 and 80+80 MHz support
 * 3: (reserved)

The check must therefore not be done bitwise but instead it must checked
whether the capabilities announced by the driver are at least the ones
requested by the user.

Fixes: c781eb842852 ("hostapd: Verify VHT capabilities are supported by driver")
Signed-off-by: Sven Eckelmann <sven.eckelmann@openmesh.com>
8 years agotests: Make wnm_bss_tm_req_with_mbo_ie more robust
Andrei Otcheretianski [Mon, 12 Jun 2017 06:29:28 +0000 (09:29 +0300)] 
tests: Make wnm_bss_tm_req_with_mbo_ie more robust

On slow machines or inside VM it may take some time for "DISCONNECTED"
event to arrive. Since the retry delay counter is started already, it
may result in less than 5 seconds time between "DISCONNECTED" and
"CONNECTED" events.

Fix the test by taking more accurate timestamps between the events.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
8 years agoWNM: Differentiate between WNM for station and for AP in build
Avraham Stern [Mon, 12 Jun 2017 06:29:27 +0000 (09:29 +0300)] 
WNM: Differentiate between WNM for station and for AP in build

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

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

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
8 years agoRRM: Remove duplicate frequencies from beacon report scan request
Avraham Stern [Sun, 11 Jun 2017 12:41:23 +0000 (15:41 +0300)] 
RRM: Remove duplicate frequencies from beacon report scan request

When setting the frequencies for beacon report request scan, it is
possible that a frequency is added twice (e.g., when the same channel
appears both in the channel field and in the AP channel report
subelement). This may cause the scan request to fail.
Make sure the frequencies array contains no duplications before
requesting the scan.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
8 years agotests: Fix RRM tests to allow refused/incapable responses
Andrei Otcheretianski [Sun, 11 Jun 2017 12:41:22 +0000 (15:41 +0300)] 
tests: Fix RRM tests to allow refused/incapable responses

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
8 years agoRRM: Send response when Beacon report request is not supported/refused
Avraham Stern [Sun, 11 Jun 2017 12:41:21 +0000 (15:41 +0300)] 
RRM: Send response when Beacon report request is not supported/refused

Send Radio Measurement response with measurement mode set to reject
in the following cases:
 1. Reporting conditions is not supported.
 2. No valid channels found for the measurement

Sending a response with an incapable indication will stop the AP from
sending other measurement requests of the same type as specified
in IEEE Std 802.11-2016, 11.11.6.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
8 years agoRRM: Send Radio Measurement response when beacon report scan fails
Avraham Stern [Sun, 11 Jun 2017 12:41:20 +0000 (15:41 +0300)] 
RRM: Send Radio Measurement response when beacon report scan fails

When failing to trigger scan for beacon report (e.g., when the
requested duration is not supported by the driver), send a
Radio Measurement response with the mode set to refused and don't
retry the scan.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
8 years agotests: Rejection of group-addressed RRM measurement request
Jouni Malinen [Mon, 17 Jul 2017 14:47:25 +0000 (17:47 +0300)] 
tests: Rejection of group-addressed RRM measurement request

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoRRM: Send reject/refuse response only to unicast measurement request
Avraham Stern [Sun, 11 Jun 2017 12:41:19 +0000 (15:41 +0300)] 
RRM: Send reject/refuse response only to unicast measurement request

IEEE Std 802.11-2016, 11.11.6 specifies that a station that is unable to
make a requested measurement or refuses to make a measurement shall
respond only if the measurement request was received within an
individually addressed radio measurement request frame, but shall not
respond if such a request was received in a group addressed frame.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
8 years agowpa_cli: Fix global control interface for STA-FIRST/STA-NEXT
Dmitry Shmidt [Mon, 22 May 2017 21:38:58 +0000 (21:38 +0000)] 
wpa_cli: Fix global control interface for STA-FIRST/STA-NEXT

If global control interface is used and wlan doesn't support P2P,
   wpa_s->global->p2p == NULL, and log shows:
wpa_supplicant: Failed to create interface p2p-dev-wlan0: -5 (I/O error)
wpa_supplicant: nl80211: Failed to create a P2P Device interface p2p-dev-wlan0
wpa_supplicant: P2P: Failed to enable P2P Device interface

Then STA-FIRST/STA-NEXT is not going to redirect to any interface,
making update_stations(ctrl_conn) is stuck in never-ending loop:

sendto(3, "STA-FIRST", 9, 0, NULL, 0)   = 9
pselect6(4, [3], NULL, NULL, {10, 0}, NULL) = 1 (in [3], left {9, 999995000})
recvfrom(3, "UNKNOWN COMMAND\n", 4095, 0, NULL, NULL) = 16
sendto(3, "STA-NEXT UNKNOWN COMMAND", 24, 0, NULL, 0) = 24
pselect6(4, [3], NULL, NULL, {10, 0}, NULL) = 1 (in [3], left {9, 999995833})
recvfrom(3, "UNKNOWN COMMAND\n", 4095, 0, NULL, NULL) = 16
sendto(3, "STA-NEXT UNKNOWN COMMAND", 24, 0, NULL, 0) = 24
pselect6(4, [3], NULL, NULL, {10, 0}, NULL) = 1 (in [3], left {9, 999995000})
recvfrom(3, "UNKNOWN COMMAND\n", 4095, 0, NULL, NULL) = 16
sendto(3, "STA-NEXT UNKNOWN COMMAND", 24, 0, NULL, 0) = 24

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
8 years agoDPP: Fix build with OpenSSL 1.1.0
Jouni Malinen [Mon, 17 Jul 2017 09:26:44 +0000 (12:26 +0300)] 
DPP: Fix build with OpenSSL 1.1.0

X509_ALGOR_get0() was modified to use const ** pointer as the first
argument in OpenSSL 1.1.0, so need to use different type here to avoid
compilation issues.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoOpenSSL: Clear default_passwd_cb more thoroughly
Jouni Malinen [Mon, 17 Jul 2017 09:06:17 +0000 (12:06 +0300)] 
OpenSSL: Clear default_passwd_cb more thoroughly

Previously, the pointer to strdup passwd was left in OpenSSL library
default_passwd_cb_userdata and even the default_passwd_cb was left set
on an error path. To avoid unexpected behavior if something were to
manage to use there pointers, clear them explicitly once done with
loading of the private key.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoOpenSSL: Fix private key password handling with OpenSSL >= 1.1.0f
Beniamino Galvani [Sun, 9 Jul 2017 09:14:10 +0000 (11:14 +0200)] 
OpenSSL: Fix private key password handling with OpenSSL >= 1.1.0f

Since OpenSSL version 1.1.0f, SSL_use_PrivateKey_file() uses the
callback from the SSL object instead of the one from the CTX, so let's
set the callback on both SSL and CTX. Note that
SSL_set_default_passwd_cb*() is available only in 1.1.0.

Signed-off-by: Beniamino Galvani <bgalvani@redhat.com>
8 years agoOpenSSL: Add build option to select default ciphers
Beniamino Galvani [Sun, 9 Jul 2017 09:06:50 +0000 (11:06 +0200)] 
OpenSSL: Add build option to select default ciphers

Add a build option to select different default ciphers for OpenSSL
instead of the hardcoded default "DEFAULT:!EXP:!LOW".

This new option is useful on distributions where the security level
should be consistent for all applications, as in Fedora [1]. In such
cases the new configuration option would be set to "" or
"PROFILE=SYSTEM" to select the global crypto policy by default.

[1] https://fedoraproject.org/wiki/Changes/CryptoPolicy

Signed-off-by: Beniamino Galvani <bgalvani@redhat.com>
8 years agoOCE: Add hostapd mode OCE capability indication if enabled
Ashwini Patil [Fri, 16 Jun 2017 12:17:03 +0000 (17:47 +0530)] 
OCE: Add hostapd mode OCE capability indication if enabled

Add OCE IE in Beacon, Probe Response, and (Re)Association Response
frames if OCE is enabled in the configuration.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoSTA: Add OCE capability indication attribute
Ashwini Patil [Mon, 10 Jul 2017 12:05:31 +0000 (17:35 +0530)] 
STA: Add OCE capability indication attribute

Add OCE capability indication attribute in Probe Request and
(Re)Association Request frames.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agonl80211: Check if driver supports OCE specific features
Ashwini Patil [Mon, 10 Jul 2017 09:33:01 +0000 (15:03 +0530)] 
nl80211: Check if driver supports OCE specific features

Check if device supports OCE STA/STA-CFON/AP specific mandatory
features. This commit includes checking based on the QCA vendor
attributes.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoAdd vendor flags for OCE feature support indication
vamsi krishna [Fri, 7 Jul 2017 07:56:22 +0000 (13:26 +0530)] 
Add vendor flags for OCE feature support indication

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoFILS: Fix issuing FILS connect to a non-FILS AP in driver-FILS case
Vidyullatha Kanchanapally [Wed, 12 Jul 2017 09:29:16 +0000 (14:59 +0530)] 
FILS: Fix issuing FILS connect to a non-FILS AP in driver-FILS case

If an AP is not FILS capable and wpa_supplicant has a saved network
block for the network with FILS key management and a saved erp info,
wpa_supplicant might end up issuing a FILS connection to a non-FILS AP.
Fix this by looking for the presence of FILS AKMs in wpa_s->key_mgmt,
i.e., after deciding on the AKM suites to use for the current
connection.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoIntroduce a vendor attribute to represent the PNO/EPNO Request ID
Sunil Dutt [Thu, 13 Jul 2017 14:31:36 +0000 (20:01 +0530)] 
Introduce a vendor attribute to represent the PNO/EPNO Request ID

This request ID was wrongly referred from the REQUEST_ID in
enum qca_wlan_vendor_attr_gscan_config_params which is mapped to
QCA_WLAN_VENDOR_ATTR_PNO_PASSPOINT_LIST_PARAM_NUM in PNO Config.
Hence define a different attribute to represent the request ID
for PNO Config.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoFILS: Fix compilation with CONFIG_NO_WPA
Emmanuel Grumbach [Thu, 8 Jun 2017 08:18:00 +0000 (11:18 +0300)] 
FILS: Fix compilation with CONFIG_NO_WPA

wpa_fils_is_completed() was not defined.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agotests: Additional EAP-TTLS error path
Jouni Malinen [Sat, 8 Jul 2017 13:18:04 +0000 (16:18 +0300)] 
tests: Additional EAP-TTLS error path

This is a regression test for a memory leak on an error path.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoEAP-TTLS: Fix a memory leak on error paths
Jouni Malinen [Sat, 8 Jul 2017 13:21:01 +0000 (16:21 +0300)] 
EAP-TTLS: Fix a memory leak on error paths

The allocated challenge needs to be freed on these error paths as well.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoEAP-TTLS: Fix possible memory leak in eap_ttls_phase2_request_mschap()
Ilan Peer [Thu, 8 Jun 2017 08:17:59 +0000 (11:17 +0300)] 
EAP-TTLS: Fix possible memory leak in eap_ttls_phase2_request_mschap()

The msg buffer needs to be freed on these two error paths.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
8 years agoMBO: Fix possible memory leak in anqp_send_req()
Ilan Peer [Thu, 8 Jun 2017 08:17:58 +0000 (11:17 +0300)] 
MBO: Fix possible memory leak in anqp_send_req()

In case that an mbo object is allocated, but there is a failure
to resize the wpabuf, need to free the mbo object.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
8 years agotests: Additional LEAP error path
Jouni Malinen [Sat, 8 Jul 2017 13:13:05 +0000 (16:13 +0300)] 
tests: Additional LEAP error path

This is a regression test for a memory leak on an error path.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoEAP-LEAP: Fix possible memory leak in eap_leap_process_request()
Ilan Peer [Thu, 8 Jun 2017 08:17:57 +0000 (11:17 +0300)] 
EAP-LEAP: Fix possible memory leak in eap_leap_process_request()

Free 'resp' object in case of a failure to derive the response.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
8 years agoRRM: Filter scan results by parent TSF only if driver supports it
Avraham Stern [Thu, 8 Jun 2017 08:17:56 +0000 (11:17 +0300)] 
RRM: Filter scan results by parent TSF only if driver supports it

Scan results with parent TSF older than the scan start TSF are not added
to the beacon report since they are considered as scan results from
previous scans. However, for drivers that report the scan start TSF but
not the parent TSF of each scan result, the parent TSF will be zero so
valid scan results will be dropped.

Fix this by filtering scan results by the parent TSF only if the
driver supports reporting the parent TSF for each scan result.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
8 years agoap: Fix invalid HT40 channel pair fallback
Naftali Goldstein [Thu, 8 Jun 2017 08:17:55 +0000 (11:17 +0300)] 
ap: Fix invalid HT40 channel pair fallback

In case of incorrect HT40 configuration as part of an attempt to create
a 80 MHz AP, iface->conf->vht_oper_centr_freq_seg0_idx and
iface->conf->vht_oper_centr_freq_seg1_idx are zero'ed, but
iface->conf->vht_oper_chwidth remains VHT_CHANWIDTH_80MHZ. This causes
the logic in dfs_get_start_chan_idx to fail.

Fix this by setting iface->conf->vht_oper_chwidth to
VHT_CHANWIDTH_USE_HT when zero'ing the center frequency parameters.

Signed-off-by: Naftali Goldstein <naftali.goldstein@intel.com>
8 years agoap: Fix return value in hostapd_drv_switch_channel()
Ilan Peer [Thu, 8 Jun 2017 08:17:54 +0000 (11:17 +0300)] 
ap: Fix return value in hostapd_drv_switch_channel()

The documentation in driver.h state that in case of an error
-1 is returned.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
8 years agotests: Use global control interface in test_p2p_channel.py
Adiel Aloni [Thu, 22 Jun 2017 07:58:44 +0000 (10:58 +0300)] 
tests: Use global control interface in test_p2p_channel.py

Previously p2p_channel_drv_pref_* tests would fail
if dedicated P2P device is used, since the SET commands
were sent to incorrect interface.
Fix this by using a global control interface instead.

Signed-off-by: Adiel Aloni <adiel.aloni@intel.com>
8 years agoP2P: Clear get_pref_freq_list_override on P2P Device
Andrei Otcheretianski [Wed, 5 Jul 2017 18:25:05 +0000 (21:25 +0300)] 
P2P: Clear get_pref_freq_list_override on P2P Device

Clear the get_pref_freq_list_override in p2p_ctrl_flush(). This fixes
the case when a dedicated P2P device interface is used.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
8 years agotests: Print higher debug level on console
Johannes Berg [Tue, 30 May 2017 14:29:56 +0000 (16:29 +0200)] 
tests: Print higher debug level on console

We capture the dmesg that contains everything, but if a test
causes a kernel crash we will miss all logging at higher levels
like debug. Change the printk level to catch all of that too.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agotests: Catch various lockdep warnings
Johannes Berg [Tue, 30 May 2017 14:29:50 +0000 (16:29 +0200)] 
tests: Catch various lockdep warnings

Lockdep no longer prints "INFO:" but now prints "WARNING:".
Also add the "*** DEADLOCK ***" string it usually prints so
if it changes again we can keep finding that string.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agoDPP: Fix compilation without openssl
Andrei Otcheretianski [Wed, 5 Jul 2017 18:25:07 +0000 (21:25 +0300)] 
DPP: Fix compilation without openssl

dpp.h file requires openssl in order to compile, which breaks
compilation on systems without it.
Move DPP_OUI_TYPE to ieee802_11_defs.h and don't include dpp.h when
not really needed.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
8 years agotests: Skip dpp_pkex_config dpp_pkex_config2 tests correctly
Andrei Otcheretianski [Wed, 5 Jul 2017 18:25:06 +0000 (21:25 +0300)] 
tests: Skip dpp_pkex_config dpp_pkex_config2 tests correctly

When CONFIG_DPP is not defined these tests would fail. Skip them.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
8 years agoP2P: Allow auto GO on DFS channels if driver supports this
Sunil Dutt [Tue, 13 Jun 2017 11:52:02 +0000 (17:22 +0530)] 
P2P: Allow auto GO on DFS channels if driver supports this

If a DFS forced frequency is provided in 'p2p_group_add' and the driver
supports DFS offload, the frequency was rejected in
wpas_p2p_init_go_params(). However, it was accepted in
wpas_p2p_select_go_freq() and wpas_p2p_group_add(). To make the behavior
consistent, the DFS frequency is now accepted in
wpas_p2p_init_go_params() similar to the way done in
wpas_p2p_select_go_freq().

Redundant check in wpas_p2p_group_add() for DFS forced frequency is
removed.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoFILS: Advertize FILS capability based on driver capability
Vidyullatha Kanchanapally [Thu, 22 Jun 2017 13:30:15 +0000 (19:00 +0530)] 
FILS: Advertize FILS capability based on driver capability

Add changes to control interface command get_capability to advertize
FILS capability, FILS AKMs suites, and FILS Authentication algorithms
based on the driver capabilities.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoFix a typo in vendor attribute documentation
Jouni Malinen [Fri, 7 Jul 2017 10:26:45 +0000 (13:26 +0300)] 
Fix a typo in vendor attribute documentation

The attribute is QCA_WLAN_VENDOR_ATTR_SAR_LIMITS_SAR_ENABLE, not
QCA_WLAN_VENDOR_ATTR_SAR_LIMITS_SELECT.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoFILS: Add HLP support with driver-based AP SME
Jeffin Mammen [Thu, 6 Jul 2017 10:57:54 +0000 (13:57 +0300)] 
FILS: Add HLP support with driver-based AP SME

This allows HLP processing to postpone association processing in
hostapd_notify_assoc().

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoFILS: Fix the IP header protocol field in HLP DHCP response
Jeffin Mammen [Thu, 6 Jul 2017 10:58:50 +0000 (13:58 +0300)] 
FILS: Fix the IP header protocol field in HLP DHCP response

The IP header should indicate that UDP is used in the message.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: FILS ERP authentication followed by PMKSA caching
Vidyullatha Kanchanapally [Wed, 5 Jul 2017 14:55:10 +0000 (17:55 +0300)] 
tests: FILS ERP authentication followed by PMKSA caching

This test case verifies that both wpa_supplicant and hostapd are adding
a PMKSA cache entry based on FILS shared key authentication using ERP.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoFILS: ERP-based PMKSA cache addition on AP
Jouni Malinen [Wed, 5 Jul 2017 14:52:23 +0000 (17:52 +0300)] 
FILS: ERP-based PMKSA cache addition on AP

hostapd did not add a new PMKSA cache entry when FILS shared key
authentication was used, i.e., only the initial full authentication
resulted in a PMKSA cache entry being created. Derive the PMKID for the
ERP case as well and add a PMKSA cache entry if the ERP exchange
succeeds.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoFILS: Fix a frame name in a debug print
Jouni Malinen [Wed, 5 Jul 2017 14:29:44 +0000 (17:29 +0300)] 
FILS: Fix a frame name in a debug print

The EAP message included in FILS Wrapped Data from the non-AP STA to the
AP is EAP-Initiate/Re-auth.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoMBO: Whitespace cleanup
Jouni Malinen [Tue, 4 Jul 2017 21:56:40 +0000 (00:56 +0300)] 
MBO: Whitespace cleanup

Fix couple of previously missed whitespace issues.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoOCE: Define OCE attributes and other related macros
Ashwini Patil [Thu, 15 Jun 2017 07:29:32 +0000 (12:59 +0530)] 
OCE: Define OCE attributes and other related macros

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: Scan for a specific BSSID
Jouni Malinen [Tue, 4 Jul 2017 21:39:09 +0000 (00:39 +0300)] 
tests: Scan for a specific BSSID

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoAdd wpa_supplicant ctrl iface support to scan for a specific BSSID
Ashwini Patil [Thu, 11 May 2017 07:52:00 +0000 (13:22 +0530)] 
Add wpa_supplicant ctrl iface support to scan for a specific BSSID

Add support to scan for a specific BSSID through the wpa_supplicant
control interface.

Usage: wpa_cli scan bssid=ab:bc:cd:de:ef:12

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: DPP configurator signing own connector
Jouni Malinen [Tue, 4 Jul 2017 14:49:29 +0000 (17:49 +0300)] 
tests: DPP configurator signing own connector

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoDPP: Add DPP_CONFIGURATOR_SIGN to generate own connector
Jouni Malinen [Tue, 4 Jul 2017 14:48:44 +0000 (17:48 +0300)] 
DPP: Add DPP_CONFIGURATOR_SIGN to generate own connector

The DPP Configurator can use this new command to generate its own signed
connector for the network that it manages.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoDPP: Add control interface commands into hostapd_cli
Jouni Malinen [Tue, 4 Jul 2017 12:55:30 +0000 (15:55 +0300)] 
DPP: Add control interface commands into hostapd_cli

These are copied from wpa_cli.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: DPP_BOOTSTRAP_INFO with hostapd
Jouni Malinen [Tue, 4 Jul 2017 12:49:35 +0000 (15:49 +0300)] 
tests: DPP_BOOTSTRAP_INFO with hostapd

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoDPP: DPP_BOOTSTRAP_INFO for hostapd
Jouni Malinen [Tue, 4 Jul 2017 12:45:37 +0000 (15:45 +0300)] 
DPP: DPP_BOOTSTRAP_INFO for hostapd

This extends the hostapd control interface to support the
DPP_BOOTSTRAP_INFO command that was recently added for wpa_supplicant.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoDPP: Share bootstrap type to string helper function
Jouni Malinen [Tue, 4 Jul 2017 12:45:03 +0000 (15:45 +0300)] 
DPP: Share bootstrap type to string helper function

This can be used in hostapd as well.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoDPP: Allow wpa_cli DPP_CONFIGURATOR_ADD without arguments
Jouni Malinen [Tue, 4 Jul 2017 12:38:52 +0000 (15:38 +0300)] 
DPP: Allow wpa_cli DPP_CONFIGURATOR_ADD without arguments

All the arguments to this command are optional, so do not mandate at
least one to be included in wpa_cli.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: Clear ignore_old_scan_res after sigma_dut test cases
Jouni Malinen [Mon, 3 Jul 2017 12:58:58 +0000 (15:58 +0300)] 
tests: Clear ignore_old_scan_res after sigma_dut test cases

sigma_dut can end up setting ignore_old_scan_res=1 and that can result
in some of the consecutive test cases failing. Fix this by explicitly
clearing ignore_old_scan_res after sigma_dut cases that may have ended
up setting the parameter.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: key_mgmt values OWE and DPP
Jouni Malinen [Mon, 3 Jul 2017 11:33:58 +0000 (14:33 +0300)] 
tests: key_mgmt values OWE and DPP

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoAdd new key_mgmt values for wpa_supplicant STATUS command
Jouni Malinen [Mon, 3 Jul 2017 11:33:16 +0000 (14:33 +0300)] 
Add new key_mgmt values for wpa_supplicant STATUS command

Recently added OWE and DPP were missing from the key_mgmt string list.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: mgmt_group_cipher in STATUS
Jouni Malinen [Mon, 3 Jul 2017 11:29:10 +0000 (14:29 +0300)] 
tests: mgmt_group_cipher in STATUS

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoAdd mgmt_group_cipher to wpa_supplicant STATUS command
Jouni Malinen [Mon, 3 Jul 2017 11:28:24 +0000 (14:28 +0300)] 
Add mgmt_group_cipher to wpa_supplicant STATUS command

This can be used to check which management group cipher is used in an
association that uses PMF.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoUpdate default wpa_group_rekey to once-per-day when using CCMP/GCMP
Jouni Malinen [Mon, 3 Jul 2017 10:42:55 +0000 (13:42 +0300)] 
Update default wpa_group_rekey to once-per-day when using CCMP/GCMP

The default value for GTK rekeying period was previously hardcoded to
600 seconds for all cases. Leave that short value only for TKIP as group
cipher while moving to the IEEE 802.11 default value of 86400 seconds
(once-per-day) for CCMP/GCMP.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoDPP: Set PMKSA expiration based on peer connector
Jouni Malinen [Sun, 2 Jul 2017 09:36:41 +0000 (12:36 +0300)] 
DPP: Set PMKSA expiration based on peer connector

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: DPP configurator in hostapd
Jouni Malinen [Mon, 3 Jul 2017 09:56:29 +0000 (12:56 +0300)] 
tests: DPP configurator in hostapd

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoDPP: Update hostapd configurator parameters to match wpa_supplicant
Jouni Malinen [Mon, 3 Jul 2017 10:01:35 +0000 (13:01 +0300)] 
DPP: Update hostapd configurator parameters to match wpa_supplicant

This updates the previously copied implementation to be up-to-date with
the more recent wpa_supplicant changes.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoDPP: Configurator in hostapd
Jouni Malinen [Mon, 3 Jul 2017 09:56:48 +0000 (12:56 +0300)] 
DPP: Configurator in hostapd

This integrates DPP configuration request processing into hostapd GAS
server implementation.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: DPP PKEX in hostapd
Jouni Malinen [Sun, 2 Jul 2017 19:10:41 +0000 (22:10 +0300)] 
tests: DPP PKEX in hostapd

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoDPP: PKEX in hostapd
Jouni Malinen [Sun, 2 Jul 2017 09:36:48 +0000 (12:36 +0300)] 
DPP: PKEX in hostapd

Allow hostapd to initiate and respond with PKEX bootstrapping similarly
to how this was implemented in wpa_supplicant.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: hostapd as DPP Authentication initiator
Jouni Malinen [Sun, 2 Jul 2017 18:42:32 +0000 (21:42 +0300)] 
tests: hostapd as DPP Authentication initiator

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoDPP: Check JWS protected header alg against C-sign-key curve
Jouni Malinen [Sun, 2 Jul 2017 09:36:38 +0000 (12:36 +0300)] 
DPP: Check JWS protected header alg against C-sign-key curve

These need to be compatible for the JWS protected header signing to be
valid, so add an explicit check to confirm this.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: DPP auth responder acting as configurator
Jouni Malinen [Sun, 2 Jul 2017 09:36:36 +0000 (12:36 +0300)] 
tests: DPP auth responder acting as configurator

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoDPP: Configurator parameters in responder role
Jouni Malinen [Sun, 2 Jul 2017 09:36:33 +0000 (12:36 +0300)] 
DPP: Configurator parameters in responder role

This allows wpa_supplicant to be configured to act as the configurator
in the case where a peer device initiates DPP Authentication.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoDPP: Update JWS algorithm strings for Brainpool curves
Jouni Malinen [Sun, 2 Jul 2017 09:36:31 +0000 (12:36 +0300)] 
DPP: Update JWS algorithm strings for Brainpool curves

Instead of trying to share the existing definitions for NIST curves,
start using unique strings for Brainpool curves.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoDPP: Rename Brainpool curve names for JSON
Jouni Malinen [Sun, 2 Jul 2017 09:36:28 +0000 (12:36 +0300)] 
DPP: Rename Brainpool curve names for JSON

This removes the "R1" postfix from the names used in JSON.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: DPP PKEX test cases
Jouni Malinen [Sun, 2 Jul 2017 09:36:25 +0000 (12:36 +0300)] 
tests: DPP PKEX test cases

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoDPP: PKEX bootstrapping
Jouni Malinen [Sun, 2 Jul 2017 09:36:23 +0000 (12:36 +0300)] 
DPP: PKEX bootstrapping

This implements genric PKEX functionality in src/common/dpp.c and glue
code to use this in wpa_supplicant (i.e, hostapd DPP implementation does
not yet support PKEX).

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoDPP: Add helper functions for running hash operations
Jouni Malinen [Sun, 2 Jul 2017 09:36:20 +0000 (12:36 +0300)] 
DPP: Add helper functions for running hash operations

Use helper functions to cover all three different hash algorithm options
for DPP operations instead of having separate calls to each function at
every location a hash operation based on the curve is needed.

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