]> git.ipfire.org Git - thirdparty/hostap.git/log
thirdparty/hostap.git
4 years agotests: remove: Fix a typo in a comment
Jouni Malinen [Sun, 23 Feb 2020 13:19:59 +0000 (15:19 +0200)] 
tests: remove: Fix a typo in a comment

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: Extend wpas_ctrl_bssid_filter for remote testing
Janusz Dziedzic [Sun, 12 Jan 2020 22:02:26 +0000 (23:02 +0100)] 
tests: Extend wpas_ctrl_bssid_filter for remote testing

When this test case is ran in remote test environment, there could be
additional APs in scan results after bssid_filter has been disabled.
That breaks the check on SCAN_RESULTS output. Extend this to cover the
remote testing case by using bssid_filter with both known APs listed
instead of full wildcard.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@gmail.com>
4 years agotests: Fix multi_check() for remote testing
Janusz Dziedzic [Sun, 12 Jan 2020 22:02:25 +0000 (23:02 +0100)] 
tests: Fix multi_check() for remote testing

Don't use hardcoded BSSID; instead use the real BSSID from the device.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@gmail.com>
4 years agotests: remote: Generate and send BSS configuration files
Janusz Dziedzic [Sun, 12 Jan 2020 22:02:24 +0000 (23:02 +0100)] 
tests: remote: Generate and send BSS configuration files

Instead of hardcoded bss-[1-6]*.conf files, generate them using the
correct BSSID for each AP device and send/install them on the remote
client as well if needed.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@gmail.com>
4 years agohostapd: Replace UDP ctrl_iface global cookies with per-instance ones
Janusz Dziedzic [Sun, 12 Jan 2020 22:02:23 +0000 (23:02 +0100)] 
hostapd: Replace UDP ctrl_iface global cookies with per-instance ones

The cookie values for UDP control interface commands was defined as a
static global array. This did not allow multi-BSS test cases to be
executed with UDP control interface. For example, after
    hapd1 = hostapd.add_bss(apdev[0], ifname1, 'bss-1.conf')
    hapd2 = hostapd.add_bss(apdev[0], ifname2, 'bss-2.conf')

hapd1->ping() did not work.

Move those cookie values to per-instance location in struct
hapd_interfaces and struct hostapd_data to fix this.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@gmail.com>
4 years agotests: Generate ACL files
Janusz Dziedzic [Sun, 12 Jan 2020 22:02:22 +0000 (23:02 +0100)] 
tests: Generate ACL files

Generate ACL files instead of using files with hardcoded values for the
STA MAC addresses. Send the generated files also to the remote client if
required.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@gmail.com>
4 years agotests: remotehost: Add send_file()
Janusz Dziedzic [Sun, 12 Jan 2020 22:02:21 +0000 (23:02 +0100)] 
tests: remotehost: Add send_file()

Some hostapd test cases use configuration files, e.g., ACLs in BSS
configuration. When executing remote tests (udp), we have to first send
these configuration files to the appropriate remote device. The new
send_file() helper can be used for that.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@gmail.com>
4 years agoUse IFNAME= prefix for global UDP control interface events
Janusz Dziedzic [Sun, 12 Jan 2020 22:02:20 +0000 (23:02 +0100)] 
Use IFNAME= prefix for global UDP control interface events

There does not seem to be a good reason for using the different IFACE=
prefix on the UDP control interface. This got added when the UDP
interface in wpa_supplicant was extended in commit f0e5d3b5c6c7
("wpa_supplicant: Share attach/detach/send UDP ctrl_iface functions")
and that was then extended to hostapd in commit e9208056856c ("hostapd:
Extend global control interface notifications").

Replace the IFACE= prefix in UDP case with IFNAME= to be consistent with
the UNIX domain socket based control interface.

This fixes a problem when at least one test case fail (hapd_ctrl_sta)
when remote/udp used. This also fixes test_connectivity().

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@gmail.com>
4 years agotests: remote: Handle different ifconfig output formats
Janusz Dziedzic [Sun, 12 Jan 2020 22:02:19 +0000 (23:02 +0100)] 
tests: remote: Handle different ifconfig output formats

We could have different ifconfig output formats on the remote devices,
so make the parser more flexible to handle such cases.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@gmail.com>
4 years agotests: remote: Allow hwsim test cases with more than two arguments
Janusz Dziedzic [Sun, 12 Jan 2020 22:02:18 +0000 (23:02 +0100)] 
tests: remote: Allow hwsim test cases with more than two arguments

This allows more test cases to be run in remote setup. Previously, we
used to block all test cases that required more than two arguments
(i.e., that needed the params argument).

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@gmail.com>
4 years agotests: remote: Show dev/apdev for hwsim
Janusz Dziedzic [Sun, 12 Jan 2020 22:02:17 +0000 (23:02 +0100)] 
tests: remote: Show dev/apdev for hwsim

In case the hwsim wrapper is used in remote tests, show also which
device will be used as
apdev - hostapd
dev - wpa_supplicant

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@gmail.com>
4 years agotests: remote: Kill correct hostapd/wpa_supplicant process
Janusz Dziedzic [Sun, 12 Jan 2020 22:02:16 +0000 (23:02 +0100)] 
tests: remote: Kill correct hostapd/wpa_supplicant process

Kill hostapd and wpa_supplicant based on the configuration parameters.
Previously, we could have killed wrong processes.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@gmail.com>
4 years agotests: remote: Switch to python3
Janusz Dziedzic [Sun, 12 Jan 2020 22:02:15 +0000 (23:02 +0100)] 
tests: remote: Switch to python3

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@gmail.com>
4 years agoIBSS RSN: Coding style cleanup
Alexander Wetzel [Fri, 10 Jan 2020 22:19:10 +0000 (23:19 +0100)] 
IBSS RSN: Coding style cleanup

Use consistent style for pointers.

Signed-off-by: Alexander Wetzel <alexander@wetzel-home.de>
4 years agotests: Allow PTK0 rekey for tests
Alexander Wetzel [Fri, 10 Jan 2020 22:19:10 +0000 (23:19 +0100)] 
tests: Allow PTK0 rekey for tests

Verify PTK0 rekey blocking is working as intended.

Signed-off-by: Alexander Wetzel <alexander@wetzel-home.de>
4 years agoSTA: Allow PTK rekeying without Ext KeyID to be disabled as a workaround
Alexander Wetzel [Fri, 10 Jan 2020 22:19:09 +0000 (23:19 +0100)] 
STA: Allow PTK rekeying without Ext KeyID to be disabled as a workaround

Rekeying a pairwise key using only keyid 0 (PTK0 rekey) has many broken
implementations and should be avoided when using or interacting with
one. The effects can be triggered by either end of the connection and
range from hardly noticeable disconnects over long connection freezes up
to leaking clear text MPDUs.

To allow affected users to mitigate the issues, add a new configuration
option "wpa_deny_ptk0_rekey" to replace all PTK0 rekeys with fast
reconnects.

Signed-off-by: Alexander Wetzel <alexander@wetzel-home.de>
4 years agoAP: Allow PTK rekeying without Ext KeyID to be disabled as a workaround
Alexander Wetzel [Fri, 10 Jan 2020 22:19:08 +0000 (23:19 +0100)] 
AP: Allow PTK rekeying without Ext KeyID to be disabled as a workaround

Rekeying a pairwise key using only keyid 0 (PTK0 rekey) has many broken
implementations and should be avoided when using or interacting with
one. The effects can be triggered by either end of the connection and
range from hardly noticeable disconnects over long connection freezes up
to leaking clear text MPDUs.

To allow affected users to mitigate the issues, add a new hostapd
configuration option "wpa_deny_ptk0_rekey" to replace all PTK0 rekeys
with disconnection. This requires the station to reassociate to get
connected again and as such, can result in connectivity issues as well.

Signed-off-by: Alexander Wetzel <alexander@wetzel-home.de>
4 years agonl80211: Add driver capability flag for CAN_REPLACE_PTK0
Alexander Wetzel [Sat, 4 Jan 2020 22:10:00 +0000 (23:10 +0100)] 
nl80211: Add driver capability flag for CAN_REPLACE_PTK0

The CAN_REPLACE_PTK0 flag provided by nl80211 can be used to detect if
the card/driver is explicitly indicating capability to rekey STA PTK
keys using only keyid 0 correctly.

Check if the card/driver supports it and make the status available as a
driver flag.

Signed-off-by: Alexander Wetzel <alexander@wetzel-home.de>
4 years agoDo not skip MBO PMF check with the WPS special case WPA check exception
Jouni Malinen [Sat, 22 Feb 2020 17:07:11 +0000 (19:07 +0200)] 
Do not skip MBO PMF check with the WPS special case WPA check exception

The MBO PMF check for AP SME in the driver case was added into a
location that is skipped for WPS processing. That was not really the
correct place for this since the skip_wpa_check label was supposed to
remain immediately following the WPA checks. While this does not really
have much of a practical impact, move the check around so that the
skip_wpa_check label remains where it is supposed to be.

Fixes: 4c572281edaa ("MBO: Mandate use of PMF for WPA2+MBO association (AP)")
Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoSave RM enabled capability of station with AP SME
Ouden [Fri, 21 Feb 2020 01:39:46 +0000 (09:39 +0800)] 
Save RM enabled capability of station with AP SME

Save RM enabled capability element of an associating station when
hostapd use the device AP SME similarly to how this information is saved
with SME-on-hostapd cases. This allows radio measurement operations
(e.g., REQ_BEACON) to be used.

Signed-off-by: Ouden <Ouden.Biz@gmail.com>
4 years agoMake INTERWORKING_CONNECT more reliable in testing environment
Jouni Malinen [Sat, 22 Feb 2020 16:49:01 +0000 (18:49 +0200)] 
Make INTERWORKING_CONNECT more reliable in testing environment

Pick the most recently added BSS entry based on BSSID matching to avoid
issues in testing environment where the SSID of the AP may have changed
and both the old and new BSS is still present in the scan results.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoFix a typo in a comment
Jouni Malinen [Sat, 22 Feb 2020 15:08:19 +0000 (17:08 +0200)] 
Fix a typo in a comment

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoRemove Secondary Channel Offset element from Beacon/Probe Response frames
Jouni Malinen [Sat, 22 Feb 2020 15:05:20 +0000 (17:05 +0200)] 
Remove Secondary Channel Offset element from Beacon/Probe Response frames

This element is not used in Beacon or Probe Response frames (which is
the reason why the standard does not indicate where exactly it would be
in those frames..); HT Operation element has this information and so
does Extended CSA element.

In practice, this reverts the functionality added in commit 76aab0305c1f
("Add secondary channel IE for CSA").

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoFix HE element order in Beacon and Probe Response frames
Jouni Malinen [Sat, 22 Feb 2020 14:50:10 +0000 (16:50 +0200)] 
Fix HE element order in Beacon and Probe Response frames

Spatial Reuse Parameter Set element is before MU EDCA Parameter Set
element.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoRemove CONFIG_IEEE80211N build option
Jouni Malinen [Sat, 22 Feb 2020 14:22:18 +0000 (16:22 +0200)] 
Remove CONFIG_IEEE80211N build option

Hardcoded CONFIG_IEEE80211N to be included to clean up implementation.
More or less all new devices support IEEE 802.11n (HT) and there is not
much need for being able to remove that functionality from the build.
Included this unconditionally to get rid of one more build options and
to keep things simpler.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agoFix location of MDE and RSNXE in Beacon and Probe Response frames
Jouni Malinen [Sat, 22 Feb 2020 14:07:17 +0000 (16:07 +0200)] 
Fix location of MDE and RSNXE in Beacon and Probe Response frames

Split the IEs from WPA authenticator state machine into separately added
IEs so that the exact location between these and other elements can be
controlled. This fixes the location of MDE and RSNXE in Beacon and Probe
Response frames. In addition, this swaps the order of BSS Load and RM
Enabled Capabilities elements in Beacon frames to get them into the
correct order (which was already used for Probe Response frames).
Furthermore, this fixes the buffer end checks for couple of elements to
make the implementation more consistent (though, in practice, there is
no impact from this since the old size limit was smaller than needed,
but still sufficiently large to have room for these).

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: Beacon protection
Jouni Malinen [Mon, 17 Feb 2020 21:45:18 +0000 (23:45 +0200)] 
tests: Beacon protection

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agowlantest: BIGTK fetching and Beacon protection validation
Jouni Malinen [Fri, 21 Feb 2020 17:40:32 +0000 (19:40 +0200)] 
wlantest: BIGTK fetching and Beacon protection validation

Fetch the BIGTK from EAPOL-Key msg 3/4 and use it to validate MME in
Beacon frames when the AP uses Beacon protection.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoConfigure received BIGTK on station/supplicant side
Jouni Malinen [Mon, 17 Feb 2020 22:06:26 +0000 (00:06 +0200)] 
Configure received BIGTK on station/supplicant side

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agowpa_supplicant configuration for Beacon protection
Jouni Malinen [Mon, 17 Feb 2020 22:16:55 +0000 (00:16 +0200)] 
wpa_supplicant configuration for Beacon protection

Add a new wpa_supplicant network profile configuration parameter
beacon_prot=<0/1> to allow Beacon protection to be enabled.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoAdd BIGTK KDE and subelement similarly to IGTK
Jouni Malinen [Mon, 17 Feb 2020 21:08:05 +0000 (23:08 +0200)] 
Add BIGTK KDE and subelement similarly to IGTK

This provides the BIGTK updates to associated stations similarly to
IGTK.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoGenerate BIGTK and rekey it with IGTK
Jouni Malinen [Mon, 17 Feb 2020 21:08:05 +0000 (23:08 +0200)] 
Generate BIGTK and rekey it with IGTK

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoParsing of BIGTK KDE in EAPOL-Key frames
Jouni Malinen [Mon, 17 Feb 2020 21:03:40 +0000 (23:03 +0200)] 
Parsing of BIGTK KDE in EAPOL-Key frames

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoParsing of BIGTK subelement in FTE
Jouni Malinen [Mon, 17 Feb 2020 21:01:59 +0000 (23:01 +0200)] 
Parsing of BIGTK subelement in FTE

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agodriver: Document use of set_key() for BIGTK
Jouni Malinen [Mon, 17 Feb 2020 20:58:52 +0000 (22:58 +0200)] 
driver: Document use of set_key() for BIGTK

Also update the comment to match the current IGTK KeyID range.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoAP mode indication of Beacon protection being enabled
Jouni Malinen [Mon, 17 Feb 2020 20:55:12 +0000 (22:55 +0200)] 
AP mode indication of Beacon protection being enabled

Add the new Extended Capability bit for indicating Beacon protection.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agohostapd configuration for Beacon protection
Jouni Malinen [Mon, 17 Feb 2020 20:54:23 +0000 (22:54 +0200)] 
hostapd configuration for Beacon protection

Add a new hostapd configuration parameter beacon_prot=<0/1> to allow
Beacon protection to be enabled.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agonl80211: Remove an extra closing parenthesis from a debug message
Jouni Malinen [Mon, 17 Feb 2020 21:44:26 +0000 (23:44 +0200)] 
nl80211: Remove an extra closing parenthesis from a debug message

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agonl80211: Check nla_nest_start() result for NL80211_ATTR_HE_OBSS_PD
Jouni Malinen [Mon, 17 Feb 2020 17:30:47 +0000 (19:30 +0200)] 
nl80211: Check nla_nest_start() result for NL80211_ATTR_HE_OBSS_PD

nla_nest_start() might fail, so need to check its return value similarly
to all the other callers.

Fixes: a84bf443887d ("HE: Send the AP's OBSS PD settings to the kernel")
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoHE: Propagate BSS color settings to nl80211
John Crispin [Tue, 4 Feb 2020 08:04:55 +0000 (09:04 +0100)] 
HE: Propagate BSS color settings to nl80211

Add the code required to send the BSS color settings to the kernel.

Signed-off-by: John Crispin <john@phrozen.org>
4 years agoFix VERSION_STR printf() calls in case the postfix strings include %
Didier Raboud [Sun, 16 Feb 2020 15:14:54 +0000 (16:14 +0100)] 
Fix VERSION_STR printf() calls in case the postfix strings include %

Do not use VERSION_STR directly as the format string to printf() since
it is possible for that string to contain '%'.

Signed-off-by: Didier Raboud <odyx@debian.org>
4 years agonl80211: Handle AKM suite selectors for AP configuration
Jouni Malinen [Mon, 17 Feb 2020 15:43:11 +0000 (17:43 +0200)] 
nl80211: Handle AKM suite selectors for AP configuration

Previously only couple of AKM suite selectors were converted into
NL80211_ATTR_AKM_SUITES. Add rest of the AKM suites here. However, since
the current kernel interface has a very small limit
(NL80211_MAX_NR_AKM_SUITES = 2), add the attribute only when no more
than that limit entries are included. cfg80211 would reject the command
with any more entries listed.

This needs to be extended in cfg80211/nl80211 in a backwards compatible
manner, so this seems to be the best that can be done for now in user
space. Many drivers do not use this attribute, so must not reject the
configuration completely when larger number of AKM suites is configured.
Such cases may not work properly with drivers that depend on
NL80211_ATTR_AKM_SUITES value.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agoRemove duplicated wpa_akm_to_suite() entry
Jouni Malinen [Mon, 17 Feb 2020 15:41:51 +0000 (17:41 +0200)] 
Remove duplicated wpa_akm_to_suite() entry

This was unreachable code due to the previous WPA_KEY_MGTM_OWE case
returning from the function.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agonl80211: Add NLA_F_NESTED to nla_nest_start() with older libnl versions
Jouni Malinen [Mon, 17 Feb 2020 15:25:05 +0000 (17:25 +0200)] 
nl80211: Add NLA_F_NESTED to nla_nest_start() with older libnl versions

This is needed to work around a missing attribute that would cause
cfg80211 to reject some nl80211 commands (e.g.,
NL80211_ATTR_VENDOR_DATA) with new kernel versions that enforce netlink
attribute policy validation.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years agowebkit: Clean up USE_WEBKIT2 blocks
Jouni Malinen [Sun, 16 Feb 2020 16:45:12 +0000 (18:45 +0200)] 
webkit: Clean up USE_WEBKIT2 blocks

Use a single block each for webkit and webkit2 signal handlers. This
cleans up browser.c to have clear sections for each webkit API version.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agowebkit2: Split decide-policy into a separate function
Jouni Malinen [Sun, 16 Feb 2020 16:40:42 +0000 (18:40 +0200)] 
webkit2: Split decide-policy into a separate function

This cleans up the #ifdef/#else/#endif mess in the function for webkit
vs. webkit2 API.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agowebkit2: Split resource-load-started handler into a separate function
Jouni Malinen [Sun, 16 Feb 2020 16:37:02 +0000 (18:37 +0200)] 
webkit2: Split resource-load-started handler into a separate function

This cleans up the #ifdef/#else/#endif mess in the function for webkit
vs. webkit2 API.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agowebkit: Track gtk_main()/gtk_main_quit() calls
Jouni Malinen [Sun, 16 Feb 2020 16:31:31 +0000 (18:31 +0200)] 
webkit: Track gtk_main()/gtk_main_quit() calls

Avoid unnecessary warnings from webkit on calling gtk_main_quit() more
than once for a single gtk_main() call. This is also fixing an issue for
a corner case where the very first URL has special purpose (osu:// or
http://localhost:12345).

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agowebkit2: Remove TODO not for download-started
Jouni Malinen [Sun, 16 Feb 2020 16:18:07 +0000 (18:18 +0200)] 
webkit2: Remove TODO not for download-started

It does not look like this signal handler would be needed.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agowebkit2: Do not register notify::load-status handler
Jouni Malinen [Sun, 16 Feb 2020 16:16:13 +0000 (18:16 +0200)] 
webkit2: Do not register notify::load-status handler

This did not seem to do anything with webkit2, so do not bother
registering the handler.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agowebkit2: Replace notfy::progress with notify::estimated-load-progress
Jouni Malinen [Sun, 16 Feb 2020 16:11:42 +0000 (18:11 +0200)] 
webkit2: Replace notfy::progress with notify::estimated-load-progress

The older signal handler for notify::progress did not really work with
webkit2.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agowebkit2: Implement notify::title handler
Jouni Malinen [Sun, 16 Feb 2020 16:06:20 +0000 (18:06 +0200)] 
webkit2: Implement notify::title handler

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agowebkit2: Use mouse-target-changed to replace hovering-over-link
Jouni Malinen [Sun, 16 Feb 2020 16:00:49 +0000 (18:00 +0200)] 
webkit2: Use mouse-target-changed to replace hovering-over-link

The previous implementation of hovering-over-link signal handler did not
really work with webkit2, so replace this with mouse-target-changed
handler.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agohs20-osu-client: Validate HTTPS server certificate by default (browser)
Jouni Malinen [Sun, 16 Feb 2020 15:33:58 +0000 (17:33 +0200)] 
hs20-osu-client: Validate HTTPS server certificate by default (browser)

This changes "hs20-osu-client browser <URL>" behavior to validate the
HTTPS server certificate against the system trust roots. The new command
line argument -T can be used to disable this validation.

This does not change behavior for SPP/OMA-DM triggered OSU operation,
i.e., they continue to not mandate server certificate validation for now
to avoid breaking existing test cases.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agohs20_web_browser() to allow TLS server validation to be enabled
Jouni Malinen [Sun, 16 Feb 2020 15:28:58 +0000 (17:28 +0200)] 
hs20_web_browser() to allow TLS server validation to be enabled

hs20_web_browser() was previously hardcoded to not perform strict TLS
server validation. Add an argument to this function to allow that
behavior to be configured. The hs20-osu-client users are still using the
old behavior, i.e., not validating server certificates, to be usable for
testing purposes.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agohs20-osu-client: Ignore TLS errors with webkit2
Ben Greear [Fri, 7 Feb 2020 09:10:16 +0000 (01:10 -0800)] 
hs20-osu-client: Ignore TLS errors with webkit2

Hopefully this helps with self-signed certificates. This matches the
older behavior with webkit.

Signed-off-by: Ben Greear <greearb@candelatech.com>
4 years agohs20-osu-client: Enable webkit2 support
Ben Greear [Fri, 7 Feb 2020 09:10:13 +0000 (01:10 -0800)] 
hs20-osu-client: Enable webkit2 support

This is my mostly-ignorant attempt to port hs20-osu-client to webkit2
API.

Signed-off-by: Ben Greear <greearb@candelatech.com>
4 years agoHT: Remove SMPS in AP mode
Jouni Malinen [Sun, 16 Feb 2020 11:58:54 +0000 (13:58 +0200)] 
HT: Remove SMPS in AP mode

SM Power Save was described in somewhat unclear manner in IEEE Std
802.11n-2009 as far the use of it locally in an AP to save power. That
was clarified in IEEE Std 802.11-2016 to allow only a non-AP STA to use
SMPS while the AP is required to support an associated STA doing so. The
AP itself cannot use SMPS locally and the HT Capability advertisement
for this is not appropriate.

Remove the parts of SMPS support that involve the AP using it locally.
In practice, this reverts the following commits:
04ee647d58a2 ("HT: Let the driver advertise its supported SMPS modes for AP mode")
8f461b50cfe4 ("HT: Pass the smps_mode in AP parameters")
da1080d7215f ("nl80211: Advertise and configure SMPS modes")

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years agotests: Remove ap_ht_smps
Jouni Malinen [Sun, 16 Feb 2020 11:48:39 +0000 (13:48 +0200)] 
tests: Remove ap_ht_smps

AP using SMPS mode locally is about to be removed from hostapd, so
remove the test case that was using it.

Signed-off-by: Jouni Malinen <j@w1.fi>
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>