]> git.ipfire.org Git - thirdparty/hostap.git/log
thirdparty/hostap.git
4 years agowlantest: Basic Extended Key ID support
Alexander Wetzel [Sun, 15 Mar 2020 19:04:25 +0000 (20:04 +0100)] 
wlantest: Basic Extended Key ID support

Signed-off-by: Alexander Wetzel <alexander@wetzel-home.de>
4 years agonl80211: Debug print set_key() command names
Jouni Malinen [Sun, 15 Mar 2020 21:42:21 +0000 (23:42 +0200)] 
nl80211: Debug print set_key() command names

This makes it easier to understand the debug log for various set_key()
operations.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agonl80211: Extended Key ID support
Alexander Wetzel [Sun, 15 Mar 2020 19:04:24 +0000 (20:04 +0100)] 
nl80211: Extended Key ID support

Add key configuration parameters needed to support Extended Key ID with
pairwise keys. Add a driver capability flag to indicate support forusing
this.

Signed-off-by: Alexander Wetzel <alexander@wetzel-home.de>
4 years agoRemove unnecessary and confusing length check from the PMKID KDE case
Jouni Malinen [Sun, 15 Mar 2020 21:24:18 +0000 (23:24 +0200)] 
Remove unnecessary and confusing length check from the PMKID KDE case

wpa_parse_kde_ies(), i.e., the only caller to wpa_parse_generic(),
verifies that there is room for KDE Length field and pos[1] (that
length) octets of payload in the Key Data buffer. The PMKID KDE case
within wpa_parse_generic() was doing an unnecessary separate check for
there being room for the Length, OUI, and Data Type fields. This is
covered by the check in the calling function with the combination of
verifying that pos[1] is large enough to contain RSN_SELECTOR_LEN +
PMKID_LEN octets of payload.

This is confusing since no other KDE case was checking remaining full
buffer room within wpa_parse_generic(). Clean this up by removing the
unnecessary check from the PMKID KDE case so that all KDEs are handled
consistently.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoAdd parsing of Key ID KDE for Extended Key ID
Alexander Wetzel [Sun, 15 Mar 2020 19:04:20 +0000 (20:04 +0100)] 
Add parsing of Key ID KDE for Extended Key ID

wpa_parse_generic() can now recognize the Key ID KDE that will be needed
to deliver the Key ID of the pairwise key when Extended Key ID is used.

Signed-off-by: Alexander Wetzel <alexander@wetzel-home.de>
4 years agoAdd KEY_FLAG_MODIFY for Extended Key ID support
Alexander Wetzel [Sun, 15 Mar 2020 19:04:19 +0000 (20:04 +0100)] 
Add KEY_FLAG_MODIFY for Extended Key ID support

KEY_FLAG_MODIFY was initial added for the planned Extended Key ID
support with commit a919a260352a ("Introduce and add key_flag") and then
removed with commit 82eaa3e6882f ("Remove the not yet needed
KEY_FLAG_MODIFY") to simplify commit e9e69221c1d1 ("Validity checking
function for key_flag API").

Add it again and update check_key_flag() accordingly.

Signed-off-by: Alexander Wetzel <alexander@wetzel-home.de>
4 years agotests: Scanning in AP mode
Jouni Malinen [Sun, 15 Mar 2020 19:22:18 +0000 (21:22 +0200)] 
tests: Scanning in AP mode

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agonl80211: Allow scanning in wpa_supplicant AP mode
Jouni Malinen [Sun, 15 Mar 2020 19:21:35 +0000 (21:21 +0200)] 
nl80211: Allow scanning in wpa_supplicant AP mode

If the driver supports this, request cfg80211 to allow the explicitly
requested scan to go through in AP mode.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoIndicate scan completion in active AP mode even when ignoring results
Jouni Malinen [Sun, 15 Mar 2020 19:18:16 +0000 (21:18 +0200)] 
Indicate scan completion in active AP mode even when ignoring results

This is needed to avoid leaving external components (through control
interface or D-Bus) timing out while waiting for the scan completion
events. This was already taken care of for the scan-only case
("TYPE=only"), but the scan-and-allow-roaming case did not report the
scan completion event when operating in AP mode.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agonl80211: Remove extraneous space from send_mlme debug print
Jouni Malinen [Sun, 15 Mar 2020 15:09:27 +0000 (17:09 +0200)] 
nl80211: Remove extraneous space from send_mlme debug print

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: Check more details in pmksa_cache_ap_expiration
Jouni Malinen [Sun, 15 Mar 2020 15:07:52 +0000 (17:07 +0200)] 
tests: Check more details in pmksa_cache_ap_expiration

It looks like this test case can fail if the STA goes to power save mode
and the Deauthentication frame from the AP after session timeout is not
actually sent at all. Check more details to make it clear that this is
indeed the reason behind the failure.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agonl80211: Add more TX status details in debug log in AP mode
Jouni Malinen [Sun, 15 Mar 2020 15:06:35 +0000 (17:06 +0200)] 
nl80211: Add more TX status details in debug log in AP mode

The actual TX status (whether ACK frame was received) was not included
in the debug log in AP mode. Add that for all cases. In addition, add
some more details in the debug log to make the log more helpful in
debugging issues related to frame delivery.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: SAE and RSNE mismatch in EAPOL-Key msg 2/4
Jouni Malinen [Sun, 15 Mar 2020 09:16:22 +0000 (11:16 +0200)] 
tests: SAE and RSNE mismatch in EAPOL-Key msg 2/4

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoAllow RSNE in EAPOL-Key msg 2/4 to be overridden for testing purposes
Jouni Malinen [Sun, 15 Mar 2020 09:11:38 +0000 (11:11 +0200)] 
Allow RSNE in EAPOL-Key msg 2/4 to be overridden for testing purposes

The new wpa_supplicant control interface parameter rsne_override_eapol
can be used similarly to the earlier rsnxe_override_eapol to override
the RSNE value added into EAPOL-Key msg 2/4.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: FT protocol RSNE/RSNXE mismatch in Reassociation Response frame
Jouni Malinen [Sat, 14 Mar 2020 21:31:13 +0000 (23:31 +0200)] 
tests: FT protocol RSNE/RSNXE mismatch in Reassociation Response frame

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoAllow RSNE/RSNXE to be replaced in FT protocol Reassocation Response frame
Jouni Malinen [Sat, 14 Mar 2020 21:30:27 +0000 (23:30 +0200)] 
Allow RSNE/RSNXE to be replaced in FT protocol Reassocation Response frame

This can be used to test station side behavior for FT protocol
validation steps.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoFT: Check RSNE/RSNXE match in FT protocol Reassociation Response frame
Jouni Malinen [Sat, 14 Mar 2020 21:57:39 +0000 (23:57 +0200)] 
FT: Check RSNE/RSNXE match in FT protocol Reassociation Response frame

While 13.7.1 (FT reassociation in an RSN) in P802.11-REVmd/D3.0 did not
explicitly require this to be done, this is implied when describing the
contents of the fourth message in the FT authentication sequence (see
13.8.5). Furthermore, 20/332r2 is proposing an explicit validation step
to be added into 13.7.1.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agowlantest: Do not report PMF failure without BSS supporting PMF
Jouni Malinen [Sat, 14 Mar 2020 16:20:31 +0000 (18:20 +0200)] 
wlantest: Do not report PMF failure without BSS supporting PMF

Previously, missing CCMP protection on Robust Management frames was
reported based on the STA having indicated MFPC=1. That is not accurate
since the AP/BSS may have MFPC=0. Report this failure only if both the
AP and STA have indicated MFPC=1, i.e., when PMF has been negotiated for
the association.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agowlantest: Detect and report plaintext payload in protected frames
Jouni Malinen [Sat, 14 Mar 2020 15:31:57 +0000 (17:31 +0200)] 
wlantest: Detect and report plaintext payload in protected frames

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agonl80211: Debug print driver capabilities
Jouni Malinen [Fri, 13 Mar 2020 18:03:14 +0000 (20:03 +0200)] 
nl80211: Debug print driver capabilities

This can be helpful in understanding driver behavior.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoMove the "WPA: AP key_mgmt" debug print to be after final changes
Jouni Malinen [Fri, 13 Mar 2020 18:01:53 +0000 (20:01 +0200)] 
Move the "WPA: AP key_mgmt" debug print to be after final changes

Driver capabilities may end up masking out some WPA_KEY_MGMT_* bits, so
debug print the outcome only after having performed all these steps.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoMulti-AP: Set 4-address mode after network selection
Gurumoorthi Gnanasambandhan [Wed, 11 Mar 2020 10:41:54 +0000 (16:11 +0530)] 
Multi-AP: Set 4-address mode after network selection

Split multi_ap_process_assoc_resp() to set 4-address mode after network
selection. Previously, wpa_s->current_ssid might have been NULL in some
cases and that would have resulted in 4-address mode not getting enabled
properly.

Signed-off-by: Gurumoorthi Gnanasambandhan <gguru@codeaurora.org>
4 years agoHS 2.0 server: Add a note on OCSP server hostname
Ben Greear [Fri, 6 Mar 2020 22:58:11 +0000 (14:58 -0800)] 
HS 2.0 server: Add a note on OCSP server hostname

Signed-off-by: Ben Greear <greearb@candelatech.com>
4 years agohs20-osu-client: Use more specific debug message on OSU connection
Ben Greear [Fri, 6 Mar 2020 22:58:11 +0000 (14:58 -0800)] 
hs20-osu-client: Use more specific debug message on OSU connection

Signed-off-by: Ben Greear <greearb@candelatech.com>
4 years agotests: Current Operating Class value from STA
Jouni Malinen [Wed, 11 Mar 2020 16:30:51 +0000 (18:30 +0200)] 
tests: Current Operating Class value from STA

Verify Supported Operating Classes element contents from STA in various
HT and VHT cases.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoFill the current opclass in (Re)AssocRequest depending on HT/VHT IEs
Ananya Barat [Tue, 10 Mar 2020 06:37:33 +0000 (12:07 +0530)] 
Fill the current opclass in (Re)AssocRequest depending on HT/VHT IEs

The previous implementation was assuming a fixed 20 MHz channel
bandwidth when determining which operating class value to indicate as
the Current Operating Class in the Supported Operating Classes element.
This is not accurate for many HT/VHT cases.

Fix this by determining the current operating class (i.e., the operating
class used for the requested association) based on the HT/VHT operation
elements from scan results.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoAP: Fix regression in frequency check for a usable EDMG channel
Hrishikesh Vidwans [Fri, 6 Mar 2020 18:57:58 +0000 (10:57 -0800)] 
AP: Fix regression in frequency check for a usable EDMG channel

Commit 5f9b4afd ("Use frequency in HT/VHT validation steps done before
starting AP") modified hostapd_is_usable_edmg() to use freq instead of
channel numbers. Unfortunately, it did not convert the frequency
calculation correctly and this broke EDMG functionality.

Fix the frequency calculation so that EDMG channel 9 works again.

Fixes: 5f9b4afdfaf5 ("Use frequency in HT/VHT validation steps done before starting AP")
Signed-off-by: Hrishikesh Vidwans <hvidwans@codeaurora.org>
4 years agomesh: Fix CONFIG_HT_OVERRIDES build without CONFIG_VHT_OVERRIDES
Arturo Buzarra [Mon, 9 Mar 2020 17:18:16 +0000 (18:18 +0100)] 
mesh: Fix CONFIG_HT_OVERRIDES build without CONFIG_VHT_OVERRIDES

Commit e5a9b1e8a3 ("mesh: Implement use of VHT20 config in mesh mode")
introduced the possibility to check the disable_vht param. However, this
entry is only available when CONFIG_VHT_OVERRIDES is enabled and as
such, this broke the build for some cases.

Fix this by encapsulating VHT property with the proper CONFIG entry.

Fixes: e5a9b1e8a3a5 ("mesh: Implement use of VHT20 config in mesh mode")
Signed-off-by: Arturo Buzarra <arturo.buzarra@digi.com>
4 years agoWPS: Do not set auth_alg=OPEN for PSK+SAE case
Jouni Malinen [Tue, 10 Mar 2020 18:48:15 +0000 (20:48 +0200)] 
WPS: Do not set auth_alg=OPEN for PSK+SAE case

When wps_cred_add_sae=1 is used, WPS_AUTH_WPA2PSK credential gets
converted to enabling both PSK and SAE AKMs. However, this case was
still hardcoded auth_alg=OPEN which is not really correct for SAE. While
the SME-in-wpa_supplicant case can handle that, the SME-in-driver case
might not. Remove the unnecessary auth_alg=OPEN configuration to get the
normal PSK+SAE configuration enabled for the network profile.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agotests: Set device_name for WPS test cases
Janusz Dziedzic [Sun, 8 Mar 2020 13:27:04 +0000 (14:27 +0100)] 
tests: Set device_name for WPS test cases

Set device_name in the test cases instead of relying on the
wpa_supplicant configuration file. This fixes problems when we run WPS
test cases in remote test environment.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@gmail.com>
4 years agotests: Clear regulatory domain on the correct remote device
Janusz Dziedzic [Sun, 8 Mar 2020 13:27:03 +0000 (14:27 +0100)] 
tests: Clear regulatory domain on the correct remote device

In case we run remote tests we need to clear/set regulatory domain on
the correct device.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@gmail.com>
4 years agotests: remote: Allow to run module tests
Janusz Dziedzic [Sun, 8 Mar 2020 13:27:02 +0000 (14:27 +0100)] 
tests: remote: Allow to run module tests

Add a new command line option -f (--modules) that will run all test
cases from the specified module(s).

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@gmail.com>
4 years agoSAE: Expose sae_write_commit() error cases to callers
Jouni Malinen [Sun, 8 Mar 2020 14:59:42 +0000 (16:59 +0200)] 
SAE: Expose sae_write_commit() error cases to callers

Check whether an error is reported from any of the functions that could
in theory fail and if so, do not proceed with the partially filled SAE
commit buffer.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoSAE: Check hmac_sha256() result in sae_token_hash()
Jouni Malinen [Sun, 8 Mar 2020 14:51:30 +0000 (16:51 +0200)] 
SAE: Check hmac_sha256() result in sae_token_hash()

In theory, hmac_sha256() might fail, so check for that possibility
instead of continuing with undetermined index value that could point to
an arbitrary token entry.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agonl80211: Fix error print for hapd_send_eapol()
Jouni Malinen [Sun, 8 Mar 2020 14:48:00 +0000 (16:48 +0200)] 
nl80211: Fix error print for hapd_send_eapol()

The return value from nl80211_send_monitor() is not suitable for use
with strerror(). Furthermore, nl80211_send_monitor() itself is printing
out a more detailed error reason.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoos_unix: Call srandom() only if os_get_random() succeeds
Jouni Malinen [Sun, 8 Mar 2020 14:43:09 +0000 (16:43 +0200)] 
os_unix: Call srandom() only if os_get_random() succeeds

Don't use uninitialized stack memory if /dev/urandom is not available.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agonl80211: Fix tx_control_port error print
Jouni Malinen [Sun, 8 Mar 2020 14:38:57 +0000 (16:38 +0200)] 
nl80211: Fix tx_control_port error print

send_and_recv_msgs() returns a negative number as the error code and
that needs to be negated for strerror().

Fixes: 8759e9116aa6 ("nl80211: Control port over nl80211 helpers")
Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoDPP: Remove unreachable return statement
Jouni Malinen [Sun, 8 Mar 2020 14:35:45 +0000 (16:35 +0200)] 
DPP: Remove unreachable return statement

This was forgotten from an earlier development version.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoSAE: Check sta pointer more consistently in testing code
Jouni Malinen [Sun, 8 Mar 2020 14:32:47 +0000 (16:32 +0200)] 
SAE: Check sta pointer more consistently in testing code

send_auth_reply() could be called with sta == NULL in certain error
conditions. While that is not applicable for this special test
functionality for SAE, the inconsistent checks for the sta pointer could
result in warnings from static analyzers. Address this by explicitly
checking the sta pointer here.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoClean up hostapd_get_he_twt_responder() processing
Jouni Malinen [Sun, 8 Mar 2020 14:28:03 +0000 (16:28 +0200)] 
Clean up hostapd_get_he_twt_responder() processing

mode->he_capab is an array and as such, there is no point in checking
whether it is NULL since that cannot be the case. Check for the
he_supported flag instead. In addition, convert the TWT responder
capability bit into a fixed value 1 to avoid any surprising to the
callers. In practice, neither of these changes results in different
behavior in the current implementation, but this is more robust.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoDPP: Fix connectorTemplate addition
Jouni Malinen [Sun, 8 Mar 2020 14:18:22 +0000 (16:18 +0200)] 
DPP: Fix connectorTemplate addition

There was a copy-paste error in this code that would be adding the
connectorTemplate once that becomes available. In practice, this was not
reachable code, but anyway, this should be ready for potential addition
of connectorTemplate in the future.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoReplace systemd install Alias with WantedBy
Joshua DeWeese [Mon, 4 Feb 2019 20:43:29 +0000 (15:43 -0500)] 
Replace systemd install Alias with WantedBy

According to the systemd documentation "WantedBy=foo.service in a
service bar.service is mostly equivalent to
Alias=foo.service.wants/bar.service in the same file." However,
this is not really the intended purpose of install Aliases.

Signed-off-by: Joshua DeWeese <jdeweese@hennypenny.com>
4 years agotests: Fix sigma_dut_sae_pw_id_pwe_loop to clear sae_pwe setting
Jouni Malinen [Sun, 8 Mar 2020 11:49:22 +0000 (13:49 +0200)] 
tests: Fix sigma_dut_sae_pw_id_pwe_loop to clear sae_pwe setting

Leaving out the special sae_pwe value was causing failures for following
test cases, e.g., in the following sequence:
sigma_dut_sae_pw_id_pwe_loop sae_password_id_only

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: Opportunistic Wireless Encryption transition mode and RSNE mismatch
Jouni Malinen [Sun, 8 Mar 2020 11:21:11 +0000 (13:21 +0200)] 
tests: Opportunistic Wireless Encryption transition mode and RSNE mismatch

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoRSN: Stop 4-way handshake if scan results are not available
Jouni Malinen [Sun, 8 Mar 2020 11:11:50 +0000 (13:11 +0200)] 
RSN: Stop 4-way handshake if scan results are not available

While there may have initially been cases where the RSNE from
Beacon/Probe Response frames was not available from some drivers, it is
now more valuable to notice if such a case were to be hit with drivers
that are always expected to have such information available. As such,
make it a fatal error if the scan results for the current AP are not
available to check the RSNE/RSNXE in EAPOL-Key msg 3/4.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoOWE: Allow BSS entry with different SSID to be used in transition mode
Jouni Malinen [Sun, 8 Mar 2020 09:29:45 +0000 (11:29 +0200)] 
OWE: Allow BSS entry with different SSID to be used in transition mode

Similarly to the wpa_supplicant_select_config() case,
wpa_get_beacon_ie() needs to handle the special case for OWE transition
mode where the SSID in the network profile does not match the SSID of
the OWE BSS (that has a hidden, random SSID). Accept such a BSS in case
the current scan results needs to be fetched for verifying EAPOL-Key msg
3/4 IEs.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoOWE: Mark BSS for transition mode based on active OWE network profiles
Jouni Malinen [Sun, 8 Mar 2020 14:13:35 +0000 (16:13 +0200)] 
OWE: Mark BSS for transition mode based on active OWE network profiles

It is possible for the hidden OWE BSS to be found based on SSID-specific
scan (e.g., from the special OWE scan mechanism). In that sequence, the
previously used learning of OWE BSS was skipped since the SSID was
already present in the BSS entry. This could result in not being able to
find a matching BSS entry for the OWE BSS in transition mode.

Fix this by adding the BSS flag for transition mode based on SSID
matching against currently enabled OWE network profiles in addition to
the previous mechanism.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoOWE: Avoid incorrect profile update in transition mode
Jouni Malinen [Sat, 7 Mar 2020 16:03:32 +0000 (18:03 +0200)] 
OWE: Avoid incorrect profile update in transition mode

The "unexpected" change of SSID between the current network profile
(which uses the SSID from the open BSS in OWE transition mode) and the
association with the OWE BSS (which uses a random, hidden SSID) resulted
in wpa_supplicant incorrectly determining that this was a
driver-initiated BSS selection ("Driver-initiated BSS selection changed
the SSID to <the random SSID from OWE BSS>" in debug log).

This ended up with updating security parameters based on the network
profile inwpa_supplicant_set_suites() instead of using the already
discovered information from scan results. In particular, this cleared
the RSN supplicant state machine information of AP RSNE and resulted in
having to fetch the scan results for the current BSS when processing
EAPOL-Key msg 3/4.

Fix this by recognizing the special case for OWE transition mode where
the SSID for the associated AP does not actually match the SSID in the
network profile.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoFT: Silence debug prints when FT is not actually used
Jouni Malinen [Sat, 7 Mar 2020 15:42:50 +0000 (17:42 +0200)] 
FT: Silence debug prints when FT is not actually used

Avoid printing confusing FT debug entries from wpa_sm_set_ft_params()
when FT is not actually used for the connection.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoRecognize OWE Transition Mode element in IE parser
Jouni Malinen [Sat, 7 Mar 2020 15:27:32 +0000 (17:27 +0200)] 
Recognize OWE Transition Mode element in IE parser

This silences the debug log entry on unknown WFA IE being ignored.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: RSNXE mismatch in EAPOL-Key msg 3/4
Jouni Malinen [Sat, 7 Mar 2020 15:06:12 +0000 (17:06 +0200)] 
tests: RSNXE mismatch in EAPOL-Key msg 3/4

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoReport RSNXE mismatch in EAPOL-Key msg 3/4 more consistently with RSNE
Jouni Malinen [Sat, 7 Mar 2020 15:05:01 +0000 (17:05 +0200)] 
Report RSNXE mismatch in EAPOL-Key msg 3/4 more consistently with RSNE

Use the same reason code to indicate that IE different in 4-way
handshake and also print a hexdump of RSNXE in both Beacon/ProbeResp and
EAPOL-Key msg 3/4 in the log.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: RSNE mismatch in EAPOL-Key msg 3/4
Jouni Malinen [Sat, 7 Mar 2020 14:57:08 +0000 (16:57 +0200)] 
tests: RSNE mismatch in EAPOL-Key msg 3/4

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoAllow RSNE in EAPOL-Key msg 3/4 to be replaced for testing purposes
Jouni Malinen [Sat, 7 Mar 2020 14:45:52 +0000 (16:45 +0200)] 
Allow RSNE in EAPOL-Key msg 3/4 to be replaced for testing purposes

The new hostapd configuration parameter rsne_override_eapol can now be
used similarly to the previously added rsnxe_override_eapol to override
(replace contents or remove) RSNE in EAPOL-Key msg 3/4. This can be used
for station protocol testing to verify sufficient checks for RSNE
modification between the Beacon/Probe Response frames and EAPOL-Key msg
3/4.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: RSNXE missing from EAPOL-Key msg 3/4
Jouni Malinen [Sat, 7 Mar 2020 14:42:47 +0000 (16:42 +0200)] 
tests: RSNXE missing from EAPOL-Key msg 3/4

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoExtend hostapd rsnxe_override_eapol to allow IE removal
Jouni Malinen [Sat, 7 Mar 2020 14:39:36 +0000 (16:39 +0200)] 
Extend hostapd rsnxe_override_eapol to allow IE removal

Previous implementation was determining whether the override value was
set based on its length being larger than zero. Replace this with an
explicit indication of whether the parameter is set to allow zero length
replacement, i.e., remove of RSNXE from EAPOL-Key msg 3/4.

In addition, move IE replacement into a more generic helper function to
allow this to be used with other IEs as well.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: WPA2-EAP AP with STA using 4addr mode
Jouni Malinen [Sat, 7 Mar 2020 11:59:17 +0000 (13:59 +0200)] 
tests: WPA2-EAP AP with STA using 4addr mode

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoDo not override WDS VLAN assignment for STA
Jouni Malinen [Sat, 7 Mar 2020 11:56:56 +0000 (13:56 +0200)] 
Do not override WDS VLAN assignment for STA

The 4-address frames WDS design in mac80211 uses VLAN interfaces
similarly to the way VLAN interfaces based on VLAN IDs are used. The EAP
authentication case ended up overriding the WDS specific assignment even
when the RADIUS server did not assign any specific VLAN for the STA.
This broke WDS traffic.

Fix this by skipping VLAN assignment to VLAN ID 0 for STAs that have
been detected to use 4-address frames.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoHS 2.0 server: Allow OCSP responder to continue running after errors
Jouni Malinen [Sat, 7 Mar 2020 11:26:56 +0000 (13:26 +0200)] 
HS 2.0 server: Allow OCSP responder to continue running after errors

By default, 'openssl ocsp' exits upon receiving a malformed request.
That's not really ideal for a server, so configure openssl to not do
that and instead, continue running to process other requests.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agowebkit2: Fix http://localhost:12345/ redirect handling
Jouni Malinen [Sat, 7 Mar 2020 09:51:23 +0000 (11:51 +0200)] 
webkit2: Fix http://localhost:12345/ redirect handling

The resource-load-started cannot be used to replace the older
resource-request-starting signal and as such, the final redirect to the
special http://localhost:12345/ URL did not work. Use the decide-policy
signal for navigation action instead.

Also remove the attempt to modify the request URI from
resource-load-started since that is not going to work either. This is
not really critical for functionality, but could eventually be replaced
with a handler for the WebKitWebPage send-request signal.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: sigma_dut with OWE PTK workaround
Jouni Malinen [Fri, 6 Mar 2020 19:38:01 +0000 (21:38 +0200)] 
tests: sigma_dut with OWE PTK workaround

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoReplace WPA_ALG_PMK with KEY_FLAG_PMK
Alexander Wetzel [Thu, 5 Mar 2020 21:06:46 +0000 (22:06 +0100)] 
Replace WPA_ALG_PMK with KEY_FLAG_PMK

Drop the no longer needed internal alg WPA_ALG_PMK and use KEY_FLAG_PMK
as replacement.

Signed-off-by: Alexander Wetzel <alexander@wetzel-home.de>
4 years agonl80211: Drop outdated TDLS set_key() hack
Alexander Wetzel [Thu, 5 Mar 2020 21:06:45 +0000 (22:06 +0100)] 
nl80211: Drop outdated TDLS set_key() hack

wpa_tdls_set_key() did set the key_id to -1 to avoid a useless
NL80211_CMD_SET_KEY call that the updated nl80211 driver no longer
carries out. Remove the no longer required workaround.

Signed-off-by: Alexander Wetzel <alexander@wetzel-home.de>
4 years agowpa_cli: Add missing quote around interface name
Andrew Siplas [Thu, 5 Mar 2020 01:55:18 +0000 (20:55 -0500)] 
wpa_cli: Add missing quote around interface name

There was only an open quote present.

Signed-off-by: Andrew Siplas <andrew@asiplas.net>
4 years agoDFS: Add support for 80+80 MHz when going through channel switch
Pravas Kumar Panda [Fri, 6 Mar 2020 09:36:42 +0000 (15:06 +0530)] 
DFS: Add support for 80+80 MHz when going through channel switch

After a radar signal is detected, the AP should switch to another
channel, but in the case of 80+80 MHz, channel switch failed because
hostapd did not select the secondary channel in the process. Fix this by
selecting a secondary channel in the case of 80+80 MHz.

Signed-off-by: Xin Wang <xwangw@codeaurora.org>
Signed-off-by: Pravas Kumar Panda <kumarpan@codeaurora.org>
4 years agotests: Automatic channel selection with fallback to 20 MHz
Jouni Malinen [Fri, 6 Mar 2020 18:50:21 +0000 (20:50 +0200)] 
tests: Automatic channel selection with fallback to 20 MHz

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agotests: HT with 20 MHz channel width doing CSA to 40 MHz
Jouni Malinen [Fri, 6 Mar 2020 18:21:27 +0000 (20:21 +0200)] 
tests: HT with 20 MHz channel width doing CSA to 40 MHz

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agotests: Make ap_ht_40mhz_intolerant_ap more robust
Jouni Malinen [Fri, 6 Mar 2020 15:27:40 +0000 (17:27 +0200)] 
tests: Make ap_ht_40mhz_intolerant_ap more robust

Some test case sequences seemed to prevent the station from completing
the first OBSS scan (that scan was aborted) and that resulted in failing
the test case because the AP had not received any report in time. Wait
for scan completion and allow additional scans before timing out to
avoid indicating incorrect AP behavior in cases where the report was not
even received.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoOWE: Fix PTK derivation workaround for interoperability
Hu Wang [Thu, 5 Mar 2020 11:20:38 +0000 (19:20 +0800)] 
OWE: Fix PTK derivation workaround for interoperability

The initial implementation of the PTK derivation workaround for
interoperability with older OWE implementations forced
WPA_KEY_MGMT_PSK_SHA256 to be used for all of PTK derivation. While that
is needed for selecting which hash algorithm to use, this was also
changing the length of the PTK components and by doing so, did not
actually address the backwards compatibility issue.

Fix this by forcing SHA256 as the hash algorithm in PTK derivation
without changing the PTK length calculation for OWE when
owe_ptk_workaround is enabled.

Fixes: 65a44e849af9 ("OWE: PTK derivation workaround in AP mode")
Fixes: 8b138d28264e ("OWE: PTK derivation workaround in STA mode")
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agotests: wpa_supplicant SAVE_CONFIG without config file
Jouni Malinen [Fri, 6 Mar 2020 09:24:28 +0000 (11:24 +0200)] 
tests: wpa_supplicant SAVE_CONFIG without config file

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoFix segmentation fault for NULL confname in SAVE_CONFIG
Zhaoyang Liu [Thu, 5 Mar 2020 03:25:00 +0000 (11:25 +0800)] 
Fix segmentation fault for NULL confname in SAVE_CONFIG

When wpa_supplicant interface is added without a configuration file, the
SAVE_CONFIG command causes a segmentation fault due to referencing a
NULL pointer if the update_config parameter is first explicitly enabled.

Fix the issue by checking the confname for NULL before saving
configuration.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agonl80211: Migrate from set_tx to key_flag API
Alexander Wetzel [Wed, 4 Mar 2020 17:16:56 +0000 (18:16 +0100)] 
nl80211: Migrate from set_tx to key_flag API

Migrate nl80211 driver to key_flag API and add additional sanity checks.

I'm still not sure why we install unicast WEP keys also as default
unicast keys. Based on how I understand how mac80211 handles that it
should be pointless. I just stuck to how we do things prior to the patch
for WEP keys to not break anything. After all other drivers may need it.

Signed-off-by: Alexander Wetzel <alexander@wetzel-home.de>
4 years agonl80211: Don't ignore when SET_KEY returns ENOENT
Alexander Wetzel [Wed, 4 Mar 2020 17:16:55 +0000 (18:16 +0100)] 
nl80211: Don't ignore when SET_KEY returns ENOENT

Always report an error when NL80211_CMD_SET_KEY can't set a key to
default.

The old ioctl-based design used a single command to add, set, and delete
a key and had to ignore ENOENT for key deletions. It looks like that
special handling was also ported for NL80211_CMD_NEW_KEY and
NL80211_CMD_SET_KEY instead only for NL80211_CMD_DEL_KEY.

Signed-off-by: Alexander Wetzel <alexander@wetzel-home.de>
4 years agonl80211: Remove not needed netlink key attribute
Alexander Wetzel [Wed, 4 Mar 2020 17:16:54 +0000 (18:16 +0100)] 
nl80211: Remove not needed netlink key attribute

Calling NL80211_CMD_NEW_KEY with NL80211_KEY_DEFAULT_TYPES attributes is
pointless. The information is not expected and therefore the kernel
never forwards it to the drivers. That attribute is used with
NL80211_CMD_SET_KEY.

Signed-off-by: Alexander Wetzel <alexander@wetzel-home.de>
4 years agonl80211: Fix wrong return code in set_key error path
Alexander Wetzel [Wed, 4 Mar 2020 17:16:53 +0000 (18:16 +0100)] 
nl80211: Fix wrong return code in set_key error path

Allow to abort key installations with different error codes and fix one
misleading return code.

Signed-off-by: Alexander Wetzel <alexander@wetzel-home.de>
4 years agonl80211: Ignore seq number for key deletion
Alexander Wetzel [Wed, 4 Mar 2020 17:16:52 +0000 (18:16 +0100)] 
nl80211: Ignore seq number for key deletion

Turns out we are sometime providing a seq when deleting the key. Since
that makes no sense on key deletion let's stop forwarding that to the
driver at least.

Signed-off-by: Alexander Wetzel <alexander@wetzel-home.de>
4 years agoValidity checking function for key_flag API
Alexander Wetzel [Wed, 4 Mar 2020 17:16:51 +0000 (18:16 +0100)] 
Validity checking function for key_flag API

Add masks for each key type to define which flags can be combined and
add a helper function to validate key_flag values.

Signed-off-by: Alexander Wetzel <alexander@wetzel-home.de>
4 years agonl80211: Add a missing key_flag for WEP shared key authentication
Alexander Wetzel [Wed, 4 Mar 2020 17:16:51 +0000 (18:16 +0100)] 
nl80211: Add a missing key_flag for WEP shared key authentication

Signed-off-by: Alexander Wetzel <alexander@wetzel-home.de>
4 years agoRemove the not yet needed KEY_FLAG_MODIFY
Alexander Wetzel [Wed, 4 Mar 2020 17:16:51 +0000 (18:16 +0100)] 
Remove the not yet needed KEY_FLAG_MODIFY

I decided to drop KEY_FLAG_MODIFY instead of allowing flag combinations not
yet used in the code and will simply recreate it with the Extended Key
ID patches once we get there. For that reason I also did not renumber
the flags.

Signed-off-by: Alexander Wetzel <alexander@wetzel-home.de>
4 years agoFix a wrong key_flag when deleting 802.1X WEP keys
Alexander Wetzel [Wed, 4 Mar 2020 17:16:51 +0000 (18:16 +0100)] 
Fix a wrong key_flag when deleting 802.1X WEP keys

Signed-off-by: Alexander Wetzel <alexander@wetzel-home.de>
4 years agoAP: Don't try to set NULL WEP default key
Alexander Wetzel [Wed, 4 Mar 2020 17:16:50 +0000 (18:16 +0100)] 
AP: Don't try to set NULL WEP default key

hostapd_broadcast_wep_set() can be called without a WEP key set.
Don't try to install a default key in that case.

This patch is not critical for the new API. With key_flag we just would
report an (ignored) error and do nothing. With the patch we simply do
nothing.

Signed-off-by: Alexander Wetzel <alexander@wetzel-home.de>
4 years agoFix unicast argument for set_wep_key() from EAPOL supplicant
Alexander Wetzel [Wed, 4 Mar 2020 17:16:49 +0000 (18:16 +0100)] 
Fix unicast argument for set_wep_key() from EAPOL supplicant

The unicast parameter in set_wep_key() is only expected to be set to 0
or 1. Without this patch we set unicast to 0x80 instead of 1. Since
unicast is used as boolean that is working fine but violates the
documented API.

Signed-off-by: Alexander Wetzel <alexander@wetzel-home.de>
4 years agotests: WPS PBC/PIN timeout on AP
Jouni Malinen [Wed, 4 Mar 2020 21:28:45 +0000 (23:28 +0200)] 
tests: WPS PBC/PIN timeout on AP

Verify that AuthorizedMACs advertisement is removed when a PBC session
or a PIN times out.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoWPS: Remove expired PINs on Selected Registrar timeout
Jouni Malinen [Wed, 4 Mar 2020 21:26:02 +0000 (23:26 +0200)] 
WPS: Remove expired PINs on Selected Registrar timeout

This clears the AuthorizedMACs advertisement immediately when the
Selected Registrar timeout is hit and no more active PINs are present.
Previously, the AuthorizedMACs advertisement could remain in place
indefinitely since expired PINs were removed only when actually trying
to find a PIN for a new WPS exchange.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agotests: sigma_dut special case for SAE Password Identifier with PWE looping
Jouni Malinen [Wed, 4 Mar 2020 19:23:43 +0000 (21:23 +0200)] 
tests: sigma_dut special case for SAE Password Identifier with PWE looping

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoDFS: More debug prints on channel selection after radar detection
Jouni Malinen [Tue, 3 Mar 2020 16:45:42 +0000 (18:45 +0200)] 
DFS: More debug prints on channel selection after radar detection

This makes it easier to understand what is happening when a new channel
needs to be selected based on a radar detection event.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agotests: DFS channel bandwidth downgrade from VHT80 to VHT40
Jouni Malinen [Tue, 3 Mar 2020 16:36:10 +0000 (18:36 +0200)] 
tests: DFS channel bandwidth downgrade from VHT80 to VHT40

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agohostapd: Fix to downgrade bandwidth in radar detection
Seevalamuthu Mariappan [Fri, 13 Dec 2019 10:16:41 +0000 (15:46 +0530)] 
hostapd: Fix to downgrade bandwidth in radar detection

Upon radar detection we used to search channels with the same bandwidth.
This way we might not find any other channels. If there are no channels
available with that bandwidth the AP service will be stopped. To avoid
this problem, also search a suitable channel by downgrading the
bandwidth. This scenario is applicable during CAC as well.

Signed-off-by: Seevalamuthu Mariappan <seevalam@codeaurora.org>
4 years agoDFS: Do not process radar event while disabling an interface
Seevalamuthu Mariappan [Fri, 13 Dec 2019 10:16:41 +0000 (15:46 +0530)] 
DFS: Do not process radar event while disabling an interface

In the normal case hostapd_disable_iface() and hostapd_enable_iface()
will be done while switching to another DFS channel upon radar
detection. In certain scenarios radar detected event can come while
hostapd_disable_iface() is in progress and iface->current_mode will be
NULL in that scenario. Previously, we did not check for this scenario
and proceeded with the radar detection logic which can trigger a
segmentation fault. To fix this, avoid proceeding the radar detection
event if iface->current_mode is NULL.

Signed-off-by: Seevalamuthu Mariappan <seevalam@codeaurora.org>
4 years agotests: Specific vs. wildcard SSID in Probe Request frame in BSSID-scan
Jouni Malinen [Mon, 2 Mar 2020 18:44:23 +0000 (20:44 +0200)] 
tests: Specific vs. wildcard SSID in Probe Request frame in BSSID-scan

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoAllow wildcard SSID to be enforced for a specific BSSID scan
Veerendranath Jakkam [Sat, 29 Feb 2020 06:56:36 +0000 (12:26 +0530)] 
Allow wildcard SSID to be enforced for a specific BSSID scan

Specific BSSID scan was replacing wildcard SSID with the known SSID if
any BSS with the specified BSSID is available in the known BSSes list.

Add control interface support to force use of a wildcard SSID in a
specific BSSID scan by user with the new "wildcard_ssid=1" argument to
the SCAN command.

Signed-off-by: Veerendranath Jakkam <vjakkam@codeaurora.org>
4 years agotests: Verify that HE gets fully enabled for mesh
Jouni Malinen [Mon, 2 Mar 2020 17:56:27 +0000 (19:56 +0200)] 
tests: Verify that HE gets fully enabled for mesh

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agomesh: Fix HE enablement on 5 GHz with VHT
Pradeep Kumar Chitrapu [Thu, 5 Dec 2019 02:57:28 +0000 (02:57 +0000)] 
mesh: Fix HE enablement on 5 GHz with VHT

Incorrect he_enabled parameter was being passed to
hostapd_set_freq_params() in mesh which caused HE to be not fully
enabled on the 5 GHz band. Fix this by setting freq->he_enabled instead
of vht_freq.he_enabled so that the hostapd_set_freq_params() uses the
correct he_enabled value (and then ends up copying this to
vht_freq.he_enabled in the success case).

Fixes: 6e711e7ab32 ("mesh: Do not enable HE on 5 GHz without VHT")
Signed-off-by: Pradeep Kumar Chitrapu <pradeepc@codeaurora.org>
4 years agotests: wpa_supplicant config file writing with SAE
Jouni Malinen [Mon, 2 Mar 2020 09:51:38 +0000 (11:51 +0200)] 
tests: wpa_supplicant config file writing with SAE

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoSAE: Allow SAE-only network profile with sae_password to be written
Sachin Shelke [Sun, 1 Mar 2020 23:48:41 +0000 (05:18 +0530)] 
SAE: Allow SAE-only network profile with sae_password to be written

The commit a34ca59e (SAE: Allow SAE password to be configured separately
(STA)) added sae_password configuration option. We should also consider
sae_password in the wpa_config_write() function which stores the valid
network block details to an external database.

Fixes: a34ca59e4db0 ("SAE: Allow SAE password to be configured separately (STA)")
Signed-off-by: Sachin Shelke <sachin.shelke@nxp.com>
Signed-off-by: Cathy Luo <xiaohua.luo@nxp.com>
Signed-off-by: Ganapathi Bhat <ganapathi.bhat@nxp.com>
4 years agoprivsep: Mask out control port capability flag
Jouni Malinen [Sun, 1 Mar 2020 19:31:07 +0000 (21:31 +0200)] 
privsep: Mask out control port capability flag

There is no support for using the control port for sending out EAPOL
frames through privsep yet, so mask out this capability to fall back to
the l2_packet based design.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoprivsep: Add key_flag to set_key()
Alexander Wetzel [Thu, 9 Jan 2020 23:04:59 +0000 (00:04 +0100)] 
privsep: Add key_flag to set_key()

Pass through the new key_flag to wpa_priv.

Signed-off-by: Alexander Wetzel <alexander@wetzel-home.de>
4 years agoSilence a compiler warning in no-WEP and no-EAP builds
Jouni Malinen [Sun, 1 Mar 2020 18:57:14 +0000 (20:57 +0200)] 
Silence a compiler warning in no-WEP and no-EAP builds

wep_keys_set was not used in wpas_start_assoc_cb() without
IEEE8021X_EAPOL, so need to make this local variable conditional on
build options.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: SAE and PSK with multiple passwords/passphrases
Jouni Malinen [Sun, 1 Mar 2020 17:53:16 +0000 (19:53 +0200)] 
tests: SAE and PSK with multiple passwords/passphrases

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agocommon: Add support for element defragmentation
Ilan Peer [Mon, 24 Feb 2020 09:14:33 +0000 (11:14 +0200)] 
common: Add support for element defragmentation

Add support for element defragmentation as defined in IEEE
P802.11-REVmd/D3.0, 10.28.12 (Element defragmentation).

Signed-off-by: Ilan Peer <ilan.peer@intel.com>