]> git.ipfire.org Git - thirdparty/hostap.git/log
thirdparty/hostap.git
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>
8 years agoDPP: Increase hostapd_cli buffer limits
Jouni Malinen [Sun, 2 Jul 2017 09:36:18 +0000 (12:36 +0300)] 
DPP: Increase hostapd_cli buffer limits

This is needed for DPP events/commands.

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

This was supposed to use semicolons, not commas..

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoDPP: More debug for own connector configuration errors
Jouni Malinen [Sun, 2 Jul 2017 09:36:11 +0000 (12:36 +0300)] 
DPP: More debug for own connector configuration errors

This makes it easier to notice a reason for failure in cases a connector
string has been truncated.

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

This function is used for parsing both the C-sign-key and netAccessKey,
so better not imply that all cases are C-sign-key in the debug prints.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agonl80211/MBO: Set temporary disallowed BSSID list to driver
Ashwini Patil [Wed, 21 Jun 2017 14:46:07 +0000 (20:16 +0530)] 
nl80211/MBO: Set temporary disallowed BSSID list to driver

Set temporary disallowed BSSID list to the driver so that the driver
doesn't try to connect to any of the blacklisted BSSIDs during
driver-based roaming operation. This commit includes support only for
the nl80211 driver interface using a QCA vendor command for this.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoERP: Derive ERP key only after successful EAP authentication
Vidyullatha Kanchanapally [Mon, 12 Jun 2017 09:25:52 +0000 (14:55 +0530)] 
ERP: Derive ERP key only after successful EAP authentication

ERP key was previously derived immediately after the availability of
EMSK and Session-Id and the ERP key hierarchy was saved even if the
authentication resulted in failure eventually. Instead, derive the ERP
key only after a successful EAP authentication.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoAdd Set Wi-Fi Configuration vendor attribute to configure LRO
Sunil Dutt [Wed, 24 May 2017 09:16:15 +0000 (14:46 +0530)] 
Add Set Wi-Fi Configuration vendor attribute to configure LRO

This can be used to dynamically enable/disable LRO.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoIntroduce a vendor command to specify the active Type Of Service
Sunil Dutt [Wed, 14 Jun 2017 06:07:37 +0000 (11:37 +0530)] 
Introduce a vendor command to specify the active Type Of Service

This commit introduces QCA_NL80211_VENDOR_SUBCMD_ACTIVE_TOS to specify
the active Type Of Service on the specific interface. This can be used
to modify some of the low level scan parameters (off channel dwell time,
home channel time) in the driver/firmware.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agonl80211: Make KCK attribute optional in rekey data
Vidyullatha Kanchanapally [Tue, 13 Jun 2017 13:39:08 +0000 (19:09 +0530)] 
nl80211: Make KCK attribute optional in rekey data

New AKM suites like FILS-SHA256 do not use KCK and hence KCK length can
be zero. Add changes to include KCK attribute in rekey data only if the
length is non-zero.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: sigma_dut test cases
Jouni Malinen [Fri, 23 Jun 2017 11:33:38 +0000 (14:33 +0300)] 
tests: sigma_dut test cases

Add possibility to test sigma_dut functionality as part of the hwsim
test cases.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: Update DPP legacy config cases to provide the passphrase
Jouni Malinen [Thu, 22 Jun 2017 12:57:53 +0000 (15:57 +0300)] 
tests: Update DPP legacy config cases to provide the passphrase

This is now needed from the control interface since the hardcoded
default value has been removed from the implementation.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoDPP: Allow passphrase to be set for Configurator
Jouni Malinen [Thu, 22 Jun 2017 12:57:09 +0000 (15:57 +0300)] 
DPP: Allow passphrase to be set for Configurator

The new pass=<hexdump> parameter to DPP_AUTH_INIT can now be used to
specify the passphrase to use in config object.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: DPP Configurator getting SSID from control interface
Jouni Malinen [Thu, 22 Jun 2017 12:12:43 +0000 (15:12 +0300)] 
tests: DPP Configurator getting SSID from control interface

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoDPP: Allow SSID to be set for Configurator
Jouni Malinen [Thu, 22 Jun 2017 12:11:22 +0000 (15:11 +0300)] 
DPP: Allow SSID to be set for Configurator

The new ssid=<hexdump> parameter to DPP_AUTH_INIT can now be used to
specify the SSID to use in config object.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoJSON: Fix \u escaping
Jouni Malinen [Thu, 22 Jun 2017 12:09:57 +0000 (15:09 +0300)] 
JSON: Fix \u escaping

Remove the extra 'x' character from the escaped string.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoDPP: Add an example python script for QR Code operations
Jouni Malinen [Thu, 22 Jun 2017 11:52:28 +0000 (14:52 +0300)] 
DPP: Add an example python script for QR Code operations

This script can be used to process Android logcat information for
scanned QR Codes (e.g., from Barcode Scanner app) and also to display QR
Codes for locally generated bootstrap keys.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoDPP: Add DPP_BOOTSTRAP_INFO command
Jouni Malinen [Thu, 22 Jun 2017 11:51:21 +0000 (14:51 +0300)] 
DPP: Add DPP_BOOTSTRAP_INFO command

This can be used to fetch parsed details on bootstrapping information.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: DPP automatic network profile processing
Jouni Malinen [Wed, 21 Jun 2017 15:01:34 +0000 (18:01 +0300)] 
tests: DPP automatic network profile processing

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoDPP: Automatic network profile creation
Jouni Malinen [Wed, 21 Jun 2017 15:01:51 +0000 (18:01 +0300)] 
DPP: Automatic network profile creation

wpa_supplicant can now be configured to generate a network profile
automatically based on DPP configuration. The following
dpp_config_processing values can be used to specify the behavior:
0 = report received configuration to an external program for
    processing; do not generate any network profile internally (default)
1 = report received configuration to an external program and generate
    a network profile internally, but do not automatically connect
    to the created (disabled) profile; the network profile id is
    reported to external programs
2 = report received configuration to an external program, generate
    a network profile internally, try to connect to the created
    profile automatically

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoFILS: Fix EVENT_ASSOC processing checks for driver-SME
Jouni Malinen [Mon, 19 Jun 2017 18:34:10 +0000 (21:34 +0300)] 
FILS: Fix EVENT_ASSOC processing checks for driver-SME

Commit 5538fc930988bfc12935579b2b9930d18ffd1be8 ('FILS: Track completion
with FILS shared key authentication offload') added an additional case
for calling wpa_supplicant_event_assoc_auth() from EVENT_ASSOC handling
in case of FILS-completion with driver-based-SME. However, that checked
what placed outside the data != NULL case while data != NULL needs to
apply for this case as well due to wpa_supplicant_event_assoc_auth()
behavior. Move the data != NULL check to apply to both cases to avoid
potentially issues if a driver interface were to return EVENT_ASSOC
without the associate data. (CID 164708)

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoMake wpa_config_read_blob() easier for static analyzers
Jouni Malinen [Mon, 19 Jun 2017 18:28:37 +0000 (21:28 +0300)] 
Make wpa_config_read_blob() easier for static analyzers

While encoded == NULL could happen in the case of an empty blob, that
will result in encoded_len == 0 and base64_decode() not derefencing the
src argument. That seems to be too difficult for some static analyzers,
so to avoid false warnings, explicitly reject the encoded == NULL case
without even trying to base64 decode it. (CID 164709)

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: DPP bootstrapping, authentication, and configuration exchanges
Jouni Malinen [Thu, 15 Jun 2017 18:18:20 +0000 (21:18 +0300)] 
tests: DPP bootstrapping, authentication, and configuration exchanges

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoDPP: Network Introduction protocol for wpa_supplicant
Jouni Malinen [Sun, 18 Jun 2017 17:19:25 +0000 (20:19 +0300)] 
DPP: Network Introduction protocol for wpa_supplicant

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoDPP: Network Introduction protocol for hostapd
Jouni Malinen [Sun, 18 Jun 2017 17:19:57 +0000 (20:19 +0300)] 
DPP: Network Introduction protocol for hostapd

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoDPP: Network Introduction protocol
Jouni Malinen [Sun, 18 Jun 2017 17:19:57 +0000 (20:19 +0300)] 
DPP: Network Introduction protocol

This commit adds generic helper functions for going through Network
Introduction protocol.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoDPP: AP parameters for DPP AKM
Jouni Malinen [Sun, 18 Jun 2017 14:29:57 +0000 (17:29 +0300)] 
DPP: AP parameters for DPP AKM

Extend hostapd configuration to include parameters needed for the DPP
AKM: dpp_connector, dpp_netaccesskey, dpp_netaccesskey_expiry,
dpp_csign, dpp_csign_expiry.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoDPP: Network profile parameters for DPP AKM
Jouni Malinen [Sun, 18 Jun 2017 10:48:57 +0000 (13:48 +0300)] 
DPP: Network profile parameters for DPP AKM

Extend wpa_supplicant network profile to include parameters needed for
the DPP AKM: dpp_connector, dpp_netaccesskey, dpp_netaccesskey_expiry,
dpp_csign, dpp_csign_expiry.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoDPP: Allow PMKSA cache entries to be added through hostapd ctrl_iface
Jouni Malinen [Sun, 18 Jun 2017 11:14:18 +0000 (14:14 +0300)] 
DPP: Allow PMKSA cache entries to be added through hostapd ctrl_iface

This allows external programs to generate and add PMKSA cache entries
into hostapd. The main use for this is to run external DPP processing
(network introduction) and testing.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoDPP: Add new AKM
Jouni Malinen [Sat, 17 Jun 2017 20:48:52 +0000 (23:48 +0300)] 
DPP: Add new AKM

This new AKM is used with DPP when using the signed Connector to derive
a PMK. Since the KCK, KEK, and MIC lengths are variable within a single
AKM, this needs number of additional changes to get the PMK length
delivered to places that need to figure out the lengths of the PTK
components.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoDPP: Integration for hostapd
Jouni Malinen [Thu, 15 Jun 2017 19:16:45 +0000 (22:16 +0300)] 
DPP: Integration for hostapd

This adds DPP bootstrapping, authentication, and configuration into
hostapd similarly to how the design was integrated in wpa_supplicant.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoDPP: Add wpa_cli commands for DPP operations
Jouni Malinen [Thu, 15 Jun 2017 18:18:17 +0000 (21:18 +0300)] 
DPP: Add wpa_cli commands for DPP operations

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoDPP: Configuration exchange
Jouni Malinen [Thu, 15 Jun 2017 18:18:15 +0000 (21:18 +0300)] 
DPP: Configuration exchange

This adds support for DPP Configuration Protocol using GAS. Full
generation and processing of the configuration object is not included in
this commit.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoDPP: Authentication exchange
Jouni Malinen [Thu, 15 Jun 2017 18:18:12 +0000 (21:18 +0300)] 
DPP: Authentication exchange

Add wpa_supplicant control interface commands for managing DPP
Authentication exchange.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoDPP: Bootstrap information management
Jouni Malinen [Thu, 15 Jun 2017 18:18:10 +0000 (21:18 +0300)] 
DPP: Bootstrap information management

Add wpa_supplicant control interface commands for parsing the bootstrap
info URI from a QR Code (get peer public key) and to generate a new
bootstrap info with private key for local use. The optional
key=<hexdump> argument to the DPP_BOOTSTRAP_GEN command can be used to
specify the bootstrapping private key in OpenSSL ECPrivateKey DER
encoding format. This results in the local bootstrapping information
entry being created with the specified key instead of generating a new
random one.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoFix offchannel TX done handling for sequence of TX frames
Jouni Malinen [Thu, 15 Jun 2017 18:18:07 +0000 (21:18 +0300)] 
Fix offchannel TX done handling for sequence of TX frames

There could be multiple pending TX operations and if the earlier ones
have used wait_time, but the last one did not, the driver call for
canceling pending wait was not done. This could result in the driver
getting stuck waiting for the previously scheduled wait time and not
being able to do new operations until that. Fix this by canceling the
wait if any of the past offchannel_send_action() calls since the last
offchannel_send_action_done() used non-zero wait_time.

This was showing up as issues in certain DPP Public Action frame
sequences when the same offchannel operation is used with multiple
frames and the last frame in the sequence does not need wait_time.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agonl80211: Register to receive DPP Public Action frames
Jouni Malinen [Thu, 15 Jun 2017 18:18:05 +0000 (21:18 +0300)] 
nl80211: Register to receive DPP Public Action frames

These are needed for DPP exchanges. In addition, register GAS frames for
DPP builds.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: Module tests for JSON parser
Jouni Malinen [Thu, 15 Jun 2017 18:18:03 +0000 (21:18 +0300)] 
tests: Module tests for JSON parser

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoAdd JavaScript Object Notation (JSON) parser (RFC7159)
Jouni Malinen [Thu, 15 Jun 2017 18:18:00 +0000 (21:18 +0300)] 
Add JavaScript Object Notation (JSON) parser (RFC7159)

This is needed for DPP configuration attributes/objects.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: Update base64 OOM test cases to match implementation changes
Jouni Malinen [Thu, 15 Jun 2017 18:17:57 +0000 (21:17 +0300)] 
tests: Update base64 OOM test cases to match implementation changes

Introduction of the new base64 helper function changed the backtraces
for these OOM test cases and resulted in test failures. Update the test
scripts to work with the new implementation.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoAdd base64url encoding/decoding per RFC 4648
Jouni Malinen [Thu, 15 Jun 2017 18:17:54 +0000 (21:17 +0300)] 
Add base64url encoding/decoding per RFC 4648

This adds functionality needed for parsing and generating JSON Web Key
data structures in DPP.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoExtend SHA-384 and SHA-512 support to match SHA-256
Jouni Malinen [Thu, 15 Jun 2017 18:17:50 +0000 (21:17 +0300)] 
Extend SHA-384 and SHA-512 support to match SHA-256

The additional SHA-384 and SHA-512 functionality is needed to support
DPP with various ECC curves.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoP2P: Debug print P2P_FIND rejection reason
Jouni Malinen [Tue, 13 Jun 2017 11:50:51 +0000 (14:50 +0300)] 
P2P: Debug print P2P_FIND rejection reason

This can be helpful in figuring out what happened if P2P_FIND operation
is unexpectedly rejected.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoP2P: Fix p2p_in_provisioning clearing in failure case
Wu Gao [Tue, 13 Jun 2017 11:45:49 +0000 (14:45 +0300)] 
P2P: Fix p2p_in_provisioning clearing in failure case

wpa_s->p2p_in_provisioning needs to be cleared when group formation
fully completes. The change to postpone GO side handling to the first
data connection in commit 41f853235fe1d1fad1acecc0ee5dfe81c872c6b2
('P2P: Extend group formation timeout on GO to first data connection')
resulted in making this not happen in one P2P Client side case: EAP-WSC
timeout in PBC case. While that is quite special case since it requires
30 second timeout without receiving new EAPOL frames and not getting
disassociation, it can apparently happen in some cases in practice. This
would result in new P2P operations (e.g., P2P_FIND) getting rejected
until wpa_supplicant is restarted.

Fix this by clearing wpa_s->p2p_in_provisioning whenever processing a
group formation failure case. For group formation success,
wpa_s->p2p_in_provisioning is left set to non-zero value to avoid
breaking the earlier limits on the GO side.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoeap_proxy: Support multiple SIMs in get_imsi()
Vidyullatha Kanchanapally [Fri, 2 Jun 2017 13:08:20 +0000 (18:38 +0530)] 
eap_proxy: Support multiple SIMs in get_imsi()

This allows the eap_proxy mechanism to be used with multiple SIMs by
following the configured sim_num to index which SIM to use for when
fetching the IMSI through eap_proxy.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoeap_proxy: Build realm from IMSI for proxy based EAP methods
Vidyullatha Kanchanapally [Fri, 2 Jun 2017 13:08:20 +0000 (18:38 +0530)] 
eap_proxy: Build realm from IMSI for proxy based EAP methods

For proxy based EAP methods, the EAP identity is constructed in
eap_proxy layer from IMSI when required. Realm information from identity
is used to do ERP eventually, hence construct the realm for proxy based
methods from IMSI in core wpa_supplicant to enable the ERP use case.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agonl80211: Do not notify interface as re-enabled if initialization fails
Jouni Malinen [Tue, 6 Jun 2017 00:07:43 +0000 (03:07 +0300)] 
nl80211: Do not notify interface as re-enabled if initialization fails

wpa_supplicant tries to reinitialize an interface when a previously
removed netdev is restored (e.g., re-insert a USB dongle). If that
initialization fails (e.g., driver ejects ifconfig UP), the previous
implementation resulted in leaving the interface in incomplete state
while still claiming to upper layers that the interface status has
changed back to functional one.

Fix this by skipping the interface status update if reinitialization
fails. In other words, remain in INTERFACE_DISABLED state if the
interface cannot be re-enabled successfully.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoeap_proxy: Add support for deriving ERP information
Vidyullatha Kanchanapally [Mon, 15 May 2017 14:28:25 +0000 (19:58 +0530)] 
eap_proxy: Add support for deriving ERP information

This commit adds support for deriving ERP key information in EAP Proxy
based EAP method implementations.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agohostapd: Fix handling a 20/40 BSS Coexistence Management frame
Vidyullatha Kanchanapally [Mon, 29 May 2017 11:13:37 +0000 (16:43 +0530)] 
hostapd: Fix handling a 20/40 BSS Coexistence Management frame

hostapd processes a received 20/40 BSS Coexistence management frame, but
if no separate callbacks are registered for handling Public Action
frames it eventually sends a reply with MSB of category code set to 1
thinking that the received frame is an invalid frame. This could happen
based on whether hostapd was built and enabled with functionality using
the callback functions.

Fix this by explicitly returning 1 from the function when the 20/40 BSS
Coexistence Management frame is processed.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoAdd a config parameter to exclude DFS channels from ACS
Sunil Dutt [Tue, 16 May 2017 10:42:38 +0000 (16:12 +0530)] 
Add a config parameter to exclude DFS channels from ACS

The new acs_exclude_dfs=1 parameter can be used to request hostapd to
exclude all DFS channels from ACS consideration. This is mainly of use
for cases where the driver supports DFS channels, but for some reason a
non-DFS channel is desired when using automatic channel selection.
Previously, the chanlist parameter could have been used for this, but
that required listing all the acceptable channels. The new parameter
allows this to be done without such a list.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoP2P: wpas_p2p_select_go_freq() to check for supported pref_freq
Sunil Dutt [Wed, 24 May 2017 15:40:53 +0000 (21:10 +0530)] 
P2P: wpas_p2p_select_go_freq() to check for supported pref_freq

This commit is similar to the commit
783c2920cc9117b663506dc82223867bfa792a5d ('P2P: Check if the pref_freq
reported by the driver supports P2P') but extends the check for
supported pref_freq to wpas_p2p_select_go_freq().

This avoids issues with P2P_GROUP_ADD ending up selecting an unexpected
channel when get_pref_freq_list() (i.e.,
QCA_NL80211_VENDOR_SUBCMD_GET_PREFERRED_FREQ_LIST) is used. Filter the
list 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 agotests: Avoid unexpected roam in wnm_bss_tm
Jouni Malinen [Sat, 27 May 2017 08:19:00 +0000 (11:19 +0300)] 
tests: Avoid unexpected roam in wnm_bss_tm

It was possible for the BTM Request with no matching BSSIDs to cause
wpa_supplicant-initated roam to a better BSS (5 GHz band preferred) when
finding the second AP in a scan started by that BTM Request. This could
make the following step in the test case fail. Fix this by asking
another channel to be scanned to postpone discovery of the other AP.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Write TEST-START and TEST-STOP into kernel logs with timestamps
Jouni Malinen [Sat, 27 May 2017 08:08:16 +0000 (11:08 +0300)] 
tests: Write TEST-START and TEST-STOP into kernel logs with timestamps

This makes it easier to synchronize log entries in the kernel log
(seconds from boot) and wpa_supplicant/hostapd (UNIX timestamp).

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoInterworking: Add NULL checking for EAP name in phase2/autheap parameter
Peng Xu [Wed, 24 May 2017 18:33:20 +0000 (11:33 -0700)] 
Interworking: Add NULL checking for EAP name in phase2/autheap parameter

Add NULL checking for EAP name. If it is NULL, do not add the phase2
parameter autheap. This should not happen in practice due to earlier
checks for credential matching, but if there is a code path that would
allow this to be set, it is better to skip setting of the invalid value
and allow automatic selection of the Phase 2 parameters.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoRename vendor attribute DISABLE_OFFCHANNEL to RESTRICT_OFFCHANNEL
Sunil Dutt [Tue, 23 May 2017 16:49:34 +0000 (22:19 +0530)] 
Rename vendor attribute DISABLE_OFFCHANNEL to RESTRICT_OFFCHANNEL

This commit renames the vendor attribute
QCA_WLAN_VENDOR_ATTR_CONFIG_DISABLE_OFFCHANNEL to
QCA_WLAN_VENDOR_ATTR_CONFIG_RESTRICT_OFFCHANNEL as intended by the
original commit d506c35efc9177cf622bc19b9860d9f7f5554536 ('Set Wi-Fi
Configuration attribute to restrict offchannel operations').

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoSet Wi-Fi Configuration attribute to restrict offchannel operations
Sunil Dutt [Fri, 12 May 2017 13:27:49 +0000 (18:57 +0530)] 
Set Wi-Fi Configuration attribute to restrict offchannel operations

This commit defines an attribute to
QCA_NL80211_VENDOR_SUBCMD_SET_WIFI_CONFIGURATION -
QCA_WLAN_VENDOR_ATTR_CONFIG_RESTRICT_OFFCHANNEL which can be used to
restrict offchannel operations on the AP/GO interface.

The goal is to restrict any operations which would cause the AP/GO to
leave its operating channel.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoERP: Do not generate ERP keys when domain name is not specified
Vidyullatha Kanchanapally [Wed, 17 May 2017 12:37:11 +0000 (18:07 +0530)] 
ERP: Do not generate ERP keys when domain name is not specified

This commit adds changes to not generate ERP information if the domain
name is not specified in the EAP identity. keyName-NAI needs the realm
part and as such, it is reasonable to require the main EAP configuration
to provide that realm.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: Use a domain name in the identity for get_emsk OOM tests
Jouni Malinen [Mon, 22 May 2017 10:47:37 +0000 (13:47 +0300)] 
tests: Use a domain name in the identity for get_emsk OOM tests

These test cases depend on ERP processing to reach the get_emsk handler
function. Since ERP really needs the realm to derive a proper
keyName-NAI, modify these test cases to pass the realm part in the
identity to allow error checking to be introduced for rejecting ERP
cases where the realm is not available.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoDo not flush PMKSA on bssid_hint change
Purushottam Kushwaha [Fri, 19 May 2017 18:24:10 +0000 (23:54 +0530)] 
Do not flush PMKSA on bssid_hint change

Change in any network configuration at runtime will cause flush to
PMKSA cache. For most of the network parameters if there is no change
in value, PMKSA flush is not performed except 'bssid' and 'priority'.

Add 'bssid_hint' to exemption list of avoiding PMKSA flush on change.
This is needed to complete change in commit
43a356b2687219b7a212df8ef21237b5ddf49f35 ('Provide option to configure
BSSID hint for a network').

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agonl80211: Fix race condition in detecting MAC change
Beniamino Galvani [Fri, 28 Apr 2017 15:59:30 +0000 (17:59 +0200)] 
nl80211: Fix race condition in detecting MAC change

Commit 3e0272ca00ce1df35b45e7d739dd7e935f13fd84 ('nl80211: Re-read MAC
address on RTM_NEWLINK') added the detection of external changes to MAC
address when the interface is brought up.

If the interface state is changed quickly enough, wpa_supplicant may
receive the netlink message for the !IFF_UP event when the interface
has already been brought up and would ignore the next netlink IFF_UP
message, missing the MAC change.

Fix this by also reloading the MAC address when a !IFF_UP event is
received with the interface up, because this implies that the
interface went down and up again, possibly changing the address.

Signed-off-by: Beniamino Galvani <bgalvani@redhat.com>
8 years agoDFS: Allow switch to DFS channel after radar detection in ETSI
Vasanthakumar Thiagarajan [Fri, 12 May 2017 07:48:01 +0000 (13:18 +0530)] 
DFS: Allow switch to DFS channel after radar detection in ETSI

This is to comply with uniform spreading requirement for ETSI domain
(section 4.7.2.7 in EN 301 893 - V1.8.1). ETSI uniform spreading
requires equal probability for the usable channels. The previous channel
selection logic after a radar detection did not fully comply with the
uniform spreading requirement for the domain by ignoring DFS channels.
Consider DFS channels also during channel selection when the current DFS
domain is ETSI.

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qti.qualcomm.com>
8 years agodriver: Make DFS domain information available to core
Vasanthakumar Thiagarajan [Fri, 12 May 2017 07:48:00 +0000 (13:18 +0530)] 
driver: Make DFS domain information available to core

Current DFS domain information of the driver can be used in ap/dfs
to comply with DFS domain specific requirements like uniform spreading
for ETSI domain.

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qti.qualcomm.com>
8 years agotests: Verify DFS channel switch both in and outside ETSI
Jouni Malinen [Sat, 13 May 2017 17:01:06 +0000 (20:01 +0300)] 
tests: Verify DFS channel switch both in and outside ETSI

The behavior will be different based on the uniform spreading
requirement.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoVendor attributes to retain connection on a roam request failure
Vidyullatha Kanchanapally [Fri, 5 May 2017 15:11:08 +0000 (20:41 +0530)] 
Vendor attributes to retain connection on a roam request failure

This commit introduces the following two attributes to
QCA_NL80211_VENDOR_SUBCMD_KEY_MGMT_ROAM_AUTH events:

QCA_WLAN_VENDOR_ATTR_ROAM_AUTH_STATUS - Indicates the status of
re-association requested by user space
QCA_WLAN_VENDOR_ATTR_ROAM_AUTH_RETAIN_CONNECTION - Indicates whether
the old association was maintained when a re-association
is requested by user space and that re-association attempt
fails (i.e., cannot connect to the requested BSS, but can
remain associated with the BSS with which the association was
in place when being requested to roam).

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: cfg80211 connect command with bssid_hint
Jouni Malinen [Thu, 11 May 2017 21:33:06 +0000 (00:33 +0300)] 
tests: cfg80211 connect command with bssid_hint

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoProvide option to configure BSSID hint for a network
Purushottam Kushwaha [Tue, 9 May 2017 15:03:51 +0000 (20:33 +0530)] 
Provide option to configure BSSID hint for a network

This exposes user configurable option to set bssid_hint for a network.
bssid_hint indicates which BSS has been found a suitable candidate for
initial association for drivers that use driver/firmware-based BSS
selection. Unlike the bssid parameter, bssid_hint does not limit the
driver from selecting other BSSs in the ESS.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoDefine a QCA vendor attribute to update the listen interval
Sunil Dutt [Thu, 27 Apr 2017 13:28:06 +0000 (18:58 +0530)] 
Define a QCA vendor attribute to update the listen interval

This commit defines an attribute
QCA_WLAN_VENDOR_ATTR_CONFIG_LISTEN_INTERVAL which allows the currently
used listen interval to be updated using
QCA_NL80211_VENDOR_SUBCMD_SET_WIFI_CONFIGURATION. This update applies
only during the association and is done without updating the AP about
the change.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: OCSP test coverage with SHA-1 hash
Jouni Malinen [Tue, 9 May 2017 20:41:50 +0000 (23:41 +0300)] 
tests: OCSP test coverage with SHA-1 hash

The previous fix to the OCSP request construction ended up finally
moving from SHA-1 -based hash to SHA-256 for OCSP test cases. To
maintain coverage for SHA-1, add cloned versions of the two test cases
so that both SHA-256 and SHA-1 cases get covered.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: Fix openssl ocsp command and check for errors
Johannes Berg [Tue, 18 Apr 2017 19:18:14 +0000 (21:18 +0200)] 
tests: Fix openssl ocsp command and check for errors

Fix the openssl ocsp command line and check if it returns an error - so
that instead of having something unusable later we error out
immediately. Moving the -sha256 argument earlier fixes hash function use
for the OCSP request generation (the old version used SHA-1).

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agoOpenSSL: Try SHA256 hash for OCSP certificate matching
Jouni Malinen [Tue, 9 May 2017 20:31:20 +0000 (23:31 +0300)] 
OpenSSL: Try SHA256 hash for OCSP certificate matching

Previously, only SHA1 hash -based server certificate matching was used,
but the OCSP response may use SHA256 instead of SHA1, so check the match
with both hash functions, if needed.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoHTTP (curl): Try SHA256 hash for OCSP certificate matching
Jouni Malinen [Tue, 9 May 2017 20:35:59 +0000 (23:35 +0300)] 
HTTP (curl): Try SHA256 hash for OCSP certificate matching

Previously, only SHA1 hash -based server certificate matching was used,
but the OCSP response may use SHA256 instead of SHA1, so check the match
with both hash functions, if needed.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoFix compiler warning with CONFIG_IEEE80211R no-CONFIG_FILS build
Jouni Malinen [Tue, 9 May 2017 20:29:55 +0000 (23:29 +0300)] 
Fix compiler warning with CONFIG_IEEE80211R no-CONFIG_FILS build

Addition of remove_ies() handled the CONFIG_IEEE80211R dependency, but
missed the caller being within CONFIG_FILS as well.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoMake CONFIG_MACSEC depend on IEEE8021X_EAPOL
Jaap Keuter [Tue, 11 Apr 2017 15:22:36 +0000 (17:22 +0200)] 
Make CONFIG_MACSEC depend on IEEE8021X_EAPOL

When reducing the configuration for MACsec/MKA to the bare minimum, so
no EAP authentication, just MACsec/MKA SA use with preshared key/name,
the EAPOL engine is still needed to run the protocol for MKA. Without
any EAP authentication options the IEEE8021X_EAPOL option is not set,
resulting in a non-working Key Agreement Entity.

Therefore the CONFIG_MACSEC block needs to move up and set the
IEEE8021X_EAPOL option.

Signed-off-by: Jaap Keuter <jaap.keuter@xs4all.nl>
8 years agotests: Add mesh RSSI threshold test
Masashi Honma [Mon, 3 Apr 2017 22:28:36 +0000 (07:28 +0900)] 
tests: Add mesh RSSI threshold test

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
8 years agomesh: Make NL80211_MESHCONF_RSSI_THRESHOLD configurable
Masashi Honma [Mon, 3 Apr 2017 22:28:35 +0000 (07:28 +0900)] 
mesh: Make NL80211_MESHCONF_RSSI_THRESHOLD configurable

In some practical cases, it is useful to suppress joining to node in the
distance. The new field mesh_rssi_threshold could be used as RSSI
threshold for joining.

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
8 years agotests: BSS TM request with 160 MHz opclass 129
Jouni Malinen [Sun, 7 May 2017 19:02:12 +0000 (22:02 +0300)] 
tests: BSS TM request with 160 MHz opclass 129

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoFix 160 MHz opclass channel to frequency conversion
Jouni Malinen [Sun, 7 May 2017 18:54:58 +0000 (21:54 +0300)] 
Fix 160 MHz opclass channel to frequency conversion

This needs to allow all 20 MHz channel numbers to be converted even
though the Annex E table lists only channel _center_ frequencies 50 and
114. Neighbor Report (see IEEE Std 802.11-2016, 9.4.2.37 Neighbor Report
element) uses Channel Number field with "last known primary channel of
the AP" which refers to the 20 MHz channel and not the channel center
frequency.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: D-Bus methods for setting TDLS channel switching
Jouni Malinen [Sun, 7 May 2017 18:36:00 +0000 (21:36 +0300)] 
tests: D-Bus methods for setting TDLS channel switching

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agodbus: Add method to disable channel switching with a TDLS peer
Nishant Chaprana [Thu, 13 Apr 2017 12:09:01 +0000 (17:39 +0530)] 
dbus: Add method to disable channel switching with a TDLS peer

This patch adds "TDLSCancelChannelSwitch" dbus method on
"fi.w1.wpa_supplicant1.Interface" interface to disable channel switching
with a TDLS peer.

Signed-off-by: Nishant Chaprana <n.chaprana@samsung.com>
8 years agodbus: Add method to enable channel switching with a TDLS peer
Nishant Chaprana [Mon, 1 May 2017 04:05:37 +0000 (09:35 +0530)] 
dbus: Add method to enable channel switching with a TDLS peer

This patch adds "TDLSChannelSwitch" dbus method on
"fi.w1.wpa_supplicant1.Interface" interface to enable channel switching
with a TDLS peer.

Signed-off-by: Nishant Chaprana <n.chaprana@samsung.com>