]> git.ipfire.org Git - thirdparty/hostap.git/log
thirdparty/hostap.git
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 years agotests: D-Bus scan trigger and abort
Jouni Malinen [Sun, 7 May 2017 17:59:44 +0000 (20:59 +0300)] 
tests: D-Bus scan trigger and abort

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agodbus: Add AbortScan method to abort ongoing scan
Saurav Babu [Thu, 13 Apr 2017 03:58:11 +0000 (09:28 +0530)] 
dbus: Add AbortScan method to abort ongoing scan

Signed-off-by: Saurav Babu <saurav.babu@samsung.com>
7 years agotests: FILS SK using ERP and FT initial mobility domain association
Jouni Malinen [Sun, 7 May 2017 11:32:53 +0000 (14:32 +0300)] 
tests: FILS SK using ERP and FT initial mobility domain association

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoFILS: Derive FT key hierarchy on authenticator side for FILS+FT
Jouni Malinen [Sun, 7 May 2017 11:32:25 +0000 (14:32 +0300)] 
FILS: Derive FT key hierarchy on authenticator side for FILS+FT

Derive PMK-R0 and the relevant key names when using FILS authentication
for initial FT mobility domain association.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoFILS: Derive FT key hierarchy on supplicant side for FILS+FT
Jouni Malinen [Sun, 7 May 2017 09:00:27 +0000 (12:00 +0300)] 
FILS: Derive FT key hierarchy on supplicant side for FILS+FT

Derive PMK-R0 and the relevant key names when using FILS authentication
for initial FT mobility domain association. Fill in the FT IEs in
(Re)Association Request frame for this.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoFILS: Implement FILS-FT derivation
Jouni Malinen [Sun, 7 May 2017 08:47:44 +0000 (11:47 +0300)] 
FILS: Implement FILS-FT derivation

This extends fils_pmk_to_ptk() to allow FILS-FT to be derived. The
callers do not yet use that capability; i.e., actual use will be added
in separate commits.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoFILS: Fix Key-Auth derivation for SK+PFS for authenticator side
Jouni Malinen [Sun, 7 May 2017 14:04:08 +0000 (17:04 +0300)] 
FILS: Fix Key-Auth derivation for SK+PFS for authenticator side

The conditional gSTA and gAP (DH public keys) were not previously
included in Key-Auth derivation, but they are needed for the PFS case.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoFILS: Fix Key-Auth derivation for SK+PFS for supplicant side
Jouni Malinen [Sun, 7 May 2017 14:02:47 +0000 (17:02 +0300)] 
FILS: Fix Key-Auth derivation for SK+PFS for supplicant side

The conditional gSTA and gAP (DH public keys) were not previously
included in Key-Auth derivation, but they are needed for the PFS case.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoFILS: Debug print inputs to Key-Auth derivation
Jouni Malinen [Sun, 7 May 2017 14:01:21 +0000 (17:01 +0300)] 
FILS: Debug print inputs to Key-Auth derivation

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agowpa_supplicant: Add GET_CAPABILITY for P2P redirection
Dmitry Shmidt [Thu, 6 Apr 2017 00:09:49 +0000 (00:09 +0000)] 
wpa_supplicant: Add GET_CAPABILITY for P2P redirection

It will give capability to check channel list before P2P group is
created.

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
7 years agoDetect endianness when building for RTEMS
Jonas Larsson [Thu, 6 Apr 2017 17:21:06 +0000 (10:21 -0700)] 
Detect endianness when building for RTEMS

This adds endianness detection and byte swap
definitions for the RTEMS RTOS.

Signed-off-by: Jonas Larsson <ljonas@google.com>
7 years agoAndroid: Define CONFIG_TESTING_OPTIONS if enabled in config
Vamsi Krishna [Thu, 4 May 2017 12:33:44 +0000 (18:03 +0530)] 
Android: Define CONFIG_TESTING_OPTIONS if enabled in config

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoMBO: Add support to set ignore assoc disallow to driver
Vamsi Krishna [Thu, 4 May 2017 07:24:49 +0000 (12:54 +0530)] 
MBO: Add support to set ignore assoc disallow to driver

Add support to set ignore assoc disallow to the driver so that the
driver ignores assoc disallowed bit set by APs while connecting. This is
used by drivers that handle BSS selection and roaming internally.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agotests: FT with AP-to-AP broadcast messages
Michael Braun [Sun, 2 Apr 2017 12:52:53 +0000 (14:52 +0200)] 
tests: FT with AP-to-AP broadcast messages

Signed-off-by: Michael Braun <michael-dev@fami-braun.de>
7 years agoFT: Add support for wildcard R0KH/R1KH
Michael Braun [Sun, 2 Apr 2017 12:52:52 +0000 (14:52 +0200)] 
FT: Add support for wildcard R0KH/R1KH

Enable use of FT RRB without configuring each other AP locally. Instead,
broadcast messages are exchanged to discover APs within the local
network.

When an R0KH or R1KH is discovered, it is cached for one day.

When a station uses an invalid or offline r0kh_id, requests are always
broadcast. In order to avoid this, if r0kh does not reply, a temporary
blacklist entry is added to r0kh_list.

To avoid blocking a valid r0kh when a non-existing pmk_r0_name is
requested, r0kh is required to always reply using a NAK. Resend requests
a few times to ensure blacklisting does not happen due to small packet
loss.

To free newly created stations later, the r*kh_list start pointer in
conf needs to be updateable from wpa_auth_ft.c, where only wconf is
accessed.

Signed-off-by: Michael Braun <michael-dev@fami-braun.de>
7 years agotests: Update FT RRB function OOM paths
Michael Braun [Sun, 2 Apr 2017 12:52:51 +0000 (14:52 +0200)] 
tests: Update FT RRB function OOM paths

Signed-off-by: Michael Braun <michael-dev@fami-braun.de>
7 years agoFT RRB: Add msg replay and msg delay protection
Michael Braun [Sun, 2 Apr 2017 12:52:51 +0000 (14:52 +0200)] 
FT RRB: Add msg replay and msg delay protection

This adds a counter and adds sequence numbering to FT RRB packets. The
sequence number is checked against r0kh/r1kh sequence number cache.

Special attention is needed in case the remote AP reboots and thus loses
its state. I prefer it to recover automatically even without synchronized
clocks. Therefore an identifier called dom is generated randomly along the
initial sequence number. If the dom transmitted does not match or the
sequence number is not in the range currently expected, the sender is asked
for a fresh confirmation of its currently used sequence numbers. The packet
that triggered this is cached and processed again later.

Additionally, in order to ensure freshness, the remote AP includes an
timestamp with its messages. It is then verified that the received
messages are indeed fresh by comparing it to the older timestamps
received and the time elapsed since then. Therefore FT_RRB_TIMESTAMP is
no longer needed.

This assigns new OUI 00:13:74 vendor-specific subtype 0x0001 subtypes:
4 (SEQ_REQ) and 5 (SEQ_RESP).

This breaks backward compatibility, i.e., hostapd needs to be updated
on all APs at the same time to allow FT to remain functional.

Signed-off-by: Michael Braun <michael-dev@fami-braun.de>
7 years agotests: FT using old style key for AP-to-AP protocol
Jouni Malinen [Sat, 15 Apr 2017 09:22:29 +0000 (12:22 +0300)] 
tests: FT using old style key for AP-to-AP protocol

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agotests: Update FT test cases for new RRB message format
Michael Braun [Sun, 2 Apr 2017 12:52:50 +0000 (14:52 +0200)] 
tests: Update FT test cases for new RRB message format

This updates the AP-to-AP keys to the longer form and OOM test case
functions to match the new implementation.

Signed-off-by: Michael Braun <michael-dev@fami-braun.de>
7 years agoFT: New RRB message format
Michael Braun [Sun, 2 Apr 2017 12:52:50 +0000 (14:52 +0200)] 
FT: New RRB message format

Convert FT RRB into a new TLV based format. Use AES-SIV as AEAD cipher
to protect the messages.

This needs at least 32 byte long keys. These can be provided either
by a config file change or letting a KDF derive the 32 byte key used
from the 16 byte key given.

This breaks backward compatibility, i.e., hostapd needs to be updated on
all APs at the same time to allow FT to remain functional.

Signed-off-by: Michael Braun <michael-dev@fami-braun.de>
7 years agoFT: Replace inter-AP protocol with use of OUI Extended Ethertype
Michael Braun [Sun, 2 Apr 2017 12:52:49 +0000 (14:52 +0200)] 
FT: Replace inter-AP protocol with use of OUI Extended Ethertype

Replace the previously used extension of IEEE 802.11 managed Ethertype
89-0d (originally added for Remote Request/Response in IEEE 802.11r)
with Ethertype 88-b7 (OUI Extended EtherType) for FT inter-AP
communication. The new design uses a more properly assigned identifier
for the messages.

This assigns the OUI 00:13:74 vendor-specific subtype 0x0001 for the new
hostapd AP-to-AP communication purposes. Subtypes 1 (PULL), 2 (RESP),
and 3 (PUSH) are also assigned in this commit for the R0KH-R1KH
protocol.

This breaks backward compatibility, i.e., hostapd needs to be updated on
all APs at the same time to allow FT to remain functional.

Signed-off-by: Michael Braun <michael-dev@fami-braun.de>
7 years agotests: Validate kernel behavior in wnm_bss_tm_connect_cmd
Jouni Malinen [Tue, 2 May 2017 14:18:50 +0000 (17:18 +0300)] 
tests: Validate kernel behavior in wnm_bss_tm_connect_cmd

The cfg80211 connect command extension to allow roaming request from
user space while connect was added to the kernel, so uncomment the
previously commented out TODO item to verify this behavior.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoMBO: Fix possible NULL pointer dereference on candidate handling
Pradeep Reddy Potteti [Fri, 28 Apr 2017 10:52:08 +0000 (16:22 +0530)] 
MBO: Fix possible NULL pointer dereference on candidate handling

If the driver provides input on MBO transition candidate handling, the
target value in get_mbo_transition_candidate() can be NULL if the driver
provided BSSID is not found in the wpa_supplicant BSS table. And later
it would be dereferenced. Fix this by adding an explicit check before
dereferencing the pointer.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoERP: Silence static analyzer warning
Jouni Malinen [Mon, 1 May 2017 19:06:53 +0000 (22:06 +0300)] 
ERP: Silence static analyzer warning

The check for erp->keyname_nai within eap_erp_get_key() is apparently
too difficult for some static analyzers to notice. Add an explicit check
for os_strchr() return value being non-NULL to avoid false reports.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoatheros: Get rid of static analyzer warnings on 0-length memcpy
Jouni Malinen [Mon, 1 May 2017 14:45:53 +0000 (17:45 +0300)] 
atheros: Get rid of static analyzer warnings on 0-length memcpy

These functions can potentially be called with ie == NULL and ie_len ==
0. Check explitcitly for the ie == NULL case to avoid confusing
memcpy(dst, NULL, 0) calls.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoEnable CONFIG_WNM=y automatically for CONFIG_MBO=y builds
Jouni Malinen [Mon, 1 May 2017 14:33:10 +0000 (17:33 +0300)] 
Enable CONFIG_WNM=y automatically for CONFIG_MBO=y builds

wpa_supplicant build with MBO enabled failed in CONFIG_WNM=y was not
specified explicitly. Add the WNM dependency automatically to avoid
needing explicit addition in build configuration.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoFix GAS server ifdef block use
Jouni Malinen [Mon, 1 May 2017 14:29:06 +0000 (17:29 +0300)] 
Fix GAS server ifdef block use

Commit 941caed98009104484ca894dd49f87bf23cff091 ('MBO: Add MBO
ANQP-element processing on AP') changed the design by using the
rx_anqp_vendor_specific() function to process all ANQP vendor specific
elements. However, the caller for this was within ifdef CONFIG_HS20
block. Fix this by calling the function even in CONFIG_HS20=y is not
included in the build. This fixes CONFIG_MBO=y builds without
CONFIG_HS20=y.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoFix CONFIG_INTERWORKING=y build without CONFIG_HS20=y
Jouni Malinen [Mon, 1 May 2017 14:24:18 +0000 (17:24 +0300)] 
Fix CONFIG_INTERWORKING=y build without CONFIG_HS20=y

Commit 34f28519027d2504168e109519112c1b12d1fdf6 ('MBO: Parse MBO
ANQP-element on STA') started using the type variable outside
CONFIG_HS20 block, but forgot to remove the ifdef from the variable
declaration.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agotests: Make p2p_service_discovery_peer_not_listening a bit more robust
Jouni Malinen [Sat, 29 Apr 2017 19:40:01 +0000 (22:40 +0300)] 
tests: Make p2p_service_discovery_peer_not_listening a bit more robust

It was apparently possible for the P2P_FIND operation to terminate
before the peer device was found. Increase the timeout to avoid this.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agotests: DISABLE_NETWORK during connection and blacklist behavior
Jouni Malinen [Sat, 29 Apr 2017 15:00:26 +0000 (18:00 +0300)] 
tests: DISABLE_NETWORK during connection and blacklist behavior

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoDo not blacklist the current AP on DISABLE_NETWORK
Sunil Dutt [Mon, 24 Apr 2017 10:01:05 +0000 (15:31 +0530)] 
Do not blacklist the current AP on DISABLE_NETWORK

Disconnection due to DISABLE_NETWORK while being connected was resulting
in the AP getting blacklisted. Avoid this by setting own_disconnect_req
on a disconnect request due to DISABLE_NETWORK similarly to the
SELECT_NETWORK disconnection case.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agotests: HT40 with both plus and minus allowed
Jouni Malinen [Sat, 29 Apr 2017 11:11:17 +0000 (14:11 +0300)] 
tests: HT40 with both plus and minus allowed

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agohostapd: Select a valid secondary channel if both enabled
Peng Xu [Fri, 21 Apr 2017 00:05:25 +0000 (17:05 -0700)] 
hostapd: Select a valid secondary channel if both enabled

When starting AP in HT40 mode and both HT40+ and HT40- options are
specified in hostapd.conf, select a valid secondary channel for the AP
automatically.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoFILS: Specify if FILS HLP was sent in connect
Vidyullatha Kanchanapally [Thu, 20 Apr 2017 12:08:49 +0000 (17:38 +0530)] 
FILS: Specify if FILS HLP was sent in connect

This adds a string "FILS_HLP_SENT" to connect event when HLP is sent
as part of ASSOC/CONNECT request.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoFILS: Add HLP to Connect IEs
Vidyullatha Kanchanapally [Fri, 14 Apr 2017 10:55:30 +0000 (16:25 +0530)] 
FILS: Add HLP to Connect IEs

Add FILS HLP elements to Connect IEs and fragment them if necessary.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoAllocate dynamic memory for connect IEs
Vidyullatha Kanchanapally [Fri, 14 Apr 2017 10:55:30 +0000 (16:25 +0530)] 
Allocate dynamic memory for connect IEs

This is needed to allow new elements (e.g., FILS HLP request) to be
added.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoPAE: Silence static analyzer warning about NULL pointer dereference
Ranga Ravuri [Mon, 24 Apr 2017 08:38:10 +0000 (11:38 +0300)] 
PAE: Silence static analyzer warning about NULL pointer dereference

ieee802_1x_kay_move_live_peer() did not check
ieee802_1x_kay_get_potential_peer() result explicitly and a static
analyzer reported a warning about the possible NULL result. This cannot
really happen in practice since the only caller of
ieee802_1x_kay_move_live_peer() verifies that the specific peer entry is
available. Anyway, it is easy to silence the false warning by adding an
explicit check here and cover any other potential case if another caller
is added.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoAdd control interface command to enable/disable roaming
Ashwini Patil [Mon, 10 Apr 2017 06:58:49 +0000 (12:28 +0530)] 
Add control interface command to enable/disable roaming

The new "SET roaming <0/1>" command can now be used to control
driver-based roaming.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoFILS: Handle authentication/association in partial driver AP SME
Jeffin Mammen [Fri, 21 Apr 2017 15:42:00 +0000 (18:42 +0300)] 
FILS: Handle authentication/association in partial driver AP SME

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoFILS: Make handle_auth_fils() re-usable for driver-based AP SME
Jeffin Mammen [Fri, 21 Apr 2017 15:42:00 +0000 (18:42 +0300)] 
FILS: Make handle_auth_fils() re-usable for driver-based AP SME

Allow this function to be called from outside ieee802_11.c and with the
final steps replaced through a callback function.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoFILS: Move authentication response handling into a helper function
Jeffin Mammen [Fri, 21 Apr 2017 15:42:00 +0000 (18:42 +0300)] 
FILS: Move authentication response handling into a helper function

This can be reused when splitting handle_auth_fils() to support the
driver-based AP SME case.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoFILS: Pass only IE area to handle_auth_fils()
Jeffin Mammen [Sun, 23 Apr 2017 15:24:38 +0000 (18:24 +0300)] 
FILS: Pass only IE area to handle_auth_fils()

This function does not need the frame header, so pass in only the IE
area to make it easier to share this for driver-based AP SME handling.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoFILS: Move AssocResp construction to a helper function
Jeffin Mammen [Fri, 21 Apr 2017 15:42:00 +0000 (18:42 +0300)] 
FILS: Move AssocResp construction to a helper function

This can be reused from driver-based AP SME callback.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoFILS: Move Key Confirm element validation to a helper function
Jeffin Mammen [Fri, 21 Apr 2017 15:42:00 +0000 (18:42 +0300)] 
FILS: Move Key Confirm element validation to a helper function

This can be reused from driver-based AP SME callback.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoFILS: Move Session element validation to a helper function
Jeffin Mammen [Fri, 21 Apr 2017 15:42:00 +0000 (18:42 +0300)] 
FILS: Move Session element validation to a helper function

This can be reused from driver-based AP SME callback.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoFILS: Add FILS auth_alg to driver-based AP SME association handling
Jeffin Mammen [Fri, 21 Apr 2017 18:10:23 +0000 (21:10 +0300)] 
FILS: Add FILS auth_alg to driver-based AP SME association handling

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoFILS: Add driver-AP SME callback to set TK after association
Jeffin Mammen [Fri, 21 Apr 2017 18:01:03 +0000 (21:01 +0300)] 
FILS: Add driver-AP SME callback to set TK after association

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoFILS: Add FILS AEAD parameters for sta_auth() calls
Jeffin Mammen [Fri, 21 Apr 2017 17:43:57 +0000 (20:43 +0300)] 
FILS: Add FILS AEAD parameters for sta_auth() calls

This is used with partial AP SME in driver cases to enable FILS
association (AES-SIV) processing.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoatheros: Add FILS AAD parameters in sta_auth() handler
Jeffin Mammen [Fri, 21 Apr 2017 16:39:55 +0000 (19:39 +0300)] 
atheros: Add FILS AAD parameters in sta_auth() handler

This is needed to allow the driver SME to perform the needed AES-SIV
operations during FILS association.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agodriver: Move sta_auth() arguments to a struct
Jeffin Mammen [Fri, 21 Apr 2017 15:15:37 +0000 (18:15 +0300)] 
driver: Move sta_auth() arguments to a struct

This makes it easier to add more parameters without having to change the
callback function prototype.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoatheros: Enable raw management frame receive for FILS builds
Jeffin Mammen [Fri, 21 Apr 2017 15:48:25 +0000 (18:48 +0300)] 
atheros: Enable raw management frame receive for FILS builds

This is needed to be able to process authentication and association
frames for FILS.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoatheros: Read driver FILS capability
Jeffin Mammen [Fri, 21 Apr 2017 15:17:01 +0000 (18:17 +0300)] 
atheros: Read driver FILS capability

This will be used to determine what type of operations to use for STA
authentication and association.

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