]> git.ipfire.org Git - thirdparty/hostap.git/log
thirdparty/hostap.git
5 years agotests: Add wlantest description for ap_ft_pmf_*_over_ds
Jouni Malinen [Sat, 9 Mar 2019 09:37:02 +0000 (11:37 +0200)] 
tests: Add wlantest description for ap_ft_pmf_*_over_ds

This is convenient to allow easier examination of the FT Action frames.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: Use run_ap_ft_pmf_bip_over_ds() for ap_ft_pmf_over_ds
Jouni Malinen [Sat, 9 Mar 2019 09:33:49 +0000 (11:33 +0200)] 
tests: Use run_ap_ft_pmf_bip_over_ds() for ap_ft_pmf_over_ds

No need to duplicate this functionality when all the ap_ft_pmf_*_over_ds
test cases are doing practically the same thing and the
no-specific-cipher-configuration case can be addressed easily with the
same helper function.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: Fix ap_ft_pmf_over_ds
Jouni Malinen [Sat, 9 Mar 2019 09:26:38 +0000 (11:26 +0200)] 
tests: Fix ap_ft_pmf_over_ds

The main step of the test case was accidentally removed when adding the
cipher specific versions.

Fixes: ffcaca68d3ed ("tests: FT with different BIP algorithms")
Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoEAP-pwd server: Fix memory leak with salted passwords
Masashi Honma [Sun, 3 Mar 2019 00:52:22 +0000 (09:52 +0900)] 
EAP-pwd server: Fix memory leak with salted passwords

The struct hostapd_eap_user changes with a new allocated variable were
not covered in the RADIUS server code. Fix this by using eap_user_free()
instead of custom memory freeing operation in radius_server.c.

The hwsim tests with salted password (ap_wpa2_eap_pwd_salt_sha1,
ap_wpa2_eap_pwd_salt_sha256, ap_wpa2_eap_pwd_salt_sha512) triggered
these memory leaks.

Fixes: d52ead3db7b2 ("EAP-pwd server: Add support for salted password databases")
Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
5 years agotests: Report authentication server memory leaks more visible
Jouni Malinen [Fri, 8 Mar 2019 14:52:52 +0000 (16:52 +0200)] 
tests: Report authentication server memory leaks more visible

It was too easy to miss memory leaks in the hostapd-as-AS log.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoSAE: Add Finite Cyclic Group field in status code 77 response
Jouni Malinen [Fri, 8 Mar 2019 14:21:03 +0000 (16:21 +0200)] 
SAE: Add Finite Cyclic Group field in status code 77 response

Copy the Finite Cyclic Group field value from the request to the
response Authentication frame if we end up rejecting the request due to
unsupported group.

IEEE Std 802.11-2016 has conflicting statements about this behavior.
Table 9-36 (Presence of fields and elements in Authentication frames)
indicates that the Finite Cyclic Group field is only included with
status code values 0 (success) and 76 (anti-clogging token request)
while SAE protocol description implying that the Finite Cyclic Group
field is set to the rejected group (12.4.8.6.3 and 12.4.8.6.4).

The standard language needs to cleaned up to describe this
unambiguously, but since it looks safe to add the field into the
rejection case and since there is desire to have the field present to be
able to implement what exactly is stated in 12.4.8.6.4, it looks
reasonable to move ahead with the AP mode implementation change. There
is no change in wpa_supplicant for now to modify its behavior based on
whether this field is present, i.e., wpa_supplicant will continue to
work with both the old and new hostapd behavior for SAE group
negotiation.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoEAP-pwd: Fix a memory leak in hunting-and-pecking loop
Jouni Malinen [Wed, 6 Mar 2019 22:27:12 +0000 (00:27 +0200)] 
EAP-pwd: Fix a memory leak in hunting-and-pecking loop

tmp2 (y^2) was derived once in each iteration of the loop and only freed
after all the loop iterations. Fix this by freeing the temporary value
during each iteration.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: WPS with PSK+SAE
Jouni Malinen [Wed, 6 Mar 2019 19:45:19 +0000 (21:45 +0200)] 
tests: WPS with PSK+SAE

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoWPS: Allow SAE configuration to be added automatically for PSK
Jouni Malinen [Wed, 6 Mar 2019 19:44:06 +0000 (21:44 +0200)] 
WPS: Allow SAE configuration to be added automatically for PSK

The new wpa_supplicant configuration parameter wps_cred_add_sae=1 can be
used to request wpa_supplicant to add SAE configuration whenever WPS is
used to provision WPA2-PSK credentials and the credential includes a
passphrase (instead of PSK). This can be used to enable WPA3-Personal
transition mode with both SAE and PSK enabled and also with PMF enabled.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoWPS: Allow AP SAE configuration to be added automatically for PSK
Jouni Malinen [Wed, 6 Mar 2019 19:41:44 +0000 (21:41 +0200)] 
WPS: Allow AP SAE configuration to be added automatically for PSK

The new hostapd configuration parameter wps_cred_add_sae=1 can be used
to request hostapd to add SAE configuration whenever WPS is used to
configure the AP to use WPA2-PSK and the credential includes a
passphrase (instead of PSK). This can be used to enable WPA3-Personal
transition mode with both SAE and PSK enabled and PMF enabled for PSK
and required for SAE associations.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoVendor feature capability for TWT (Target Wake Time)
Sunil Dutt [Thu, 28 Feb 2019 09:04:04 +0000 (14:34 +0530)] 
Vendor feature capability for TWT (Target Wake Time)

Add a new QCA vendor specific feature capability indication for the
device to indicate the support of TWT.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoVendor attribute to indicate a set_blacklist of BSSID only as a hint
Sunil Dutt [Thu, 28 Feb 2019 09:39:29 +0000 (15:09 +0530)] 
Vendor attribute to indicate a set_blacklist of BSSID only as a hint

The current/default behavior of set blacklist BSSID QCA vendor command
is a mandate to the driver - do not consider this BSSID for connect/roam
till reset.

There are use cases where this need not be a mandate and thus could
provide the flexibility for the driver to consider this BSSID if there
are no better ones. Such use cases can use this new flag attribute to
only hint the blacklist of a BSSID to the driver.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoVendor attribute to configure HE testbed default capabilities
Kiran Kumar Lokere [Thu, 28 Feb 2019 01:40:51 +0000 (17:40 -0800)] 
Vendor attribute to configure HE testbed default capabilities

Add a new QCA vendor attribute for testing purposes.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoVendor attribute to configure support to enable VHT in 2.4G band
Kiran Kumar Lokere [Wed, 6 Feb 2019 01:04:24 +0000 (17:04 -0800)] 
Vendor attribute to configure support to enable VHT in 2.4G band

Add a new QCA vendor attribute for testing purposes.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoVendor attribute to configure HE OMI UL MU data disable
Kiran Kumar Lokere [Wed, 6 Feb 2019 00:59:27 +0000 (16:59 -0800)] 
Vendor attribute to configure HE OMI UL MU data disable

Add a new QCA vendor attribute for testing purposes.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: SAE anti clogging during an attack
Jouni Malinen [Sun, 3 Mar 2019 15:10:40 +0000 (17:10 +0200)] 
tests: SAE anti clogging during an attack

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoSAE: Reuse previously generated PWE on a retry with the same STA
Jouni Malinen [Sun, 3 Mar 2019 14:56:14 +0000 (16:56 +0200)] 
SAE: Reuse previously generated PWE on a retry with the same STA

Do not start SAE authentication from scratch if a STA starts a new
attempt for the same group while we still have previously generated PWE
available. Instead, use the previously generated PWE as-is and skip
anti-clogging token exchange since the heavy processing is already
completed. This saves unnecessary processing on the AP side in case the
STA failed to complete authentication on the first attempt (e.g., due to
heavy SAE load on the AP causing a timeout) and makes it more likely for
a valid STA to be able to complete SAE authentication during a DoS
attack.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoSAE: Reuse previously generated PWE on a retry with the same AP
Jouni Malinen [Sun, 3 Mar 2019 14:23:19 +0000 (16:23 +0200)] 
SAE: Reuse previously generated PWE on a retry with the same AP

Do not start SAE authentication from scratch when the AP requests
anti-clogging token to be used. Instead, use the previously generated
PWE as-is if the retry is for the same AP and the same group. This saves
unnecessary processing on the station side in case the AP is under heavy
SAE authentiation load.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoSAE: Enforce single use for anti-clogging tokens
Jouni Malinen [Fri, 1 Mar 2019 20:05:52 +0000 (22:05 +0200)] 
SAE: Enforce single use for anti-clogging tokens

Add a 16-bit token index into the anti-clogging token. This can be used
to enforce only a single use of each issued anti-clogging token request.
The token value is now token-index |
last-30-octets-of(HMAC-SHA256(sae_token_key, STA-MAC-address |
token-index)), i.e., the first two octets of the SHA256 hash value are
replaced with the token-index and token-index itself is protected as
part of the HMAC context data.

Track the used 16-bit token index values and accept received tokens only
if they use an index value that has been requested, but has not yet been
used. This makes it a bit more difficult for an attacker to perform DoS
attacks against the heavy CPU operations needed for processing SAE
commit since the attacker cannot simply replay the same frame multiple
times and instead, needs to request each token separately.

While this does not add significant extra processing/CPU need for the
attacker, this can be helpful in combination with the queued processing
of SAE commit messages in enforcing more delay during flooding of SAE
commit messages since the new anti-clogging token values are not
returned before the new message goes through the processing queue.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoSAE: Process received commit message through a queue
Jouni Malinen [Fri, 1 Mar 2019 17:54:51 +0000 (19:54 +0200)] 
SAE: Process received commit message through a queue

This allows better control of processing new SAE sessions so that other
operations can be given higher priority during bursts of SAE requests,
e.g., during a potential DoS attack. The receive commit messages are
queued (up to maximum of 15 entries) and processed from eloop callback.
If the queue has multiple pending entries, more wait time is used to go
through the each new entry to reduce heavy CPU load from SAE processing.

Enable anti-clogging token use also based on the pending commit message
queue and not only based on the already started sessions.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: More complete group list for sae_groups
Jouni Malinen [Wed, 6 Mar 2019 11:05:23 +0000 (13:05 +0200)] 
tests: More complete group list for sae_groups

Add group 1 for completeness sake and also and Brainpool groups with
OpenSSL 1.1.*.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoSAE: Enable only groups 19, 20, and 21 in station mode
Jouni Malinen [Tue, 5 Mar 2019 15:23:58 +0000 (17:23 +0200)] 
SAE: Enable only groups 19, 20, and 21 in station mode

Remove groups 25 (192-bit Random ECP Group) and 26 (224-bit Random ECP
Group) from the default SAE groups in station mode since those groups
are not as strong as the mandatory group 19 (NIST P-256).

In addition, add a warning about MODP groups 1, 2, 5, 22, 23, and 24
based on "MUST NOT" or "SHOULD NOT" categorization in RFC 8247. All the
MODP groups were already disabled by default and would have needed
explicit configuration to be allowed.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoSAE: Enable only group 19 by default in AP mode
Jouni Malinen [Tue, 5 Mar 2019 15:18:11 +0000 (17:18 +0200)] 
SAE: Enable only group 19 by default in AP mode

Change the AP mode default for SAE to enable only the group 19 instead
of enabling all ECC groups that are supported by the used crypto library
and the SAE implementations. The main reason for this is to avoid
enabling groups that are not as strong as the mandatory-to-support group
19 (i.e., groups 25 and 26). In addition, this disables heavier groups
by default.

In addition, add a warning about MODP groups 1, 2, 5, 22, 23, and 24
based on "MUST NOT" or "SHOULD NOT" categorization in RFC 8247. All the
MODP groups were already disabled by default and would have needed
explicit configuration to be allowed.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: Enable needed SAE groups explicitly in sae_oom_wpas
Jouni Malinen [Tue, 5 Mar 2019 15:13:35 +0000 (17:13 +0200)] 
tests: Enable needed SAE groups explicitly in sae_oom_wpas

Configure the sae_groups parameter for hostapd explicitly in preparation
for the default value change in the implementation.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: Enable needed SAE groups explicitly in sigma_dut_sae
Jouni Malinen [Tue, 5 Mar 2019 15:12:44 +0000 (17:12 +0200)] 
tests: Enable needed SAE groups explicitly in sigma_dut_sae

Configure the sae_groups parameter for hostapd explicitly in preparation
for the default value change in the implementation.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoAdd explicit checks for peer's DH public key
Jouni Malinen [Tue, 5 Mar 2019 15:05:03 +0000 (17:05 +0200)] 
Add explicit checks for peer's DH public key

Pass the group order (if known/specified) to crypto_dh_derive_secret()
(and also to OpenSSL DH_generate_key() in case of Group 5) and verify
that the public key received from the peer meets 1 < pubkey < p and
pubkey^q == 1 mod p conditions.

While all these use cases were using only ephemeral DH keys, it is
better to use more explicit checks while deriving the shared secret to
avoid unexpected behavior.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agobignum: Fix documentation for bignum_cmp_d()
Jouni Malinen [Tue, 5 Mar 2019 14:10:33 +0000 (16:10 +0200)] 
bignum: Fix documentation for bignum_cmp_d()

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: FT-SAE with Password Identifier
Jouni Malinen [Tue, 26 Feb 2019 18:39:54 +0000 (20:39 +0200)] 
tests: FT-SAE with Password Identifier

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: More robust connect command testing
Jouni Malinen [Mon, 25 Feb 2019 19:58:28 +0000 (21:58 +0200)] 
tests: More robust connect command testing

Avoid an invalid failure case due to scan results being left behind from
connect_cmd_bssid_hint when executing connect_cmd_reject_assoc by
explicitly clearing the scan results from dev5. This fixes an error case
that happened with the following test case sequence:
connect_cmd_bssid_hint connect_cmd_reject_assoc

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: Make MACsec test cases clear monitor socket more thoroughly
Jouni Malinen [Mon, 25 Feb 2019 19:40:23 +0000 (21:40 +0200)] 
tests: Make MACsec test cases clear monitor socket more thoroughly

The wpas (dev5) control interface socket did not always get cleared in
the MACsec test cases and this could result in issues with following
test cases if the dev5 message queue hit the maximum limit.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agodefconfig: Enable IEEE 802.11w management frame protection (wpa_supplicant)
Lubomir Rintel [Tue, 19 Feb 2019 13:44:19 +0000 (14:44 +0100)] 
defconfig: Enable IEEE 802.11w management frame protection (wpa_supplicant)

NetworkManager can use these if available and the distros generally
enable this already.

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
5 years agodefconfig: enable IEEE 802.11r fast BSS transition (wpa_supplicant)
Lubomir Rintel [Tue, 19 Feb 2019 13:44:18 +0000 (14:44 +0100)] 
defconfig: enable IEEE 802.11r fast BSS transition (wpa_supplicant)

Generally useful. Linux distros already enable these, upcoming
NetworkManager will support it too.

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
5 years agodefconfig: Enable IEEE 802.11n and 802.11ac (wpa_supplicant)
Lubomir Rintel [Tue, 19 Feb 2019 13:44:17 +0000 (14:44 +0100)] 
defconfig: Enable IEEE 802.11n and 802.11ac (wpa_supplicant)

I guess there's no reason anyone with capable hardware wouldn't want to
enable these. Debian and Fedora aleady do.

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
5 years agodefconfig: Enable Hotspot 2.0 (wpa_supplicant)
Lubomir Rintel [Tue, 19 Feb 2019 13:44:16 +0000 (14:44 +0100)] 
defconfig: Enable Hotspot 2.0 (wpa_supplicant)

Generally useful, Debian enables this. Other distros should too.

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
5 years agodefconfig: Enable RSN on IBSS networks (wpa_supplicant)
Lubomir Rintel [Tue, 19 Feb 2019 13:44:15 +0000 (14:44 +0100)] 
defconfig: Enable RSN on IBSS networks (wpa_supplicant)

Fedora and Debian enable this. NetworkManager actually rejects such
configurations citing kernel bugs, but that actually might not be the
right thing to do anymore.

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
5 years agodefconfig: Remove obsolete notes about OpenSSL requirements for EAP-FAST
Jouni Malinen [Mon, 25 Feb 2019 17:29:02 +0000 (19:29 +0200)] 
defconfig: Remove obsolete notes about OpenSSL requirements for EAP-FAST

OpenSSL 0.9.8 reached its end-of-life long time ago, so remove these old
notes about need of a newer OpenSSL version for EAP-FAST since all
current OpenSSL versions include the needed functionality.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agodefconfig: Enable a handful of EAP methods (wpa_supplicant)
Lubomir Rintel [Tue, 19 Feb 2019 13:44:14 +0000 (14:44 +0100)] 
defconfig: Enable a handful of EAP methods (wpa_supplicant)

Fedora uses AKA, FAST, GPSK_SHA256, GPSK, IKEV2, PAX, SAKE and TNC. I
don't know why these in particular. AKA wouldn't work, because
CONFIG_PCSC is off anyways; let's enable all the other ones, and also
PWD (openSUSE enabled it because users demanded it).

Debian enables all of the above uses, but also PWD, AKA_PRIME, SIM, PSK
and EKE.

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
5 years agodefconfig: Enable logging to file and syslog (wpa_supplicant)
Lubomir Rintel [Tue, 19 Feb 2019 13:44:12 +0000 (14:44 +0100)] 
defconfig: Enable logging to file and syslog (wpa_supplicant)

Debian and Fedora enable both and log to syslog. openSUSE seems to log
to a flat file instead.

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
5 years agodefconfig: Enable simple bgscan module (wpa_supplicant)
Lubomir Rintel [Tue, 19 Feb 2019 13:44:11 +0000 (14:44 +0100)] 
defconfig: Enable simple bgscan module (wpa_supplicant)

Generally useful. Linux distros enable this and also utilize it via
NetworkManager.

Debian also enables the learn module. I'm leaving it off as it's marked
experimental.

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
5 years agodefconfig: Enable AP (wpa_supplicant)
Lubomir Rintel [Tue, 19 Feb 2019 13:44:10 +0000 (14:44 +0100)] 
defconfig: Enable AP (wpa_supplicant)

Generally useful. Debian and Fedora enable this and support creating
access points via NetworkManager too.

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
5 years agodefconfig: Enable WPS (wpa_supplicant)
Lubomir Rintel [Tue, 19 Feb 2019 13:44:09 +0000 (14:44 +0100)] 
defconfig: Enable WPS (wpa_supplicant)

WPS is generally useful with consumer hardware, and exposed to desktop
users via NetworkManager.

The Linux distros, including Debian, Fedora, and openSUSE enable it.
Debian also enables external registar support and NFC.

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
5 years agodefconfig: Fix typos in Wi-Fi Display description
Jouni Malinen [Mon, 25 Feb 2019 17:18:32 +0000 (19:18 +0200)] 
defconfig: Fix typos in Wi-Fi Display description

These were supposed to be talking about Wi-Fi Display, not Wi-Fi Direct.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agodefconfig: Enable P2P and Wi-Fi Display (wpa_supplicant)
Lubomir Rintel [Tue, 19 Feb 2019 13:44:07 +0000 (14:44 +0100)] 
defconfig: Enable P2P and Wi-Fi Display (wpa_supplicant)

Generally useful. Debian and Fedora enable this, upcoming NetworkManager
provide some level of support too.

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
5 years agodefconfig: Add SAE (wpa_supplicant)
Lubomir Rintel [Tue, 19 Feb 2019 13:44:06 +0000 (14:44 +0100)] 
defconfig: Add SAE (wpa_supplicant)

Generally useful and the distros (Debian, Fedora) enable this already to
support WPA3-Personal and protected 802.11s mesh BSSs.

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
5 years agodefconfig: Add DPP (wpa_supplicant)
Lubomir Rintel [Tue, 19 Feb 2019 13:44:05 +0000 (14:44 +0100)] 
defconfig: Add DPP (wpa_supplicant)

Generally useful, already enabled in Debian and Fedora.

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
5 years agotests: Remove CONFIG_PEERKEY
Lubomir Rintel [Tue, 19 Feb 2019 13:44:04 +0000 (14:44 +0100)] 
tests: Remove CONFIG_PEERKEY

The functionality has been removed in commit a0bf1b68c03 ('Remove all
PeerKey functionality').

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
5 years agoUBSan: Avoid a warning on unsigned integer overflow
Jouni Malinen [Mon, 25 Feb 2019 00:57:41 +0000 (02:57 +0200)] 
UBSan: Avoid a warning on unsigned integer overflow

wpa_non_pref_chan_cmp() needs to use explicit typecasts to avoid UBSan
warnings for unsigned integer overflows.

mbo.c:298:26: runtime error: unsigned integer overflow: 1 - 2 cannot be represented in type 'unsigned int'

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: libFuzzer integration for test-json and test-x509
Jouni Malinen [Sun, 24 Feb 2019 16:52:54 +0000 (18:52 +0200)] 
tests: libFuzzer integration for test-json and test-x509

Allow these test tools to be used with libFuzzer in addition to
afl-fuzz.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoFix a regression from VLAN assignment using WPA/WPA2 passphrase/PSK
Jouni Malinen [Sat, 23 Feb 2019 16:54:54 +0000 (18:54 +0200)] 
Fix a regression from VLAN assignment using WPA/WPA2 passphrase/PSK

This extension of VLAN assignment code had a bug in one of the code
paths where vlan_id could have been left uninitialized. This could
result in SAE authentication getting rejected in cases where VLAN
assignment is not used if the uninitialized stack memory had nonzero
value.

Fixes: dbfa691df4dc ("VLAN assignment based on used WPA/WPA2 passphrase/PSK")
Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoUBSan: Avoid a warning on signed left shift
Jouni Malinen [Sat, 23 Feb 2019 16:43:38 +0000 (18:43 +0200)] 
UBSan: Avoid a warning on signed left shift

Use unsigned 1 (1U) instead of signed (1) when doing left shift that
could potentially need to use all bits of the 32-bit unsigned variable.

radius_server.c:2254:14: runtime error: left shift of 1 by 31 places cannot be represented in type 'int'

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoUBSan: Split loop index decrementation into a separate step
Jouni Malinen [Sat, 23 Feb 2019 16:14:29 +0000 (18:14 +0200)] 
UBSan: Split loop index decrementation into a separate step

Avoid an unnecessary unsigned integer overflow warning due to loop index
j-- use.

hostapd.c:661:10: runtime error: unsigned integer overflow: 0 - 1 cannot be represented in type 'unsigned int'

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoatheros: Avoid clang compiler warning on address of array check
Jouni Malinen [Sat, 23 Feb 2019 16:02:16 +0000 (18:02 +0200)] 
atheros: Avoid clang compiler warning on address of array check

ie.wps_ie is an array, so there is no point in checking whether it is
NULL.

driver_atheros.c:1221:9: error: address of array 'ie.wps_ie' will
      always evaluate to 'true' [-Werror,-Wpointer-bool-conversion]

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoAvoid compiler warning about potentially unaligned pointer value
Jouni Malinen [Sat, 23 Feb 2019 15:57:23 +0000 (17:57 +0200)] 
Avoid compiler warning about potentially unaligned pointer value

(&mgmt->u.deauth.reason_code + 1) is not exactly clean and now that we
have the u8 variable[] member in the struct after this field, use that
directly to avoid clang compiler warning:
ctrl_iface_ap.c:454:18: error: taking address of packed member
      'reason_code' of class or structure 'ieee80211_mgmt::(anonymous
      union)::(anonymous)' may result in an unaligned pointer value
      [-Werror,-Waddress-of-packed-member]

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoUBSan: Define FST LLT macros without integer overflow
Jouni Malinen [Sat, 23 Feb 2019 15:39:38 +0000 (17:39 +0200)] 
UBSan: Define FST LLT macros without integer overflow

FST_MAX_LLT_MS definition depended on undefined behavior with unsigned
integer overflow. Avoid that and also optimize the
FST_LLT_{MS_TO_VAL,VAL_TO_MS} macros to handle larger values without
overflowing 32-bit unsigned integers.

fst_session.c:1274:52: runtime error: unsigned integer overflow: 4294967295 * 32 cannot be represented in type 'unsigned int'

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoUBSan: Avoid integer overflow in a loop index counter
Jouni Malinen [Sat, 23 Feb 2019 14:28:16 +0000 (16:28 +0200)] 
UBSan: Avoid integer overflow in a loop index counter

Split the check and decrementation into separate steps to avoid an
unnecessary UBSan warning.

hostapd.c:1895:14: runtime error: unsigned integer overflow: 0 - 1 cannot be represented in type 'size_t' (aka 'unsigned long')

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoUBSan: Avoid NULL pointer dereferences on an error path
Jouni Malinen [Sat, 23 Feb 2019 14:24:19 +0000 (16:24 +0200)] 
UBSan: Avoid NULL pointer dereferences on an error path

hapd->conf might be NULL in case initialized failed, so better be
prepared for that when debug printing interface name in the deinit path.

hostapd.c:312:54: runtime error: member access within null pointer of type 'struct hostapd_bss_config'
hostapd.c:351:29: runtime error: member access within null pointer of type 'struct hostapd_bss_config'
hostapd.c:2158:18: runtime error: member access within null pointer of type 'struct hostapd_bss_config'

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoUBSan: Avoid unsigned integer overflow in base64 encoding
Jouni Malinen [Sat, 23 Feb 2019 14:09:31 +0000 (16:09 +0200)] 
UBSan: Avoid unsigned integer overflow in base64 encoding

Add a constraint on the base64 encoded buffer length to avoid an integer
overflow in the output length calculation.

common.c:1087:16: runtime error: unsigned integer overflow: 0 - 1 cannot be represented in type 'size_t' (aka 'unsigned long')

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoUBSan: Avoid unsigned integer overflow in utf8_{,un}escape()
Jouni Malinen [Sat, 23 Feb 2019 14:03:47 +0000 (16:03 +0200)] 
UBSan: Avoid unsigned integer overflow in utf8_{,un}escape()

Split the if/while loop condition into two independent steps so that
in_size-- happens only in the case in_size is nonzero. This gets rid of
unnecessary UBSan warnings.

common.c:1087:16: runtime error: unsigned integer overflow: 0 - 1 cannot be represented in type 'size_t' (aka 'unsigned long')
common.c:1076:16: runtime error: unsigned integer overflow: 0 - 1 cannot be represented in type 'size_t' (aka 'unsigned long')
common.c:1119:16: runtime error: unsigned integer overflow: 0 - 1 cannot be represented in type 'size_t' (aka 'unsigned long')

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoUBSan: Avoid unnecessary warning
Jouni Malinen [Sat, 23 Feb 2019 12:03:59 +0000 (14:03 +0200)] 
UBSan: Avoid unnecessary warning

elems->mic might be NULL here, so do not try to decrement it by 2 even
if the result is not used anywhere due to a latter check for elems->mic
being NULL.

mesh_rsn.c:646:20: runtime error: pointer index expression with base 0x000000000000 overflowed to 0xfffffffffffffffe

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoUBSan: Avoid memcpy(ptr, NULL, 0)
Jouni Malinen [Sat, 23 Feb 2019 12:01:25 +0000 (14:01 +0200)] 
UBSan: Avoid memcpy(ptr, NULL, 0)

This results in an UBSan warning that can be avoided easily.

os_unix.c:524:3: runtime error: null pointer passed as argument 2, which is declared to never be null

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoUBSan: Avoid an unsigned integer overflow warning
Jouni Malinen [Sat, 23 Feb 2019 11:57:51 +0000 (13:57 +0200)] 
UBSan: Avoid an unsigned integer overflow warning

ext_supp_rates_len would be 0 here, so decrementing it by 2 will result
in unsigned integer overflow even if that result is not actually used
anywhere. Avoid that to get rid of the UBSan warning.

tdls.c:1597:27: runtime error: unsigned integer overflow: 0 - 2 cannot be represented in type 'unsigned long'

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoUBSan: Pack MACsec peer id structure
Jouni Malinen [Sat, 23 Feb 2019 11:54:33 +0000 (13:54 +0200)] 
UBSan: Pack MACsec peer id structure

This is needed to avoid an UBSan warning and since this struct is used
as part of a message construction, it needs to be packed anyway to
guarantee correct functionality.

ieee802_1x_kay.c:1021:3: runtime error: member access within misaligned address 0x0000031921e2 for type 'struct ieee802_1x_mka_peer_id', which requires 4 byte alignment

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoUBSan: Avoid memcmp(ptr, NULL, 0)
Jouni Malinen [Sat, 23 Feb 2019 11:50:47 +0000 (13:50 +0200)] 
UBSan: Avoid memcmp(ptr, NULL, 0)

Skip the memcmp() call if ssid_len == 0 and entry->ssid might be NULL to
avoid an UBSan warning.

wpa_supplicant.c:3956:9: runtime error: null pointer passed as argument 2, which is declared to never be null

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoUBSan: Use typecast to avoid unsigned integer overflow
Jouni Malinen [Sat, 23 Feb 2019 11:44:20 +0000 (13:44 +0200)] 
UBSan: Use typecast to avoid unsigned integer overflow

iface->num_bss is unsigned integer, so need to explicit typecast it to
unsigned before decrementation by one even when the result is stored in
an unsigned integer.

../src/ap/hostapd.c:2185:26: runtime error: unsigned integer overflow: 0 - 1 cannot be represented in type 'unsigned long'

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoUBSan: Fix RRM beacon processing attempt without scan_info
Jouni Malinen [Sat, 23 Feb 2019 10:59:10 +0000 (12:59 +0200)] 
UBSan: Fix RRM beacon processing attempt without scan_info

Some driver interfaces (e.g., wext) might not include the
data->scan_info information and data could be NULL here. Do not try to
call the RRM handler in this case since that would dereference the NULL
pointer when determining where scan_info is located and could
potentially result in trying to read from unexpected location if RRM is
enabled with a driver interface that does not support it.

events.c:1907:59: runtime error: member access within null pointer of type 'union wpa_event_data'

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoUBSan: Avoid size_t variable overflow in control interface
Jouni Malinen [Sat, 23 Feb 2019 10:49:17 +0000 (12:49 +0200)] 
UBSan: Avoid size_t variable overflow in control interface

The loop "if (i-- == 0) break" style construction works in practice fine
since the check against 0 is done before decrementation. However, this
hits an UBSan warning, so split that decrementation to happen as a
separate step after the check and break from the loop.

ctrl_iface.c:5086:9: runtime error: unsigned integer overflow: 0 - 1 cannot be represented in type 'size_t' (aka 'unsigned long')

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoUBSan: Avoid unsigned integer overflow is throughput estimation
Jouni Malinen [Sat, 23 Feb 2019 10:42:20 +0000 (12:42 +0200)] 
UBSan: Avoid unsigned integer overflow is throughput estimation

wpa_scan_result_compar() would return wb->est_throughput -
wa->est_throughput in case the comparison is done based on the
throughput estimates. While the return value from this function is a
signed integer, these est_throughput values are unsigned integers and
need to be explicitly typecast to avoid an UBSan warning.

scan.c:1996:30: runtime error: unsigned integer overflow: 54000 - 135000 cannot be represented in type 'unsigned int'

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoModify dl_list_for_each() to not use unaligned access with WPA_TRACE
Jouni Malinen [Sat, 23 Feb 2019 10:07:21 +0000 (12:07 +0200)] 
Modify dl_list_for_each() to not use unaligned access with WPA_TRACE

UBSan testing with WPA_TRACE=y ended up hitting an unaligned access for
struct os_alloc_trace in os_program_deinit() because of the
dl_list_for_each() design that looked like dereferencing the member
element of the list head which is something that does not exist.

Get the first entry from the list using dl_list_first() so that the
empty list special case is covefred and compare item pointers instead of
struct dl_list pointers to check whether the end of the loop has been
reached.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoMulti-AP: Avoid memcpy(ptr, NULL, 0) in WPS Registrar initialization
Jouni Malinen [Sat, 23 Feb 2019 09:37:20 +0000 (11:37 +0200)] 
Multi-AP: Avoid memcpy(ptr, NULL, 0) in WPS Registrar initialization

This can result in compiler warnings due to the unexpected NULL pointer
as a source memory even when the length of the copied data is 0.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoFix cipher suite selector default value in RSNE for DMG
Lior David [Wed, 6 Feb 2019 10:33:35 +0000 (12:33 +0200)] 
Fix cipher suite selector default value in RSNE for DMG

According to IEEE Std 802.11-2016, 9.4.2.25 when fields of an RSNE are
not included, the default values are used. The cipher suite defaults
were hardcoded to CCMP in the previous implementation, but the default
is actually different for DMG: GCMP (per 9.4.2.25.2).

It is not possible to find out from the RSNE if the network is non-DMG
or DMG, so callers of wpa_parse_wpa_ie_rsn() need to handle this case
based on context, which can be different for each caller.

In order to fix this issue, add flags to the wpa_ie_data indicating
whether pairwise/group ciphers were included in the RSNE. Callers can
check these flags and fill in the appropriate ciphers. The
wpa_parse_wpa_ie_rsn() function still initializes the ciphers to CCMP by
default so existing callers will not break. This change also fixes some
callers which need to handle the DMG network case.

Signed-off-by: Lior David <liord@codeaurora.org>
5 years agoAdd new QCA vendor attributes for coex configuration
Jiani Liu [Mon, 18 Feb 2019 05:39:49 +0000 (13:39 +0800)] 
Add new QCA vendor attributes for coex configuration

Signed-off-by: Jiani Liu <jianil@codeaurora.org>
5 years agoAdd a vendor attribute for specifying ethernet protocol type
Arun Kumar Khandavalli [Tue, 19 Feb 2019 07:13:59 +0000 (12:43 +0530)] 
Add a vendor attribute for specifying ethernet protocol type

This new QCA vendor attribute adds provision to specify the
ethernet protocol id from userspace to the packets which are
offloaded to the driver/firmware (e.g., IPv4, IPv6).

Signed-off-by: Arun Kumar Khandavalli <akhandav@codeaurora.org>
5 years agotests: Multi-AP WPS provisioning
Arnout Vandecappelle (Essensium/Mind) [Tue, 12 Feb 2019 14:35:28 +0000 (15:35 +0100)] 
tests: Multi-AP WPS provisioning

Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
5 years agohostapd: Add README-MULTI-AP
Arnout Vandecappelle (Essensium/Mind) [Tue, 12 Feb 2019 14:35:27 +0000 (15:35 +0100)] 
hostapd: Add README-MULTI-AP

Document what hostapd and wpa_supplicant do for Multi-AP.

This is only included in hostapd, since a Multi-AP device is always an
access point so it should have hostapd.

Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
5 years agohostapd: Support Multi-AP backhaul STA onboarding with WPS
Davina Lu [Tue, 12 Feb 2019 14:35:26 +0000 (15:35 +0100)] 
hostapd: Support Multi-AP backhaul STA onboarding with WPS

The Wi-Fi Alliance Multi-AP Specification v1.0 allows onboarding of a
backhaul STA through WPS. To enable this, the WPS Registrar offers a
different set of credentials (backhaul credentials instead of fronthaul
credentials) when the Multi-AP subelement is present in the WFA vendor
extension element of the WSC M1 message.

Add new configuration options to specify the backhaul credentials for
the hostapd internal registrar: multi_ap_backhaul_ssid,
multi_ap_backhaul_wpa_psk, multi_ap_backhaul_wpa_passphrase. These are
only relevant for a fronthaul SSID, i.e., where multi_ap is set to 2 or
3. When these options are set, pass the backhaul credentials instead of
the normal credentials when the Multi-AP subelement is present.

Ignore the Multi-AP subelement if the backhaul config options are not
set. Note that for an SSID which is fronthaul and backhaul at the same
time (i.e., multi_ap == 3), this results in the correct credentials
being sent anyway.

The security to be used for the backaul BSS is fixed to WPA2PSK. The
Multi-AP Specification only allows Open and WPA2PSK networks to be
configured. Although not stated explicitly, the backhaul link is
intended to be always encrypted, hence WPA2PSK.

To build the credentials, the credential-building code is essentially
copied and simplified. Indeed, the backhaul credentials are always
WPA2PSK and never use per-device PSK. All the options set for the
fronthaul BSS WPS are simply ignored.

Signed-off-by: Davina Lu <ylu@quantenna.com>
Signed-off-by: Igor Mitsyanko <igor.mitsyanko.os@quantenna.com>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Cc: Marianna Carrera <marianna.carrera.so@quantenna.com>
5 years agowpa_supplicant: Support Multi-AP backhaul STA onboarding with WPS
Davina Lu [Tue, 12 Feb 2019 14:35:25 +0000 (15:35 +0100)] 
wpa_supplicant: Support Multi-AP backhaul STA onboarding with WPS

The Wi-Fi Alliance Multi-AP Specification v1.0 allows onboarding of a
backhaul STA through WPS. To enable this, the backhaul STA needs to add
a Multi-AP IE to the WFA vendor extension element in the WSC M1 message
that indicates it supports the Multi-AP backhaul STA role. The Registrar
(if it support Multi-AP onboarding) will respond to that with a WSC M8
message that also contains the Multi-AP IE, and that contains the
credentials for the backhaul SSID (which may be different from the SSID
on which WPS is performed).

Introduce a new parameter to wpas_wps_start_pbc() and allow it to be
set via control interface's new multi_ap=1 parameter of WPS_PBC call.
multi_ap_backhaul_sta is set to 1 in the automatically created SSID.
Thus, if the AP does not support Multi-AP, association will fail and
WPS will be terminated.

Only wps_pbc is supported.

This commit adds the multi_ap argument only to the control socket
interface, not to the D-Bus interface.

Since WPS associates with the fronthaul BSS instead of the backhaul BSS,
we should not drop association if the AP announces fronthaul-only BSS.
Still, we should only do that in the specific case of WPS. Therefore,
add a check to multi_ap_process_assoc_resp() to allow association with a
fronthaul-only BSS if and only if key_mgmt contains WPS.

Signed-off-by: Davina Lu <ylu@quantenna.com>
Signed-off-by: Igor Mitsyanko <igor.mitsyanko.os@quantenna.com>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Cc: Marianna Carrera <marianna.carrera.so@quantenna.com>
5 years agoWPS: Add multi_ap_subelem to wps_build_wfa_ext()
Arnout Vandecappelle (Essensium/Mind) [Tue, 12 Feb 2019 14:35:24 +0000 (15:35 +0100)] 
WPS: Add multi_ap_subelem to wps_build_wfa_ext()

The Multi-AP specification adds a new subelement to the WFA extension
element in the WPS exchange. Add an additional parameter to
wps_build_wfa_ext() to add this subelement. The subelement is only added
if the parameter is nonzero. Note that we don't reuse the existing
MULTI_AP_SUB_ELEM_TYPE definition here, but rather define a new
WFA_ELEM_MULTI_AP, to make sure the enum of WFA subelement types for WPS
vendor extension remains complete.

For now, all callers set the multi_ap_subelem parameter to 0.

Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
5 years agotests: Update multi_ap_fronthaul_on_ap to match implementation
Arnout Vandecappelle (Essensium/Mind) [Tue, 12 Feb 2019 14:35:23 +0000 (15:35 +0100)] 
tests: Update multi_ap_fronthaul_on_ap to match implementation

Now that the backhaul STA Multi-AP association is not rejected anymore
by the AP, update the test case to expect disconnection to be triggered
by the STA.

Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
5 years agoMulti-AP: Don't reject backhaul STA on fronthaul BSS
Arnout Vandecappelle (Essensium/Mind) [Tue, 12 Feb 2019 14:35:23 +0000 (15:35 +0100)] 
Multi-AP: Don't reject backhaul STA on fronthaul BSS

The Multi-AP specification only specifies that information elements have
to be added to the Association Request and Association Response frame;
it doesn't specify anything about what should be done in case they are
missing. Previously, we rejected non-backhaul associations on a
backhaul-only BSS, and non-fronthaul associations on a fronthaul-only
BSS.

However, this makes WPS fail when fronthaul and backhaul are separate
SSIDs. Indeed, WPS for the backhaul link is performed on the *fronthaul*
SSID. Thus, the Association Request frmae used for WPS *will* contain
the Multi-AP IE indicating a backhaul STA. Rejecting that association
makes WPS fail.

Therefore, accept a multi-AP backhaul STA Association Request frame on a
fronthaul-only BSS. Still issue a warning about it, but only at level
DEBUG intead of INFO. Also change the condition checking to make it
clearer.

While we're at it, also fix the handling of unexpected bits in the
Multi-AP IE. 4 bits are reserved in the specification, so these
certainly have to be ignored. The specification also doesn't say that
setting one of the other bits is not allowed. Therefore, only report
unexpected values in the Multi-AP IE, don't reject because of it. Note
that a malformed IE (containing more than one byte) still triggers a
rejection.

Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
5 years agotests: Refactor test_multi_ap
Arnout Vandecappelle (Essensium/Mind) [Tue, 12 Feb 2019 14:35:22 +0000 (15:35 +0100)] 
tests: Refactor test_multi_ap

With just one additional argument, the run_multi_ap_association()
function can be used for all tests.

Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
5 years agoHS 2.0: Make hs20-osu-client SP and <FQDN> directories group writable
Purushottam Kushwaha [Sat, 16 Feb 2019 06:43:12 +0000 (12:13 +0530)] 
HS 2.0: Make hs20-osu-client SP and <FQDN> directories group writable

This updates SP/<FQDN> directory with following permissions on Android
to allow moving certificate at runtime from Cert/ to SP/<FQDN> folder:
 - user:read/write/exec
 - group:read/write/exec
(i.e., add group write permission)

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agomesh: More consistent checking of wpa_s->ifmsh in completion handler
Jouni Malinen [Mon, 18 Feb 2019 16:46:40 +0000 (18:46 +0200)] 
mesh: More consistent checking of wpa_s->ifmsh in completion handler

It does not look like wpa_s->ifmsg could be NULL here, but better be
more consistent anyway to keep static analyzers happier by avoiding
dereference of wpa_s->ifmsh in the function before the NULL check for
it.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: Empty token in wpa_psk_file
Jouni Malinen [Mon, 18 Feb 2019 16:41:43 +0000 (18:41 +0200)] 
tests: Empty token in wpa_psk_file

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoFix wpa_psk_file parser error case handling
Jouni Malinen [Mon, 18 Feb 2019 16:24:52 +0000 (18:24 +0200)] 
Fix wpa_psk_file parser error case handling

str_token() can return NULL for the name if the remaining token contains
only the delimiter. Fix this to avoid NULL pointer dereference with a
corner case of an invalid value used in the configuration.

Fixes: ec5c39a5574d ("AP: Allow identifying which passphrase station used with wpa_psk_file")
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: Mark log files to use utf-8 encoding
Jouni Malinen [Mon, 18 Feb 2019 16:19:06 +0000 (18:19 +0200)] 
tests: Mark log files to use utf-8 encoding

This seems to be needed when using python3 in VM for the ssid_utf8 test
case debug prints from the control interface requests. This breaks
python2 support for the same logging entries, but there does not seem to
be any easy way of addressing this in a manner that works for both
python versions, so move ahead with the python3-only support from now
on.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: Switch default python version to 3
Masashi Honma [Tue, 12 Feb 2019 08:59:40 +0000 (17:59 +0900)] 
tests: Switch default python version to 3

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
5 years agotests: AP VLAN based on SAE Password Identifier
Jouni Malinen [Sun, 17 Feb 2019 15:22:28 +0000 (17:22 +0200)] 
tests: AP VLAN based on SAE Password Identifier

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoSAE: VLAN assignment based on SAE Password Identifier
Jouni Malinen [Sun, 17 Feb 2019 15:22:37 +0000 (17:22 +0200)] 
SAE: VLAN assignment based on SAE Password Identifier

The new sae_password parameter [|vlanid=<VLAN ID>] can now be used to
assign stations to a specific VLAN based on which SAE Password
Identifier they use. This is similar to the WPA2-Enterprise case where
the RADIUS server can assign stations to different VLANs and the
WPA2-Personal case where vlanid parameter in wpa_psk_file is used.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: Force diff chan in p2ps_channel_active_go_and_station_different_mcc
Jouni Malinen [Sun, 17 Feb 2019 14:55:50 +0000 (16:55 +0200)] 
tests: Force diff chan in p2ps_channel_active_go_and_station_different_mcc

This test case was failing pretty frequently due to an issue in being
able to send out the Provision Discovery Response frame on the operating
channel. Now that wpa_supplicant has a fix for that issue, modify this
test case to hit this error condition every time. In addition, make sure
the possible exception from p2ps_exact_seek() does not get hidden with a
failing remove_group() call in the finally section.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoP2P: Stop listen state if Action frame TX is needed on another channel
Jouni Malinen [Sun, 17 Feb 2019 14:53:03 +0000 (16:53 +0200)] 
P2P: Stop listen state if Action frame TX is needed on another channel

This speeds up P2P responses to frames received on an operating channel
in case there is an ongoing P2P listen operation on another channel.
This is applicable to drivers that support multiple channels in
concurrently.

This addresses an issue showing up in the
p2ps_channel_active_go_and_station_different_mcc test case where the
Provision Discovery Request frame can be received on the operating
channel of a group instead of the Listen channel. The response was
delayed until the listen operation timed out and this took too long time
for the peer to receive the response.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoP2P: Fix a typo in a debug message
Jouni Malinen [Sun, 17 Feb 2019 14:24:34 +0000 (16:24 +0200)] 
P2P: Fix a typo in a debug message

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: OpenSSL ECDH curve configuration
Jouni Malinen [Sun, 17 Feb 2019 12:01:30 +0000 (14:01 +0200)] 
tests: OpenSSL ECDH curve configuration

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agohostapd: Document openssl_ecdh_curves configuration parameter
Hristo Venev [Thu, 20 Apr 2017 13:44:31 +0000 (14:44 +0100)] 
hostapd: Document openssl_ecdh_curves configuration parameter

Signed-off-by: Hristo Venev <hristo@venev.name>
5 years agotests: EAP-PEAP/EAP-GTC
Jouni Malinen [Fri, 15 Feb 2019 10:03:45 +0000 (12:03 +0200)] 
tests: EAP-PEAP/EAP-GTC

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoAdd QCA vendor subcmd/attribute to check wlan firmware state
Qun Zhang [Wed, 13 Feb 2019 02:35:26 +0000 (10:35 +0800)] 
Add QCA vendor subcmd/attribute to check wlan firmware state

Allow user space applications to check whether wlan firmware is alive
through an nl80211 vendor command.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: Wi-Fi generation indication for HT and VHT
Jouni Malinen [Thu, 14 Feb 2019 20:36:40 +0000 (22:36 +0200)] 
tests: Wi-Fi generation indication for HT and VHT

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoIndicate wifi_generation in wpa_supplicant STATUS output
Jouni Malinen [Thu, 14 Feb 2019 20:24:16 +0000 (22:24 +0200)] 
Indicate wifi_generation in wpa_supplicant STATUS output

This adds a wifi_generation=4/5/6 line to the STATUS output if the
driver reports (Re)Association Request frame and (Re)Association
Response frame information elements in the association or connection
event. Only the generations 4 (HT = 802.11n), 5 (VHT = 802.11ac), and 6
(HE = 802.11ax) are reported.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoAdd HE Capabilities into ieee802_11_parse_elems()
Jouni Malinen [Thu, 14 Feb 2019 20:23:05 +0000 (22:23 +0200)] 
Add HE Capabilities into ieee802_11_parse_elems()

This is needed to determine whether an association negotiated use of HE.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agonl80211: (Re)Association Request frame IEs from association event
Jouni Malinen [Thu, 14 Feb 2019 20:01:20 +0000 (22:01 +0200)] 
nl80211: (Re)Association Request frame IEs from association event

Process NL80211_ATTR_REQ_IE from the NL80211_CMD_ASSOCIATE event to
allow request IEs to be made available for the SME-in-wpa_supplicant
case similarly to how this is done with SME-in-driver with
NL80211_CMD_CONNECT.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: ap_wpa_ie_parsing to allow EAPOL-Key msg 2/4 rejection
Jouni Malinen [Fri, 15 Feb 2019 00:06:46 +0000 (02:06 +0200)] 
tests: ap_wpa_ie_parsing to allow EAPOL-Key msg 2/4 rejection

Once mac80211 starts reporting the used Association Request frame IEs in
the association event, wpa_supplicant will update RSN supplicant IE
information based on that and that will make the AP reject EAPOL-Key msg
2/4 in this particular test scenario due to the hack of including two
RSN IEs in the Association Request frame. Accept this sequence as a
valid test execution in addition to the previously expected connection
to avoid reporting incorrect failures.

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