]> git.ipfire.org Git - thirdparty/hostap.git/log
thirdparty/hostap.git
6 years agotests: Support UML kernel as a replacement for KVM
Jouni Malinen [Sat, 4 May 2019 09:42:02 +0000 (12:42 +0300)] 
tests: Support UML kernel as a replacement for KVM

This allows UML builds to be used in running user mode without having to
run the full x86 kernel in virtual machine.

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agotests: sigma_dut and TLS server certificate constraints
Jouni Malinen [Fri, 3 May 2019 10:06:44 +0000 (13:06 +0300)] 
tests: sigma_dut and TLS server certificate constraints

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoAdd QCA_WLAN_VENDOR_ATTR_WIFI_INFO_RADIO_INDEX
Jeff Johnson [Thu, 11 Apr 2019 18:46:29 +0000 (11:46 -0700)] 
Add QCA_WLAN_VENDOR_ATTR_WIFI_INFO_RADIO_INDEX

Update enum qca_wlan_vendor_attr_get_wifi_info to add support for
attribute QCA_WLAN_VENDOR_ATTR_WIFI_INFO_RADIO_INDEX. In addition
update the documentation for qca_wlan_vendor_attr_get_wifi_info and
QCA_NL80211_VENDOR_SUBCMD_GET_WIFI_INFO to fully describe the
operation of the command and the format of the attributes.

Signed-off-by: Jeff Johnson <jjohnson@codeaurora.org>
6 years agoAdd QCA vendor command to support beacon reporting feature
Vamsi Krishna [Wed, 3 Apr 2019 19:23:05 +0000 (00:53 +0530)] 
Add QCA vendor command to support beacon reporting feature

Add a QCA vendor sub command QCA_NL80211_VENDOR_SUBCMD_BEACON_REPORTING
to implement beacon reporting feature. Different operations required to
implement this feature can be specified in
QCA_WLAN_VENDOR_ATTR_BEACON_REPORTING_OP_TYPE.

Userspace requests the driver/firmware to periodically report received
Beacon frames whose BSSID matches the current connected BSS's MAC
address. If userspace requests the driver/firmware to send beacon
reports actively, the driver encapsulates the details of the beacon in
an event and sends it to userspace asynchronously. Otherwise, the driver
will only update the beacon in cfg80211 scan cache but will not send any
event to userspace.

If this command is not issued, the current behavior of the
driver/firmware is to update the cfg80211 scan cache only when there is
a scan issued by the host in progress or whenever there is a change in
IEs of the Beacon frames from the current connected BSS.

The userspace requests the driver/firmware to stop reporting beacons
when reporting is not required anymore. If the driver/firmware is not
able to receive Beacon frames because of other Wi-Fi operations such as
off-channel activities, etc., the driver/firmware sends a pause event to
userspace and stops reporting Beacon frames. The driver/firmware
indicates whether the beacon reporting automatically resumes later by
using the QCA_WLAN_VENDOR_ATTR_BEACON_REPORTING_AUTO_RESUMES flag. If
userspace doesn't want the beacon reporting to be resumed automatically,
userspace can send QCA_WLAN_VENDOR_BEACON_REPORTING_OP_STOP command to
the driver to stop beacon reporting.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agohostapd: Add airtime policy configuration support
Toke Høiland-Jørgensen [Wed, 20 Mar 2019 14:58:52 +0000 (15:58 +0100)] 
hostapd: Add airtime policy configuration support

This adds support to hostapd for configuring airtime policy settings for
stations as they connect to the access point. This is the userspace
component of the airtime policy enforcement system PoliFi described in
this paper: https://arxiv.org/abs/1902.03439

The Linux kernel part has been merged into mac80211 for the 5.1 dev
cycle.

The configuration mechanism has three modes: Static, dynamic and limit.
In static mode, weights can be set in the configuration file for
individual MAC addresses, which will be applied when the configured
stations connect.

In dynamic mode, weights are instead set per BSS, which will be scaled
by the number of active stations on that BSS, achieving the desired
aggregate weighing between the configured BSSes. Limit mode works like
dynamic mode, except that any BSS *not* marked as 'limited' is allowed
to exceed its configured share if a per-station fairness share would
assign more airtime to that BSS. See the paper for details on these
modes.

Signed-off-by: Toke Høiland-Jørgensen <toke@toke.dk>
6 years agonl80211: Station airtime weight configuration
Toke Høiland-Jørgensen [Wed, 20 Mar 2019 14:58:52 +0000 (15:58 +0100)] 
nl80211: Station airtime weight configuration

This provides a mechanism for configuring per-STA airtime weight for
airtime policy configuration.

Signed-off-by: Toke Høiland-Jørgensen <toke@toke.dk>
6 years agonl80211: Fetch STA TX/RX duration statistics
Toke Høiland-Jørgensen [Wed, 20 Mar 2019 14:58:52 +0000 (15:58 +0100)] 
nl80211: Fetch STA TX/RX duration statistics

This makes per-STA TX/RX duration statistics available for airtime policy
configuration.

Signed-off-by: Toke Høiland-Jørgensen <toke@toke.dk>
6 years agonl80211: Fetch STA TXQ backlog statistics
Toke Høiland-Jørgensen [Wed, 20 Mar 2019 14:58:52 +0000 (15:58 +0100)] 
nl80211: Fetch STA TXQ backlog statistics

This makes per-STA TXQ backlog statistics available for airtime policy
configuration.

Signed-off-by: Toke Høiland-Jørgensen <toke@toke.dk>
6 years agoFix ENGINE support with OpenSSL 1.1+
David Woodhouse [Sun, 28 Apr 2019 18:56:34 +0000 (21:56 +0300)] 
Fix ENGINE support with OpenSSL 1.1+

Commit 373c7969485 ("OpenSSL: Fix compile with OpenSSL 1.1.0 and
deprecated APIs") removed a call to ENGINE_load_dynamic() for newer
versions of OpenSSL, asserting that it should happen automatically.

That appears not to be the case, and loading engines now fails because
the dynamic engine isn't present.

Fix it by calling ENGINE_load_builtin_engines(), which works for all
versions of OpenSSL. Also remove the call to ERR_load_ENGINE_strings()
because that should have happened when SSL_load_error_strings() is
called anyway.

Fixes: 373c79694859 ("OpenSSL: Fix compile with OpenSSL 1.1.0 and deprecated APIs")
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
6 years agonl80211: Simplify if_indices tracking
Jouni Malinen [Sun, 28 Apr 2019 18:05:54 +0000 (21:05 +0300)] 
nl80211: Simplify if_indices tracking

Maintain a single array (of struct with two int variables) instead of
two independent arrays (of int) for tracking know ifindexes and reasons
for having added them. The previous implementation tried to maintain two
independent arrays even though they were always required to be of
exactly same length and order. That had resulted in a bug earlier and
the code was not exactly easy to understand either, so replace this with
a single array.

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agonl80211: Fix handling of if_indices reallocation failure
Jouni Malinen [Sun, 28 Apr 2019 17:52:10 +0000 (20:52 +0300)] 
nl80211: Fix handling of if_indices reallocation failure

Addition of a separate if_indices_reason array broke reallocation
failure checking. drv->if_indices or drv->if_indices_reason could not be
NULL in the place where this check was moved to. Fix that by maintaining
knowledge of reallocation failure in a separate local variable.

Fixes: 732b1d20ec06 ("nl80211: Clean up ifidx properly if interface in a bridge is removed")
Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agoDPP2: Check conn->ctrl more consistently
Jouni Malinen [Sun, 28 Apr 2019 17:28:46 +0000 (20:28 +0300)] 
DPP2: Check conn->ctrl more consistently

There is no point in checking this pointer against NULL after it has
been dereferenced. Move the check to the beginning of the function.

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agoFix a regression in storing of external_auth SSID/BSSID
Jouni Malinen [Sun, 28 Apr 2019 13:24:32 +0000 (16:24 +0300)] 
Fix a regression in storing of external_auth SSID/BSSID

An earlier change in drivers_ops API for struct external_auth broke the
way SSID and BSSID for an external authentication request were stored.
The implementation depended on the memory array being available in the
API struct with a use of memcpy() to copy the full structure even though
when only SSID and BSSID was needed. Fix this by replacing that
easy-to-break storing mechanism with explicit arrays for the exact set
of needed information.

Fixes: dd1a8cef4c05 ("Remove unnecessary copying of SSID and BSSID for external_auth")
Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agotests: FT-EAP and PMKSA caching for initial mobility domain association
Jouni Malinen [Sun, 28 Apr 2019 13:03:03 +0000 (16:03 +0300)] 
tests: FT-EAP and PMKSA caching for initial mobility domain association

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoFT: Allow PMKSA caching to be enabled with FT-EAP
Jouni Malinen [Sun, 28 Apr 2019 13:01:45 +0000 (16:01 +0300)] 
FT: Allow PMKSA caching to be enabled with FT-EAP

The new wpa_supplicant network profile configuration parameter
ft_eap_pmksa_caching=1 can be used to enable use of PMKSA caching with
FT-EAP for FT initial mobility domain association. This is still
disabled by default (i.e., maintaining previous behavior) to avoid
likely interoperability issues.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoFT: Allow cached XXKey/MPMK to be used if new XXKey is not available
Jouni Malinen [Sun, 28 Apr 2019 12:52:43 +0000 (15:52 +0300)] 
FT: Allow cached XXKey/MPMK to be used if new XXKey is not available

This allows authenticator side to complete FT initial mobility domain
association using FT-EAP with PMKSA caching.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoFT: Store XXKey/MPMK in PMKSA cache instead of MSK (authenticator)
Jouni Malinen [Sun, 28 Apr 2019 12:52:08 +0000 (15:52 +0300)] 
FT: Store XXKey/MPMK in PMKSA cache instead of MSK (authenticator)

When completing FT initial mobility domain association with EAP, store
XXKey/MPMK in the PMKSA cache instead of MSK. The previously stored MSK
was of no use since it could not be used as the XXKey for another FT
initial mobility domain association using PMKSA caching.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoFT: Allow cached XXKey/MPMK to be used if new XXKey is not available
Jouni Malinen [Sun, 28 Apr 2019 12:50:51 +0000 (15:50 +0300)] 
FT: Allow cached XXKey/MPMK to be used if new XXKey is not available

This allows supplicant side to complete FT initial mobility domain
association using FT-EAP with PMKSA caching.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoFT: Store XXKey/MPMK in PMKSA cache instead of MSK (supplicant)
Jouni Malinen [Sun, 28 Apr 2019 12:48:58 +0000 (15:48 +0300)] 
FT: Store XXKey/MPMK in PMKSA cache instead of MSK (supplicant)

When completing FT initial mobility domain association with EAP, store
XXKey/MPMK in the PMKSA cache instead of MSK. The previously stored MSK
was of no use since it could not be used as the XXKey for another FT
initial mobility domain association using PMKSA caching.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoRemove unused crypto_bignum_bits()
Jouni Malinen [Fri, 26 Apr 2019 14:43:45 +0000 (17:43 +0300)] 
Remove unused crypto_bignum_bits()

This wrapper function is not needed anymore.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agotests: Update SAE local error tests to match implementation
Jouni Malinen [Fri, 26 Apr 2019 14:36:27 +0000 (17:36 +0300)] 
tests: Update SAE local error tests to match implementation

The change to use a shared dragonfly_generate_scalar() helper function
resulted in failures in sae_no_random and sae_bignum_failure test cases
due to renamed functions and removed uses.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoShare common SAE and EAP-pwd functionality: own scalar generation
Jouni Malinen [Fri, 26 Apr 2019 14:33:44 +0000 (17:33 +0300)] 
Share common SAE and EAP-pwd functionality: own scalar generation

Use a shared helper function for deriving rand, mask, and own scalar.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoIgnore channel switch event if AP interface is not yet ready
Jouni Malinen [Fri, 26 Apr 2019 13:24:31 +0000 (16:24 +0300)] 
Ignore channel switch event if AP interface is not yet ready

It is apparently possible to somehow trigger the driver to report a
channel switch event during ACS operation when the interface information
is not yet complete. hapd->iface->current_mode could be NULL in that
case and that would result in process termination due to NULL pointer
dereference.

It should not really be possible to trigger a channel switch during ACS
is running (i.e., before the AP mode operation has been started), but
since that has been seen in an arbitrary test sequence with interface
start/stop operations with various parameters (both valid and invalid),
better prevent a crash here by ignoring the unexpected event instead of
trying to process it.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoVerify that channel info is available in hostapd_hw_get_channel()
Jouni Malinen [Fri, 26 Apr 2019 13:17:59 +0000 (16:17 +0300)] 
Verify that channel info is available in hostapd_hw_get_channel()

Unexpected CHAN_SWITCH command could get this function using a NULL
pointer if the channel switch was requested while the interface was
already disabled.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoClear cached extended_capa pointers on hapd_deinit() call
Jouni Malinen [Fri, 26 Apr 2019 13:15:15 +0000 (16:15 +0300)] 
Clear cached extended_capa pointers on hapd_deinit() call

driver->hapd_deinit() is going to free the memory that the cached
pointers are pointing to, so clear the pointers to avoid possibility of
dereferencing used memory. It seemed to be possible to hit a code path
using those fields by issuing a CHAN_SWITCH command on disabled hostapd
interface in some cases.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agotests: ieee80211ax=1 in hostapd STATUS
Jouni Malinen [Fri, 26 Apr 2019 12:08:10 +0000 (15:08 +0300)] 
tests: ieee80211ax=1 in hostapd STATUS

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoIndicate ieee80211ax configuration in hostapd STATUS output
Hu Wang [Mon, 22 Apr 2019 07:39:48 +0000 (15:39 +0800)] 
Indicate ieee80211ax configuration in hostapd STATUS output

This adds a ieee80211ax=0/1 line to the STATUS output to indicate
the configuration of ieee80211ax, which similar to ieee80211n and
ieee80211ac.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agotests: Initial and still very minimal HE testing
Jouni Malinen [Thu, 25 Apr 2019 21:18:52 +0000 (00:18 +0300)] 
tests: Initial and still very minimal HE testing

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoHE: Fix he_bss_color documentation
Jouni Malinen [Thu, 25 Apr 2019 21:12:53 +0000 (00:12 +0300)] 
HE: Fix he_bss_color documentation

This field needs to be set to a value within 1-63 range, i.e., 0 is not
a valid value and does not indicate that BSS color is disabled. B7 of
the BSS Color octet is used to indicate that the BSS Color is
_temporarily_ disabled, but that is something that would happen
automatically based on detecting a collision in the used BSS colors and
not something that would be configured.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoHE: Fix HE Operation element byte order on bigendian CPUs
Jouni Malinen [Thu, 25 Apr 2019 20:57:47 +0000 (23:57 +0300)] 
HE: Fix HE Operation element byte order on bigendian CPUs

The first four octets of the element were used as a host byte order u32.
That is not correct on bigendian CPUs, so handle byte swapping needs
properly. Mark the he_oper_params field as le32 to explicitly indicate
the byte order and swap the generated params content based on CPU byte
order.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoHE: Fix HE operation field size
John Crispin [Thu, 25 Apr 2019 14:57:48 +0000 (16:57 +0200)] 
HE: Fix HE operation field size

The current code will always use the size required when all optional
elements are present. This will cause the Linux kernel to consider the
field to be malformed if the elements are not actually flagged as being
present.

Signed-off-by: Shashidhar Lakkavalli <slakkavalli@datto.com>
Signed-off-by: John Crispin <john@phrozen.org>
6 years agotests: Update SAE local error tests to match implementation
Jouni Malinen [Thu, 25 Apr 2019 17:19:11 +0000 (20:19 +0300)] 
tests: Update SAE local error tests to match implementation

The change to use shared dragonfly_get_random_qr_qnr() and
dragonfly_get_rand_1_to_p_1() helper functions resulted in failures in
sae_no_random and sae_bignum_failure test cases due to renamed functions
and removed uses.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoShare common SAE and EAP-pwd functionality: is_quadratic_residue
Jouni Malinen [Thu, 25 Apr 2019 19:35:14 +0000 (22:35 +0300)] 
Share common SAE and EAP-pwd functionality: is_quadratic_residue

Use a shared helper function for the blinded mechanism of determining
the Legendre symbol.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoShare common SAE and EAP-pwd functionality: random 1..p-1 creation
Jouni Malinen [Thu, 25 Apr 2019 17:43:41 +0000 (20:43 +0300)] 
Share common SAE and EAP-pwd functionality: random 1..p-1 creation

Use a shared helper function to create a random value in 1..p-1 range
for is_quadratic_residue().

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoShare common SAE and EAP-pwd functionality: random qr/qnr creation
Jouni Malinen [Thu, 25 Apr 2019 17:18:27 +0000 (20:18 +0300)] 
Share common SAE and EAP-pwd functionality: random qr/qnr creation

Use a shared helper function to create random qr/qnr values.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoShare common SAE and EAP-pwd functionality: suitable groups
Jouni Malinen [Thu, 25 Apr 2019 16:45:27 +0000 (19:45 +0300)] 
Share common SAE and EAP-pwd functionality: suitable groups

Start sharing common SAE and EAP-pwd functionality by adding a new
source code file that can be included into both. This first step is
bringing in a shared function to check whether a group is suitable.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoShare a single buf_shift_right() implementation
Jouni Malinen [Thu, 25 Apr 2019 16:29:39 +0000 (19:29 +0300)] 
Share a single buf_shift_right() implementation

Move the identical function used by both SAE and EAP-pwd to
src/utils/common.c to avoid duplicated implementation.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoOpenSSL: Use BN_bn2binpad() or BN_bn2bin_padded() if available
Jouni Malinen [Thu, 25 Apr 2019 16:23:05 +0000 (19:23 +0300)] 
OpenSSL: Use BN_bn2binpad() or BN_bn2bin_padded() if available

This converts crypto_bignum_to_bin() to use the OpenSSL/BoringSSL
functions BN_bn2binpad()/BN_bn2bin_padded(), when available, to avoid
differences in runtime and memory access patterns depending on the
leading bytes of the BIGNUM value.

OpenSSL 1.0.2 and LibreSSL do not include such functions, so those cases
are still using the previous implementation where the BN_num_bytes()
call may result in different memory access pattern.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoEAP-pwd: Use const_time_memcmp() for pwd_value >= prime comparison
Jouni Malinen [Thu, 25 Apr 2019 16:07:05 +0000 (19:07 +0300)] 
EAP-pwd: Use const_time_memcmp() for pwd_value >= prime comparison

This reduces timing and memory access pattern differences for an
operation that could depend on the used password.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoSAE: Use const_time_memcmp() for pwd_value >= prime comparison
Jouni Malinen [Thu, 25 Apr 2019 15:52:34 +0000 (18:52 +0300)] 
SAE: Use const_time_memcmp() for pwd_value >= prime comparison

This reduces timing and memory access pattern differences for an
operation that could depend on the used password.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoHE: Add Spatial Reuse Parameter Set element to the Beacon frames
John Crispin [Tue, 16 Apr 2019 12:34:01 +0000 (14:34 +0200)] 
HE: Add Spatial Reuse Parameter Set element to the Beacon frames

SPR allows us to detect OBSS overlaps and allows us to do adaptive CCA
thresholds. For this to work the AP needs to broadcast the element
first.

Signed-off-by: Shashidhar Lakkavalli <slakkavalli@datto.com>
Signed-off-by: John Crispin <john@phrozen.org>
6 years agoHE: Properly populate Beacon template prior to sending it to the kernel
John Crispin [Tue, 16 Apr 2019 12:34:00 +0000 (14:34 +0200)] 
HE: Properly populate Beacon template prior to sending it to the kernel

Properly populate the the HE Capabilities element with the info read
from the kernel.

Signed-off-by: Shashidhar Lakkavalli <slakkavalli@datto.com>
Signed-off-by: John Crispin <john@phrozen.org>
6 years agoHE: Fix Operation Parameters order
John Crispin [Tue, 16 Apr 2019 12:33:59 +0000 (14:33 +0200)] 
HE: Fix Operation Parameters order

According to P802.11ax/D4.0 9.4.2.238 (HE Operation element) the BSS
Color Information field is located after the HE Operation Parameters
field. Fix the ordering of the bit masks/offsets for fields in these 3+1
octets used as a single 32-bit value. With these changes, Wireshark 3.2
is able to properly parse and display Beacon frames.

Signed-off-by: Shashidhar Lakkavalli <slakkavalli@datto.com>
Signed-off-by: John Crispin <john@phrozen.org>
6 years agoHE: Disable TXOP duration-based RTS if he_rts_threshold is not set
John Crispin [Tue, 16 Apr 2019 12:33:58 +0000 (14:33 +0200)] 
HE: Disable TXOP duration-based RTS if he_rts_threshold is not set

IEEE P802.11ax/D4.0 9.4.2.243 "HE Operation element" indicates that the
special value 1023 in the TXOP Duration RTS Threshold field is used to
indicate that TXOP duration-based RTS is disabled. Use that value as the
default instead of the previously used value 0 which would really mean
threshold of 0 usec. Furthermore, the previous implementation did not
allow values larger than 255 to be used for this field while the field
is actually 10 bits in size.

Signed-off-by: Shashidhar Lakkavalli <slakkavalli@datto.com>
Signed-off-by: John Crispin <john@phrozen.org>
6 years agonl80211: Add driver HE capabilities parsing support
John Crispin [Tue, 16 Apr 2019 12:33:57 +0000 (14:33 +0200)] 
nl80211: Add driver HE capabilities parsing support

Add code to parse NL80211_BAND_ATTR_IFTYPE_DATA when reading the band
info. This is needed to find out about the local HE capabilities in AP
mode.

Signed-off-by: Shashidhar Lakkavalli <slakkavalli@datto.com>
Signed-off-by: John Crispin <john@phrozen.org>
6 years agonl80211: Remove QCA vendor specific HE capability handling
Jouni Malinen [Thu, 25 Apr 2019 08:41:18 +0000 (11:41 +0300)] 
nl80211: Remove QCA vendor specific HE capability handling

The QCA_NL80211_VENDOR_SUBCMD_GET_HE_CAPABILITIES attributes are not
up-to-date with the latest P802.11ax/D4.0 capabilities and would need to
be updated or replaced. Since the variables from this functionality were
not used for anything in practice, it is easier to simply remove this
functionality completely to avoid issues with upcoming updates to use
upstream nl80211 information to determine HE capabilities.

This is practically reverting the commit ca1ab9db2a9e ("hostapd: Get
vendor HE capabilities").

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agotests: Channel switch started/completed events
Jouni Malinen [Mon, 22 Apr 2019 18:03:07 +0000 (21:03 +0300)] 
tests: Channel switch started/completed events

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agowpa_cli: Make CTRL-EVENT-CHANNEL-SWITCH available to action scripts
Omer Dagan [Mon, 8 Apr 2019 06:45:04 +0000 (06:45 +0000)] 
wpa_cli: Make CTRL-EVENT-CHANNEL-SWITCH available to action scripts

Signed-off-by: Omer Dagan <omer.dagan@tandemg.com>
6 years agoMake channel switch started event available over control interface
Omer Dagan [Mon, 8 Apr 2019 06:44:57 +0000 (06:44 +0000)] 
Make channel switch started event available over control interface

This makes it easier to upper layer components to manage operating
channels in cases where the same radio is shared for both station and AP
mode virtual interfaces.

Signed-off-by: Omer Dagan <omer.dagan@tandemg.com>
6 years agoAdd 802.11 status code strings
Alex Khouderchah [Thu, 18 Apr 2019 18:03:21 +0000 (11:03 -0700)] 
Add 802.11 status code strings

Logs involving IEEE 802.11 Status Codes output the Status Code value,
but do not provide any explanation of what the value means. This change
provides a terse explanation of each status code using the latter part
of the Status Code #define names.

Signed-off-by: Alex Khouderchah <akhouderchah@chromium.org>
6 years agoReplace int status/reason_code with u16 variable
Jouni Malinen [Mon, 22 Apr 2019 17:17:38 +0000 (20:17 +0300)] 
Replace int status/reason_code with u16 variable

These cases are for the IEEE 802.11 Status Code and Reason Code and
those fields are unsigned 16 bit values, so use the more appropriate
type consistently. This is mainly to document the uses and to make the
source code easier to understand.

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agoAdd 802.11 reason code strings into wpa_supplicant messages
Alex Khouderchah [Mon, 15 Apr 2019 19:20:05 +0000 (12:20 -0700)] 
Add 802.11 reason code strings into wpa_supplicant messages

Logs involving IEEE 802.11 Reason Codes output the Reason Code value,
but do not provide any explanation of what the value means. This change
provides a terse explanation of each Reason Code using the latter part
of the reason code #define names.

Signed-off-by: Alex Khouderchah <akhouderchah@chromium.org>
6 years agotests: DPP over TCP using Controller/Relay
Jouni Malinen [Sun, 24 Mar 2019 20:17:49 +0000 (22:17 +0200)] 
tests: DPP over TCP using Controller/Relay

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoDPP2: wpa_supplicant as TCP initiator
Jouni Malinen [Sun, 24 Mar 2019 20:17:49 +0000 (22:17 +0200)] 
DPP2: wpa_supplicant as TCP initiator

A DPP TCP connection can now be initiated directly from wpa_supplicant
with the new new tcp_port and tcp_addr parameters to the DPP_AUTH_INIT
control interface command. This initiates DPP Authentication exchange
over TCP with the specified Controller instead of using DPP Public
Action frames over WLAN.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoDPP2: wpa_supplicant as Controller over TCP
Jouni Malinen [Sun, 24 Mar 2019 20:17:49 +0000 (22:17 +0200)] 
DPP2: wpa_supplicant as Controller over TCP

New wpa_supplicant control interface commands "DPP_CONTROLLER_START
[tcp_port=<port>]" and "DPP_CONTROLLER_STOP" can be used to start and
stop listening to DPP requests over TCP in the Responder role. The TCP
connections are processed similarly to the ones that would have been
received over DPP Public Action frames.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoDPP2: hostapd as TCP Relay
Jouni Malinen [Sun, 24 Mar 2019 20:17:49 +0000 (22:17 +0200)] 
DPP2: hostapd as TCP Relay

The new hostapd configuration parameter dpp_controller can now be used
with the following subparameter values: ipaddr=<IP address>
pkhash=<hexdump>. This adds a new Controller into the configuration
(i.e., more than one can be configured) and all incoming DPP exchanges
that match the specified Controller public key hash are relayed to the
particular Controller.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoDPP2: Protocol exchange over TCP using Controller/Relay
Jouni Malinen [Sun, 24 Mar 2019 20:17:49 +0000 (22:17 +0200)] 
DPP2: Protocol exchange over TCP using Controller/Relay

Add initial implementation of DPP-over-TCP. This adds the general TCP
encapsulation routines into the shared src/common/dpp.c implementation.
That functionality will be exposed through hostapd and wpa_supplicant in
the following commits.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoDPP: Make pkhash available in bootstrapping info
Jouni Malinen [Sun, 24 Mar 2019 20:17:49 +0000 (22:17 +0200)] 
DPP: Make pkhash available in bootstrapping info

This can be helpful for testing DPP2 Controller functionality (get
pkhash from Controller to Relay).

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoDPP: Add configuration structure to dpp_global_init()
Jouni Malinen [Sun, 21 Apr 2019 18:18:24 +0000 (21:18 +0300)] 
DPP: Add configuration structure to dpp_global_init()

This can be used to provide configurable parameter to the global DPP
context. This initial commit introduces the msg_ctx context pointer for
wpa_msg().

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoThe master branch is now used for v2.9 development
Jouni Malinen [Sun, 21 Apr 2019 14:04:07 +0000 (17:04 +0300)] 
The master branch is now used for v2.9 development

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agoPreparations for v2.8 release hostap_2_8
Jouni Malinen [Sun, 21 Apr 2019 07:10:22 +0000 (10:10 +0300)] 
Preparations for v2.8 release

Update the version number for the build and also add the ChangeLog
entries for both hostapd and wpa_supplicant to describe main changes
between v2.7 and v2.8.

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agotests: EAP-IKEV2 server local errors and protocol testing
Jouni Malinen [Sat, 20 Apr 2019 18:00:16 +0000 (21:00 +0300)] 
tests: EAP-IKEV2 server local errors and protocol testing

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agotests: EAP-MD5 server local errors and protocol testing
Jouni Malinen [Sat, 20 Apr 2019 08:28:31 +0000 (11:28 +0300)] 
tests: EAP-MD5 server local errors and protocol testing

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agotests: EAP-PAX server local errors and protocol testing
Jouni Malinen [Fri, 19 Apr 2019 21:20:32 +0000 (00:20 +0300)] 
tests: EAP-PAX server local errors and protocol testing

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agoEAP-PAX server: Fix message length checks for MSGDUMP level hexdump
Jouni Malinen [Fri, 19 Apr 2019 21:19:02 +0000 (00:19 +0300)] 
EAP-PAX server: Fix message length checks for MSGDUMP level hexdump

EAP-PAX server implementation could end up reading beyond the end of the
buffer if MSGDUMP level debugging was enabled and a message without the
ICV field was received. Fix this by using more strict message length
validation.

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agoEAP-PAX server: Check hash function results
Jouni Malinen [Fri, 19 Apr 2019 21:08:00 +0000 (00:08 +0300)] 
EAP-PAX server: Check hash function results

While these local failure cases are mostly theoretical, it is better to
check for the errors explicitly.

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agotests: EAP-PSK server local errors and protocol testing
Jouni Malinen [Fri, 19 Apr 2019 20:46:00 +0000 (23:46 +0300)] 
tests: EAP-PSK server local errors and protocol testing

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agotests: EAP-GPSK server local errors and protocol testing
Jouni Malinen [Fri, 19 Apr 2019 14:09:09 +0000 (17:09 +0300)] 
tests: EAP-GPSK server local errors and protocol testing

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agoEAP-GPSK server: Fix memory freeing on error path
Jouni Malinen [Fri, 19 Apr 2019 14:08:27 +0000 (17:08 +0300)] 
EAP-GPSK server: Fix memory freeing on error path

Allocated struct wpabuf was freed with incorrect freeing function. Fix
this by using the appropriate function.

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agotests: Additional EAP-SAKE peer error path coverage
Jouni Malinen [Fri, 19 Apr 2019 13:57:50 +0000 (16:57 +0300)] 
tests: Additional EAP-SAKE peer error path coverage

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agotests: EAP-SAKE server local errors and protocol testing
Jouni Malinen [Fri, 19 Apr 2019 09:48:13 +0000 (12:48 +0300)] 
tests: EAP-SAKE server local errors and protocol testing

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agoEAP-SAKE: Report hash function failures to callers
Jouni Malinen [Fri, 19 Apr 2019 13:50:42 +0000 (16:50 +0300)] 
EAP-SAKE: Report hash function failures to callers

While this is mostly theoretical, the hash functions can fail and it is
better for the upper layer code to explicitly check for such failures.

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agoEAP-SAKE server: Fix memory freeing on error path
Jouni Malinen [Fri, 19 Apr 2019 13:43:14 +0000 (16:43 +0300)] 
EAP-SAKE server: Fix memory freeing on error path

Allocated struct wpabuf was freed with incorrect freeing function. Fix
this by using the appropriate function.

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agotests: FT and PTK rekeying
Jouni Malinen [Fri, 19 Apr 2019 08:45:27 +0000 (11:45 +0300)] 
tests: FT and PTK rekeying

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agoFT: Derive PTK properly for rekeying with FT protocol
Jouni Malinen [Thu, 18 Apr 2019 15:17:07 +0000 (18:17 +0300)] 
FT: Derive PTK properly for rekeying with FT protocol

Do not try to derive a PMK-R0 and PMK-R1 again for the case where an
association was started with FT protocol and PTK is rekeyed using 4-way
handshake. Instead, use the previously derived PMK-R1 to allow a new PTK
to be derived.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoFT: Do not add bogus PMKID in msg 1/4 for FT protocol PTK rekeying
Jouni Malinen [Thu, 18 Apr 2019 15:17:07 +0000 (18:17 +0300)] 
FT: Do not add bogus PMKID in msg 1/4 for FT protocol PTK rekeying

Do not try to derive a PMKID for EAPOL-key msg 1/4 when going through
4-way handshake to rekey PTK during an association that was started
through FT protocol.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoFT: Maintain PMK-R1 for a connected STA
Jouni Malinen [Thu, 18 Apr 2019 15:17:07 +0000 (18:17 +0300)] 
FT: Maintain PMK-R1 for a connected STA

This is needed to allow PTK rekeying to be performed through 4-way
handshake in an association started through FT protocol.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoWPA: Clear authenticator keys for a STA on deinit/disconnection
Jouni Malinen [Thu, 18 Apr 2019 15:17:07 +0000 (18:17 +0300)] 
WPA: Clear authenticator keys for a STA on deinit/disconnection

Do not leave keys in heap memory after they are no longer needed.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoWPA: Stop WPA statement on STA disassociation
Jouni Malinen [Thu, 18 Apr 2019 15:17:07 +0000 (18:17 +0300)] 
WPA: Stop WPA statement on STA disassociation

This is needed to avoid leaving some timers (e.g., for PTK rekeying)
running afrer a STA has disassociated.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoFT: Start PTK rekey timer on FT protocol completion
Jouni Malinen [Thu, 18 Apr 2019 22:11:41 +0000 (01:11 +0300)] 
FT: Start PTK rekey timer on FT protocol completion

This is needed to trigger PTK rekeying properly for associations started
with FT protocol.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoFT: Remove unused pmk argument from wpa_auth_derive_ptk_ft()
Jouni Malinen [Thu, 18 Apr 2019 21:23:43 +0000 (00:23 +0300)] 
FT: Remove unused pmk argument from wpa_auth_derive_ptk_ft()

FT rules for PTK derivation do not use PMK. Remove the unused argument
to the PTK derivation function.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoFT: Allow 4-way handshake for PTK rekeying to continue without PMK/PMKID
Jouni Malinen [Thu, 18 Apr 2019 21:17:52 +0000 (00:17 +0300)] 
FT: Allow 4-way handshake for PTK rekeying to continue without PMK/PMKID

There is no PMK/PMKID when going through 4-way handshake during an
association started with FT protocol, so need to allow the operation to
proceed even if there is no selected PMKSA cache entry in place.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agotests: PMKSA caching and PTK rekey triggered by AP
Jouni Malinen [Wed, 17 Apr 2019 19:54:41 +0000 (22:54 +0300)] 
tests: PMKSA caching and PTK rekey triggered by AP

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agotests: FILS and PTK rekeying
Jouni Malinen [Wed, 17 Apr 2019 19:54:23 +0000 (22:54 +0300)] 
tests: FILS and PTK rekeying

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoFILS: Fix PTK rekeying
Jouni Malinen [Wed, 17 Apr 2019 19:52:23 +0000 (22:52 +0300)] 
FILS: Fix PTK rekeying

The PMK and PMKID information from FILS ERP and FILS PMKSA caching needs
to be stored within struct wpa_state_machine for PTK to work. Without
this, PTK derivation would fail and attempt to go through rekeying would
result in disconnection. Furthermore, wpa_rekey_ptk() timer needs to be
started at the completion of FILS association since the place where it
was done for non-FILS cases at the end of 4-way handshake is not reached
when FILS authentication is used.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agonl80211: Check nla_put_flag() failure for ext auth
Jouni Malinen [Thu, 18 Apr 2019 18:54:13 +0000 (21:54 +0300)] 
nl80211: Check nla_put_flag() failure for ext auth

All nla_put*() operations should be verified to succeed, so check this
recently added one for NL80211_ATTR_EXTERNAL_AUTH_SUPPORT.

Fixes: 236e793e7b8b ("nl80211: External authentication in driver-based AP SME mode")
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agotests: EAP-pwd protocol testing for the server
Jouni Malinen [Wed, 17 Apr 2019 10:23:56 +0000 (13:23 +0300)] 
tests: EAP-pwd protocol testing for the server

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoEAP-pwd server: Remove unused srandom() call
Jouni Malinen [Tue, 16 Apr 2019 23:04:17 +0000 (02:04 +0300)] 
EAP-pwd server: Remove unused srandom() call

Commit 4b16c15bbc8b ("EAP-pwd server: Use os_get_random() for
unpredictable token") replaced use of os_random(), i.e., of random(),
with os_get_random(), but forgot to remove the now unused srandom()
call. Clean up the implementation and remove that unneeded code.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agotests: EAP-pwd protocol tests - unexpected more-fragment frame
Jouni Malinen [Tue, 16 Apr 2019 23:22:51 +0000 (02:22 +0300)] 
tests: EAP-pwd protocol tests - unexpected more-fragment frame

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoEAP-pwd peer: Fix reassembly buffer handling
Jouni Malinen [Tue, 16 Apr 2019 23:21:20 +0000 (02:21 +0300)] 
EAP-pwd peer: Fix reassembly buffer handling

Unexpected fragment might result in data->inbuf not being allocated
before processing and that could have resulted in NULL pointer
dereference. Fix that by explicitly checking for data->inbuf to be
available before using it.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agotests: EAP-pwd local error cases on server
Jouni Malinen [Tue, 16 Apr 2019 23:01:38 +0000 (02:01 +0300)] 
tests: EAP-pwd local error cases on server

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoEAP-pwd server: Fix reassembly buffer handling
Jouni Malinen [Tue, 16 Apr 2019 22:55:32 +0000 (01:55 +0300)] 
EAP-pwd server: Fix reassembly buffer handling

data->inbuf allocation might fail and if that were to happen, the next
fragment in the exchange could have resulted in NULL pointer
dereference. Unexpected fragment with more bit might also be able to
trigger this. Fix that by explicitly checking for data->inbuf to be
available before using it.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoEAP-pwd server: Fix a memory leak on error path
Jouni Malinen [Tue, 16 Apr 2019 22:28:31 +0000 (01:28 +0300)] 
EAP-pwd server: Fix a memory leak on error path

eap_pwd_h_final() needs to be called to free the value from
eap_pwd_h_init() even in error cases.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agotests: Addition WPS local error case coverage
Jouni Malinen [Tue, 16 Apr 2019 21:55:16 +0000 (00:55 +0300)] 
tests: Addition WPS local error case coverage

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agotests: OWE invalid Association Response frame contents
Jouni Malinen [Tue, 16 Apr 2019 19:37:18 +0000 (22:37 +0300)] 
tests: OWE invalid Association Response frame contents

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agotests: Opportunistic Wireless Encryption - local errors on supplicant
Jouni Malinen [Tue, 16 Apr 2019 19:02:39 +0000 (22:02 +0300)] 
tests: Opportunistic Wireless Encryption - local errors on supplicant

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agotests: WPA2-PSK and local error cases on supplicant
Jouni Malinen [Tue, 16 Apr 2019 18:35:04 +0000 (21:35 +0300)] 
tests: WPA2-PSK and local error cases on supplicant

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agotests: Additional coverage for EAP-MSCHAPv2 local error cases
Jouni Malinen [Tue, 16 Apr 2019 18:25:27 +0000 (21:25 +0300)] 
tests: Additional coverage for EAP-MSCHAPv2 local error cases

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoEAP-MSCHAPv2: Propagate GetAsymetricStartKey() failures up from getKey()
Jouni Malinen [Tue, 16 Apr 2019 18:21:35 +0000 (21:21 +0300)] 
EAP-MSCHAPv2: Propagate GetAsymetricStartKey() failures up from getKey()

Report failure from getKey() if MSK cannot be derived due to unexpected
sha1_vector() local failure.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agotests: Milenage local error cases
Jouni Malinen [Tue, 16 Apr 2019 18:09:50 +0000 (21:09 +0300)] 
tests: Milenage local error cases

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