]> git.ipfire.org Git - thirdparty/hostap.git/log
thirdparty/hostap.git
4 years agoHE: Add TWT responder extended capabilities field
Mikhail Karpenko [Tue, 4 Feb 2020 08:05:41 +0000 (09:05 +0100)] 
HE: Add TWT responder extended capabilities field

Set the proper bits inside the extended capabilities field to indicate
support for TWT responder.

Tested-by: John Crispin <john@phrozen.org>
Signed-off-by: Mikhail Karpenko <karpenko@fastmail.com>
4 years agoHE: Dynamically turn on TWT responder support
John Crispin [Tue, 4 Feb 2020 08:05:40 +0000 (09:05 +0100)] 
HE: Dynamically turn on TWT responder support

This allows us to dynamically turn on TWT responder support using an
nl80211 attribute.

Signed-off-by: John Crispin <john@phrozen.org>
4 years agoHE: Extend BSS color support
John Crispin [Tue, 4 Feb 2020 08:04:54 +0000 (09:04 +0100)] 
HE: Extend BSS color support

The HE Operation field for BSS color consists of a disabled, a partial,
and 6 color bits. The original commit adding support for BSS color
considered this to be a u8. This commit changes this to the actual
bits/values.

This adds an explicit config parameter for the partial bit. The disabled
is set to 0 implicitly if a bss_color is defined.

Interoperability testing showed that stations will require a BSS color
to be set even if the feature is disabled. Hence the default color is 1
when none is defined inside the config file.

Signed-off-by: John Crispin <john@phrozen.org>
4 years agoSync with mac80211-next.git include/uapi/linux/nl80211.h
Jouni Malinen [Sun, 16 Feb 2020 10:05:43 +0000 (12:05 +0200)] 
Sync with mac80211-next.git include/uapi/linux/nl80211.h

This brings in nl80211 definitions as of 2020-02-07.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoWPS: Mark added PSK entry with wps=1 tag for per-Enrollee PSK case
Jouni Malinen [Sun, 16 Feb 2020 09:54:36 +0000 (11:54 +0200)] 
WPS: Mark added PSK entry with wps=1 tag for per-Enrollee PSK case

Commit 2bab073dfe02 ("WPS: Add new PSK entries with wps=1 tag") added
this when writing the new entry into a file, but the in-memory update
did not get the tag. Add it there as well.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: WPS PIN provisioning with per-station PSK preset
Jouni Malinen [Sun, 16 Feb 2020 09:54:30 +0000 (11:54 +0200)] 
tests: WPS PIN provisioning with per-station PSK preset

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: Add basic power saving tests for ap_open
Thomas Pedersen [Wed, 5 Feb 2020 07:13:49 +0000 (23:13 -0800)] 
tests: Add basic power saving tests for ap_open

ap_open_sta_ps checks whether a STA told its hardware to enter power
save after enabling power save.

ap_open_ps_mc_buf checks whether an AP properly buffers and releases
multicast frames when a STA with PS active is associated.

Signed-off-by: Thomas Pedersen <thomas@adapt-ip.com>
4 years agotests: Factor out multicast connectivity check
Thomas Pedersen [Wed, 5 Feb 2020 07:13:48 +0000 (23:13 -0800)] 
tests: Factor out multicast connectivity check

A test may want to check multicast connectivity independent of unicast
or check multicast without exercising unicast first. Factor out the
multicast connectivity check code into its own function.

Signed-off-by: Thomas Pedersen <thomas@adapt-ip.com>
4 years agoFix exception checking in a wpa_supplicant P2P example script
Jouni Malinen [Sat, 15 Feb 2020 15:48:29 +0000 (17:48 +0200)] 
Fix exception checking in a wpa_supplicant P2P example script

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: Fix exception generation in persistent_group_per_sta_psk
Jouni Malinen [Sat, 15 Feb 2020 15:42:14 +0000 (17:42 +0200)] 
tests: Fix exception generation in persistent_group_per_sta_psk

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: Fix a typo in raising an exception
Jouni Malinen [Sat, 15 Feb 2020 15:40:55 +0000 (17:40 +0200)] 
tests: Fix a typo in raising an exception

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: Require wps=1 tag in ap_wps_per_station_psk
Jouni Malinen [Sat, 15 Feb 2020 15:38:22 +0000 (17:38 +0200)] 
tests: Require wps=1 tag in ap_wps_per_station_psk

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoWPS: Add new PSK entries with wps=1 tag
Jouni Malinen [Sat, 15 Feb 2020 15:30:41 +0000 (17:30 +0200)] 
WPS: Add new PSK entries with wps=1 tag

Now that hostapd wpa_psk_file has a new tag for identifying PSKs that
can be used with WPS, add that tag to new entries for PSKs from WPS.
This makes it clearer where the PSK came from and in addition, this
allows the same PSK to be assigned if the same Enrollee goes through WPS
provisioning again.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: Prepare ap_wps_per_station_psk for the new wps=1 tag in PSK file
Jouni Malinen [Sat, 15 Feb 2020 15:37:07 +0000 (17:37 +0200)] 
tests: Prepare ap_wps_per_station_psk for the new wps=1 tag in PSK file

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoWPS: Make it possible to use PSKs loaded from the PSK file
Tomasz Jankowski [Mon, 10 Feb 2020 11:49:33 +0000 (12:49 +0100)] 
WPS: Make it possible to use PSKs loaded from the PSK file

By default, when configuration file set wpa_psk_file, hostapd generated
a random PSK for each Enrollee provisioned using WPS and appended that
PSK to wpa_psk_file.

Changes that behavior by adding a new step. WPS will first try to use a
PSK from wpa_psk_file. It will only try PSKs with wps=1 tag.
Additionally it'll try to match enrollee's MAC address (if provided). If
it fails to find an appropriate PSK, it falls back to generating a new
PSK.

Signed-off-by: Tomasz Jankowski <tomasz.jankowski@plume.com>
4 years agoWPS: Use PMK_LEN instead of hardcoded 32
Jouni Malinen [Sat, 15 Feb 2020 15:27:03 +0000 (17:27 +0200)] 
WPS: Use PMK_LEN instead of hardcoded 32

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoDo not split strings into multiple lines
Jouni Malinen [Sat, 15 Feb 2020 15:12:45 +0000 (17:12 +0200)] 
Do not split strings into multiple lines

Convert hostapd_config_read_wpa_psk() to the newer style of not
splitting strings into multiple lines.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoUse PMK_LEN macro instead of hardcoded value 64 (= 2 * 32)
Jouni Malinen [Sat, 15 Feb 2020 15:11:18 +0000 (17:11 +0200)] 
Use PMK_LEN macro instead of hardcoded value 64 (= 2 * 32)

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoCheck pbkdf2_sha1() result when generating PSK from PSK file
Jouni Malinen [Sat, 15 Feb 2020 15:10:08 +0000 (17:10 +0200)] 
Check pbkdf2_sha1() result when generating PSK from PSK file

This function can fail in theory, so check the return value.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoOWE: Rename owe_assoc_req_process() parameter reason to status
Sergey Matyukevich [Thu, 13 Feb 2020 08:51:23 +0000 (08:51 +0000)] 
OWE: Rename owe_assoc_req_process() parameter reason to status

In the function owe_assoc_req_process(), values assigned to the reason
argument imply that it should be renamed to status. Rename 'reason' to
'status' and modify the uses of owe_assoc_req_process() accordingly.

Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com>
4 years agodoc: Describe Set properties of fi.w1.wpa_supplicant1.Network
Clemens Famulla-Conrad [Fri, 14 Feb 2020 11:02:00 +0000 (12:02 +0100)] 
doc: Describe Set properties of fi.w1.wpa_supplicant1.Network

The current description of Properties of fi.wq.wpa_supplicant1.Network
only apply when retrieving these.
If you need to use the method=Set, then the types should be in the same
format as with function AddNetwork().

Signed-off-by: Clemens Famulla-Conrad <cfamullaconrad@suse.de>
4 years agoAdditional get_sta_info attrs for Beacon/Probe Response/disconnect reasons
Sunil Dutt [Thu, 13 Feb 2020 15:03:11 +0000 (20:33 +0530)] 
Additional get_sta_info attrs for Beacon/Probe Response/disconnect reasons

This commit adds new attributes for getting the Probe Response frame
IEs, Beacon frame IEs and the disconnection reason codes through
get_sta_info vendor command.

The host driver shall give this driver specific reason code through
the disconnection reason code attribute
QCA_WLAN_VENDOR_ATTR_GET_STA_DRIVER_DISCONNECT_REASON.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoIntroduce QCA_NL80211_VENDOR_SUBCMD_DRIVER_DISCONNECT_REASON
Sachin Ahuja [Thu, 13 Feb 2020 12:12:04 +0000 (17:42 +0530)] 
Introduce QCA_NL80211_VENDOR_SUBCMD_DRIVER_DISCONNECT_REASON

This acts as an event from the host driver to the user space to notify
the driver specific reason for a disconnection. The host driver
initiates the disconnection for various scenarios (beacon miss, Tx
Failures, gateway unreachability, etc.) and the reason codes from
cfg80211_disconnected() do not carry these driver specific reason codes.
Host drivers should trigger this event immediately prior to triggering
cfg80211_disconnected() to allow the user space to correlate the driver
specific reason code with the disconnect indication.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoIntroduce QCA_NL80211_VENDOR_SUBCMD_UPDATE_STA_INFO
Sunil Dutt [Sat, 25 Jan 2020 11:39:30 +0000 (17:09 +0530)] 
Introduce QCA_NL80211_VENDOR_SUBCMD_UPDATE_STA_INFO

This acts as a vendor event and is used to update the information
of a station from the driver to userspace.

Add an attribute for the driver to update the channels scanned in
the last connect/roam attempt.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoP2P: Increase number of channels per operating class
Vamsi Krishna [Wed, 12 Feb 2020 09:51:21 +0000 (15:21 +0530)] 
P2P: Increase number of channels per operating class

Some of the operating classes added in the 6 GHz band have a larger
number of channels included in them (e.g., operating class 131 has 59
channels). Increase the maximum number of channels per operating class
so that all channels will get populated.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoP2P: Fix a possible buffer overflow in struct p2p_reg_class
Vamsi Krishna [Wed, 12 Feb 2020 09:44:59 +0000 (15:14 +0530)] 
P2P: Fix a possible buffer overflow in struct p2p_reg_class

Avoid adding more than P2P_MAX_REG_CLASSES operating classes or
P2P_MAX_REG_CLASS_CHANNELS channels while populating P2P channels. The
current limits on the operating classes or channels per operating class
could be hit in some case (mainly, with 6 GHz, but in theory, with a
2.4/5/60 GHz capable device as well).

If the local driver advertised a larger number of supported operarting
classes or channels per operating class, the construction of the struct
p2p_reg_class instances could have resulted in writing beyond the end of
the buffer and ending up corrupting memory around the struct p2p_config.
This could result in unexpected behavior in some other operations that
used corrupted memory, e.g., generation of a P2P Channel List failing
(with validation code stopping the process to avoid writing beyond the
end of the message buffer) due to not having sufficient buffer space for
the corrupted data.

This issue is triggered only based on information from the local driver
(mainly based on addition of support for 6 GHz band operating classes),
so the issue cannot be triggered based on received frames or any other
remote information.

The issue was introduced by commit d7c2c5c98c4f ("AP: Add initial
support for 6 GHz band") which added the operating class 131 which has
sufficiently large number of channels to go beyond the
P2P_MAX_REG_CLASS_CHANNELS limit.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoIntroduce QCA_WLAN_VENDOR_ATTR_BEACON_REPORT_FAIL
Sunil Dutt [Sat, 8 Feb 2020 11:26:15 +0000 (16:56 +0530)] 
Introduce QCA_WLAN_VENDOR_ATTR_BEACON_REPORT_FAIL

This attribute aims to configure the STA to send the Beacon Report
Response with failure reason for the scenarios where the Beacon Report
Request cannot be handled.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agotests: Make gas_anqp_extra_elements more robust
Jouni Malinen [Tue, 11 Feb 2020 05:54:47 +0000 (07:54 +0200)] 
tests: Make gas_anqp_extra_elements more robust

Explicitly flush cfg80211 scan cache for this test case since the BSS
entry check might fail if there are multiple results for the same BSSID.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoDPP: Stop Action frame sequence on DPP_STOP_LISTEN and PKEX failure
Jouni Malinen [Tue, 11 Feb 2020 05:07:22 +0000 (07:07 +0200)] 
DPP: Stop Action frame sequence on DPP_STOP_LISTEN and PKEX failure

Previously it was possible for the PKEX/DPP exchange to terminate with
an error and the ongoing Action frame TX/RX offchannel operation not
getting terminated. This could leave the driver waiting on offchannel
until timeout and failing following operations before that timeout
happens. Fix this by explicitly stopping the Action frame sequence in
the driver in the previously missed cases.

This fixes a case that was showing up with the following test sequence
every now and then:
dpp_qr_code_chan_list_unicast dpp_pkex_test_fail dpp_enrollee_reject_config

dpp_pkex_test_fail was adding a large number of pending offchannel
operations and dpp_enrollee_reject_config could fail if those pending
operations were blocking new remain-on-channel or offchannel TX
operation for a sufficiently long time.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agotests: DPP QR Code and enrollee initiating with netrole specified
Jouni Malinen [Tue, 11 Feb 2020 04:35:15 +0000 (06:35 +0200)] 
tests: DPP QR Code and enrollee initiating with netrole specified

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoDPP: Do not require dpp_configurator_params to start with a space
Jouni Malinen [Tue, 11 Feb 2020 04:41:33 +0000 (06:41 +0200)] 
DPP: Do not require dpp_configurator_params to start with a space

This ugly hack for being able to search for optional arguments with
space before them was quite inconvenient and unexpected. Clean this up
by handling this mess internally with a memory allocation and string
duplication if needed so that the users of wpa_supplicant control
interface do not need to care about such details.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoDPP: Reset DPP_AUTH_INIT netrole back to STA by default
Jouni Malinen [Tue, 11 Feb 2020 04:33:24 +0000 (06:33 +0200)] 
DPP: Reset DPP_AUTH_INIT netrole back to STA by default

Previously DPP_AUTH_INIT command update wpa_s->dpp_netrole only if the
netrole parameter was included. This could leave AP or configurator
network in place for the next DPP_AUTH_INIT command. This would be
unexpected behavior, so reset wpa_s->dpp_netrole back to the
DPP_NETROLE_STA default if no explicit netrole parameter is included.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agotests: wifi_generation on 2.4 GHz with subset of VHT
Jouni Malinen [Tue, 11 Feb 2020 03:12:37 +0000 (05:12 +0200)] 
tests: wifi_generation on 2.4 GHz with subset of VHT

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoAdd check to consider band in enabling connection_vht flag
Veerendranath Jakkam [Mon, 10 Feb 2020 19:34:33 +0000 (01:04 +0530)] 
Add check to consider band in enabling connection_vht flag

connection_vht flag was set to true when both Association Request and
Response frame IEs have VHT capability. Thus all devices that have
support for the vendor specific partial VHT support in the 2.4 GHz band
were also being reported as VHT capable. However, IEEE Std 802.11ac-2013
defines VHT STA to operate in frequency bands below 6 GHz excluding the
2.4 GHz band.

Do not set connection_vht when the operating band is 2.4 GHz. This
avoids reporting wifi_generation 5 on the 2.4 GHz band and reserves the
generation value 5 for full VHT as defined in the IEEE 802.11 standard.

Signed-off-by: Veerendranath Jakkam <vjakkam@codeaurora.org>
4 years agoDefine macro BIT() in qca_vendor.h
Vamsi Krishna [Tue, 4 Feb 2020 17:53:08 +0000 (23:23 +0530)] 
Define macro BIT() in qca_vendor.h

As qca_vendor.h alone can be included by other applications, define
macro BIT() in qca_vendor.h itself if not yet defined, e.g., by
including utils/common.h before qca_vendor.h.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agowlantest: Add PTK derivation support with SAE, OWE, DPP
Jouni Malinen [Mon, 10 Feb 2020 19:58:10 +0000 (21:58 +0200)] 
wlantest: Add PTK derivation support with SAE, OWE, DPP

wlantest build did not define build options to determine key management
values for SAE, OWE, and DPP. Add those and the needed SHA512 functions
to be able to decrypt sniffer captures with PMK available from an
external source.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoSend RM Enabled Capabilities element in (Re)Association Response frame
Markus Theil [Fri, 24 Jan 2020 16:24:53 +0000 (17:24 +0100)] 
Send RM Enabled Capabilities element in (Re)Association Response frame

(Re)Association Response frames should include radio measurement
capabilities in order to let stations know if they can, e.g., use
neighbor requests.

I tested this commit with a Samsung S8, which does not send neighbor
requests without this commit and sends them afterwards.

Signed-off-by: Markus Theil <markus.theil@tu-ilmenau.de>
4 years agoCheck for FT support when selecting FT suites
Matthew Wang [Tue, 4 Feb 2020 01:12:05 +0000 (17:12 -0800)] 
Check for FT support when selecting FT suites

A driver supports FT if it either supports SME or the
NL80211_CMD_UPDATE_FT_IES command. When selecting AKM suites,
wpa_supplicant currently doesn't take into account whether or not either
of those conditions are met. This can cause association failures, e.g.,
when an AP supports both WPA-EAP and FT-EAP but the driver doesn't
support FT (wpa_supplicant will decide to do FT-EAP since it is unaware
the driver doesn't support it). This change allows an FT suite to be
selected only when the driver also supports FT.

Signed-off-by: Matthew Wang <matthewmwang@chromium.org>
Reviewed-by: Brian Norris <briannorris@chromium.org>
4 years agoReplace deprecated readdir_r() with readdir()
Dmitry Shmidt [Tue, 4 Feb 2020 18:27:49 +0000 (18:27 +0000)] 
Replace deprecated readdir_r() with readdir()

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
4 years agotests: SAE Password Identifier with unexpected PWE derivation
Jouni Malinen [Mon, 10 Feb 2020 03:09:19 +0000 (05:09 +0200)] 
tests: SAE Password Identifier with unexpected PWE derivation

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoSAE: Special test mode sae_pwe=3 for looping with password identifier
Jouni Malinen [Mon, 10 Feb 2020 02:59:10 +0000 (04:59 +0200)] 
SAE: Special test mode sae_pwe=3 for looping with password identifier

The new sae_pwe=3 mode can be used to test non-compliant behavior with
SAE Password Identifiers. This can be used to force use of
hunting-and-pecking loop for PWE derivation when Password Identifier is
used. This is not allowed by the standard and as such, this
functionality is aimed at compliance testing.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agotests: sigma_dut fetching the current PMK
Jouni Malinen [Sun, 9 Feb 2020 18:16:45 +0000 (20:16 +0200)] 
tests: sigma_dut fetching the current PMK

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agotests: GET_PMK and PMKSA_GET match
Jouni Malinen [Mon, 10 Feb 2020 00:35:53 +0000 (02:35 +0200)] 
tests: GET_PMK and PMKSA_GET match

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoAdd GET_PMK for fetching the current PMK for a STA from hostapd
Jouni Malinen [Mon, 10 Feb 2020 00:19:52 +0000 (02:19 +0200)] 
Add GET_PMK for fetching the current PMK for a STA from hostapd

This test functionality (CONFIG_TESTING_OPTIONS=y) can be used to fetch
the current PMK for a STA.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoSAE: Verify that appropriate Status Code is used in SAE commit (SME)
Jouni Malinen [Sat, 8 Feb 2020 01:36:13 +0000 (03:36 +0200)] 
SAE: Verify that appropriate Status Code is used in SAE commit (SME)

Previous version accepted both 0 and 126 values in SAE commit message
from the AP. Explicitly check that the value the AP uses matches what
the STA started with to avoid unexpected cases.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoDPP: Fix encryptedContent DER encoding
Jouni Malinen [Fri, 7 Feb 2020 23:28:46 +0000 (01:28 +0200)] 
DPP: Fix encryptedContent DER encoding

This was not supposed to set the constructed bit in the header. Fix this
to avoid parsing issues with other ASN.1 DER parsers.

Fixes: c025c2eb5911 ("DPP: DPPEnvelopedData generation for Configurator backup")
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agotests: SAE anti clogging (forced, H2E + loop)
Jouni Malinen [Fri, 7 Feb 2020 23:26:40 +0000 (01:26 +0200)] 
tests: SAE anti clogging (forced, H2E + loop)

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agotests: WPA2-PSK-FT-SAE AP (AP H2E, STA loop)
Jouni Malinen [Fri, 7 Feb 2020 21:34:20 +0000 (23:34 +0200)] 
tests: WPA2-PSK-FT-SAE AP (AP H2E, STA loop)

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoDPP: Try to negotiate different parameters if NFC handover fails
Jouni Malinen [Thu, 6 Feb 2020 21:47:54 +0000 (23:47 +0200)] 
DPP: Try to negotiate different parameters if NFC handover fails

This is mainly for NFC testing purposes now since the own DPP parameters
are not yet updated.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoDPP: Allow local channel list to be set
Jouni Malinen [Thu, 6 Feb 2020 21:22:39 +0000 (23:22 +0200)] 
DPP: Allow local channel list to be set

The new dpp-nfc.py command line argument --chan can be used to replace
the local channel list default (81/1).

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agotests: sigma_dut and DPP Configurator provisioning
Jouni Malinen [Thu, 6 Feb 2020 02:20:13 +0000 (04:20 +0200)] 
tests: sigma_dut and DPP Configurator provisioning

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agotests: Configurator provisioning test cases to use conf=configurator
Jouni Malinen [Thu, 6 Feb 2020 01:35:54 +0000 (03:35 +0200)] 
tests: Configurator provisioning test cases to use conf=configurator

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoDPP: Require conf=configurator to allow Configurator provisioning
Jouni Malinen [Thu, 6 Feb 2020 01:34:36 +0000 (03:34 +0200)] 
DPP: Require conf=configurator to allow Configurator provisioning

Make Configurator provisioning require explicit conf parameter enabling
similarly to the previously used conf=ap-* and conf=sta-* cases.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agotests: dpp_pkex_alloc_fail to match implementation change
Jouni Malinen [Thu, 6 Feb 2020 01:46:17 +0000 (03:46 +0200)] 
tests: dpp_pkex_alloc_fail to match implementation change

The new dpp_alloc_auth() function addition changed function call
backtraces for memory allocation failure tests.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoDPP: Initialize conf_resp_status to non-OK
Jouni Malinen [Wed, 5 Feb 2020 23:18:58 +0000 (01:18 +0200)] 
DPP: Initialize conf_resp_status to non-OK

This avoids unexpected behavior if GAS query fails and the Config
Response does not get processed at all. Previously, this could result in
configuration being assumed to be successful instead of failure when
Config Response object was not received at all. That could result in
undesired Config Result frame transmission with DPP Rel 2 and not
clearing the ongoing DPP session.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agotests: DPP and duplicated Authentication Confirmation
Jouni Malinen [Wed, 5 Feb 2020 22:33:27 +0000 (00:33 +0200)] 
tests: DPP and duplicated Authentication Confirmation

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoDPP: Ignore unexpected duplicated Authentication Confirm
Jouni Malinen [Wed, 5 Feb 2020 22:29:39 +0000 (00:29 +0200)] 
DPP: Ignore unexpected duplicated Authentication Confirm

Previously, unexpected Authentication Confirm messages were ignored in
cases where no Authentication Confirm message was expected at all, but
if this message was received twice in a state where it was expected, the
duplicated version was also processed. This resulted in unexpected
behavior when authentication result was processed multiple times (e.g.,
two instances of GAS client could have been started).

Fix this by checking auth->waiting_auth_conf before processing
Authetication Confirm. That boolean was already tracked, but it was used
only for other purposes.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoSAE: Fix peer-commit-scalar reuse check
Jouni Malinen [Wed, 5 Feb 2020 00:06:27 +0000 (02:06 +0200)] 
SAE: Fix peer-commit-scalar reuse check

Only one peer-commit-scalar value was stored for a specific STA (i.e.,
one per MAC address) and that value got replaced when the next SAE
Authentication exchange was started. This ended up breaking the check
against re-use of peer-commit-scalar from an Accepted instance when
anti-clogging token was requested. The first SAE commit message (the one
without anti-clogging token) ended up overwriting the cached
peer-commit-scalar value while leaving that instance in Accepted state.
The second SAE commit message (with anti-clogging token) added ended up
getting rejected if it used the same value again (and re-use is expected
in this particular case where the value was not used in Accepted
instance).

Fix this by using a separate pointer for storing the peer-commit-scalar
value that was used in an Accepted instance. There is no need to
allocate memory for two values, i.e., it is sufficient to maintain
separate pointers to the value and move the stored value to the special
Accepted state pointer when moving to the Accepted state.

This fixes issues where a peer STA ends up running back-to-back SAE
authentication within couple of seconds, i.e., without hostapd timing
out the STA entry for a case where anti-clogging token is required.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agotests: Fix fuzzing/asn1 build
Jouni Malinen [Mon, 3 Feb 2020 15:45:06 +0000 (17:45 +0200)] 
tests: Fix fuzzing/asn1 build

asn1.c needs wpabuf.c to be included now.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agotests: ACS with both HT40+ and HT40- allowed
Jouni Malinen [Sun, 2 Feb 2020 18:15:21 +0000 (20:15 +0200)] 
tests: ACS with both HT40+ and HT40- allowed

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoUse secondary channel provided by ACS for HT40 if valid
Qiwei Cai [Sun, 19 Jan 2020 02:37:26 +0000 (10:37 +0800)] 
Use secondary channel provided by ACS for HT40 if valid

Previously, hostapd ignored the secondary channel provided by ACS if
both HT40+ and HT40- are set in hostapd.conf. This change selects such
channel for HT40 if it's valid, which is more reasonable.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agotests: Replace tabs with spaces in python indentation
Jouni Malinen [Sun, 2 Feb 2020 19:14:59 +0000 (21:14 +0200)] 
tests: Replace tabs with spaces in python indentation

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agotests: WMM IE contents in FCC and ETSI
Jouni Malinen [Sun, 2 Feb 2020 20:47:33 +0000 (22:47 +0200)] 
tests: WMM IE contents in FCC and ETSI

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoFix wmm compile on fedora-17 (gcc 4.7.2)
Ben Greear [Tue, 21 Jan 2020 20:09:26 +0000 (12:09 -0800)] 
Fix wmm compile on fedora-17 (gcc 4.7.2)

I guess this compiler does not like to initialize arrays with brackets?

Signed-off-by: Ben Greear <greearb@candelatech.com>
4 years agonl80211: Fix regulatory limits for WMM cwmin/cwmax values
Felix Fietkau [Thu, 23 Jan 2020 13:13:33 +0000 (14:13 +0100)] 
nl80211: Fix regulatory limits for WMM cwmin/cwmax values

The internal WMM AC parameters use just the exponent of the CW value,
while nl80211 reports the full CW value. This led to completely bogus
CWmin/CWmax values in the WMM IE when a regulatory limit was present.
Fix this by converting the value to the exponent before passing it on.

Fixes: 636c02c6e9 ("nl80211: Add regulatory wmm_limit to hostapd_channel_data")
Signed-off-by: Felix Fietkau <nbd@nbd.name>
4 years agonl80211: Fix WMM queue mapping for regulatory limit
Felix Fietkau [Thu, 23 Jan 2020 13:13:32 +0000 (14:13 +0100)] 
nl80211: Fix WMM queue mapping for regulatory limit

nl80211 uses a different queue mapping from hostap, so AC indexes need
to be converted.

Fixes: 636c02c6e9 ("nl80211: Add regulatory wmm_limit to hostapd_channel_data")
Signed-off-by: Felix Fietkau <nbd@nbd.name>
4 years agoscan_est_throughput: Use ie_len instead of res->ie_len
Matthew Wang [Thu, 23 Jan 2020 22:18:17 +0000 (14:18 -0800)] 
scan_est_throughput: Use ie_len instead of res->ie_len

Local variable should be used. This fixes an issue where IEs are
available only from a Beacon frame.

Fixes: ad06ac0b0 ("Move throughput estimation into a helper function")
Signed-off-by: Matthew Wang <matthewmwang@chromium.org>
4 years agoBSD: Fix the maximum size of a route(4) msg to 2048
Roy Marples [Wed, 29 Jan 2020 12:11:05 +0000 (12:11 +0000)] 
BSD: Fix the maximum size of a route(4) msg to 2048

The size of a single route(4) message cannot be derived from
either the size of the AF_INET or AF_INET6 routing tables.
Both could be empty or very large.

As such revert back to a buffer size of 2048 which mirrors
other programs which parse the routing socket.

Signed-off-by: Roy Marples <roy@marples.name>
4 years agoBSD: Remove an outdated comment
Roy Marples [Tue, 28 Jan 2020 16:58:29 +0000 (16:58 +0000)] 
BSD: Remove an outdated comment

With interface matching support, wpa_supplicant can wait for an
interface to appear.

Signed-off-by: Roy Marples <roy@marples.name>
4 years agoBSD: Don't set or remove IFF_UP
Roy Marples [Tue, 28 Jan 2020 16:58:28 +0000 (16:58 +0000)] 
BSD: Don't set or remove IFF_UP

Now that both hostapd and wpa_supplicant react to interface flag
changes, there is no need to set or remove IFF_UP.

It should be an administrative flag only.

Signed-off-by: Roy Marples <roy@marples.name>
4 years agoBSD: Share route(4) processing with hostapd and wpa_supplicant.
Roy Marples [Tue, 28 Jan 2020 16:58:27 +0000 (16:58 +0000)] 
BSD: Share route(4) processing with hostapd and wpa_supplicant.

There is little point in having both and it brings interface
addition/removal and IFF_UP notifications to hostapd.

Signed-off-by: Roy Marples <roy@marples.name>
4 years agoBSD: Driver does not need to know about both wpa and hostap contexts
Roy Marples [Tue, 28 Jan 2020 16:58:26 +0000 (16:58 +0000)] 
BSD: Driver does not need to know about both wpa and hostap contexts

It will either be one or the other.
Fold hapd into ctx to match other drivers.

Signed-off-by: Roy Marples <roy@marples.name>
4 years agonl80211: Fix send_mlme for SAE external auth
Ouden [Thu, 30 Jan 2020 09:08:14 +0000 (17:08 +0800)] 
nl80211: Fix send_mlme for SAE external auth

When external authentication is used, the station send mlme frame (auth)
to the driver may not be able to get the frequency (bss->freq) after
hostap.git commit b6f8b5a9 ("nl80211: Update freq only when CSA
completes"). Use the assoc_freq to send the MLME frame when SAE external
authentication is used to avoid this issue.

Signed-off-by: Ouden <Ouden.Biz@gmail.com>
4 years agotests: Remove tabs
Johannes Berg [Fri, 31 Jan 2020 08:37:59 +0000 (09:37 +0100)] 
tests: Remove tabs

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
4 years agoAdditional stats through QCA_NL80211_VENDOR_SUBCMD_GET_STA_INFO
Sunil Dutt [Mon, 27 Jan 2020 15:02:58 +0000 (20:32 +0530)] 
Additional stats through QCA_NL80211_VENDOR_SUBCMD_GET_STA_INFO

This commit introduces additional stats to query through
QCA_NL80211_VENDOR_SUBCMD_UPDATE_STA_INFO.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agotests: DPP Configurator provisioning
Jouni Malinen [Thu, 12 Dec 2019 00:17:02 +0000 (02:17 +0200)] 
tests: DPP Configurator provisioning

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoDPP: DPPEnvelopedData generation for Configurator backup
Jouni Malinen [Thu, 12 Dec 2019 00:28:39 +0000 (02:28 +0200)] 
DPP: DPPEnvelopedData generation for Configurator backup

This adds support for generating an encrypted backup of the local
Configurator information for the purpose of enrolling a new
Configurator. This includes all ASN.1 construction and data encryption,
but the configuration and connector template values in
dpp_build_conf_params() are not yet complete.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoDPP: Received Configurator backup processing
Jouni Malinen [Thu, 30 Jan 2020 21:56:31 +0000 (23:56 +0200)] 
DPP: Received Configurator backup processing

Add local Configurator instance for each received Configurator backup.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoDPP: DPPEnvelopedData parsing for Configurator backup/restore
Jouni Malinen [Thu, 12 Dec 2019 00:28:39 +0000 (02:28 +0200)] 
DPP: DPPEnvelopedData parsing for Configurator backup/restore

Process the received DPPEnvelopedData when going through Configurator
provisioning as the Enrollee (the new Configurator). This parses the
message, derives the needed keys, and decrypts the Configurator
parameters. This commit stores the received information in
auth->conf_key_pkg, but the actually use of that information to create a
new Configurator instance will be handled in a separate commit.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoDPP: Add ASN.1 support into build
Jouni Malinen [Thu, 12 Dec 2019 00:28:39 +0000 (02:28 +0200)] 
DPP: Add ASN.1 support into build

This will be needed in following patches to process DPPEnvelopedData.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoASN.1: Helper functions for building DER encoded data
Jouni Malinen [Fri, 31 Jan 2020 13:28:25 +0000 (15:28 +0200)] 
ASN.1: Helper functions for building DER encoded data

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoASN.1: More OID definitions
Jouni Malinen [Fri, 31 Jan 2020 15:10:48 +0000 (17:10 +0200)] 
ASN.1: More OID definitions

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoASN.1: Add a helper for parsing AlgorithmIdentifier
Jouni Malinen [Thu, 30 Jan 2020 13:04:03 +0000 (15:04 +0200)] 
ASN.1: Add a helper for parsing AlgorithmIdentifier

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoASN.1: Add a helper for parsing SEQUENCE
Jouni Malinen [Thu, 30 Jan 2020 10:11:51 +0000 (12:11 +0200)] 
ASN.1: Add a helper for parsing SEQUENCE

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoASN.1: Add a helper for parsing INTEGER
Jouni Malinen [Thu, 12 Dec 2019 00:28:39 +0000 (02:28 +0200)] 
ASN.1: Add a helper for parsing INTEGER

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoDPP2: Add Protocol Version attr to Auth Resp only if peer is R2 or newer
Jouni Malinen [Tue, 28 Jan 2020 22:58:33 +0000 (00:58 +0200)] 
DPP2: Add Protocol Version attr to Auth Resp only if peer is R2 or newer

There is no need for the Protocol Version attribute in Authentication
Response if the peer is a DPP R1 device since such device would not know
how to use this attribute. To reduce risk for interoperability issues,
add this new attribute only if the peer included it in Authentication
Request.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoAdd a vendor attribute for RTPL instance primary frequency
Krishna Rao [Tue, 14 Jan 2020 12:46:55 +0000 (18:16 +0530)] 
Add a vendor attribute for RTPL instance primary frequency

Add an attribute QCA_WLAN_VENDOR_ATTR_RTPLINST_PRIMARY_FREQUENCY for
primary channel center frequency in the definition for Representative
Tx Power List (RTPL) list entry instance. This is required for 6 GHz
support, since the 6 GHz channel numbers overlap with existing 2.4 GHz
and 5 GHz channel numbers thus requiring frequency values to uniquely
identify channels.

Mark QCA_WLAN_VENDOR_ATTR_RTPLINST_PRIMARY as deprecated if both the
driver and user space application support 6 GHz. For backward
compatibility, QCA_WLAN_VENDOR_ATTR_RTPLINST_PRIMARY is still used if
either the driver or user space application or both do not support the
6 GHz band.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoTLS: Fix bounds checking in certificate policy parser
Jouni Malinen [Tue, 28 Jan 2020 12:17:52 +0000 (14:17 +0200)] 
TLS: Fix bounds checking in certificate policy parser

The recent addition of the X.509v3 certificatePolicies parser had a
copy-paste issue on the inner SEQUENCE parser that ended up using
incorrect length for the remaining buffer. Fix that to calculate the
remaining length properly to avoid reading beyond the end of the buffer
in case of corrupted input data.

Credit to OSS-Fuzz: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=20363
Fixes: d165b32f3887 ("TLS: TOD-STRICT and TOD-TOFU certificate policies")
Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoDPP: Example script for NFC bootstrapping method
Jouni Malinen [Mon, 27 Jan 2020 19:39:54 +0000 (21:39 +0200)] 
DPP: Example script for NFC bootstrapping method

This Python script is an example on how nfcpy can be used to drive an
NFC Device to perform DPP bootstrapping operations over DPP (tag with
NFC URI and negotiated connection handover).

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agotests: DPP bootstrapping via NFC negotiated handover
Jouni Malinen [Mon, 27 Jan 2020 15:04:12 +0000 (17:04 +0200)] 
tests: DPP bootstrapping via NFC negotiated handover

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoDPP: Show selected negotiation channel in DPP_BOOTSTRAP_INFO
Jouni Malinen [Mon, 27 Jan 2020 15:31:10 +0000 (17:31 +0200)] 
DPP: Show selected negotiation channel in DPP_BOOTSTRAP_INFO

Make the selected channel available for upper layer software to use,
e.g., when starting DPP listen operation during NFC negotiated
connection handover.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoDPP: NFC negotiated connection handover
Jouni Malinen [Mon, 27 Jan 2020 15:04:26 +0000 (17:04 +0200)] 
DPP: NFC negotiated connection handover

Add new control interface commands "DPP_NFC_HANDOVER_REQ own=<id>
uri=<URI>" and "DPP_NFC_HANDOVER_SEL own=<id> uri=<URI>" to support NFC
negotiated connection handover. These commands are used to report a DPP
URI received from a peer NFC Device in Handover Request and Handover
Select messages. The commands return peer bootstrapping information ID
or FAIL on failure. The returned ID is used similarly to any other
bootstrapping information to initiate DPP authentication.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoDPP: Helper function for bootstrapping URI generation
Jouni Malinen [Mon, 27 Jan 2020 15:04:26 +0000 (17:04 +0200)] 
DPP: Helper function for bootstrapping URI generation

The new dpp_gen_uri() helper function can be used to build the
bootstrapping URI from locally stored information. This can be used to
make it easier to update the URI, e.g., for NFC negotiated connection
handover cases.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agotests: Fix eap_proto_ttls_errors with CONFIG_TLS=internal
Jouni Malinen [Sun, 26 Jan 2020 15:09:50 +0000 (17:09 +0200)] 
tests: Fix eap_proto_ttls_errors with CONFIG_TLS=internal

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agocrypto: Allow up to 10 fragments for hmac_sha*_vector()
Jouni Malinen [Sun, 26 Jan 2020 15:04:54 +0000 (17:04 +0200)] 
crypto: Allow up to 10 fragments for hmac_sha*_vector()

This increases the limit of how many data fragments can be supported
with the internal HMAC implementation. The previous limit was hit with
some FT use cases.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: Check for domain_suffix_match in HS 2.0 PPS MO testing
Jouni Malinen [Sun, 26 Jan 2020 14:56:06 +0000 (16:56 +0200)] 
tests: Check for domain_suffix_match in HS 2.0 PPS MO testing

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: Check for TLS EC support in build
Jouni Malinen [Sun, 26 Jan 2020 14:54:07 +0000 (16:54 +0200)] 
tests: Check for TLS EC support in build

These test cases need to be skipped with CONFIG_TLS=internal.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: Check for TLS library capabilities in sigma_dut test cases
Jouni Malinen [Sun, 26 Jan 2020 14:50:20 +0000 (16:50 +0200)] 
tests: Check for TLS library capabilities in sigma_dut test cases

These test cases cannot be run with CONFIG_TLS=internal.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoTLS: TOD-STRICT and TOD-TOFU certificate policies
Jouni Malinen [Sun, 26 Jan 2020 14:44:49 +0000 (16:44 +0200)] 
TLS: TOD-STRICT and TOD-TOFU certificate policies

Add parsing of certificate policies for TOD-STRICT and TOD-TOFU when
using CONFIG_TLS=internal.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: Recognize more test SKIP reasons
Jouni Malinen [Sun, 26 Jan 2020 14:03:31 +0000 (16:03 +0200)] 
tests: Recognize more test SKIP reasons

Signed-off-by: Jouni Malinen <j@w1.fi>