]> git.ipfire.org Git - thirdparty/hostap.git/log
thirdparty/hostap.git
7 years agoHS 2.0: Process received Terms and Conditions Acceptance notification
Jouni Malinen [Mon, 23 Apr 2018 21:17:47 +0000 (00:17 +0300)] 
HS 2.0: Process received Terms and Conditions Acceptance notification

Extend wpa_supplicant WNM-Notification RX handling to parse and process
received Terms and Conditions Acceptance notifications. If PMF is
enabled for the association, this frame results in control interface
indication (HS20-T-C-ACCEPTANCE <URL>) to get upper layers to guide the
user through the required acceptance steps.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoHS 2.0: Send Terms and Conditions Acceptance notification
Jouni Malinen [Mon, 23 Apr 2018 21:05:44 +0000 (00:05 +0300)] 
HS 2.0: Send Terms and Conditions Acceptance notification

This extends hostapd Access-Accept processing to check if the RADIUS
server indicated that Terms and Conditions Acceptance is required. The
new hs20_t_c_server_url parameter is used to specify the server URL
template that the STA is requested to visit.

This commit does not enable any kind of filtering, i.e., only the part
of forwarding a request from Access-Accept to the STA using
WNM-Notification is covered.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoHS 2.0: Terms and Conditions attributes in Access-Request messages
Jouni Malinen [Mon, 23 Apr 2018 18:10:52 +0000 (21:10 +0300)] 
HS 2.0: Terms and Conditions attributes in Access-Request messages

This extends hostapd with two new configuration parameters
(hs20_t_c_filename and hs20_t_c_timestamp) that can be used to specify
that the Terms and Conditions attributes are to be added into all
Access-Request messages for Hotspot 2.0 STAs.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agotests: WDS STA interface events and STA command output
Jouni Malinen [Mon, 23 Apr 2018 17:38:40 +0000 (20:38 +0300)] 
tests: WDS STA interface events and STA command output

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agohostapd: Add ctrl iface indications for WDS STA interface
Bhagavathi Perumal S [Fri, 20 Apr 2018 09:05:36 +0000 (14:35 +0530)] 
hostapd: Add ctrl iface indications for WDS STA interface

This allows user to get event indication when a new interface is
added/removed for 4addr WDS STA and also WDS STA ifname is informed
through the STA command.

Signed-off-by: Bhagavathi Perumal S <bperumal@codeaurora.org>
7 years agoFILS: Enable SHA256 KDF even without PMF/SAE in the build
Jouni Malinen [Mon, 23 Apr 2018 15:25:59 +0000 (18:25 +0300)] 
FILS: Enable SHA256 KDF even without PMF/SAE in the build

While it is unlikely that FILS would be used without PMF or SAE in the
build, it is possible to generate such a build and as such, it would be
good for the KDF selection to work properly. Add CONFIG_FILS as an
independent condition for the SHA256-based KDF. Previously, this
combination would have resulted in failure to derive keys and terminated
key management exchange.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agonl80211: Print NL80211_CMD_SET_POWER_SAVE errors in debug log
Jouni Malinen [Mon, 23 Apr 2018 10:44:06 +0000 (13:44 +0300)] 
nl80211: Print NL80211_CMD_SET_POWER_SAVE errors in debug log

This makes it easier to understand what happened with PS configuration.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agotests: WPA2-PSK/GCMP/CCMP ciphers
Jouni Malinen [Mon, 23 Apr 2018 10:43:52 +0000 (13:43 +0300)] 
tests: WPA2-PSK/GCMP/CCMP ciphers

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoDo not remove CCMP group cipher if any CCMP/GCMP cipher is enabled
Jouni Malinen [Mon, 23 Apr 2018 10:40:39 +0000 (13:40 +0300)] 
Do not remove CCMP group cipher if any CCMP/GCMP cipher is enabled

CCMP group cipher was removed if CCMP was not allowed as a pairwise
cipher when loading a configuration file (but not actually when changing
configuration during runtime). This is needed to avoid issues with
configurations that use the default group cipher (TKIP CCMP) while
modifying pairwise cipher from the default CCMP TKIP) to TKIP. However,
there is not really a need to remove the CCMP group cipher if any GCMP
or CCMP cipher is enabled as a pairwise cipher.

Change the network profile validation routine to not remove CCMP as
group cipher if CCMP-256, GCMP, or GCMP-256 is enabled as a pairwise
cipher even if CCMP is not.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agotests: Async. AP setup failure with wpa_supplicant
Andrei Otcheretianski [Mon, 21 Aug 2017 16:42:20 +0000 (19:42 +0300)] 
tests: Async. AP setup failure with wpa_supplicant

Verify that the AP initialization failure is reported back to
wpa_supplicant also when the initialization is complete in a callback.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
7 years agoAP: Handle AP initalization failure in async flow
Tova Mussai [Mon, 21 Aug 2017 16:42:19 +0000 (19:42 +0300)] 
AP: Handle AP initalization failure in async flow

When AP initialization is completed in a callback (e.g., OBSS scan),
wpa_supplicant_deinit_ap() is not called in case of failure. Fix this by
calling setup_complete_cb in case of failure, too, which in turn calls
wpa_supplicant_deinit_ap() if needed.

Signed-off-by: Tova Mussai <tova.mussai@intel.com>
7 years agoFT: Add FT auth algorithm to connect params when roaming
Ahmad Masri [Mon, 16 Apr 2018 10:30:42 +0000 (13:30 +0300)] 
FT: Add FT auth algorithm to connect params when roaming

Add WPA FT auth to connect params in case of a re-connection to ESS
supporting FT when FT was used in the first connect.

Signed-off-by: Ahmad Masri <amasri@codeaurora.org>
7 years agoFT: Add MDE to assoc request IEs in connect params
Ahmad Masri [Mon, 16 Apr 2018 10:52:27 +0000 (13:52 +0300)] 
FT: Add MDE to assoc request IEs in connect params

Add MDE (mobility domain element) to Association Request frame IEs in
the driver assoc params. wpa_supplicant will add MDE only if the network
profile allows FT, the selected AP supports FT, and the mobility domain
ID matches.

Signed-off-by: Ahmad Masri <amasri@codeaurora.org>
7 years agoMake CENTER_FRQ1 available independently in SIGNAL_POLL
Bhagavathi Perumal S [Thu, 19 Apr 2018 11:55:49 +0000 (17:25 +0530)] 
Make CENTER_FRQ1 available independently in SIGNAL_POLL

This allows user to get center frequency and find secondary channel
offset.

Signed-off-by: Bhagavathi Perumal S <bperumal@codeaurora.org>
7 years agoHS 2.0: Add Roaming Consortium Selection element into AssocReq
Jouni Malinen [Tue, 17 Apr 2018 14:22:56 +0000 (17:22 +0300)] 
HS 2.0: Add Roaming Consortium Selection element into AssocReq

This makes wpa_supplicant add Hotspot 2.0 Roaming Consortium Selection
element into (Re)Association Request frames if the network profile
includes roaming_consortium_selection parameter.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agotests: roaming_consortium_selection
Jouni Malinen [Tue, 17 Apr 2018 14:14:47 +0000 (17:14 +0300)] 
tests: roaming_consortium_selection

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoHS 2.0: Add Roaming Consortium Selection network profile parameter
Jouni Malinen [Tue, 17 Apr 2018 14:12:22 +0000 (17:12 +0300)] 
HS 2.0: Add Roaming Consortium Selection network profile parameter

This adds new roaming_consortium_selection network profile parameter
into wpa_supplicant. This is used to store the OI that was used for
network selection (INTERWORKING_SELECT) based on matching against the
Roaming Consortium OIs advertised by the AP. This can also be used when
using an external component to perform selection.

This commit adds the network profile parameter, but does not yet include
it in (Re)Association Request frames.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agotests: Hotspot 2.0 connection based on roaming_consortiums match
Jouni Malinen [Tue, 17 Apr 2018 13:40:14 +0000 (16:40 +0300)] 
tests: Hotspot 2.0 connection based on roaming_consortiums match

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoHS 2.0: Use roaming_consortiums list to match OIs for access
Jouni Malinen [Tue, 17 Apr 2018 13:39:10 +0000 (16:39 +0300)] 
HS 2.0: Use roaming_consortiums list to match OIs for access

This extends Hotspot 2.0 credential matching to consider the
roaming_consortiums parameter when determining whether the cred block
matches the information advertised by an AP.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoHS 2.0: OSU client to send HomeSP/RoamingConsortiumOI to wpa_supplicant
Jouni Malinen [Tue, 17 Apr 2018 13:21:36 +0000 (16:21 +0300)] 
HS 2.0: OSU client to send HomeSP/RoamingConsortiumOI to wpa_supplicant

This adds mapping of the PPS MO HomeSP/RoamingConsortiumOI leaf node
value into the wpa_supplicant cred block parameter roaming_consortiums.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agotests: wpa_supplicant cred roaming_consortiums parsing/writing
Jouni Malinen [Tue, 17 Apr 2018 13:21:00 +0000 (16:21 +0300)] 
tests: wpa_supplicant cred roaming_consortiums parsing/writing

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoHS 2.0: Add a new cred block parameter roaming_consortiums
Jouni Malinen [Tue, 17 Apr 2018 13:19:00 +0000 (16:19 +0300)] 
HS 2.0: Add a new cred block parameter roaming_consortiums

This new string parameter contains a comma delimited list of OIs
(hexdump) in a string. This is used to store Hotspot 2.0
PerProviderSubscription/<X+>/HomeSP/RoamingConsortiumOI. This commit
includes the configuration changes to parse and write the parameter. The
actual values are not yet used in Interworking network selection.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoHS 2.0: Document credential parameter required_roaming_consortium
Jouni Malinen [Tue, 17 Apr 2018 10:22:47 +0000 (13:22 +0300)] 
HS 2.0: Document credential parameter required_roaming_consortium

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoHS 2.0: Copy Roaming Consortium OI from (Re)AssocReq to Access-Request
Jouni Malinen [Tue, 17 Apr 2018 10:08:31 +0000 (13:08 +0300)] 
HS 2.0: Copy Roaming Consortium OI from (Re)AssocReq to Access-Request

This extends hostapd processing of (Re)Association Request frames to
store a local copy of the Consortium OI within the Roaming Consortium
Selection element, if present, and then add that in HS 2.0 Roaming
Consortium attribute into RADIUS Access-Request messages.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agotests: Hotspot 2.0 operator icons
Jouni Malinen [Mon, 16 Apr 2018 10:21:44 +0000 (13:21 +0300)] 
tests: Hotspot 2.0 operator icons

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoHS 2.0: Allow configuration of operator icons
Jouni Malinen [Mon, 16 Apr 2018 10:18:57 +0000 (13:18 +0300)] 
HS 2.0: Allow configuration of operator icons

This extends hostapd Hotspot 2.0 implementation to allow operator icons
to be made available. The existing hs20_icon parameter is used to define
the icons and the new operator_icon parameter (zero or more entries) is
used to specify which of the available icons are operator icons. The
operator icons are advertised in the Operator Icon Metadata ANQP-element
while the icon data can be fetched using the same mechanism (icon
request/binary file) that was added for the OSU Providers icons.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoHS 2.0: Add fetching of Operator Icon Metadata ANQP-element
Jouni Malinen [Mon, 16 Apr 2018 10:16:39 +0000 (13:16 +0300)] 
HS 2.0: Add fetching of Operator Icon Metadata ANQP-element

This extends wpa_supplicant Hotspot 2.0 ANQP routines to allow the
Operator Icon Metadata ANQP-element to be fetched with "ANQP_GET <bssid>
hs20:12". The result is available in the new hs20_operator_icon_metadata
entry in the "BSS <bssid>" output.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agowpa_supplicant: Increase authentication timeout if CAC is started
Dmitry Lebed [Wed, 4 Apr 2018 20:44:08 +0000 (23:44 +0300)] 
wpa_supplicant: Increase authentication timeout if CAC is started

Timeout is increased by dfs_cac_ms from channel data, or by max CAC time
(10 minutes) if dfs_cac_ms is not defined. This is needed for some more
complex cases, e.g., when STA is acting as an active slave with DFS
offload enabled and decided to start CAC after receiving CONNECT
command, in such a case the 10 second timeout is too small and
wpa_supplicant need to wait for CAC completion or CAC timeout (up to 10
minutes).

Without such timeout modification wpa_supplicant will be unable to
connect to an AP on DFS channel, since the default authentication
timeout (10 s) is smaller than the minimum CAC time (60 s).

Tested with nl80211 DFS offload implementation.

Signed-off-by: Dmitry Lebed <dlebed@quantenna.com>
7 years agowpa_supplicant: Rename wpas_event_*() to wpas_ap_event_*()
Dmitry Lebed [Wed, 4 Apr 2018 20:44:07 +0000 (23:44 +0300)] 
wpa_supplicant: Rename wpas_event_*() to wpas_ap_event_*()

Rename DFS event handling functions, since they are located in ap.c and
refer to AP-mode only. Needed to add some STA-mode DFS event handling.

Signed-off-by: Dmitry Lebed <dlebed@quantenna.com>
7 years agonl80211: Add MLME auth work-around for -EEXIST errno
Ben Greear [Fri, 16 Mar 2018 21:31:55 +0000 (14:31 -0700)] 
nl80211: Add MLME auth work-around for -EEXIST errno

The Linux 4.9 kernel, at least, can return EEXIST when trying to auth a
station that already exists.

We have seen this bug in multiple places, but it is difficult to
reproduce. Here is a link to someone else that appears to have hit this
issue: https://github.com/greearb/ath10k-ct/issues/18

Signed-off-by: Ben Greear <greearb@candelatech.com>
7 years agoFix building nt_password_hash with gnutls
Andrey Utkin [Sat, 14 Apr 2018 23:34:35 +0000 (00:34 +0100)] 
Fix building nt_password_hash with gnutls

Even with

    CONFIG_TLS=gnutls
    CONFIG_CRYPTO=gnutls

in .config, nt_password_hash was linked with libcrypto instead of
libgcrypt, which caused linkage failure.

Signed-off-by: Andrey Utkin <andrey_utkin@gentoo.org>
7 years agoDPP: Fix build with LibreSSL v2.5
Jouni Malinen [Sat, 14 Apr 2018 20:56:38 +0000 (23:56 +0300)] 
DPP: Fix build with LibreSSL v2.5

The ECDSA_SIG_{set,get}0() wrappers are needed with LibreSSL v2.5 (but
not v2.7.2).

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoDPP: Fix X509_ALGOR_get0() use with LibreSSL
Jouni Malinen [Sat, 14 Apr 2018 20:53:35 +0000 (23:53 +0300)] 
DPP: Fix X509_ALGOR_get0() use with LibreSSL

At least LibreSSL v2.7.2 indicates support for OpenSSL API 1.1.0, but it
does not apparently use const ASN1_OBJECT * with X509_ALGOR_get0(). Use
the older non-const version here with LibreSSL to fix compilation.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoOpenSSL: Skip SSL_OP_NO_TLSv1_3 if not defined to fix LibreSSL build
Jouni Malinen [Sat, 14 Apr 2018 20:48:42 +0000 (23:48 +0300)] 
OpenSSL: Skip SSL_OP_NO_TLSv1_3 if not defined to fix LibreSSL build

LibreSSL v2.7 claims an OPENSSL_VERSION_NUMBER value that would indicate
that SSL_OP_NO_TLSv1_3 is available, but that does not seem to be the
case with LibreSSL. As such, skip this step based on whether
SSL_OP_NO_TLSv1_3 is defined to avoid build issues.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoFix build with LibreSSL 2.7
Bernard Spil [Sun, 1 Apr 2018 19:58:06 +0000 (21:58 +0200)] 
Fix build with LibreSSL 2.7

LibreSSL 2.7 adds (most of) the OpenSSL 1.1 API.

Signed-off-by: Bernard Spil <brnrd@FreeBSD.org>
7 years agoFix sae_password documentation in wpa_supplicant to refer correct field
Jouni Malinen [Fri, 13 Apr 2018 09:08:47 +0000 (12:08 +0300)] 
Fix sae_password documentation in wpa_supplicant to refer correct field

sae_password replaces psk, not passphrase, parameter in wpa_supplicant.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agotests: wpa_supplicant secure mesh using sae_password
Jouni Malinen [Fri, 13 Apr 2018 09:03:40 +0000 (12:03 +0300)] 
tests: wpa_supplicant secure mesh using sae_password

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agomesh: Properly handle sae_password
Daniel Golle [Thu, 12 Apr 2018 22:42:10 +0000 (00:42 +0200)] 
mesh: Properly handle sae_password

The recently introduced sae_password parameter was only handled properly
in wpa_supplicant/sme.c while wpa_supplicant/mesh.c assumed that
ssid->passphrase exclusively holds the secret.

Import the logic from sme.c to mesh.c to allow having only sae_password
set which otherwise throws this error:
AP-ENABLED
mesh: Passphrase for SAE not configured

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
7 years agoFix wpa_supplicant build with CONFIG_NO_WPA
Daniel Golle [Fri, 13 Apr 2018 04:14:21 +0000 (06:14 +0200)] 
Fix wpa_supplicant build with CONFIG_NO_WPA

pmksa_cache stubs have not been updated when function prototypes have
been modified in commit 852b2f2738 (SAE: Only allow SAE AKMP for PMKSA
caching attempts). Add new function parameter int akmp to stubs of
pmksa_cache_get() and pmksa_cache_set_current() as well to fix build.

Fixes: 852b2f2738 ("SAE: Only allow SAE AKMP for PMKSA caching attempts")
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
7 years agotests: DPP and SAE AKMs
Jouni Malinen [Thu, 12 Apr 2018 18:14:33 +0000 (21:14 +0300)] 
tests: DPP and SAE AKMs

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agotests: sigma_dut DPP/QR initiator as Enrollee (SAE)
Jouni Malinen [Tue, 10 Apr 2018 18:41:58 +0000 (21:41 +0300)] 
tests: sigma_dut DPP/QR initiator as Enrollee (SAE)

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agotests: SAE and PSK enabled in wpa_supplicant network profile
Jouni Malinen [Mon, 9 Apr 2018 10:09:49 +0000 (13:09 +0300)] 
tests: SAE and PSK enabled in wpa_supplicant network profile

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoSAE: Only allow SAE AKMP for PMKSA caching attempts
Jouni Malinen [Sun, 8 Apr 2018 17:06:40 +0000 (20:06 +0300)] 
SAE: Only allow SAE AKMP for PMKSA caching attempts

Explicitly check the PMKSA cache entry to have matching SAE AKMP for the
case where determining whether to use PMKSA caching instead of new SAE
authentication. Previously, only the network context was checked, but a
single network configuration profile could be used with both WPA2-PSK
and SAE, so should check the AKMP as well.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoSAE: Fix default PMK configuration for PMKSA caching case
Jouni Malinen [Sun, 8 Apr 2018 16:55:52 +0000 (19:55 +0300)] 
SAE: Fix default PMK configuration for PMKSA caching case

The RSN supplicant state machine PMK was set based on WPA PSK even for
the cases where SAE would be used. If the AP allows PMKSA caching to be
used with SAE, but does not indicate the selected PMKID explicitly in
EAPOL-Key msg 1/4, this could result in trying to use the PSK instead of
SAE PMK. Fix this by not setting the WPA-PSK as default PMK for SAE
network profiles and instead, configuring the PMK explicitly from the
found PMKSA cache entry.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoWPA: Fix a typo in a debug message
Jouni Malinen [Sun, 8 Apr 2018 16:44:53 +0000 (19:44 +0300)] 
WPA: Fix a typo in a debug message

"PT derivation" was supposed to be saying "PTK derivation".

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoClear pmk_len more consistently for extra protection
Jouni Malinen [Sun, 8 Apr 2018 16:42:52 +0000 (19:42 +0300)] 
Clear pmk_len more consistently for extra protection

This gives more protection against unexpected behavior if RSN supplicant
code ends up trying to use sm->pmk[] with a stale value. Couple of the
code paths did not clear sm->pmk_len explicitly in cases where the old
PMK is being removed, so cover those cases as well to make sure these
will result in PMK-to-PTK derivation failures rather than use of
incorrect PMK value if such a code path could be reached somehow.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoAdd more debug prints for wpa_sm_set_pmk() calls
Jouni Malinen [Sun, 8 Apr 2018 16:11:07 +0000 (19:11 +0300)] 
Add more debug prints for wpa_sm_set_pmk() calls

Couple of these were not preceded by wpa_hexdump_key(PSK) which made it
more difficult to interpret the debug log.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoDefine new test config attribute for HE LTF configuration
Kiran Kumar Lokere [Thu, 5 Apr 2018 00:51:36 +0000 (17:51 -0700)] 
Define new test config attribute for HE LTF configuration

Add a new wifi test config attribute to configure HE LTF in the
driver. This is used for testbed configuration.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agotests: Extend hostapd reload config test to cover wmm_enabled behavior
Jouni Malinen [Fri, 6 Apr 2018 20:32:31 +0000 (23:32 +0300)] 
tests: Extend hostapd reload config test to cover wmm_enabled behavior

This is a regression test for default behavior for wmm_enabled on the
config reload path.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoFix hostapd wmm_enabled setup on config reload path
Jouni Malinen [Fri, 6 Apr 2018 20:29:11 +0000 (23:29 +0300)] 
Fix hostapd wmm_enabled setup on config reload path

If there is no explicit wmm_enabled parameter in the configuration
(i.e., conf->wmm_enabled == -1), the configuration reload path needs to
initialize conf->wmm_enabled based on iconf->ieee80211n in
hostapd_reload_bss() similarly to what is done in the initial startup
case in hostapd_setup_bss().

This fixes issues with RSN capabilities being set incorrectly when WMM
is supposed to get enabled and unexpectedly enabling WMM when it is not
supposed to be enabled (HT disabled). Either of these issues could show
up when asking hostapd to reload the configuration file (and when that
file does not set wmm_enabled explicitly).

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoFT: Add session_timeout to push/resp
Michael Braun [Thu, 18 May 2017 13:21:56 +0000 (15:21 +0200)] 
FT: Add session_timeout to push/resp

This ensures a session timeout configured on R0KH either using
RADIUS-based ACL or 802.1X authentication is copied over to the new
R1KH.

Signed-off-by: Michael Braun <michael-dev@fami-braun.de>
7 years agoFT: Add set/get session_timeout callback functions
Michael Braun [Thu, 18 May 2017 13:21:56 +0000 (15:21 +0200)] 
FT: Add set/get session_timeout callback functions

These are needed to allow wpa_auth_ft.c to control session_timeout
values for STAs.

Signed-off-by: Michael Braun <michael-dev@fami-braun.de>
7 years agoConvert STA session_timeout to os_reltime
Michael Braun [Thu, 18 May 2017 13:21:56 +0000 (15:21 +0200)] 
Convert STA session_timeout to os_reltime

This is needed to allow the remaining session time to be computed for FT
(when sending PMK-R1 to another AP).

Signed-off-by: Michael Braun <michael-dev@fami-braun.de>
7 years agotests: FT with CUI
Michael Braun [Thu, 18 May 2017 13:21:55 +0000 (15:21 +0200)] 
tests: FT with CUI

Signed-off-by: Michael Braun <michael-dev@fami-braun.de>
7 years agoFT: Include identity and radius_cui in pull/resp frames
Michael Braun [Thu, 18 May 2017 13:21:54 +0000 (15:21 +0200)] 
FT: Include identity and radius_cui in pull/resp frames

This allows APs using FT to get the EAP session information from R0KH to
R1KHs.

Signed-off-by: Michael Braun <michael-dev@fami-braun.de>
7 years agoFT: Move wpa_ft_rrb_build_r0() special case to caller
Michael Braun [Thu, 18 May 2017 13:21:54 +0000 (15:21 +0200)] 
FT: Move wpa_ft_rrb_build_r0() special case to caller

Handle the special case of no PMK-R0 entry in the caller instead of
having to have wpa_ft_rrb_build_r0() aware of the possibility of pmk_r0
being NULL.

Signed-off-by: Michael Braun <michael-dev@fami-braun.de>
7 years agoFT: Add set/get identity/radius_cui callback functions
Michael Braun [Thu, 18 May 2017 13:21:54 +0000 (15:21 +0200)] 
FT: Add set/get identity/radius_cui callback functions

These are needed to allow wpa_auth_ft.c to control identity/radius_cui
values for STAs.

Signed-off-by: Michael Braun <michael-dev@fami-braun.de>
7 years agoFix potential memory leak with identity/radius_cui
Michael Braun [Thu, 18 May 2017 13:21:54 +0000 (15:21 +0200)] 
Fix potential memory leak with identity/radius_cui

ieee802_11_set_radius_info() might be called with a STA entry that has
already stored identity and/or radius_cui information, so make sure the
old values get freed before being replaced by the new ones.

Signed-off-by: Michael Braun <michael-dev@fami-braun.de>
7 years agotests: FT-PSK with VLAN
Michael Braun [Thu, 18 May 2017 13:21:53 +0000 (15:21 +0200)] 
tests: FT-PSK with VLAN

Signed-off-by: Michael Braun <michael-dev@fami-braun.de>
7 years agotests: Add a small sleep in FT run_roams()
Michael Braun [Thu, 18 May 2017 13:21:52 +0000 (15:21 +0200)] 
tests: Add a small sleep in FT run_roams()

time.sleep() in run_roams() is required because the target AP sets the
key once the station was associated. There are races, when the station
processes the (Re)Association Response frame AND the test suite starts
FT_DS before the AP processes its local confirmation and thus
wpa_auth_sm_event(ASSOC_FT). Therefore, the ActionFrame will be lost, as
the AP driver is missing the key.

Since this is this speed is highly synthetic, wait a few milliseconds
before roaming back.

Signed-off-by: Michael Braun <michael-dev@fami-braun.de>
7 years agotests: FT-EAP with VLAN
Michael Braun [Thu, 18 May 2017 13:21:52 +0000 (15:21 +0200)] 
tests: FT-EAP with VLAN

Signed-off-by: Michael Braun <michael-dev@fami-braun.de>
7 years agoFT: Add IEEE VLAN support (including tagged VLANs)
Michael Braun [Thu, 18 May 2017 13:21:51 +0000 (15:21 +0200)] 
FT: Add IEEE VLAN support (including tagged VLANs)

This uses set_vlan()/get_vlan() callbacks to fetch and configure the
VLAN of STA. Transmission of VLAN information between APs uses new TLVs.

Signed-off-by: Michael Braun <michael-dev@fami-braun.de>
7 years agoFT: Add set_vlan()/get_vlan() callback functions
Michael Braun [Thu, 18 May 2017 13:21:51 +0000 (15:21 +0200)] 
FT: Add set_vlan()/get_vlan() callback functions

These are needed to allow wpa_auth_ft.c to control VLAN assignment for
STAs.

Signed-off-by: Michael Braun <michael-dev@fami-braun.de>
7 years agoFT: Add expiration to PMK-R0 and PMK-R1 cache
Michael Braun [Thu, 18 May 2017 13:21:50 +0000 (15:21 +0200)] 
FT: Add expiration to PMK-R0 and PMK-R1 cache

IEEE Std 802.11-2016, 12.7.1.7.1 indicates that the lifetime of the
PMK-R0 (and PMK-R1) is bound to the lifetime of PSK or MSK from which
the key was derived. This is currently stored in r0_key_lifetime, but
cache entries are not actually removed.

This commit uses the r0_key_lifetime configuration parameter when
wpa_auth_derive_ptk_ft() is called. This may need to be extended to use
the MSK lifetime, if provided by an external authentication server, with
some future changes. For PSK, there is no such lifetime, but it also
matters less as FT-PSK can be achieved without inter-AP communication.

The expiration timeout is then passed from R0KH to R1KH. The R1KH verifies
that the given timeout for sanity, it may not exceed the locally configured
r1_max_key_lifetime.

Signed-off-by: Michael Braun <michael-dev@fami-braun.de>
7 years agoFT: Use dl_list for PMK-R0/R1 cache
Michael Braun [Thu, 18 May 2017 13:21:50 +0000 (15:21 +0200)] 
FT: Use dl_list for PMK-R0/R1 cache

This makes it easier to remove expired entries from the list.

Signed-off-by: Michael Braun <michael-dev@fami-braun.de>
7 years agoFT: Add helper function for FILS key storing
Michael Braun [Thu, 18 May 2017 13:21:50 +0000 (15:21 +0200)] 
FT: Add helper function for FILS key storing

FILS calls wpa_ft_store_pmk_r0() from wpa_auth.c. This is moved into a
new function wpa_ft_store_pmk_fils() in preparation of additional
information being needed.

Signed-off-by: Michael Braun <michael-dev@fami-braun.de>
7 years agoFT: Convert r0_key_lifetime to seconds
Michael Braun [Thu, 18 May 2017 13:21:50 +0000 (15:21 +0200)] 
FT: Convert r0_key_lifetime to seconds

Add a new configuration option ft_r0_key_lifetime that deprecates
r0_key_lifetime. Though, the old configuration is still accepted for
backwards compatibility.

This simplifies testing. All other items are in seconds as well. In
addition, this makes dot11FTR0KeyLifetime comment match with what got
standardized in the end in IEEE Std 802.11r-2008.

Signed-off-by: Michael Braun <michael-dev@fami-braun.de>
7 years agoRemove CONFIG_IEEE80211R_AP=y build option from wpa_supplicant
Jouni Malinen [Mon, 2 Apr 2018 14:00:45 +0000 (17:00 +0300)] 
Remove CONFIG_IEEE80211R_AP=y build option from wpa_supplicant

There is no existing mechanism for setting up AP mode functionality with
FT enabled, so there is not really much point in having a build option
for trying to include the AP-to-AP FT functionality into wpa_supplicant
either. Since this build option results in failures to complete the
build, simply remove it completely. This can be restored if there is
ever desire to enable FT functionality in wpa_supplicant controlled AP
mode.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agohostapd: Add more authentication error case debugging
Ben Greear [Thu, 7 Dec 2017 17:14:49 +0000 (09:14 -0800)] 
hostapd: Add more authentication error case debugging

This can help one understand better why stations are failing
to authenticate.

Signed-off-by: Ben Greear <greearb@candelatech.com>
7 years agohostapd: Add logging around Michael MIC related failures
Ben Greear [Thu, 7 Dec 2017 17:14:49 +0000 (09:14 -0800)] 
hostapd: Add logging around Michael MIC related failures

This can help one understand better why stations are failing
to authentication/associate.

Signed-off-by: Ben Greear <greearb@candelatech.com>
7 years agohostapd: Add send_auth_reply() caller info in debug logging
Ben Greear [Thu, 7 Dec 2017 17:14:49 +0000 (09:14 -0800)] 
hostapd: Add send_auth_reply() caller info in debug logging

This can help one understand better what happens during the
authentication exchange.

Signed-off-by: Ben Greear <greearb@candelatech.com>
7 years agowpa_supplicant: Don't reply to EAPOL if pkt_type is PACKET_OTHERHOST
Davide Caratti [Wed, 28 Mar 2018 14:34:56 +0000 (16:34 +0200)] 
wpa_supplicant: Don't reply to EAPOL if pkt_type is PACKET_OTHERHOST

When wpa_supplicant is running on a Linux interface that is configured in
promiscuous mode, and it is not a member of a bridge, incoming EAPOL
packets are processed regardless of the Destination Address in the frame.
As a consequence, there are situations where wpa_supplicant replies to
EAPOL packets that are not destined for it.

This behavior seems undesired (see IEEE Std 802.1X-2010, 11.4.a), and can
be avoided by attaching a BPF filter that lets the kernel discard packets
having pkt_type equal to PACKET_OTHERHOST.

Signed-off-by: Davide Caratti <davide.caratti@gmail.com>
7 years agoClean up setting of iface->p2p_mgmt flag
Vasyl Vavrychuk [Mon, 12 Feb 2018 19:29:06 +0000 (21:29 +0200)] 
Clean up setting of iface->p2p_mgmt flag

Previously we set this flag to one in wpa_supplicant_init_iface() if
Wi-Fi controller does not have a dedicated P2P-interface.

This setting had effect only in scope of wpa_supplicant_init_iface() and
it contradicts with comment to struct wpa_interface::p2p_mgmt field.
This comment says that this flag is used only if Wi-Fi controller has
dedicated P2P-device interface.

Also it contradicts with usage of similiar p2p_mgmt field in struct
wpa_supplicant. Again struct wpa_supplicant::p2p_mgmt is set only for
dedicated P2P-device interface.

After this change wpa_interface become input argument to
wpa_supplicant_init_iface() that we are not modifying.

Signed-off-by: Vasyl Vavrychuk <vvavrychuk@gmail.com>
7 years agodbus: Redirect signal processing to the management device if present
Vasyl Vavrychuk [Mon, 12 Feb 2018 19:27:20 +0000 (21:27 +0200)] 
dbus: Redirect signal processing to the management device if present

This fixes sending of FindStopped, GroupFormationFailure, and
InvitationReceived signals in the case of separate P2P-Device interface.
This extends the coverage of the earlier commit
745d62322b37675b4a7eb8f0cd10e25a288168da ("dbus: Redirect P2P request to
the managment device if present") to these three functions that were
missing the redirection.

Some wireless controllers might have separate P2P-Device interface, see
as example result of 'iw dev':

phy#0
        Unnamed/non-netdev interface
                ...
                type P2P-device
                ...
        Interface wlp2s0
                type managed
                ...

In this case there is separate 'struct wpa_supplicant' created for this
p2p-dev-* device as result of 'wpa_supplicant_add_iface >
wpas_p2p_add_p2pdev_interface > wpa_supplicant_add_iface'.

This instance of wpa_supplicant is not registered in D-Bus
(wpas_dbus_register_*) since for corresponding P2P device interface flag
'struct wpa_interface > p2p_mgmt' is set.

But this instance is saved in p2p_init_wpa_s and is used for handling
P2P related D-Bus commands. Therefore we should look for D-Bus path in
the parent of p2p_init_wpa_s instance.

Without this change test dbus_p2p_discovery starts failing if we set
support_p2p_device in vm-run.sh.

Signed-off-by: Vasyl Vavrychuk <vvavrychuk@gmail.com>
7 years agodbus: Add FILS to global capabilities
Masashi Honma [Sun, 4 Feb 2018 01:50:37 +0000 (10:50 +0900)] 
dbus: Add FILS to global capabilities

If any of the interfaces supports FILS (and similarly for FILS-SK-PFS),
include the "fils" (and "fils_sk_pfs") capability in D-Bus information.

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
7 years agoAdd config information related to MACsec
Jaap Keuter [Sat, 27 May 2017 16:50:24 +0000 (18:50 +0200)] 
Add config information related to MACsec

Add examples of relevant top level CONFIG clauses for wpa_supplicant
MACsec support to defconfig.

Extend the example of MACsec related network configuration. Also bring
them in line with the format of the other example network configurations.

Signed-off-by: Jaap Keuter <jaap.keuter@xs4all.nl>
7 years agodbus: Add mesh to global capabilities
Saurav Babu [Thu, 18 May 2017 11:59:30 +0000 (17:29 +0530)] 
dbus: Add mesh to global capabilities

Signed-off-by: Saurav Babu <saurav.babu@samsung.com>
7 years agotests: Fix clearing of IGTK PN in handshake retransmit test functions
Mathy Vanhoef [Sun, 1 Apr 2018 17:16:47 +0000 (19:16 +0200)] 
tests: Fix clearing of IGTK PN in handshake retransmit test functions

When locating the position of the IGTK PN in the key data, we also need
to skip the KDE header, in addition to the keyid field. This fixes
hostapd RESEND_M3 and RESEND_GROUP_M1 behavior when PMF is negotiated
for the association. Previously, the IGTK KDE ended up getting
practically hidden since zeroing of the PN ended up clearing the KDE OUI
and Type fields.

Signed-off-by: Mathy Vanhoef <Mathy.Vanhoef@cs.kuleuven.be>
7 years agotests: RESEND_M3 and RESEND_GROUP_M1 with PMF in use
Jouni Malinen [Sun, 1 Apr 2018 18:42:49 +0000 (21:42 +0300)] 
tests: RESEND_M3 and RESEND_GROUP_M1 with PMF in use

This covers an additional code path that has a bug in IGTK PN clearing.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agotests: EAP-ERROR-CODE
Jouni Malinen [Sat, 31 Mar 2018 09:02:25 +0000 (12:02 +0300)] 
tests: EAP-ERROR-CODE

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoPropagate the EAP method error code
Ahmed ElArabawy [Thu, 15 Mar 2018 16:00:10 +0000 (09:00 -0700)] 
Propagate the EAP method error code

In the current implementation, upon an EAP method failure, followed by
an EAP failure, the EAP Status is propagated up in wpa_supplicant with a
general failure parameter string "failure". This parameter is used for a
notification on the dbus.

This commit reports the EAP method failure error code in a separate
callback.

The solution in this commit is generic to all EAP methods, and can be
used by any method that need to pass its error code. However, this
commit only implements the reporting for EAP-SIM and EAP-AKA methods
where the Notification Code (in AT_NOTIFICATION) is used as the method
specific error code value.

Signed-off-by: Ahmed ElArabawy <arabawy@google.com>
7 years agotests: WPA2-Enterprise connection using EAP-PSK after MAC address change
Jouni Malinen [Fri, 30 Mar 2018 09:11:55 +0000 (12:11 +0300)] 
tests: WPA2-Enterprise connection using EAP-PSK after MAC address change

This is a regression test for a sequence where wpa_supplicant interface
MAC address is changed externally and the ifdown-ifup sequence is
processed only after the interface has already been set UP.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agowpa_supplicant: Fix auth failure when the MAC is updated externally
Beniamino Galvani [Thu, 15 Feb 2018 10:50:01 +0000 (11:50 +0100)] 
wpa_supplicant: Fix auth failure when the MAC is updated externally

When connecting to a WPA-EAP network and the MAC address is changed
just before the association (for example by NetworkManager, which sets
a random MAC during scans), the authentication sometimes fails in the
following way ('####' logs added by me):

wpa_supplicant logs:
 wlan0: WPA: RX message 1 of 4-Way Handshake from 02:00:00:00:01:00 (ver=1)
 RSN: msg 1/4 key data - hexdump(len=22): dd 14 00 0f ac 04 d8 21 9d a5 73 98 88 26 ef 03 d2 ce f7 04 7d 23
 WPA: PMKID in EAPOL-Key - hexdump(len=22): dd 14 00 0f ac 04 d8 21 9d a5 73 98 88 26 ef 03 d2 ce f7 04 7d 23
 RSN: PMKID from Authenticator - hexdump(len=16): d8 21 9d a5 73 98 88 26 ef 03 d2 ce f7 04 7d 23
 wlan0: RSN: no matching PMKID found
 EAPOL: Successfully fetched key (len=32)
 WPA: PMK from EAPOL state machines - hexdump(len=32): [REMOVED]
 #### WPA: rsn_pmkid():
 #### WPA: aa              - hexdump(len=6): 02 00 00 00 01 00
 #### WPA: spa             - hexdump(len=6): 66 20 cf ab 8c dc
 #### WPA: PMK             - hexdump(len=32): b5 24 76 4f 6f 50 8c f6 a1 2e 24 b8 07 4e 9a 13 1b 94 c4 a8 1f 7e 22 d6 ed fc 7d 43 c7 77 b6 f7
 #### WPA: computed PMKID  - hexdump(len=16): ea 73 67 b1 8e 5f 18 43 58 24 e8 1c 47 23 87 71
 RSN: Replace PMKSA entry for the current AP and any PMKSA cache entry that was based on the old PMK
 nl80211: Delete PMKID for 02:00:00:00:01:00
 wlan0: RSN: PMKSA cache entry free_cb: 02:00:00:00:01:00 reason=1
 RSN: Added PMKSA cache entry for 02:00:00:00:01:00 network_ctx=0x5630bf85a270
 nl80211: Add PMKID for 02:00:00:00:01:00
 wlan0: RSN: PMKID mismatch - authentication server may have derived different MSK?!

hostapd logs:
 WPA: PMK from EAPOL state machine (MSK len=64 PMK len=32)
 WPA: 02:00:00:00:00:00 WPA_PTK entering state PTKSTART
 wlan1: STA 02:00:00:00:00:00 WPA: sending 1/4 msg of 4-Way Handshake
 #### WPA: rsn_pmkid():
 #### WPA: aa              - hexdump(len=6): 02 00 00 00 01 00
 #### WPA: spa             - hexdump(len=6): 02 00 00 00 00 00
 #### WPA: PMK             - hexdump(len=32): b5 24 76 4f 6f 50 8c f6 a1 2e 24 b8 07 4e 9a 13 1b 94 c4 a8 1f 7e 22 d6 ed fc 7d 43 c7 77 b6 f7
 #### WPA: computed PMKID  - hexdump(len=16): d8 21 9d a5 73 98 88 26 ef 03 d2 ce f7 04 7d 23
 WPA: Send EAPOL(version=1 secure=0 mic=0 ack=1 install=0 pairwise=1 kde_len=22 keyidx=0 encr=0)

That's because wpa_supplicant computed the PMKID using the wrong (old)
MAC address used during the scan. wpa_supplicant updates own_addr when
the interface goes up, as the MAC can only change while the interface
is down. However, drivers don't report all interface state changes:
for example the nl80211 driver may ignore a down-up cycle if the down
message is processed later, when the interface is already up. In such
cases, wpa_supplicant (and in particular, the EAP state machine) would
continue to use the old MAC.

Add a new driver event that notifies of MAC address changes while the
interface is active.

Signed-off-by: Beniamino Galvani <bgalvani@redhat.com>
7 years agoAdd definitions for RADIUS attributes standardised in RFC 7055
Alejandro Pérez Méndez [Tue, 27 Mar 2018 21:50:48 +0000 (23:50 +0200)] 
Add definitions for RADIUS attributes standardised in RFC 7055

hostap code is used by the Moonshot software (an implementation of the
GSS EAP mechanism - RFC 7055), and those definitions are required but
missing.

Signed-off-by: Alejandro Perez <alex.perez-mendez@jisc.ac.uk>
7 years agonl80211: Add DFS offload support using upstream nl80211 definitions
Dmitry Lebed [Sat, 24 Mar 2018 07:54:27 +0000 (10:54 +0300)] 
nl80211: Add DFS offload support using upstream nl80211 definitions

Add generic DFS offload support using the nl80211 feature that was
recently added to the mac80211-next tree. This uses the already
available DFS offload infrastructure that was previously used with
vendor specific definitions and just sets necessary flags (DFS_OFFLOAD
ext_feature) and forawrds CAC_STARTED event for processing.

Signed-off-by: Dmitry Lebed <lebed.dmitry@gmail.com>
7 years agoSync with mac80211-next.git include/uapi/linux/nl80211.h
Jouni Malinen [Fri, 30 Mar 2018 07:54:57 +0000 (10:54 +0300)] 
Sync with mac80211-next.git include/uapi/linux/nl80211.h

This brings in nl80211 definitions as of 2018-03-26.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoAdd SAR V2 power selection capability (QCA vendor attributes)
Kabilan Kannan [Thu, 22 Mar 2018 00:17:45 +0000 (17:17 -0700)] 
Add SAR V2 power selection capability (QCA vendor attributes)

Add changes to select SAR V2 power limits using the existing QCA vendor
command.

Signed-off-by: Kabilan Kannan <kabilank@codeaurora.org>
7 years agotests: sigma_dut DPP protocol testing - Stop at TX on Initiator/Enrollee
Jouni Malinen [Fri, 30 Mar 2018 07:44:38 +0000 (10:44 +0300)] 
tests: sigma_dut DPP protocol testing - Stop at TX on Initiator/Enrollee

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agotests: GAS/ANQP and Venue URL (hostapd venue_url)
Jouni Malinen [Mon, 26 Mar 2018 13:11:54 +0000 (16:11 +0300)] 
tests: GAS/ANQP and Venue URL (hostapd venue_url)

Test the hostapd venue_url configuration parameter. In addition, fix the
previous defined gas_anqp_venue_url test case to use correct encoding of
the Venue URL ANQP-element payload (URLs were missing and Venue Number
was off-by-one).

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoAdd hostapd.conf venue_url to set Venue URL ANQP-element
Jouni Malinen [Mon, 26 Mar 2018 13:10:47 +0000 (16:10 +0300)] 
Add hostapd.conf venue_url to set Venue URL ANQP-element

The new venue_url parameter can now be used to set the Venue URL ANQP
information instead of having to construct the data and use
anqp_elem=277:<hexdump> to set the raw value.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoOWE: Fix CONFIG_OWE=y build without CONFIG_IEEE80211R=y
Jouni Malinen [Mon, 26 Mar 2018 09:34:36 +0000 (12:34 +0300)] 
OWE: Fix CONFIG_OWE=y build without CONFIG_IEEE80211R=y

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoFILS: Fix CONFIG_FILS=y build without CONFIG_IEEE80211R=y
Jouni Malinen [Mon, 26 Mar 2018 09:33:52 +0000 (12:33 +0300)] 
FILS: Fix CONFIG_FILS=y build without CONFIG_IEEE80211R=y

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agotests: FILS SK using ERP and FT initial mobility domain association
Jouni Malinen [Sat, 24 Mar 2018 09:28:10 +0000 (11:28 +0200)] 
tests: FILS SK using ERP and FT initial mobility domain association

Verify use of KCK2/KEK2 and new FTE MIC calculation with FT-FILS-SHA256.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoAdd NOTE control interface command for hostapd
Jouni Malinen [Mon, 26 Mar 2018 08:55:42 +0000 (11:55 +0300)] 
Add NOTE control interface command for hostapd

This does the same as the matching command in wpa_supplicant, i.e., add
a note in the debug log.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoFILS: Add more complete support for FT-FILS use cases
Jouni Malinen [Sat, 24 Mar 2018 09:24:18 +0000 (11:24 +0200)] 
FILS: Add more complete support for FT-FILS use cases

This extends the original IEEE Std 802.11ai-2016 functionality with the
changes added in REVmd to describe how additional keys are derived to
protect the FT protocol using keys derived through FILS authentication.

This allows key_mgmt=FT-FILS-SHA256 to be used with FT protocol since
the FTE MIC can now be calculated following the changes in REVmd. The
FT-FILS-SHA384 case is still unsupported (it needs support for variable
length MIC field in FTE).

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoFT: Derive PMK-R1 locally if requested PMKR0Name is found
Jouni Malinen [Sat, 24 Mar 2018 16:45:42 +0000 (18:45 +0200)] 
FT: Derive PMK-R1 locally if requested PMKR0Name is found

Derive PMK-R1 locally if the derived PMKR1Name is not found from the
local cache, but the request is for a key that was originally generated
locally (R0KH-ID matches) and the PMKR0Name is found in the local cache.
This was apparently not hit in the previously used FT sequences, but
this is useful to have available if a PMK-R1 entry is dropped from the
local cache before PMK-R0.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoFT: Do not send PMK-R1 pull request to own R0KH address
Jouni Malinen [Sat, 24 Mar 2018 09:47:37 +0000 (11:47 +0200)] 
FT: Do not send PMK-R1 pull request to own R0KH address

If the requested key is not available locally, there is no point in
trying to send a pull request back to self for the key.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoSAE: Fix PTK derivation to use KDF-SHA256
Jouni Malinen [Fri, 23 Mar 2018 15:57:14 +0000 (17:57 +0200)] 
SAE: Fix PTK derivation to use KDF-SHA256

The previous implementation ended up defaulting to using PRF-SHA1 for
deriving PTK from PMK when SAE was used. This is not correct since the
SAE AKM is defined to be using SHA-256 -based KDF instead. Fix that.

Note: This change is not backwards compatible. Both the AP and station
side implementations will need to be updated at the same time to
maintain functionality.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoSAE: Fix PMKID in EAPOL-Key msg 1/4
Jouni Malinen [Fri, 23 Mar 2018 15:45:44 +0000 (17:45 +0200)] 
SAE: Fix PMKID in EAPOL-Key msg 1/4

Previously, the association that used SAE authentication ended up
recalculating the PMKID for EAPOL-Key msg 1/4 using incorrect
PMK-to-PMKID derivation instead of using the previously derived PMKID
from SAE. The correct PMKID was used only when going through PMKSA
caching exchange with a previously derived PMKSA from SAE.

Fix this by storing the SAE PMKID into the state machine entry for the
initial SAE authentication case when there is no explicit PMKSA entry
attached to the station.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoSAE: Fix FT-SAE key derivation for a case where PMKID in msg 1/4 matches
Jouni Malinen [Fri, 23 Mar 2018 16:42:21 +0000 (18:42 +0200)] 
SAE: Fix FT-SAE key derivation for a case where PMKID in msg 1/4 matches

Previously, matching PMKSA cache entry ended up clearing XXKey. However,
that XXKey is needed in the specific case where FT-SAE goes through the
initial mobility domain association with SAE authentication. FT-SAE
worked previously since the hostapd side generation of the particular
PMKID value in msg 1/4 was broken, but once that PMKID is fixed,
wpa_supplicant will need this fix to allow FT-SAE to be used.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>