]> git.ipfire.org Git - thirdparty/hostap.git/log
thirdparty/hostap.git
5 years agoOCE: Add RSSI based association rejection support (STA)
Beni Lev [Mon, 21 Aug 2017 16:43:52 +0000 (19:43 +0300)] 
OCE: Add RSSI based association rejection support (STA)

An AP might refuse to connect a STA if it has a low RSSI. In such case,
the AP informs the STA with the desired RSSI delta and a retry timeout.
Any subsequent association attempt with that AP (BSS) should be avoided,
unless the RSSI level improved by the desired delta or the timeout has
expired.

Defined in Wi-Fi Alliance Optimized Connectivity Experience technical
specification v1.0, section 3.14 (RSSI-based association rejection
information).

Signed-off-by: Beni Lev <beni.lev@intel.com>
5 years agotests: P2P cancel join-group using p2pdev and no separate group interface
Jouni Malinen [Tue, 1 Jan 2019 14:58:11 +0000 (16:58 +0200)] 
tests: P2P cancel join-group using p2pdev and no separate group interface

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoP2P: Set global->p2p_group_formation in wpas_p2p_join_start() for p2pdev
Aloni, Adiel [Mon, 21 Aug 2017 16:36:22 +0000 (19:36 +0300)] 
P2P: Set global->p2p_group_formation in wpas_p2p_join_start() for p2pdev

When a dedicated P2P device interface is used, the
global->p2p_group_formation was not set in wpas_p2p_join_start() if no
separate group interface is used. This would cause that in case of a
failure in group formation, the cleaning of p2p_in_provisioning is done
on the wrong interface. Furthermore, P2P_CANCEL command could not be
used to stop such a group-join operation. Fix this by setting the
global->p2p_group_formation correctly in case that the group interface
is reusing wpa_s->parent.

Signed-off-by: Adiel Aloni <adiel.aloni@intel.com>
5 years agotests: Clear regdom state in go_neg_forced_freq_diff_than_bss_freq
Jouni Malinen [Tue, 1 Jan 2019 14:35:42 +0000 (16:35 +0200)] 
tests: Clear regdom state in go_neg_forced_freq_diff_than_bss_freq

Be more careful with cleaning up the regdom state in cfg80211.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: Make dpp_pkex_no_responder handle enabled 5 GHz channels
Jouni Malinen [Tue, 1 Jan 2019 14:17:13 +0000 (16:17 +0200)] 
tests: Make dpp_pkex_no_responder handle enabled 5 GHz channels

It was possible for the 5 GHz PKEX channels to be enabled, e.g., when
running "ap_ht40_csa2 dpp_pkex_no_responder" test sequence, and that
resulted in a failure in dpp_pkex_no_responder due to the unexpectedly
long wait needed for the DPP-FAIL event. Increase the wait time to allow
for 5 GHz PKEX channels to be probed.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoUpdate wpa_supplicant channel list on FLUSH
Jouni Malinen [Tue, 1 Jan 2019 13:58:46 +0000 (15:58 +0200)] 
Update wpa_supplicant channel list on FLUSH

Try to make sure the driver channel list state is synchronized with
wpa_supplicant whenever explicitly clearing state (e.g., between hwsim
test cases).

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agonl80211: Debug print channel list
Jouni Malinen [Tue, 1 Jan 2019 13:51:10 +0000 (15:51 +0200)] 
nl80211: Debug print channel list

This makes it a bit easier to figure out how channel list update from
the kernel is taken into use.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: Check per-wiphy specific country code between test cases
Jouni Malinen [Mon, 31 Dec 2018 15:05:03 +0000 (17:05 +0200)] 
tests: Check per-wiphy specific country code between test cases

This allows more accurate logging of failures related to the cfg80211
country=98 (intersection) case. This version is trying to give some more
time to allow the country code to clear, but that does not seem to be
sufficient with the current cfg80211 implementation for country=98 (but
might be for other cases).

The additional check for country=98 at the beginning of each test case
is an attempt to force cfg80211 to restore world roaming state with a
new association and disconnection at the station side detected after the
AP side has already stopped. This is needed after the Linux kernel
commit 113f3aaa81bd ("cfg80211: Prevent regulatory restore during STA
disconnect in concurrent interfaces").

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: Wait a bit after 'iw reg set 00' at the end of test cases
Jouni Malinen [Tue, 1 Jan 2019 09:45:50 +0000 (11:45 +0200)] 
tests: Wait a bit after 'iw reg set 00' at the end of test cases

This is needed to avoid leaving unexpected cfg80211 regulatory country
code in place at the point when a test case terminates.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: Clear regdom changes more robustly in FST test cases
Jouni Malinen [Tue, 1 Jan 2019 09:35:22 +0000 (11:35 +0200)] 
tests: Clear regdom changes more robustly in FST test cases

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: Clear regulatory setting in ap_ht_op_class_* more robustly
Jouni Malinen [Mon, 31 Dec 2018 15:14:01 +0000 (17:14 +0200)] 
tests: Clear regulatory setting in ap_ht_op_class_* more robustly

Avoid exiting the test case with regulatory domain set to something else
than 00 (world roaming).

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agonl82011: Make wiphy-specific country (alpha2) available in STATUS-DRIVER
Jouni Malinen [Mon, 31 Dec 2018 14:41:24 +0000 (16:41 +0200)] 
nl82011: Make wiphy-specific country (alpha2) available in STATUS-DRIVER

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agonl80211: Debug print details from the beacon hint events
Jouni Malinen [Mon, 31 Dec 2018 14:29:16 +0000 (16:29 +0200)] 
nl80211: Debug print details from the beacon hint events

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agohostapd: Add configuration option check_crl_strict
Sam Voss [Mon, 7 Aug 2017 16:26:33 +0000 (11:26 -0500)] 
hostapd: Add configuration option check_crl_strict

Add the ability to ignore time-based CRL errors from OpenSSL by
specifying a new configuration parameter, check_crl_strict=0.

This causes the following:

- This setting does nothing when CRL checking is not enabled.

- When CRL is enabled, "strict mode" will cause CRL time errors to not
  be ignored and will continue behaving as it currently does.

- When CRL is enabled, disabling strict mode will cause CRL time
  errors to be ignored and will allow connections.

By default, check_crl_strict is set to 1, or strict mode, to keep
current functionality.

Signed-off-by: Sam Voss <sam.voss@rockwellcollins.com>
5 years agowpa_cli: Allow reconnect to global interface
Ben Greear [Thu, 8 Jun 2017 17:58:54 +0000 (10:58 -0700)] 
wpa_cli: Allow reconnect to global interface

Old code would just re-connect to a particular interface, even if user
had started wpa_cli with the '-g' option. Refactor global control
interface connection routine to allow it to be used in
wpa_cli_reconnect().

Signed-off-by: Ben Greear <greearb@candelatech.com>
5 years agotests: Build tests for wpa_supplicant and hostapd
Jouni Malinen [Mon, 31 Dec 2018 08:50:22 +0000 (10:50 +0200)] 
tests: Build tests for wpa_supplicant and hostapd

Allow multiple build configurations to be tested automatically.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoAdd internal HMAC-SHA512 implementation to fix NEED_SHA512 builds
Jouni Malinen [Mon, 31 Dec 2018 09:51:45 +0000 (11:51 +0200)] 
Add internal HMAC-SHA512 implementation to fix NEED_SHA512 builds

Build configurations with CONFIG_TLS=internal and NEED_SHA512 failed due
to missing sha512.c file. Add that file even though this is not really
used in the currently available configuration combinations since DPP and
OWE are the only users of it and the internal crypto implementation
supports neither.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agowpa_supplicant: Fix build with !CONFIG_AP and CONFIG_CTRL_IFACE_DBUS_NEW
Michal Privoznik [Sun, 30 Dec 2018 18:36:22 +0000 (19:36 +0100)] 
wpa_supplicant: Fix build with !CONFIG_AP and CONFIG_CTRL_IFACE_DBUS_NEW

If the CONFIG_CTRL_IFACE_DBUS_NEW is enabled but CONFIG_AP is
disabled the build fails. This is because dbus getters try to
access ap_iface member of wpa_supplicant struct which is defined
if and only if CONFIG_AP is enabled.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
5 years agomka: Log MI update failure in debug log
Jouni Malinen [Sun, 30 Dec 2018 23:09:02 +0000 (01:09 +0200)] 
mka: Log MI update failure in debug log

One of the reset_participant_mi() callers did not log the error. Make
this more consistent with the other callers.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agonl80211: Note interface-removal-from-bridge errors in debug log
Jouni Malinen [Sun, 30 Dec 2018 23:05:23 +0000 (01:05 +0200)] 
nl80211: Note interface-removal-from-bridge errors in debug log

One of the linux_br_del_if() calls did not log nl80211-specific entry.
Make this more consistent with the other cases even though
linux_br_add_if() function itself is logging an error in the ioctl()
failure case (but not in the interface not found case).

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: hostapd configuration reload from file when disabled
Jouni Malinen [Sun, 30 Dec 2018 15:35:54 +0000 (17:35 +0200)] 
tests: hostapd configuration reload from file when disabled

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agohostapd: Add openssl_ecdh_curves configuration parameter
Hristo Venev [Thu, 20 Apr 2017 13:44:31 +0000 (14:44 +0100)] 
hostapd: Add openssl_ecdh_curves configuration parameter

This makes it possible to use ECDSA certificates with EAP-TLS/TTLS/etc.
It should be noted that when using Suite B, different mechanism is used
to specify the allowed ECDH curves and this new parameter must not be
used in such cases.

Signed-off-by: Hristo Venev <hristo@venev.name>
5 years agoOpenSSL: Add openssl_ecdh_curves parameter
Hristo Venev [Thu, 20 Apr 2017 13:40:35 +0000 (14:40 +0100)] 
OpenSSL: Add openssl_ecdh_curves parameter

Some versions of OpenSSL need server support for ECDH to be explicitly
enabled, so provide a new parameter for doing so and all
SSL_{,CTX_}set_ecdh_auto() for versions that need it to enable automatic
selection.

Signed-off-by: Hristo Venev <hristo@venev.name>
5 years agoHS 2.0: DHCP broadcast-to-unicast conversion before address learning
Jouni Malinen [Sat, 29 Dec 2018 23:05:18 +0000 (01:05 +0200)] 
HS 2.0: DHCP broadcast-to-unicast conversion before address learning

handle_dhcp() was first trying to learn the IP address of an associated
STA before doing broadcast-to-unicast conversion. This could result in
not converting some DHCPACK messages since the address learning part
aborts processing by returning from the function in various cases.

Reorder these operations to allow broadcast-to-unicast conversion to
happen even if an associated STA entry is not updated based on a
DHCPACK.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: Add UDP checksum into DHCP frames in ProxyARP/DGAF disabled case
Jouni Malinen [Sat, 29 Dec 2018 23:04:03 +0000 (01:04 +0200)] 
tests: Add UDP checksum into DHCP frames in ProxyARP/DGAF disabled case

Previously, the special value 0 was used to indicate no UDP checksum.
Replace that with the calculated checksum for more like use case.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agomka: Make ICV Indicator dependant on ICV length
Jaap Keuter [Fri, 7 Apr 2017 21:39:23 +0000 (23:39 +0200)] 
mka: Make ICV Indicator dependant on ICV length

IEEE Std 802.1X-2010, 11.11 describes that the ICV is separate from the
parameter sets before it. Due to its convenient layout the ICV Indicator
'body part' is used to encode the ICV as well.

IEEE Std 802.1X-2010, 11.11.3 describes the encoding of MKPDUs. In
bullet e) is desribed that the ICV Indicator itself is encoded when the
ICV is not 16 octets in length. IEEE Std 802.1Xbx-2014, Table 11-7 note
e) states that it will not be encoded unless the Algorithm Agility
parameter specifies the use of an ICV that is not 16 octets in length.

Therefore the length calculation for the ICV indicator body part must
take into account if the ICV Indicator is to be encoded or not. The
actual encoder of the ICV body already takes care of the rest.

In practice, this change will remove the ICV Indicator parameter set (4
octets before the ICV value itself) since the only defined algorithm
agility value uses an ICV of 16 octets. IEEE Std 802.1X-2010 MKPDU
validation and decoding rules in 11.11.2 and 11.11.4 require the
receipient to handle both cases of ICV Indicator being included or not.

Signed-off-by: Jaap Keuter <jaap.keuter@xs4all.nl>
5 years agotests: Clear regulatory Beacon hints more robustly in TDLS test cases
Jouni Malinen [Sat, 29 Dec 2018 15:01:01 +0000 (17:01 +0200)] 
tests: Clear regulatory Beacon hints more robustly in TDLS test cases

The ap_open_tdls_vht* test cases could leave some pending regulatory
Beacon hints waiting to be cleared during the following test case. This
would result in a failure if the following test case expected specific
regdom event behavior. For example, this caused "ap_open_tdls_vht160
dbus_country" sequence to result in failure in dbus_country. Fix this by
using more robust sequence in clearing regdom state at the end of the
TDLS test cases that have the AP advertising a country code.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: MKA MIB information
Jouni Malinen [Sat, 29 Dec 2018 14:52:56 +0000 (16:52 +0200)] 
tests: MKA MIB information

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agomka: MIB information
Jouni Malinen [Sat, 29 Dec 2018 14:52:31 +0000 (16:52 +0200)] 
mka: MIB information

Provide MKA information through the wpa_supplicant control interface MIB
command.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: MACsec PSK with bridge interface
Jouni Malinen [Thu, 27 Dec 2018 13:57:45 +0000 (15:57 +0200)] 
tests: MACsec PSK with bridge interface

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: Use more robust way to determine MKA is done for MACsec testing
Jouni Malinen [Sat, 29 Dec 2018 09:37:01 +0000 (11:37 +0200)] 
tests: Use more robust way to determine MKA is done for MACsec testing

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agomka: Provide more status information over control interface
Jouni Malinen [Sat, 29 Dec 2018 08:38:54 +0000 (10:38 +0200)] 
mka: Provide more status information over control interface

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agomka: Stop trying to generate and distribute new SAK when not key server
Jouni Malinen [Fri, 28 Dec 2018 23:27:22 +0000 (01:27 +0200)] 
mka: Stop trying to generate and distribute new SAK when not key server

It was possible for a participant to first be elected as a key server
and schedule a new SAK to be generated and distributed just to be
followed by another participant being elected as the key server. That
did not stop the participant that disabled key server functionality to
stop generating the new SAK and then trying to distribute it. That is
not correct behavior, so make these steps conditional on the participant
still being a key server when going through the timer.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agomka: Add more debug print details
Jouni Malinen [Thu, 27 Dec 2018 14:19:46 +0000 (16:19 +0200)] 
mka: Add more debug print details

This makes it a bit easier to try to figure out what is going on with
KaY operations and MKA setup.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agomka: Fix deleteSAs clearing of principal->new_key
Jouni Malinen [Thu, 27 Dec 2018 22:47:53 +0000 (00:47 +0200)] 
mka: Fix deleteSAs clearing of principal->new_key

This pointer needs to be cleared when the matching SAK is being removed
from the SAK list. The previous implementation was doing something
pretty strange in the loop by clearing the pointer for any non-matching
key that happened to be iterated through before finding the matching
key. This could probably result in incorrect behavior, but not clearing
the pointer for the matching key could do more harm by causing freed
memory to be referenced.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agomka: Derive MACsec cipher suite and MKA algorithm table index
Jouni Malinen [Thu, 27 Dec 2018 14:37:57 +0000 (16:37 +0200)] 
mka: Derive MACsec cipher suite and MKA algorithm table index

Instead of using a specifically set index value from table definition,
use the actual real index of the table entry. This removes need for
maintaining these index values separately. Furthermore, the
mka_alg_tbl[] index was already off-by-one (but not used anywhere).

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agowpa_supplicant: Document nl80211 driver in the man page
Asbjørn Sloth Tønnesen [Thu, 27 Dec 2018 00:16:44 +0000 (00:16 +0000)] 
wpa_supplicant: Document nl80211 driver in the man page

Signed-off-by: Asbjørn Sloth Tønnesen <hostap@asbjorn.st>
5 years agomka: Clean up KaY log output
Jaap Keuter [Fri, 15 Jun 2018 15:06:41 +0000 (17:06 +0200)] 
mka: Clean up KaY log output

When running wpa_supplicant (with logging for testing) the log output is
somewhat disorganized for KaY related items. E.g., items are not
aligned, inconsistent type handling, wrong wording, missing labels, etc.
This change tries to clean up the log output, so it is somewhat more
accessible.

Signed-off-by: Jaap Keuter <jaap.keuter@xs4all.nl>
5 years agotests: MACsec PSK local failures in CP state machine
Jouni Malinen [Thu, 27 Dec 2018 10:25:37 +0000 (12:25 +0200)] 
tests: MACsec PSK local failures in CP state machine

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agomka: Do not force entry into INIT state on CP state machine creation
Jouni Malinen [Thu, 27 Dec 2018 09:33:46 +0000 (11:33 +0200)] 
mka: Do not force entry into INIT state on CP state machine creation

Go through the SM_STEP_RUN() global transition to get into the INIT
state to follow the state machine design more closely.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agomka: Remove unused authorization data from CP
Jouni Malinen [Thu, 27 Dec 2018 09:26:27 +0000 (11:26 +0200)] 
mka: Remove unused authorization data from CP

While IEEE Std 802.1X-2010 talks about arbitrary authorization data that
could be passed to the CP from sources like RADIUS server, there is not
much point in trying to implement this as an arbitrary memory buffer in
wpa_supplicant. Should such data be supported in the future, it would
much more likely use more detailed data structures that encode the
received data in easier to use form.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: MACsec
Jouni Malinen [Mon, 24 Dec 2018 21:57:10 +0000 (23:57 +0200)] 
tests: MACsec

Add some coverage for MACsec with the macsec_linux driver interface in
wpa_supplicant.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agomka: Extend CAK/CKN-from-EAP-MSK API to pass in MSK length
Jouni Malinen [Wed, 26 Dec 2018 14:37:49 +0000 (16:37 +0200)] 
mka: Extend CAK/CKN-from-EAP-MSK API to pass in MSK length

This can be used to allow 256-bit key hierarchy to be derived from
EAP-based authentication. For now, the MSK length is hardcoded to 128
bits, so the previous behavior is maintained.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agomka: Allow 256-bit CAK to be configured for PSK mode
Jouni Malinen [Wed, 26 Dec 2018 10:27:39 +0000 (12:27 +0200)] 
mka: Allow 256-bit CAK to be configured for PSK mode

This allows 256-bit CAK to be used as the root key in the MKA key
hierarchy.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agomka: Allow CAK length 32 (256-bit) to be initialized
Jouni Malinen [Wed, 26 Dec 2018 14:28:27 +0000 (16:28 +0200)] 
mka: Allow CAK length 32 (256-bit) to be initialized

The CAK length is not hardcoded in the algorithm agility parameter, so
remove that from the table. Instead, allow both 16 (128-bit) and 32
(256-bit) CAK to be used so that the following key derivations use
appropriate key lengths based on the configured/derived CAK.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agomka: Determine KCK/ICK length from CAK length
Jouni Malinen [Wed, 26 Dec 2018 14:23:29 +0000 (16:23 +0200)] 
mka: Determine KCK/ICK length from CAK length

The ICK and KEK are derived from a CAK and the length of the CAK
determines the length of the KCK/ICK. Remove the separate ICK/KEK length
parameters from the algorithm agility table.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agomka: ICV calculation using 256-bit ICK
Jouni Malinen [Wed, 26 Dec 2018 14:18:00 +0000 (16:18 +0200)] 
mka: ICV calculation using 256-bit ICK

Add support for using AES-CMAC with 256-bit key (ICK) to calculate ICV.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agomka: Support 256-bit ICK derivation
Jouni Malinen [Wed, 26 Dec 2018 10:39:21 +0000 (12:39 +0200)] 
mka: Support 256-bit ICK derivation

Support derivation of a 256-bit ICK and use of a 256-bit CAK in ICK
derivation.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agomka: Support 256-bit KEK derivation
Jouni Malinen [Wed, 26 Dec 2018 10:35:18 +0000 (12:35 +0200)] 
mka: Support 256-bit KEK derivation

Support derivation of a 256-bit KEK and use of a 256-bit CAK in KEK
derivation.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agomka: Support 256-bit CAK in SAK derivation
Jouni Malinen [Wed, 26 Dec 2018 10:20:57 +0000 (12:20 +0200)] 
mka: Support 256-bit CAK in SAK derivation

Pass the configured CAK length to SAK derivation instead of using
hardcoded 128-bit length.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agomka: AES-CMAC-256 -based KDF
Jouni Malinen [Wed, 26 Dec 2018 10:13:40 +0000 (12:13 +0200)] 
mka: AES-CMAC-256 -based KDF

Extend the previously implemented KDF (IEEE Std 802.1X-2010, 6.2.1) to
support 256-bit input key and AES-CMAC-256. This does not change any
actual key derivation functionality yet, but is needed as a step towards
supporting 256-bit CAK.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agomka: Change MI if key invalid
Andrey Kartashev [Fri, 2 Nov 2018 18:02:20 +0000 (19:02 +0100)] 
mka: Change MI if key invalid

It is possible to get a situation where a peer removes the Key Server
from its live peers list but the server still thinks that the peer is
alive (e.g., high packet loss in one direction). In such a case, the Key
Server will continue to advertise Last Key but this peer will not be
able to set up SA as it has already deleted its key.

Change the peer MI which will force the Key Server to distribute a new
SAK.

Signed-off-by: Andrey Kartashev <andrey.kartashev@afconsult.com>
5 years agomka: Speed up processing of duplicated SCI
Andrey Kartashev [Fri, 2 Nov 2018 18:02:19 +0000 (19:02 +0100)] 
mka: Speed up processing of duplicated SCI

Decrease timeout for a peer with duplicated SCI to speed up process in
case it is a valid peer after MI change.

Signed-off-by: Andrey Kartashev <andrey.kartashev@afconsult.com>
5 years agomka: Support for 256-bit SAK generation
Andrey Kartashev [Fri, 2 Nov 2018 18:02:18 +0000 (19:02 +0100)] 
mka: Support for 256-bit SAK generation

There is already partial support of GCM-AES-256. It is possible to
enable this mode by setting 'kay->macsec_csindex = 1;' in
ieee802_1x_kay_init() function, but the generated key contained only 128
bits of data while other 128 bits are in 0.

Enables KaY to generate full 256-bit SAK from the same 128-bit CAK. Note
that this does not support 256-bit CAK or AES-CMAC-256 -based KDF.

Signed-off-by: Andrey Kartashev <andrey.kartashev@afconsult.com>
5 years agomka: Remember LowestPN for each key server
Andrey Kartashev [Fri, 2 Nov 2018 18:02:17 +0000 (19:02 +0100)] 
mka: Remember LowestPN for each key server

According IEEE Std 802.1X-2010, 9.8 each participant shall record the
values of NextPN for last SAK accepted from each Key Server to use it in
case of a switch from one Key Server to another and back. Add LPN
recording and set saved value as the initial PN for the created channel.

Signed-off-by: Andrey Kartashev <andrey.kartashev@afconsult.com>
5 years agomka: Check for errors on create Secure Channel
Andrey Kartashev [Fri, 2 Nov 2018 18:02:16 +0000 (19:02 +0100)] 
mka: Check for errors on create Secure Channel

It is possible that the driver fails to create Secure Channel (due to
hardware limitations for example). Add checks of create_*_sc() result
codes and abort procedure in case of failure.

Signed-off-by: Andrey Kartashev <andrey.kartashev@afconsult.com>
5 years agomka: Fix a memory leak on error path
Andrey Kartashev [Fri, 2 Nov 2018 18:02:16 +0000 (19:02 +0100)] 
mka: Fix a memory leak on error path

Fix a minor memory leak in ieee802_1x_kay_create_mka() in
case of KEK/ICK derivation failure.

Signed-off-by: Andrey Kartashev <andrey.kartashev@afconsult.com>
5 years agomka: Debug output cleanup/fix
Andrey Kartashev [Fri, 2 Nov 2018 18:02:15 +0000 (19:02 +0100)] 
mka: Debug output cleanup/fix

Make debug output more consistent, fix several errors.

Signed-off-by: Andrey Kartashev <andrey.kartashev@afconsult.com>
5 years agomka: Allow configuration of MACsec replay protection
Andrey Kartashev [Fri, 2 Nov 2018 18:02:14 +0000 (19:02 +0100)] 
mka: Allow configuration of MACsec replay protection

Add new configuration parameters macsec_replay_protect and
macsec_replay_window to allow user to set up MACsec replay protection
feature. Note that according to IEEE Std 802.1X-2010 replay protection
and delay protection are different features: replay protection is
related only to SecY and does not appear on MKA level while delay
protection is something that KaY can use to manage SecY state.

Signed-off-by: Andrey Kartashev <andrey.kartashev@afconsult.com>
5 years agowpa_debug: Support wpa_hexdump_ascii() outputting into syslog
Andrey Kartashev [Fri, 2 Nov 2018 18:02:13 +0000 (19:02 +0100)] 
wpa_debug: Support wpa_hexdump_ascii() outputting into syslog

When syslog logging is used output from wpa_hexdump_ascii() was silently
discarded. This patch enables wpa_hexdump_ascii() to print data to
syslog but without ASCII decoding.

Signed-off-by: Andrey Kartashev <andrey.kartashev@afconsult.com>
5 years agomka: Do not update potential peer liveness timer
Mike Siedzik [Tue, 20 Feb 2018 19:28:45 +0000 (14:28 -0500)] 
mka: Do not update potential peer liveness timer

To prevent a remote peer from getting stuck in a perpetual 'potential
peer' state, only update the peer liveness timer 'peer->expire' for live
peers and not for potential peers.

Per IEEE Std 802.1X-2010, 9.4.3 (Determining liveness), potential peers
need to show liveness by including our MI/MN in their transmitted MKPDU
(within potential or live parameter sets).

When a potential peer does include our MI/MN in an MKPDU, we respond by
moving the peer from 'potential_peers' to 'live_peers'.

If a potential peer does not include our MI/MN in an MKPDU within
MKPDU_LIFE_TIME, let the peer expire to facilitate getting back in sync
with the remote peer.

Signed-off-by: Michael Siedzik <msiedzik@extremenetworks.com>
5 years agomka: Consider missing MKPDU parameter sets a failure
Mike Siedzik [Tue, 20 Feb 2018 19:28:44 +0000 (14:28 -0500)] 
mka: Consider missing MKPDU parameter sets a failure

The previous commit introduced parameter set error checking. This commit
extends upon that by considering missing parameter sets a failure.

Two checks are added by this commit. First, verify that live peers start
encoding MKA_SAK_USE within a reasonable amount of time after going live
(10 MKPDUs). Second, verify that once a live peer starts encoding
MKA_SAK_USE it continues to do so indefinitely.

Signed-off-by: Michael Siedzik <msiedzik@extremenetworks.com>
5 years agomka: Do not ignore MKPDU parameter set decoding failures
Mike Siedzik [Tue, 20 Feb 2018 19:28:43 +0000 (14:28 -0500)] 
mka: Do not ignore MKPDU parameter set decoding failures

The status values returned by mka_param_body_handler.body_rx functions
are currently ignored by ieee802_1x_kay_decode_mkpdu(). If a failure is
detected the KaY should (a) stop processing the MKDPU and (b) do not
update the associated peer's liveliness.

IEEE Std 802.1X-2010, Table 11-7 (MKPDU parameter sets) and 11.11.3
(Encoding MKPDUs) dictate that MKA_SAK_USE (set type 3) will always be
encoded before MKA_DISTRIBUTED_SAK (set type 4) in MKPDUs. Due to
implementation of mka_param_body_handler, the code will always decode
MKA_SAK_USE before MKA_DISTRIBUTED_SAK. When MKA_DISTRUBUTED_SAK
contains a new SAK the code should decode MKA_DISTRUBUTED_SAK first so
that the latest SAK is in known before decoding MKA_SAK_USE.

The ideal solution would be to make two passes at MKDPU decoding: the
first pass decodes MKA_DISTRIBUTED_SAK, the second pass decodes all
other parameter sets.

A simpler and less risky solution is presented here: ignore MKA_SAK_USE
failures if MKA_DISTRIBUTED_SAK is also present. The new SAK will be
saved so that the next MKPDU's MKA_SAK_USE can be properly decoded. This
is basically what the code prior to this commit was doing (by ignoring
all errors).

Also, the only real recourse the KaY has when detecting any bad
parameter set is to ignore the MKPDU by not updating the corresponding
peer's liveliness timer, 'peer->expire'.

Signed-off-by: Michael Siedzik <msiedzik@extremenetworks.com>
5 years agomka: Fix resource leak when detecting duplicated SCI
Mike Siedzik [Tue, 20 Feb 2018 19:28:42 +0000 (14:28 -0500)] 
mka: Fix resource leak when detecting duplicated SCI

If a live peer ever changes its Member Identifier (MI), the KaY
correctly detects a "duplicated SCI" but then proceeds to delete the
peer without deleting the peer's resources (i.e., RxSC, RxSAs, TxSAs).

Note that a remote peer's MI will change if and when an
ieee8021XPaePortInitialize is executed on the remote port.

The solution here is to ignore all MKPDUs containing the new MI until
after the peer (that corresponds to the old MI) expires and cleans up
its resources. After the old peer is removed reception of the next MKPDU
containing the new MI will result in the creation of a new peer with the
new MI.

Signed-off-by: Michael Siedzik <msiedzik@extremenetworks.com>
5 years agomka: Fix READY to TRANSMIT logic in CP state machine
Mike Siedzik [Tue, 20 Feb 2018 19:28:41 +0000 (14:28 -0500)] 
mka: Fix READY to TRANSMIT logic in CP state machine

Per IEEE Std 802.1X-2010, Figure 12-2 (CP state machine), READY to
TRANSMIT transition includes !controlledPortEnabled condition.

Signed-off-by: Michael Siedzik <msiedzik@extremenetworks.com>
5 years agomka: Fix READY to ABANDON logic in CP state machine
Mike Siedzik [Tue, 20 Feb 2018 19:28:41 +0000 (14:28 -0500)] 
mka: Fix READY to ABANDON logic in CP state machine

Per IEEE Std 802.1X-2010, Figure 12-2 (CP state machine), READY should
move to ABANDON (not RECEIVE) when new_sak or changed_connect is true.

Signed-off-by: Michael Siedzik <msiedzik@extremenetworks.com>
5 years agomka: Fix RECEIVING to TRANSMIT logic in CP state machine
Mike Siedzik [Tue, 20 Feb 2018 19:28:41 +0000 (14:28 -0500)] 
mka: Fix RECEIVING to TRANSMIT logic in CP state machine

Per IEEE Std 802.1X-2010, Figure 12-2 (CP state machine), RECEIVING to
TRANSMIT transition includes !controlledPortEnabled condition.

Signed-off-by: Michael Siedzik <msiedzik@extremenetworks.com>
5 years agomka: Fix RETIRE state deletion of SAs
Mike Siedzik [Tue, 20 Feb 2018 19:28:41 +0000 (14:28 -0500)] 
mka: Fix RETIRE state deletion of SAs

Per IEEE Std 802.1X-2010, Figure 12-2 (CP state machine), deleteSAs(oki)
is used upon entering RETIRE. Do that in addition to freeing sm->oki.

Signed-off-by: Michael Siedzik <msiedzik@extremenetworks.com>
5 years agomka: Fix lowest acceptable Packet Number (LPN) calculation and use
Mike Siedzik [Tue, 20 Feb 2018 19:28:39 +0000 (14:28 -0500)] 
mka: Fix lowest acceptable Packet Number (LPN) calculation and use

The purpose of the Lowest Acceptable PN (lpn) parameters in the MACsec
SAK Use parameter set is to enforce delay protection. Per IEEE Std
802.1X-2010, Clause 9, "Each SecY uses MKA to communicate the lowest PN
used for transmission with the SAK within the last two seconds, allowing
receivers to bound transmission delays."

When encoding the SAK Use parameter set the KaY should set llpn and olpn
to the lowest PN transmitted by the latest SAK and oldest SAK (if
active) within the last two seconds. Because MKPDUs are transmitted
every 2 seconds (MKA_HELLO_TIME), the solution implemented here
calculates lpn based on the txsc->next_pn read during the previous MKPDU
transmit.

Upon receiving and decoding a SAK Use parameter set with delay
protection enabled, the KaY will update the SecY's lpn if the delay
protect lpn is greater than the SecY's current lpn (which is a product
of last PN received and replay protection and window size).

Signed-off-by: Michael Siedzik <msiedzik@extremenetworks.com>
5 years agomka: Fix MKPDU SAK Use Body's Delay Protect bit setting
Mike Siedzik [Tue, 20 Feb 2018 19:28:38 +0000 (14:28 -0500)] 
mka: Fix MKPDU SAK Use Body's Delay Protect bit setting

Delay Protect and Replay Protect are two separate and distinct features
of MKA. Per IEEE Std 802.1X-2010, 9.10.1 "Delay Protect, TRUE if LPNs
are being reported sufficiently frequently to allow the recipient to
provide data delay protection. If FALSE, the LPN can be reported as
zero", and per 9.10 "NOTE--Enforcement of bounded received delay
necessitates transmission of MKPDUs at frequent (0.5 s) intervals, to
meet a maximum data delay of 2 s while minimizing connectivity
interruption due to the possibility of lost or delayed MKPDUs."

This means struct ieee802_1x_mka_sak_use_body::delay_protect should only
be set TRUE when MKPDUs are being transmitted every 0.5 s (or faster).
By default the KaY sends MKPDUs every MKA_HELLO_TIME (2.0 s), so by
default delay_protect should be FALSE.

Add a new 'u32 mka_hello_time' parameter to struct ieee802_1x_kay. If
delay protection is desired, the KaY initialization code should set
kay->mka_hello_time to MKA_BOUNDED_HELLO_TIME (500 ms).

Signed-off-by: Michael Siedzik <msiedzik@extremenetworks.com>
5 years agomka: Fix conf_offset value in MKPDU when in policy mode SHOULD_SECURE
Mike Siedzik [Fri, 2 Mar 2018 20:10:51 +0000 (15:10 -0500)] 
mka: Fix conf_offset value in MKPDU when in policy mode SHOULD_SECURE

Commit 7b4d546e ("wpa_supplicant: Add macsec_integ_only setting for
MKA") introduced policy setting SHOULD_ENCRYPT (MACsec provides
integrity+confidentiality) in addition to SHOULD_SECURE (MACsec provides
integrity only). In both cases the KaY is populating the
"Confidentiality Offset" parameter within the "Distributed SAK parameter
set" with CONFIDENTIALITY_OFFSET_0=1. In the case of SHOULD_SECURE the
parameter should be populated with CONFIDENTIALITY_NONE=0.

IEEE Std 802.1X-2010, Table 11-6 and Figure 11-11 define how the two
Confidentiality Offset bits in the "Distributed SAK parameter set" must
be set: "0 if confidentiality not used" and "1 if confidentiality with
no offset". When policy is SHOULD_SECURE KaY should to send the former,
and when policy is SHOULD_ENCRYPT KaY should send the latter.

Fixes: 7b4d546e3dae ("wpa_supplicant: Add macsec_integ_only setting for MKA")
Signed-off-by: Michael Siedzik <msiedzik@extremenetworks.com>
5 years agomacsec: Make pre-shared CKN variable length
michael-dev [Tue, 15 Aug 2017 15:21:03 +0000 (17:21 +0200)] 
macsec: Make pre-shared CKN variable length

IEEE Std 802.1X-2010, 9.3.1 defines following restrictions for CKN:

"MKA places no restriction on the format of the CKN, save that it comprise
an integral number of octets, between 1 and 32 (inclusive), and that all
potential members of the CA use the same CKN. No further constraints are
placed on the CKNs used with PSKs, ..."

Hence do not require a 32 octet long CKN but instead allow a shorter CKN
to be configured.

This fixes interoperability with some Aruba switches, that do not accept
a 32 octet long CKN (only support shorter ones).

Signed-off-by: Michael Braun <michael-dev@fami-braun.de>
5 years agoMKA: Handle unaligned CKN length
Michael Braun [Thu, 17 Aug 2017 21:51:58 +0000 (23:51 +0200)] 
MKA: Handle unaligned CKN length

IEEE Std 802.1X-2010, Figure 11-7 explains that "Parameter set body
length" is exclusive of the suffix padding.

Fix variable length encoding and decoding when CKN length is not a
multiple of 4 bytes.

Signed-off-by: Michael Braun <michael-dev@fami-braun.de>
5 years agoMKA: Mark frame structs packed
Jouni Malinen [Tue, 25 Dec 2018 14:31:46 +0000 (16:31 +0200)] 
MKA: Mark frame structs packed

Mark the data structures used in construction/parsing frames packed to
prevent compiler from being able to pad them.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agomacsec_linux: Add driver status information
Jouni Malinen [Mon, 24 Dec 2018 22:53:52 +0000 (00:53 +0200)] 
macsec_linux: Add driver status information

wpa_supplicant STATUS-DRIVER control interface command can now be used
to fetch the macsec_linux driver status information like parent
interface name.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agodriver: Fix a typo in a comment
Jouni Malinen [Mon, 24 Dec 2018 22:43:29 +0000 (00:43 +0200)] 
driver: Fix a typo in a comment

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: Allow TX/RX data test to use different frame length
Jouni Malinen [Mon, 24 Dec 2018 21:56:25 +0000 (23:56 +0200)] 
tests: Allow TX/RX data test to use different frame length

This is needed for MACsec test cases with a bit shorter MTU.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agomacsec_linux: More detailed debug logs for driver interaction
Jouni Malinen [Mon, 24 Dec 2018 19:12:18 +0000 (21:12 +0200)] 
macsec_linux: More detailed debug logs for driver interaction

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: Do not override connectivity test address if no driver info
Jouni Malinen [Mon, 24 Dec 2018 18:31:47 +0000 (20:31 +0200)] 
tests: Do not override connectivity test address if no driver info

Not all driver interfaces provide driver status information with the
local address, so skip the override step if the field is not available.
This is needed, e.g., with macsec_linux.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoWPS: Fix wps_validate_credential() argument type
Jouni Malinen [Mon, 24 Dec 2018 09:12:53 +0000 (11:12 +0200)] 
WPS: Fix wps_validate_credential() argument type

Newer gcc complained about the mismatching len[] argument type. Silence
that by using the correct type.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoCheck snprintf result to avoid compiler warnings
Jouni Malinen [Sun, 23 Dec 2018 22:44:36 +0000 (00:44 +0200)] 
Check snprintf result to avoid compiler warnings

These do not really get truncated in practice, but it looks like some
newer compilers warn about the prints, so silence those by checking the
result and do something a bit more useful if the output would actually
get truncated.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoReadme for DPP
Damodaran, Rohit (Contractor) [Tue, 11 Dec 2018 07:30:27 +0000 (07:30 +0000)] 
Readme for DPP

Addi a readme file for users for on-boarding devices with Device
Provisioning Protocol (DPP).

Signed-off-by: Rohit Damodaran <Rohit_Damodaran@comcast.com>
5 years agotests: AP mode and D-Bus StationAdded/StationRemoved signals
Jouni Malinen [Sun, 23 Dec 2018 14:38:02 +0000 (16:38 +0200)] 
tests: AP mode and D-Bus StationAdded/StationRemoved signals

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agodbus: Expose connected stations on D-Bus
Andrej Shadura [Sun, 7 Oct 2018 12:31:51 +0000 (14:31 +0200)] 
dbus: Expose connected stations on D-Bus

Make it possible to list connected stations in AP mode over D-Bus, along
with some of their properties: rx/tx packets, bytes, capabilities, etc.

Signed-off-by: Mathieu Trudel-Lapierre <mathieu.trudel-lapierre@canonical.com>
Rebased by Julian Andres Klode <juliank@ubuntu.com> and updated to use
the new getter API.

Further modified by Andrej Shadura to not error out when not in AP mode
and to send separate StationAdded/StationRemoved signals instead of
changing signatures of existing StaAuthorized/StaDeauthorized signals.

Signed-off-by: Andrej Shadura <andrew.shadura@collabora.co.uk>
5 years agodbus: Use dbus_bool_t, not int for boolean function arguments
Andrej Shadura [Sun, 7 Oct 2018 12:31:50 +0000 (14:31 +0200)] 
dbus: Use dbus_bool_t, not int for boolean function arguments

Properties argument specifies whether to add object's properties
or not, hence it doesn't need to be int.

Signed-off-by: Andrej Shadura <andrew.shadura@collabora.co.uk>
5 years agotests: Validate that AP doesn't reflect station frames
Johannes Berg [Thu, 11 Oct 2018 13:38:26 +0000 (15:38 +0200)] 
tests: Validate that AP doesn't reflect station frames

Add a new test to check that the AP won't send frames to the client if
it tries to talk to itself.

Note that this fails until the relevant mac80211 patch is merged.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 years agotests: Fix AP wait in ap_require_ht and ap_require_ht_limited_rates
Jouni Malinen [Sun, 23 Dec 2018 10:13:04 +0000 (12:13 +0200)] 
tests: Fix AP wait in ap_require_ht and ap_require_ht_limited_rates

These test cases seemed to have copy-paste errors where
wait_enabled=False was forgotten even though there was no additional
steps checking the AP mode startup results. This did not break the
tests, but could have resulted in slowing them down if the STAs did not
find the AP in the first scan.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: HT STBC overrides
Jouni Malinen [Sun, 23 Dec 2018 10:11:53 +0000 (12:11 +0200)] 
tests: HT STBC overrides

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: Allow overriding HT STBC capabilities
Sergey Matyukevich [Tue, 30 Oct 2018 13:16:47 +0000 (13:16 +0000)] 
tests: Allow overriding HT STBC capabilities

Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com>
5 years agowpa_supplicant: Allow overriding HT STBC capabilities
Sergey Matyukevich [Tue, 30 Oct 2018 13:16:47 +0000 (13:16 +0000)] 
wpa_supplicant: Allow overriding HT STBC capabilities

Allow user to override STBC configuration for Rx and Tx spatial streams.
Add new configuration options to test for HT capability overrides.

Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com>
5 years agotests: Automatic channel selection, HT scan, and DFS
Jouni Malinen [Sun, 23 Dec 2018 09:05:54 +0000 (11:05 +0200)] 
tests: Automatic channel selection, HT scan, and DFS

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: Work around cfg80211 reg.c intersection (country 98) issues
Jouni Malinen [Sat, 22 Dec 2018 13:55:19 +0000 (15:55 +0200)] 
tests: Work around cfg80211 reg.c intersection (country 98) issues

The Linux kernel commit 113f3aaa81bd ("cfg80211: Prevent regulatory
restore during STA disconnect in concurrent interfaces") broke the
regulatory clearing attempt in many test cases since
cfg80211_is_all_idle() is now returning false due to the AP interface
being up and that results in the Country IE -based regulatory
information not getting cleared back to defaults.

Work around this by stopping the AP interface first so that when the
station interface receives the disconnection, there are no other active
interfaces in the system. In addition, wait for REGDOM event for the
Country IE hint after association to avoid disconnection before the
regulatory events have been fully processed.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: Fix mbo_supp_oper_classes after cfg80211 change
Jouni Malinen [Fri, 21 Dec 2018 22:55:26 +0000 (00:55 +0200)] 
tests: Fix mbo_supp_oper_classes after cfg80211 change

The Linux kernel commit 113f3aaa81bd ("cfg80211: Prevent regulatory
restore during STA disconnect in concurrent interfaces") broke the
regulatory clearing attempt in this test case since
cfg80211_is_all_idle() is now returning false due to the AP interface
being up and that results in the Country IE -based regulatory
information not getting cleared back to defaults.

Work around this by stopping the AP interface first so that when the
station interface receives the disconnection, there are no other active
interfaces in the system. In addition, wait for REGDOM event for the
Country IE hint after association to avoid disconnection before the
regulatory events have been fully processed.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: Enable dynamic debug from cfg80211/mac80211
Jouni Malinen [Fri, 21 Dec 2018 22:18:33 +0000 (00:18 +0200)] 
tests: Enable dynamic debug from cfg80211/mac80211

These debug logs were lost due to CONFIG_DYNAMIC_DEBUG=y.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoAdd SAE to GET_CAPABILITY key_mgmt
Jouni Malinen [Fri, 21 Dec 2018 19:27:59 +0000 (21:27 +0200)] 
Add SAE to GET_CAPABILITY key_mgmt

Provide information about SAE AKM support in "GET_CAPABILITY key_mgmt"
for completeness. The "GET_CAPABILITY auth_alg" case is already
providing information about SAE support through user space SME.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agonl80211: Fetch supported AKM list from the driver
Veerendranath Jakkam [Fri, 21 Dec 2018 10:32:24 +0000 (16:02 +0530)] 
nl80211: Fetch supported AKM list from the driver

Try to fetch the list of supported AKM suite selectors from the driver
through the vendor interface
QCA_NL80211_VENDOR_SUBCMD_GET_SUPPORTED_AKMS. If that command is
available and succeeds, use the returned list to populate the
wpa_driver_capa key_mgmt information instead of assuming all
cfg80211-based drivers support all AKMs. If the driver does not support
this command, the previous behavior is maintained.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoVendor command to query the supported AKMs from the driver
Veerendranath Jakkam [Fri, 21 Dec 2018 10:14:25 +0000 (15:44 +0530)] 
Vendor command to query the supported AKMs from the driver

This new QCA vendor command is used to query the supported AKM suite
selectors from the driver. There has been no such capability indication
from the driver and thus the current user space has to assume the driver
to support all the AKMs. This may be the case with some drivers (e.g.,
mac80211-based ones) but there are cfg80211-based drivers that implement
SME and have constraints on which AKMs can be supported (e.g., such
drivers may need an update to support SAE AKM using
NL80211_CMD_EXTERNAL_AUTH). Allow such drivers to specify the exact set
of supported AKMs so that user space tools can determine what network
profile options should be allowed to be configured. This command returns
the list of supported AKM suite selectors in the attribute
NL80211_ATTR_AKM_SUITES.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP: Fix build with LibreSSL 2.8.3
Jouni Malinen [Fri, 21 Dec 2018 10:21:03 +0000 (12:21 +0200)] 
DPP: Fix build with LibreSSL 2.8.3

Looks like LibreSSL 2.8 pulled in the OpenSSL API change to mark the
first argument to X509_ALGOR_get0() const.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoFix build with LibreSSL
Andrey Utkin [Tue, 11 Dec 2018 17:41:10 +0000 (17:41 +0000)] 
Fix build with LibreSSL

When using LibreSSL instead of OpenSSL, linkage of hostapd executable
fails with the following error when using some LibreSSL versions

    ../src/crypto/tls_openssl.o: In function `tls_verify_cb':
    tls_openssl.c:(.text+0x1273): undefined reference to `ASN1_STRING_get0_data'
    ../src/crypto/tls_openssl.o: In function `tls_connection_peer_serial_num':
    tls_openssl.c:(.text+0x3023): undefined reference to `ASN1_STRING_get0_data'
    collect2: error: ld returned 1 exit status
    make: *** [Makefile:1278: hostapd] Error 1

ASN1_STRING_get0_data is present in recent OpenSSL, but absent in some
versions of LibreSSL (confirmed for version 2.6.5), so fallback needs to
be defined in this case, just like for old OpenSSL.

This patch was inspired by similar patches to other projects, such as
spice-gtk, pjsip.

Link: https://bugs.gentoo.org/672834
Signed-off-by: Andrey Utkin <andrey_utkin@gentoo.org>
5 years agotests: hostapd.vlan with bridge ifname
Jouni Malinen [Fri, 21 Dec 2018 09:58:51 +0000 (11:58 +0200)] 
tests: hostapd.vlan with bridge ifname

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