]> git.ipfire.org Git - thirdparty/hostap.git/log
thirdparty/hostap.git
5 years agonl80211: Tie connect handle to bss init/destroy
Markus Theil [Sat, 11 Apr 2020 10:25:21 +0000 (12:25 +0200)] 
nl80211: Tie connect handle to bss init/destroy

This commit creates a connect nl_sock * for every bss unconditionally.
It is used in the next commit for nl80211 control port RX.

Signed-off-by: Markus Theil <markus.theil@tu-ilmenau.de>
5 years agonl80211: Handle control port frame in bss events
Markus Theil [Sat, 11 Apr 2020 10:25:19 +0000 (12:25 +0200)] 
nl80211: Handle control port frame in bss events

In order to work in AP mode, handle control port frame RX as per bss
event.

Signed-off-by: Markus Theil <markus.theil@tu-ilmenau.de>
5 years agonl80211: Check ethertype for control port RX
Markus Theil [Sat, 11 Apr 2020 10:25:18 +0000 (12:25 +0200)] 
nl80211: Check ethertype for control port RX

nl80211 control port event handling previously did not differentiate
between EAPOL and RSN preauth ethertypes. Add checking of the ethertype
and report unexpected frames (only EAPOL frames are supposed to be
delivered through this path).

Signed-off-by: Markus Theil <markus.theil@tu-ilmenau.de>
5 years agonl80211: Add a separate driver capability for control port RX
Jouni Malinen [Sun, 19 Apr 2020 09:30:55 +0000 (12:30 +0300)] 
nl80211: Add a separate driver capability for control port RX

This is needed since the initial implementation of the control port
mechanism in the kernel mixed in RSN pre-authentication ethertype
unconditionally (and IMHO, incorrectly) into the control port.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agodriver: Add second driver capability flags bitmap
Jouni Malinen [Sun, 19 Apr 2020 09:29:00 +0000 (12:29 +0300)] 
driver: Add second driver capability flags bitmap

All 64 bits of the capability flags bitmap are used, so add a new
variable to hold future capability bits.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: Move csa_supported() into utils.py
Jouni Malinen [Sat, 18 Apr 2020 08:31:49 +0000 (11:31 +0300)] 
tests: Move csa_supported() into utils.py

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: Move clear_scan_cache() and set_world_reg() to utils.py
Jouni Malinen [Sat, 18 Apr 2020 08:12:54 +0000 (11:12 +0300)] 
tests: Move clear_scan_cache() and set_world_reg() to utils.py

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: Move vht_supported() into utils.py
Jouni Malinen [Sat, 18 Apr 2020 08:09:36 +0000 (11:09 +0300)] 
tests: Move vht_supported() into utils.py

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: Move check_sae_capa() into utils.py
Jouni Malinen [Sat, 18 Apr 2020 08:07:33 +0000 (11:07 +0300)] 
tests: Move check_sae_capa() into utils.py

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: Move check_wep_capa() into utils.py
Jouni Malinen [Sat, 18 Apr 2020 08:05:49 +0000 (11:05 +0300)] 
tests: Move check_wep_capa() into utils.py

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: Use function decorator to clean up --long processing
Jouni Malinen [Sat, 18 Apr 2020 08:00:49 +0000 (11:00 +0300)] 
tests: Use function decorator to clean up --long processing

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: ap_wps_reg_config_tkip to allow no-TKIP hostapd build
Jouni Malinen [Fri, 17 Apr 2020 19:07:03 +0000 (22:07 +0300)] 
tests: ap_wps_reg_config_tkip to allow no-TKIP hostapd build

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoWPS: Convert WPA/TKIP-only to WPA+WPA2 mixed mode credential
Jouni Malinen [Fri, 17 Apr 2020 19:05:07 +0000 (22:05 +0300)] 
WPS: Convert WPA/TKIP-only to WPA+WPA2 mixed mode credential

This case of accepting WPA/TKIP-only credential based on internal
registrar request to configure an AP to use TKIP was still remaining
while all the WPS cases were supposed to enable mixed mode
automatically. This is bit of a corner case since this is based on
explicit local request to configure TKIP, but anyway, convert this one
as well to allow WPA2/CCMP to be used.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: Use SAE instead of WPA/TKIP in ap_multi_bss_acs
Jouni Malinen [Fri, 17 Apr 2020 18:55:18 +0000 (21:55 +0300)] 
tests: Use SAE instead of WPA/TKIP in ap_multi_bss_acs

This makes the test case work with no-TKIP hostapd builds.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: ap_wpa2_eap_assoc_rsn to allow TKIP-disabled hostapd build
Jouni Malinen [Fri, 17 Apr 2020 18:51:26 +0000 (21:51 +0300)] 
tests: ap_wpa2_eap_assoc_rsn to allow TKIP-disabled hostapd build

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: ap_wps_init to allow TKIP-disabled hostapd build
Jouni Malinen [Fri, 17 Apr 2020 18:46:12 +0000 (21:46 +0300)] 
tests: ap_wps_init to allow TKIP-disabled hostapd build

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: Skip test cases where hostapd does not support TKIP
Jouni Malinen [Fri, 17 Apr 2020 15:16:13 +0000 (18:16 +0300)] 
tests: Skip test cases where hostapd does not support TKIP

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: Skip more tests based on missing TKIP support
Jouni Malinen [Fri, 17 Apr 2020 13:07:24 +0000 (16:07 +0300)] 
tests: Skip more tests based on missing TKIP support

This makes it more convenient to run tests with builds that disable
TKIP/WPA(v1) support completely.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: Do not enable TKIP group cipher for FT tests without need
Jouni Malinen [Fri, 17 Apr 2020 13:06:25 +0000 (16:06 +0300)] 
tests: Do not enable TKIP group cipher for FT tests without need

Change run_roams() default to CCMP-only and enable TKIP only in the test
case that needs this.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoAllow TKIP support to be removed from build
Disha Das [Thu, 9 Apr 2020 04:12:21 +0000 (09:42 +0530)] 
Allow TKIP support to be removed from build

Add a build flag CONFIG_NO_TKIP=y to remove all TKIP functionality from
hostapd and wpa_supplicant builds. This disables use of TKIP as both the
pairwise and group cipher. The end result does not interoperate with a
WPA(v1)-only device or WPA+WPA2 mixed modes.

Signed-off-by: Disha Das <dishad@codeaurora.org>
5 years agotests: sigma_dut controlled AP with FT and RSNXE Used mismatch
Jouni Malinen [Thu, 16 Apr 2020 20:58:36 +0000 (23:58 +0300)] 
tests: sigma_dut controlled AP with FT and RSNXE Used mismatch

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: FT-SAE AP and unexpected RSNXE Used in ReassocResp
Jouni Malinen [Thu, 16 Apr 2020 20:24:06 +0000 (23:24 +0300)] 
tests: FT-SAE AP and unexpected RSNXE Used in ReassocResp

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoFT: Testing override for RSNXE Used subfield in FTE (AP)
Jouni Malinen [Thu, 16 Apr 2020 20:22:57 +0000 (23:22 +0300)] 
FT: Testing override for RSNXE Used subfield in FTE (AP)

Allow hostapd to be requested to override the RSNXE Used subfield in FT
reassociation case for testing purposes with "ft_rsnxe_used=<0/1/2>"
where 0 = no override, 1 = override to 1, and 2 = override to 0.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: sigma_dut controlled FT protocol with RSNXE Used mismatch
Jouni Malinen [Wed, 15 Apr 2020 10:55:28 +0000 (13:55 +0300)] 
tests: sigma_dut controlled FT protocol with RSNXE Used mismatch

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agonl80211: Remove unnecessary inclusion of l2_packet.h
Jouni Malinen [Tue, 14 Apr 2020 16:23:09 +0000 (19:23 +0300)] 
nl80211: Remove unnecessary inclusion of l2_packet.h

The only l2_packet use within this file was removed by commit
d12dab4c6f9e ("nl80211: Use non-receiving socket for EAPOL TX").

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: FT-SAE AP and unexpected RSNXE Used in ReassocReq
Jouni Malinen [Tue, 14 Apr 2020 10:50:53 +0000 (13:50 +0300)] 
tests: FT-SAE AP and unexpected RSNXE Used in ReassocReq

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoFT: Testing override for RSNXE Used subfield in FTE
Jouni Malinen [Tue, 14 Apr 2020 10:48:43 +0000 (13:48 +0300)] 
FT: Testing override for RSNXE Used subfield in FTE

Allow wpa_supplicant to be requested to override the RSNXE Used subfield
in FT reassociation case for testing purposes with "SET ft_rsnxe_used
<0/1/2>" where 0 = no override, 1 = override to 1, and 2 = override to
0.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoFT: Discard ReassocReq with mismatching RSNXE Used value
Jouni Malinen [Tue, 14 Apr 2020 10:46:00 +0000 (13:46 +0300)] 
FT: Discard ReassocReq with mismatching RSNXE Used value

Discard the FT Reassociation Request frame instead of rejecting it
(i.e., do not send Reassociation Response frame) if RSNXE Used is
indicated in FTE, but no RSNXE is included even though the AP is
advertising RSNXE.

While there is not really much of a difference between discarding and
rejecting the frame, this discarding behavior is what the standard says
for this type of an error case.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: AP may discard FT ReassocReq in ap_ft_sae_h2e_downgrade_attack
Jouni Malinen [Tue, 14 Apr 2020 13:36:07 +0000 (16:36 +0300)] 
tests: AP may discard FT ReassocReq in ap_ft_sae_h2e_downgrade_attack

This is in preparation for a hostapd implementation change on how to
address the unexpected RSNXE Used field value in FTE during FT
reassociation.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoAdd vendor attributes indicating number of spectral detectors
Edayilliam Jayadev [Fri, 27 Mar 2020 06:13:43 +0000 (11:43 +0530)] 
Add vendor attributes indicating number of spectral detectors

Add per bandwidth capability attributes which indicate the number of
spectral detectors used.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoAdd an attribute for secondary 80 MHz span of agile spectral scan
Edayilliam Jayadev [Fri, 27 Mar 2020 08:20:01 +0000 (13:50 +0530)] 
Add an attribute for secondary 80 MHz span of agile spectral scan

Add an attribute QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_CONFIG_FREQUENCY_2
for describing the secondary 80 MHz span of agile spectral scan.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoPKCS#1: Debug dump invalid Signature EB
Jouni Malinen [Sun, 5 Apr 2020 17:13:26 +0000 (20:13 +0300)] 
PKCS#1: Debug dump invalid Signature EB

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: Enable dumping of key information in test-x509v3
Jouni Malinen [Sun, 5 Apr 2020 17:12:59 +0000 (20:12 +0300)] 
tests: Enable dumping of key information in test-x509v3

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoX509: Use unique debug prints for unused bits entries
Jouni Malinen [Sun, 5 Apr 2020 16:59:47 +0000 (19:59 +0300)] 
X509: Use unique debug prints for unused bits entries

This makes it easier to understand which X.509 BIT STRING value has the
unused bits.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: Remove test-x509
Jouni Malinen [Sun, 5 Apr 2020 16:38:41 +0000 (19:38 +0300)] 
tests: Remove test-x509

This has been obsoleted by tests/fuzzing/x509.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agowlantest: Do not include rt library for OS X builds
Jouni Malinen [Sun, 5 Apr 2020 14:59:57 +0000 (17:59 +0300)] 
wlantest: Do not include rt library for OS X builds

That is not needed or available by default, so simply drop it from the
build.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agowlantest: Link without libwlantest
Jouni Malinen [Sun, 5 Apr 2020 14:58:46 +0000 (17:58 +0300)] 
wlantest: Link without libwlantest

The ar operations with embedded libraries were not exactly portable
or strictly speaking necessary. Drop that library completely to make
this more portable.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agowlantest: Comment out Linux packet socket from OS X build
Jouni Malinen [Sun, 5 Apr 2020 14:57:32 +0000 (17:57 +0300)] 
wlantest: Comment out Linux packet socket from OS X build

For now, allow wlantest to be built on OS X without support for
live sniffer capturing.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agowlantest: Comment out ICMP processing from OS X builds
Jouni Malinen [Sun, 5 Apr 2020 14:56:59 +0000 (17:56 +0300)] 
wlantest: Comment out ICMP processing from OS X builds

For now, allow this to be compiled without ICMP support.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agowlantest: Use BSD compatible UDP header struct
Jouni Malinen [Sun, 5 Apr 2020 14:56:20 +0000 (17:56 +0300)] 
wlantest: Use BSD compatible UDP header struct

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: SAE/PMF roam
Jouni Malinen [Sat, 4 Apr 2020 20:57:18 +0000 (23:57 +0300)] 
tests: SAE/PMF roam

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoFT RRB: Remove confusing debug print about extra data
Jouni Malinen [Sat, 4 Apr 2020 20:42:05 +0000 (23:42 +0300)] 
FT RRB: Remove confusing debug print about extra data

The "FT: Ignore extra data in end" hexdump is quite confusing since it
shows all the IEs that were actually either processed or forwarded.
There is no code path that could reach this debug print with actual real
extra data. Remove it and the dead increment of pos to avoid warnings
from static analyzers.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: FT+PMF roaming with skip_prune
Jouni Malinen [Sat, 4 Apr 2020 18:49:31 +0000 (21:49 +0300)] 
tests: FT+PMF roaming with skip_prune

Verify hostapd behavior during FT protocol processing when a STA entry
is still present in the AP and that association has PMF negotiated.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoFT: Remove and re-add STA entry after FT protocol success with PMF
Jouni Malinen [Sat, 4 Apr 2020 18:50:37 +0000 (21:50 +0300)] 
FT: Remove and re-add STA entry after FT protocol success with PMF

Allow STA entry to be removed and re-added to the driver with PMF is
used with FT. Previously, this case resulted in cfg80211 rejecting STA
entry update after successful FT protocol use if the association had not
been dropped and it could not be dropped for the PMF case in
handle_auth().

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: New style fuzzing tool for DPP URI parsing
Jouni Malinen [Sat, 4 Apr 2020 17:07:38 +0000 (20:07 +0300)] 
tests: New style fuzzing tool for DPP URI parsing

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: New style fuzzing tool for SAE commit parsing
Jouni Malinen [Sat, 4 Apr 2020 15:28:06 +0000 (18:28 +0300)] 
tests: New style fuzzing tool for SAE commit parsing

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoSAE: Fix build without DPP/OWE/ERP
Jouni Malinen [Sat, 4 Apr 2020 15:08:14 +0000 (18:08 +0300)] 
SAE: Fix build without DPP/OWE/ERP

SAE needs sha256-kdf.c to be included in the build.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: Enable MACsec testing by default in the VM kernel
Thomas Pedersen [Tue, 31 Mar 2020 18:09:00 +0000 (11:09 -0700)] 
tests: Enable MACsec testing by default in the VM kernel

Include support for MACsec testing in the (vm) kernel by default.

Don't include support in the example hostapd or wpa_supplicant configs
yet since that would potentially break the build on older distributions
like Ubuntu 16.04, which is supported until April 2021.

Signed-off-by: Thomas Pedersen <thomas@adapt-ip.com>
5 years agowlantest: Add frame number fo replay detected messages
Jouni Malinen [Fri, 3 Apr 2020 21:06:59 +0000 (00:06 +0300)] 
wlantest: Add frame number fo replay detected messages

This makes it easier to find the relevant frames.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agowlantest: Remove duplicate PN/RSC prints from replay cases
Jouni Malinen [Fri, 3 Apr 2020 21:04:32 +0000 (00:04 +0300)] 
wlantest: Remove duplicate PN/RSC prints from replay cases

The PN and RSC are already printed in the "replay detected" debug
message so there is no point in having separate hexdumps of the same
values immediately after that.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agowlantest: Add debug print with frame number for decryption failures
Jouni Malinen [Fri, 3 Apr 2020 21:00:17 +0000 (00:00 +0300)] 
wlantest: Add debug print with frame number for decryption failures

This makes it more convenient to find the frames that could not be
decrypted.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agowlantest: Do not report decryption failures for WEP keys if no keys
Jouni Malinen [Fri, 3 Apr 2020 20:56:10 +0000 (23:56 +0300)] 
wlantest: Do not report decryption failures for WEP keys if no keys

If no WEP keys are available, there is not going to be an attempt to
decrypt the frame, so don't claim decryption failed.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: Make ap_vht_csa_vht40_disable more robust
Jouni Malinen [Fri, 3 Apr 2020 18:16:06 +0000 (21:16 +0300)] 
tests: Make ap_vht_csa_vht40_disable more robust

Wait for disconnection and reconnection after CSA since mac80211 does
not support clean CSA to disable VHT.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoP2P: Start group with user configured params after accepting invitation
Vamsi Krishna [Fri, 3 Apr 2020 11:52:03 +0000 (17:22 +0530)] 
P2P: Start group with user configured params after accepting invitation

Use global configuration parameters while invoking a persistent P2P
group after accepting P2P Invitation Request from a peer.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: sigma_dut and DPP with NFC
Jouni Malinen [Fri, 3 Apr 2020 13:21:30 +0000 (16:21 +0300)] 
tests: sigma_dut and DPP with NFC

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP: Mandate mutual auth with NFC negotiated connection handover
Jouni Malinen [Fri, 3 Apr 2020 12:47:18 +0000 (15:47 +0300)] 
DPP: Mandate mutual auth with NFC negotiated connection handover

Mark own bootstrap information as having been used in NFC negotiated
connection handover and do not accept non-mutual authentication when
processing Authentication Response from the peer when such bootstrapping
information is used.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: Use a helper function for starting DPP AP in sigma_dut tests
Jouni Malinen [Fri, 3 Apr 2020 09:59:47 +0000 (12:59 +0300)] 
tests: Use a helper function for starting DPP AP in sigma_dut tests

Remove unnecessary code duplication.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: Remove duplicate definitions of csign/connector in sigma_dut
Jouni Malinen [Fri, 3 Apr 2020 09:54:44 +0000 (12:54 +0300)] 
tests: Remove duplicate definitions of csign/connector in sigma_dut

There is no need to duplicate the definitions of the exact same values
within each test function.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: DPP netAccessKey for reconfig
Jouni Malinen [Fri, 3 Apr 2020 09:45:03 +0000 (12:45 +0300)] 
tests: DPP netAccessKey for reconfig

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP2: Store netAccessKey in psk/sae credentials for reconfig
Jouni Malinen [Fri, 3 Apr 2020 09:43:48 +0000 (12:43 +0300)] 
DPP2: Store netAccessKey in psk/sae credentials for reconfig

Connector alone is not sufficient for authentication during
reconfiguration, so store the netAccessKey as well.

Fixes: e4eb009d9863 ("DPP2: Add Connector and C-sign-key in psk/sae credentials for reconfig")
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoOWE: Remove check for unexpected DH Parameter IE use with other AKMs
Jouni Malinen [Fri, 3 Apr 2020 09:18:11 +0000 (12:18 +0300)] 
OWE: Remove check for unexpected DH Parameter IE use with other AKMs

While the Diffie-Hellman Parameter element is defined in RFC 8110
explicitly for use witht he OWE AKM, it has now been proposed to be used
with another AKM (DPP). Should any other AKM be extended in similar
manner in the future, the check against unexpected use could result in
additional interoperability issues. Remove that and instead, ignore the
unexpected Diffie-Hellman Parameter element if it is included in
(Re)Association Request frame when any other AKM is negotiated.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: DPP reconfiguration connector
Jouni Malinen [Thu, 2 Apr 2020 12:38:20 +0000 (15:38 +0300)] 
tests: DPP reconfiguration connector

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP2: Add Connector and C-sign-key in psk/sae credentials for reconfig
Jouni Malinen [Thu, 2 Apr 2020 12:35:56 +0000 (15:35 +0300)] 
DPP2: Add Connector and C-sign-key in psk/sae credentials for reconfig

If the Enrollee indicates support for DPP R2 or newer, add Connector and
C-sign-key in psk/sae credentials (i.e., cases where DPP AKM is not
enabled) for reconfiguration. Extend processing of such credentials in
wpa_supplicant network profile addition to handle this new case
correctly by not setting key_mgmt=DPP based on Connector being present,
but by looking at the actual akm value in the config object.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agowlantest: Update PTK after rekeying even if EAPOL-Key msg 4/4 is missing
Jouni Malinen [Wed, 1 Apr 2020 15:46:14 +0000 (18:46 +0300)] 
wlantest: Update PTK after rekeying even if EAPOL-Key msg 4/4 is missing

Update TPTK to PTK if a valid EAPOL-Key msg 2/4 and 3/4 are available,
but 4/4 is missing. This avoids certain cases where the new TK could be
derived, but it was not being used to try to decrypt following encrypted
frames.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agowlantest: Do not report decryption keys when checking only zero TK
Jouni Malinen [Wed, 1 Apr 2020 15:30:33 +0000 (18:30 +0300)] 
wlantest: Do not report decryption keys when checking only zero TK

All the "Failed to decrypt frame" debug prints were confusing since
those were not supposed to be shown unless there were one or more real
TKs available. The recently added check for zero TK added these notes
for that case which is not really correct, so get rid of them.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP2: Clear requirement for QR Code mutual authentication for chirping
Jouni Malinen [Wed, 1 Apr 2020 14:16:55 +0000 (17:16 +0300)] 
DPP2: Clear requirement for QR Code mutual authentication for chirping

The chirping cases are not really targeting interactive operations, so
clear the requirement for mutual authentication when DPP_CHIRP command
is used. This avoids testing isues where an earlier DPP_LISTEN command
has used qr=mutual parameter and that seting not getting cleared before
the next DPP_CHIRP command is used.

This fixes a test case failure in the following test sequence:
dpp_auth_resp_status_failure dpp_controller_relay_chirp

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoProcess received WNM Notification Request for beacon protection failures
Jouni Malinen [Wed, 1 Apr 2020 13:29:24 +0000 (16:29 +0300)] 
Process received WNM Notification Request for beacon protection failures

Report received notifications for beacon protection failures in syslog
and control interface.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoBeacon frame protection event for incorrect protection
Jouni Malinen [Wed, 1 Apr 2020 13:07:25 +0000 (16:07 +0300)] 
Beacon frame protection event for incorrect protection

Define a driver interface event for Beacon frame protection failures.
Report such events over the control interface and send a
WNM-Notification Request frame to the AP as well.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agowpa_supplicant: Add HE override support
P Praneesh [Mon, 9 Mar 2020 10:53:50 +0000 (16:23 +0530)] 
wpa_supplicant: Add HE override support

Add HE override support under the build parameter CONFIG_HE_OVERRIDES=y.
The disable_he=1 network profile parameter can be used to disable HE.
This requires a fallback to VHT on the 5 GHz band and to HT on the 2.4
GHz band.

There is no nl80211 support for configuring the driver to disable HE, so
for now, this applies only to IBSS and mesh cases.

Signed-off-by: P Praneesh <ppranees@codeaurora.org>
5 years agohostapd: Validate the country_code parameter value
Sriram R [Thu, 26 Mar 2020 03:12:19 +0000 (08:42 +0530)] 
hostapd: Validate the country_code parameter value

cfg80211/regulatory supports only ISO 3166-1 alpha2 country code and
that's what this parameter is supposed to use, so validate the country
code input before accepting the value. Only characters A..Z are
accepted.

Signed-off-by: Sriram R <srirrama@codeaurora.org>
5 years agoDPP: Add some more details on how to use DPP
Jouni Malinen [Sun, 29 Mar 2020 20:24:45 +0000 (23:24 +0300)] 
DPP: Add some more details on how to use DPP

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoFix the dpp_configurator_sign example command
Jouni Malinen [Sun, 29 Mar 2020 20:07:42 +0000 (23:07 +0300)] 
Fix the dpp_configurator_sign example command

The mandatory ssid parameter was forgotten from this command when it was
added to the dpp_auth_init examples.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: DFS channel switch
Jouni Malinen [Sun, 29 Mar 2020 17:49:27 +0000 (20:49 +0300)] 
tests: DFS channel switch

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agohostapd: DFS for channel switch in repeater mode
Sergey Matyukevich [Tue, 28 Jan 2020 15:09:54 +0000 (15:09 +0000)] 
hostapd: DFS for channel switch in repeater mode

In repeater mode remote AP may request channel switch to a new channel.
Check if DFS is required for the new channel before proceeding with
normal AP operations. Start CAC procedure if radar detection is required
and channel is not yet marked as available.

Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com>
5 years agohostapd: Add support for DFS channels in CHAN_SWITCH
Sergey Matyukevich [Tue, 28 Jan 2020 15:09:53 +0000 (15:09 +0000)] 
hostapd: Add support for DFS channels in CHAN_SWITCH

Enable support for DFS channels in the CHAN_SWITCH command. Perform CAC
instead of CSA if DFS channel is selected. Then restart normal AP
operations.

Note that the current implementation provides a simplified approach. It
does not check if the selected DFS channel block is already in the
HOSTAPD_CHAN_DFS_AVAILABLE state. CAC procedure is restarted anyway.

Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com>
5 years agoDFS: Add new hostapd_is_dfs_overlap() helper
Sergey Matyukevich [Tue, 28 Jan 2020 15:09:52 +0000 (15:09 +0000)] 
DFS: Add new hostapd_is_dfs_overlap() helper

Add a new hostapd_is_dfs_overlap() helper function to DFS module. This
function tells whether the selected frequency range overlaps with DFS
channels in the current hostapd configuration. Selected frequency reange
is specified by its center frequency and bandwidth.

Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com>
5 years agoDFS: Rename and export hostapd_config_dfs_chan_available helper
Sergey Matyukevich [Tue, 28 Jan 2020 15:09:51 +0000 (15:09 +0000)] 
DFS: Rename and export hostapd_config_dfs_chan_available helper

Rename DFS helper hostapd_config_dfs_chan_available() to
hostapd_is_dfs_chan_available(). Enable access to this helper function
from other hostapd components.

Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com>
5 years agohostapd: Basic channel check for CHAN_SWITCH parameters
Sergey Matyukevich [Tue, 28 Jan 2020 15:09:49 +0000 (15:09 +0000)] 
hostapd: Basic channel check for CHAN_SWITCH parameters

Implement channel sanity check for the CHAN_SWITCH command. Verify
provided values for bandwidth, frequencies, and secondary channel
offset. Reject requested channel switch operation if basic constraints
on frequencies and bandwidth are not fulfilled.

Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com>
5 years agotests: Use complete CHAN_SWITCH parameters in ap_vht_csa_vht40_disable
Jouni Malinen [Sun, 29 Mar 2020 18:09:56 +0000 (21:09 +0300)] 
tests: Use complete CHAN_SWITCH parameters in ap_vht_csa_vht40_disable

Specify the secondary channel offset and correct center_freq1 value to
make the parameters complete for a 40 MHz channel.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoAP: Drop not needed condition to delete PTK ID 1
Alexander Wetzel [Mon, 23 Mar 2020 18:42:27 +0000 (19:42 +0100)] 
AP: Drop not needed condition to delete PTK ID 1

Signed-off-by: Alexander Wetzel <alexander@wetzel-home.de>
5 years agotests: Include UML defconfig
Thomas Pedersen [Fri, 27 Mar 2020 22:51:45 +0000 (15:51 -0700)] 
tests: Include UML defconfig

Include a defconfig for building kernel as UML. Also update the README
with a few notes related to UML.

Signed-off-by: Thomas Pedersen <thomas@adapt-ip.com>
5 years agotests: Convert kernel-config to defconfig
Thomas Pedersen [Fri, 27 Mar 2020 22:51:44 +0000 (15:51 -0700)] 
tests: Convert kernel-config to defconfig

Make the included kernel-config a little more minimal by checking in the
defconfig instead.

Generate the defconfig by checking out a linux at tag wt-2020-03-17,
copy kernel-config to .config, run
'yes "" | make oldconfig && make savedefconfig',
and copy resulting defconfig to kernel-config.

Signed-off-by: Thomas Pedersen <thomas@adapt-ip.com>
5 years agoDPP2: Fix build with OpenSSL 1.0.2 (EVP_PKEY_get0_EC_KEY() wrapper)
Jouni Malinen [Sun, 29 Mar 2020 15:56:48 +0000 (18:56 +0300)] 
DPP2: Fix build with OpenSSL 1.0.2 (EVP_PKEY_get0_EC_KEY() wrapper)

EVP_PKEY_get0_EC_KEY() was added in OpenSSL 1.1.0, so add a
compatibility wrapper for it when building with OpenSSL 1.0.2.

Fixes: c025c2eb5911 ("DPP: DPPEnvelopedData generation for Configurator backup")
Fixes: 7d9e3200544c ("DPP: Received Configurator backup processing")
Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: Assume --long for UML
Johannes Berg [Sun, 29 Mar 2020 11:46:44 +0000 (13:46 +0200)] 
tests: Assume --long for UML

If we use user-mode-linux, we have time-travel, and then the --long
argument doesn't really make a difference, so just assume that's the
case.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 years agotests: FT roaming cases with authorized STA entry remaining
Jouni Malinen [Sat, 28 Mar 2020 18:40:47 +0000 (20:40 +0200)] 
tests: FT roaming cases with authorized STA entry remaining

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoAdd a hostapd testing option for skipping association pruning
Jouni Malinen [Sat, 28 Mar 2020 18:39:19 +0000 (20:39 +0200)] 
Add a hostapd testing option for skipping association pruning

The new skip_prune_assoc=1 parameter can be used to configure hostapd
not to prune associations from other BSSs operated by the same process
when a station associates with another BSS. This can be helpful in
testing roaming cases where association and authorization state is
maintained in an AP when the stations returns.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agonl80211: Allow full AP client state capability to be disabled
Jouni Malinen [Sat, 28 Mar 2020 18:38:11 +0000 (20:38 +0200)] 
nl80211: Allow full AP client state capability to be disabled

The new driver param full_ap_client_state=0 can be used to test
functionality with the driver capability for full AP client state being
forced to be disabled.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agowpa_auth: Use printf format %zu instead of type casts
Jouni Malinen [Sat, 28 Mar 2020 17:54:10 +0000 (19:54 +0200)] 
wpa_auth: Use printf format %zu instead of type casts

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agowpa_auth: Do not split strings into multiple lines
Jouni Malinen [Sat, 28 Mar 2020 17:48:32 +0000 (19:48 +0200)] 
wpa_auth: Do not split strings into multiple lines

Avoid unnecessary splitting of long string constants into multiple
lines.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agowpa_auth: Coding style cleanup for pointer is NULL comparisons
Jouni Malinen [Sat, 28 Mar 2020 17:36:00 +0000 (19:36 +0200)] 
wpa_auth: Coding style cleanup for pointer is NULL comparisons

Use !ptr instead of ptr == NULL.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agowpa_auth: Clean up pointer dereferences
Jouni Malinen [Sat, 28 Mar 2020 17:29:12 +0000 (19:29 +0200)] 
wpa_auth: Clean up pointer dereferences

Use local variables to avoid sm->wpa_auth->conf type of dereferences
where multiple instances within a function can be cleaned up.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agonl80211: Configure PMKSA lifetime and reauth threshold timer to driver
Veerendranath Jakkam [Mon, 23 Mar 2020 13:41:24 +0000 (19:11 +0530)] 
nl80211: Configure PMKSA lifetime and reauth threshold timer to driver

Drivers that trigger roaming need to know the lifetime and reauth
threshold time of configured PMKSA so that they can trigger full
authentication to avoid unnecessary disconnection. To support this, send
dot11RSNAConfigPMKLifetime and dot11RSNAConfigPMKReauthThreshold values
configured in wpa_supplicant to the driver while configuring a PMKSA.

Signed-off-by: Veerendranath Jakkam <vjakkam@codeaurora.org>
5 years agoSync with mac80211-next.git include/uapi/linux/nl80211.h
Jouni Malinen [Sat, 28 Mar 2020 14:31:14 +0000 (16:31 +0200)] 
Sync with mac80211-next.git include/uapi/linux/nl80211.h

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

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: DPP PFS
Jouni Malinen [Sat, 28 Mar 2020 13:05:57 +0000 (15:05 +0200)] 
tests: DPP PFS

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP2: Allow station to require or not allow PFS
Jouni Malinen [Sat, 28 Mar 2020 13:06:15 +0000 (15:06 +0200)] 
DPP2: Allow station to require or not allow PFS

The new wpa_supplicant network profile parameter dpp_pfs can be used to
specify how PFS is applied to associations. The default behavior
(dpp_pfs=0) remains same as it was previously, i.e., try to use PFS if
the AP supports it. PFS use can now be required (dpp_pfs=1) or disabled
(dpp_pfs=2).

This is also working around an interoperability issue of DPP R2 STA with
certain hostapd builds that included both OWE and DPP functionality.
That issue was introduced by commit 09368515d130 ("OWE: Process
Diffie-Hellman Parameter element in AP mode") and removed by commit
16a4e931f03e ("OWE: Allow Diffie-Hellman Parameter element to be
included with DPP"). hostapd builds between those two commits would
reject DPP association attempt with PFS. The new wpa_supplicant default
(dpp_pfs=0) behavior is to automatically try to connect again with PFS
disabled if that happens.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP2: Allow AP to require or reject PFS
Jouni Malinen [Sat, 28 Mar 2020 10:33:48 +0000 (12:33 +0200)] 
DPP2: Allow AP to require or reject PFS

The new hostapd configuration parameter dpp_pfs can be used to specify
how PFS is applied to associations. The default behavior (dpp_pfs=0)
remains same as it was previously, i.e., allow the station to decide
whether to use PFS. PFS use can now be required (dpp_pfs=1) or rejected
(dpp_pfs=2).

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoReturn an enum from wpa_validate_wpa_ie()
Jouni Malinen [Sat, 28 Mar 2020 10:22:28 +0000 (12:22 +0200)] 
Return an enum from wpa_validate_wpa_ie()

This is more specific then returning a generic int and also allows the
compiler to do more checks.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agohostapd: Add HE bit in BSSID Information field of own Neighbor Report
Sathishkumar Muruganandam [Tue, 24 Mar 2020 11:04:42 +0000 (16:34 +0530)] 
hostapd: Add HE bit in BSSID Information field of own Neighbor Report

Add definition for HE bit in neighbor report BSSID Information field
from IEEE P802.11ax/D6.0, 9.4.2.36 Neighbor Report element.

Signed-off-by: Sathishkumar Muruganandam <murugana@codeaurora.org>
5 years agotests: Skip background scans in beacon loss tests
Jouni Malinen [Fri, 27 Mar 2020 19:05:44 +0000 (21:05 +0200)] 
tests: Skip background scans in beacon loss tests

bgscan_learn_beacon_loss was failing quite frequently and it looks like
the background scans were related to those failures. Since those scans
are not really relevant to testing beacon loss, get rid of them in these
test cases to avoid incorrect failures.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: dpp_controller_rx_failure to match implementation changes
Jouni Malinen [Fri, 27 Mar 2020 18:00:42 +0000 (20:00 +0200)] 
tests: dpp_controller_rx_failure to match implementation changes

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