]> git.ipfire.org Git - thirdparty/hostap.git/log
thirdparty/hostap.git
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>
7 years agoFix a resource leak on hostapd maclist parsing error path
Jouni Malinen [Wed, 21 Mar 2018 20:34:09 +0000 (22:34 +0200)] 
Fix a resource leak on hostapd maclist parsing error path

The open file needs to be closed in error case. The conversion to using
a new helper function (hostapd_add_acl_maclist) somehow managed to
remove the neede fclose(f) call. Bring it back to fix this.

Fixes: 3988046de538 ("hostapd: Dynamic MAC ACL management over control interface")
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agotests: Overlapping BSS scan report handling no overlap
Jouni Malinen [Wed, 21 Mar 2018 15:02:15 +0000 (17:02 +0200)] 
tests: Overlapping BSS scan report handling no overlap

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoDo not disable 40 MHz based on co-ex report with matching primary channel
Jouni Malinen [Wed, 21 Mar 2018 14:58:05 +0000 (16:58 +0200)] 
Do not disable 40 MHz based on co-ex report with matching primary channel

When processing 20/40 BSS Coexistence Management frames that do not
explicitly require 40 MHz to be disabled, check whether the reported
channels in 20/40 BSS Intolerant Channel Report element match the
current primary channel. If so, allow 40 MHz operation to continue. This
makes the during-operation updates for 20/40 Operation Permitted more
consistent with the scans during initial BSS startup.

The received 20/40 BSS Intolerant Channel Report channels are to be used
in the OT set in the during-operation determination and the P == OT_i
exception was ignored in the previous implementation which could result
in the AP first starting with 40 MHz and then dropping to 20 MHz on
first received 20/40 BSS Coexistence Management frame even though there
was no change in the neighboring BSSs.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoSupport multiple 20/40 BSS Intolerant Channel Report elements
Jouni Malinen [Wed, 21 Mar 2018 14:43:54 +0000 (16:43 +0200)] 
Support multiple 20/40 BSS Intolerant Channel Report elements

This extends 20/40 BSS Coexistence Management frame processing to
iterate over all the included 20/40 BSS Intolerant Channel Report
elements instead of using only the first one.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoIgnore intra-BSS 20/40 BSS Coexistence Management from not-associated STA
Jouni Malinen [Wed, 21 Mar 2018 14:35:15 +0000 (16:35 +0200)] 
Ignore intra-BSS 20/40 BSS Coexistence Management from not-associated STA

The 20 MHz BSS Width Request field is set to 1 only for intra-BSS
reports. As such, ignore the frame if such a claim is made by a
transmitter that is not currently associated with the AP.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoAdd more debug prints for 20/40 BSS Coexistence Management frame Rx
Jouni Malinen [Wed, 21 Mar 2018 14:32:35 +0000 (16:32 +0200)] 
Add more debug prints for 20/40 BSS Coexistence Management frame Rx

This makes it easier to understand what kind of information a STA is
reporting about 20/40 MHz coexistence requirements.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agohostapd: Ignore LOW_ACK event for co-operative steering clients
Rajkumar Manoharan [Tue, 13 Mar 2018 03:20:28 +0000 (08:50 +0530)] 
hostapd: Ignore LOW_ACK event for co-operative steering clients

Ignore hostapd_event_sta_low_ack for a station which has agreed to
steering by checking the agreed_to_steer flag. This flag will be set
whenever a station accepts the BSS transition request from the AP.
Without this ignoring of the LOW_ACK event, the steering in-progress
might be affected due to disassociation. In this way AP will allow some
time (two seconds) for the station to move away and reset the flag after
the timeout.

Co-Developed-by: Tamizh Chelvam <tamizhr@codeaurora.org>
Signed-off-by: Rajkumar Manoharan <rmanohar@codeaurora.org>
Signed-off-by: Tamizh chelvam <tamizhr@codeaurora.org>
7 years agoMake STA opmode change event available to upper layers
Tamizh chelvam [Fri, 9 Mar 2018 12:49:09 +0000 (18:19 +0530)] 
Make STA opmode change event available to upper layers

Add an event callback for EVENT_STATION_OPMODE_CHANGED to allow
user/application to get the notification whenever there is a change in a
station's HT/VHT op mode.

The new events:
STA-OPMODE-MAX-BW-CHANGED <addr> <20(no-HT)|20|40|80|80+80|160>
STA-OPMODE-SMPS-MODE-CHANGED <addr> <automatic|off|dynamic|static>
STA-OPMODE-N_SS-CHANGED <addr> <N_SS>

Signed-off-by: Tamizh chelvam <tamizhr@codeaurora.org>
7 years agonl80211: Add support for STA opmode change events
Tamizh chelvam [Fri, 9 Mar 2018 12:49:08 +0000 (18:19 +0530)] 
nl80211: Add support for STA opmode change events

The nl80211 driver can report STA_OPMODE notification event as soon as
it receives an HT/VHT Action frame about modification of station's SMPS
mode/bandwidth/RX NSS. Add support to parse such events.

Signed-off-by: Tamizh chelvam <tamizhr@codeaurora.org>
7 years agohostapd: Add last_ack_rssi into ctrl iface cmd STA
Bhagavathi Perumal S [Tue, 6 Mar 2018 09:00:11 +0000 (14:30 +0530)] 
hostapd: Add last_ack_rssi into ctrl iface cmd STA

This allows external application to get last ACK signal strength of the
last transmitted frame if the driver makes this information
(NL80211_STA_INFO_ACK_SIGNAL) available.

Signed-off-by: Bhagavathi Perumal S <bperumal@codeaurora.org>
Signed-off-by: Venkateswara Naralasetty <vnaralas@codeaurora.org>
7 years agoAdd hostapd_cli poll_sta command
Bhagavathi Perumal S [Tue, 6 Mar 2018 09:00:11 +0000 (14:30 +0530)] 
Add hostapd_cli poll_sta command

This uses the already existing POLL_STA control interface to poll an
associated station to check connectivity.

Signed-off-by: Bhagavathi Perumal S <bperumal@codeaurora.org>
Signed-off-by: Venkateswara Naralasetty <vnaralas@codeaurora.org>
7 years agoOWE: Clean up pointer check in a testing code path
Ashok Ponnaiah [Mon, 5 Mar 2018 05:29:18 +0000 (10:59 +0530)] 
OWE: Clean up pointer check in a testing code path

Check wpa_auth_write_assoc_resp_owe() return value to keep static
analyzers happier. The code path where this could happen is not really
reachable due to the separate hapd->conf->own_ie_override check and
wpa_auth_write_assoc_resp_owe() returning NULL only in an error case in
the override path. Furthermore, clean up the pointer return value to use
a proper pointer (NULL vs. 0).

Signed-off-by: Ashok Ponnaiah <aponnaia@codeaurora.org>
7 years agoSync with mac80211-next.git include/uapi/linux/nl80211.h
Jouni Malinen [Mon, 19 Mar 2018 17:08:15 +0000 (19:08 +0200)] 
Sync with mac80211-next.git include/uapi/linux/nl80211.h

This brings in nl80211 definitions as of 2018-02-13.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agotests: DPP Configurator reconfiguration
Jouni Malinen [Fri, 16 Mar 2018 18:43:54 +0000 (20:43 +0200)] 
tests: DPP Configurator reconfiguration

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoDPP: Support retrieving of configurator's private key
Purushottam Kushwaha [Fri, 16 Mar 2018 10:04:21 +0000 (15:34 +0530)] 
DPP: Support retrieving of configurator's private key

To retain configurator information across hostapd/wpa_supplicant
restart, private key need to be maintained to generate a valid pair of
authentication keys (connector, netaccess_key, csign) for new enrollees
in the network.

Add a DPP_CONFIGURATOR_GET_KEY control interface API through which the
private key of an existing configurator can be fetched.

Command format:
DPP_CONFIGURATOR_GET_KEY <configurator_id>

The output from this command can then be used with
"DPP_CONFIGURATOR_ADD key=<hexdump>" to create the same key again.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoSAE: Fix EAPOL-Key integrity and key-wrap algorithm selection
Jouni Malinen [Fri, 16 Mar 2018 11:04:15 +0000 (13:04 +0200)] 
SAE: Fix EAPOL-Key integrity and key-wrap algorithm selection

The SAE AKM 00-0F-AC:8 is supposed to use EAPOL-Key Key Descriptor
Version 0 (AKM-defined) with AES-128-CMAC and NIST AES Key Wrap.
However, the previous implementation ended up using Key Descriptor
Version 2 (HMAC-SHA-1-128 and NIST AES Key Wrap). Fix this by using the
appropriate Key Descriptor Version and integrity algorithm. Use helper
functions to keep the selection clearer and more consistent between
wpa_supplicant and hostapd uses.

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 agotests: DPP protocol testing - stop when transmitting Auth Conf
Jouni Malinen [Mon, 12 Mar 2018 23:04:03 +0000 (01:04 +0200)] 
tests: DPP protocol testing - stop when transmitting Auth Conf

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoDPP: Extend dpp_test 89 functionality to transmit side
Srinivas Dasari [Wed, 7 Mar 2018 11:56:26 +0000 (17:26 +0530)] 
DPP: Extend dpp_test 89 functionality to transmit side

This extends dpp_test functionality to allow DPP exchanges to be stopped
after authentication is completed on the Initiator, i.e., after sending
out the Authentication Confirm message. Previously, dpp_test=89 was used
only on the Responder side to stop after receiving the Authentication
Confirm message. The main use case for this extended functionality is to
be able to stop the protocol exchange on a device that acts as
authentication Initiator and Enrollee.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agoUse correct WPA_ALG_* values to compare for enum wpa_alg
Purushottam Kushwaha [Mon, 12 Mar 2018 14:44:48 +0000 (20:14 +0530)] 
Use correct WPA_ALG_* values to compare for enum wpa_alg

enum wpa_alg was being compared with WPA_CIPHER_* values. That does not
work here and strict compilers will report this as an error. Fix the
comparision to use proper WPA_ALG_* values. This fixes testing
capability for resetting IPN for BIP.

Fixes: 16579769ff7b ("Add testing functionality for resetting PN/IPN for configured keys")
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
7 years agomka: Mark ieee802_1x_kay_create_mka() ckn and cak arguments const
Jouni Malinen [Sun, 11 Mar 2018 15:04:34 +0000 (17:04 +0200)] 
mka: Mark ieee802_1x_kay_create_mka() ckn and cak arguments const

These structures are not modified or freed (i.e., only data from them is
copied), so mark the arguments const to document this a bit more clearly
now that there was a memory leak in one of the callers to this function.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agowpa_supplicant: Fix memory leaks in ieee802_1x_create_preshared_mka()
Davide Caratti [Thu, 8 Mar 2018 16:15:02 +0000 (17:15 +0100)] 
wpa_supplicant: Fix memory leaks in ieee802_1x_create_preshared_mka()

In case MKA is initialized successfully, local copies of CAK and CKN
were allocated, but never freed. Ensure that such memory is released
also when ieee802_1x_kay_create_mka() returns a valid pointer.

Fixes: ad51731abf06 ("wpa_supplicant: Allow pre-shared (CAK,CKN) pair for MKA")
Signed-off-by: Davide Caratti <davide.caratti@gmail.com>
7 years agomka: Do not print contents of SAK to debug log
Mike Siedzik [Tue, 20 Feb 2018 19:28:40 +0000 (14:28 -0500)] 
mka: Do not print contents of SAK to debug log

Log newly generated SAKs as well as unwrapped SAKs with wpa_hexdump_key()
rather than wpa_hexdump(). By default, the wpa_hexdump_key() function
will not display sensitive key data.

Signed-off-by: Michael Siedzik <msiedzik@extremenetworks.com>
7 years agomka: Detect duplicate MAC addresses during key server election
Mike Siedzik [Tue, 20 Feb 2018 19:28:37 +0000 (14:28 -0500)] 
mka: Detect duplicate MAC addresses during key server election

In the unlikely event the local KaY and the elected peer have the same
actor priority as well as the same MAC address, log a warning message
and do not elect a key server. Resolution is for network administrator
to reconfigure MAC address.

Signed-off-by: Michael Siedzik <msiedzik@extremenetworks.com>
7 years agomka: Loss of live peers to result in connect PENDING not AUTHENTICATED
Mike Siedzik [Tue, 20 Feb 2018 19:28:34 +0000 (14:28 -0500)] 
mka: Loss of live peers to result in connect PENDING not AUTHENTICATED

When the number of live peers becomes 0 the KaY was setting
kay->authenticated true and telling the CP to connect AUTHENTICATED.
Per IEEE Std 802.1X-2010 Clause 12.2, MKA.authenticated means "the Key
Server has proved mutual authentication but has determined that
Controlled Port communication should proceed without the use of MACsec",
which means port traffic will be passed in the clear.

When the number of live peers becomes 0 the KaY must instead set
kay->authenticated false and tell the CP to connect PENDING. Per Clause
12.3 connect PENDING will "prevent connectivity by clearing the
controlledPortEnabled parameter."

Signed-off-by: Michael Siedzik <msiedzik@extremenetworks.com>
7 years agomka: Ignore MACsec SAK Use Old Key parameter if we don't have our old key
Mike Siedzik [Tue, 20 Feb 2018 19:28:32 +0000 (14:28 -0500)] 
mka: Ignore MACsec SAK Use Old Key parameter if we don't have our old key

Upon receipt of the "MACsec MKPDU SAK Use parameter set" the KaY verifies
that both the latest key and the old key are valid. If the local system
reboots or is reinitialized, the KaY won't have a copy of its old key.
Therefore if the KaY does not have a copy of its old key it should not
reject MKPDUs that contain old key data in the MACsec SAK Use parameter.

Signed-off-by: Michael Siedzik <msiedzik@extremenetworks.com>
7 years agomka: When matching CKNs ensure that lengths are identical
Mike Siedzik [Tue, 20 Feb 2018 19:28:31 +0000 (14:28 -0500)] 
mka: When matching CKNs ensure that lengths are identical

KaY looks up participants using CAK Name (CKN). Per IEEE Std 802.1X-2010
Clause 9.3.1 CAK identification, the CKN is an integral number of
octets, between 1 and 32 (inclusive). This fix will ensure that the KaY
does not inadvertently match CKNs such as 'myCakNamedFoo' and
'myCakNamedFooBar'.

Signed-off-by: Michael Siedzik <msiedzik@extremenetworks.com>
7 years agotests: Add support for wolfSSL cryptographic library
Sean Parkinson [Thu, 18 Jan 2018 02:26:39 +0000 (12:26 +1000)] 
tests: Add support for wolfSSL cryptographic library

Signed-off-by: Sean Parkinson <sean@wolfssl.com>
7 years agotests: Check PKCS#12 support in additional test cases
Sean Parkinson [Thu, 18 Jan 2018 02:26:39 +0000 (12:26 +1000)] 
tests: Check PKCS#12 support in additional test cases

These test cases use PKCS#12, so skip them if the build does not include
support for it.

Signed-off-by: Sean Parkinson <sean@wolfssl.com>
7 years agotests: Verify MSCHAPV2 support in eap_peap_session_resumption
Sean Parkinson [Thu, 18 Jan 2018 02:26:39 +0000 (12:26 +1000)] 
tests: Verify MSCHAPV2 support in eap_peap_session_resumption

This test case uses EAP-MSCHAPv2 within the PEAP tunnel, so verify that
the build includes support for that before running the test.

Signed-off-by: Sean Parkinson <sean@wolfssl.com>
7 years agoAdd support for wolfSSL cryptographic library
Sean Parkinson [Thu, 18 Jan 2018 02:26:39 +0000 (12:26 +1000)] 
Add support for wolfSSL cryptographic library

Allow hostapd/wpa_supplicant to be compiled with the wolfSSL
cryptography and TLS library.

Signed-off-by: Sean Parkinson <sean@wolfssl.com>
7 years agoExtend ACL check for Probe Request frames
Tamizh chelvam [Wed, 14 Feb 2018 13:43:56 +0000 (19:13 +0530)] 
Extend ACL check for Probe Request frames

Extend ACL check to deny Probe Request frames for the client which does
not pass ACL check. Skip this check for the case where RADIUS ACL is
used to avoid excessive load on the RADIUS authentication server due to
Probe Request frames. This patch add wpa_msg event for auth and assoc
rejection due to acl reject.

Signed-off-by: Tamizh chelvam <tamizhr@codeaurora.org>
7 years agoAdd new WiFi test config attributes to configure BA params
Kiran Kumar Lokere [Tue, 27 Feb 2018 03:23:04 +0000 (19:23 -0800)] 
Add new WiFi test config attributes to configure BA params

Define a new WiFi test configuration attributes in QCA vendor
command to configure BA session parameters and to add or
delete a BA session and to configure no ack policy.
This is used for configuring the testbed device.

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