]> git.ipfire.org Git - thirdparty/hostap.git/log
thirdparty/hostap.git
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 years agotests: AP VLAN based on PSK/passphrase
Jouni Malinen [Thu, 14 Feb 2019 11:34:17 +0000 (13:34 +0200)] 
tests: AP VLAN based on PSK/passphrase

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoVLAN assignment based on used WPA/WPA2 passphrase/PSK
Jouni Malinen [Thu, 14 Feb 2019 11:34:33 +0000 (13:34 +0200)] 
VLAN assignment based on used WPA/WPA2 passphrase/PSK

Extend wpa_psk_file to allow an optional VLAN ID to be specified with
"vlanid=<VLAN ID>" prefix on the line. If VLAN ID is specified and the
particular wpa_psk_file entry is used for a station, that station is
bound to the specified VLAN. This can be used to operate a single
WPA2-Personal BSS with multiple VLANs based on the used passphrase/PSK.
This is similar to the WPA2-Enterprise case where the RADIUS server can
assign stations to different VLANs.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoHS 2.0 server: Add X-WFA-Hotspot20-Filtering header line to T&C
Jouni Malinen [Thu, 14 Feb 2019 10:09:09 +0000 (12:09 +0200)] 
HS 2.0 server: Add X-WFA-Hotspot20-Filtering header line to T&C

When filtering is successfully disabled at the end of the terms and
conditions acceptance sequence, add the "X-WFA-Hotspot20-Filtering:
remove" header line to the HTTP response.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agotests: DPP and two initiators
Jouni Malinen [Thu, 14 Feb 2019 09:50:40 +0000 (11:50 +0200)] 
tests: DPP and two initiators

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoHE: Fix set_he_cap() parsing of config options for MU EDCA Params
Jouni Malinen [Mon, 11 Feb 2019 23:16:13 +0000 (01:16 +0200)] 
HE: Fix set_he_cap() parsing of config options for MU EDCA Params

When I replaced the POS() function with ffs() when applying relevant
parts from the original patch, this ended up breaking the frame
construction since the POS() function was supposed to count the bit
offset for the mask with 0 being the LSB instead of 1 returned by ffs().
Furthermore, ffs() is not available in all C libraries (e.g., not
directly exposed by strings.h on Android), so better not depend on that
or compiler builtins for this since there is no need for this to be as
fast as possible in configuration parsing.

Fix this with a simple function to determine the number of bits the
value needs to be shifted left to align with the mask.

Fixes: 11ce7a1bc3e2 ("HE: Add MU EDCA Parameter Set element (AP)")
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agotests: AP not receiving Authentication frame ACK
Jouni Malinen [Mon, 11 Feb 2019 15:41:13 +0000 (17:41 +0200)] 
tests: AP not receiving Authentication frame ACK

Verify that the not-associated STA gets deauthenticated, not
disassociated, on inactivity timeout.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoDo not disassociate not-associated STA on timeout
Jouni Malinen [Mon, 11 Feb 2019 15:37:08 +0000 (17:37 +0200)] 
Do not disassociate not-associated STA on timeout

If the ap_handle_timer() timeout is reached for a not-associated STA, do
not default to disassociating that STA first since Disassociation frame
is not really appropriate to send to a STA that is not in associated
state. Instead, skip directly to deauthentication and STA entry removal.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoOpenSSL: Fix uninitialized variable in CRL reloading corner case
Jouni Malinen [Mon, 11 Feb 2019 12:00:13 +0000 (14:00 +0200)] 
OpenSSL: Fix uninitialized variable in CRL reloading corner case

The flags variable needs to be initialized to 0 if check_crl is 0 in
the updated configuration.

Fixes: 159a7fbdeafe ("crl_reload_interval: Add CRL reloading support")
Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agoUse for_each_element() in ieee802_11_parse_elems()
Jouni Malinen [Mon, 11 Feb 2019 11:51:11 +0000 (13:51 +0200)] 
Use for_each_element() in ieee802_11_parse_elems()

Use the new iteration macro to simplify the impelmentation and make it
more consistent with other IE parsers.

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agocommon: Use for_each_element_id/_extid for get_ie/get_ie_ext/get_vendor_ie
Johannes Berg [Fri, 8 Feb 2019 16:57:52 +0000 (17:57 +0100)] 
common: Use for_each_element_id/_extid for get_ie/get_ie_ext/get_vendor_ie

Simplifications based on the new iteration macros.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agocommon: Use for_each_element_id() in mb_ies_info_by_ies()
Johannes Berg [Fri, 8 Feb 2019 16:57:51 +0000 (17:57 +0100)] 
common: Use for_each_element_id() in mb_ies_info_by_ies()

The change is bigger because here we need to catch the error
condition if the last element doesn't fit.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agocommon: Use for_each_element_id() in ieee802_11_vendor_ie_concat()
Johannes Berg [Fri, 8 Feb 2019 16:57:50 +0000 (17:57 +0100)] 
common: Use for_each_element_id() in ieee802_11_vendor_ie_concat()

Simple cleanup using the new iteration helper macro.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agocommon: Use for_each_element() in ieee802_11_ie_count()
Johannes Berg [Fri, 8 Feb 2019 16:57:49 +0000 (17:57 +0100)] 
common: Use for_each_element() in ieee802_11_ie_count()

Simple cleanup using the new macros.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agocommon: Add strongly typed element iteration macros
Johannes Berg [Fri, 8 Feb 2019 16:57:48 +0000 (17:57 +0100)] 
common: Add strongly typed element iteration macros

Rather than always iterating elements from frames with pure
u8 pointers, add a type "struct element" that encapsulates
the id/datalen/data format of them.

Then, add the element iteration macros
 * for_each_element
 * for_each_element_id
 * for_each_element_extid

which take, as their first 'argument', such a structure and
iterate through a given u8 array interpreting it as elements.

While at it also add
 * for_each_subelement
 * for_each_subelement_id
 * for_each_subelement_extid

which instead of taking data/length just take an outer element
and use its data/datalen.

Also add for_each_element_completed() to determine if any of
the loops above completed, i.e., it was able to parse all of
the elements successfully and no data remained.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agotests: Catch only specific exceptions
Masashi Honma [Sun, 10 Feb 2019 08:43:10 +0000 (17:43 +0900)] 
tests: Catch only specific exceptions

This allows unexpected cases to terminate parallel-vm.py without being
hidden by the exception handler.

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
6 years agotests: Document some of the test tools
Jouni Malinen [Sun, 10 Feb 2019 15:59:38 +0000 (17:59 +0200)] 
tests: Document some of the test tools

This will hopefully make it easier for others to use these test tools.

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agotests: Fix wnm-fuzzer by adding dummy configuration
Jouni Malinen [Sun, 10 Feb 2019 15:55:42 +0000 (17:55 +0200)] 
tests: Fix wnm-fuzzer by adding dummy configuration

Some of the WNM implementation expects configuration to be available
(e.g., ieee802_!1_rx_wnm_coloc_intf_req() dereferences wpa_s->conf), so
add a dummy configuration to allow the fuzzer tool to be used.

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agotests: EAPOL-Key fuzzing tool
Jouni Malinen [Sun, 10 Feb 2019 15:02:49 +0000 (17:02 +0200)] 
tests: EAPOL-Key fuzzing tool

Add test-eapol program that can be used for fuzzing the EAPOL-Key
Supplicant and Authenticator implementations. This tool can write
Supplicant or Authenticator messages into a file as an initialization
step and for the fuzzing step, that file (with potential modifications)
can be used to replace the internally generated message contents.

The TEST_FUZZ=y build parameter is used to make a special build where a
hardcoded random number generator and hardcoded timestamp are used to
force deterministic behavior for the EAPOL-Key operations. This will
also make the implementation ignore Key MIC and AES keywrap errors to
allow processing of modified messages to continue further.

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agoRSN: Do not start preauthentication timer without candidates
Jouni Malinen [Sun, 10 Feb 2019 11:41:10 +0000 (13:41 +0200)] 
RSN: Do not start preauthentication timer without candidates

There is no need to schedule the postponed RSN preauthentication start
if there are no candidates. Avoid wasting eloop resources for this.

This is most useful for fuzz testing of the 4-way handshake
implementation to avoid getting stuck waiting for this unnecessary one
second time when using eloop to coordinate the Authenticator and
Supplicant state machines.

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agoeap_example: Update expired certificates
Jouni Malinen [Sun, 10 Feb 2019 09:39:05 +0000 (11:39 +0200)] 
eap_example: Update expired certificates

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agoJSON: Fix string parsing when \\ escape is at the end of buffer
Jouni Malinen [Sat, 9 Feb 2019 23:40:36 +0000 (01:40 +0200)] 
JSON: Fix string parsing when \\ escape is at the end of buffer

This would have resulted in reading one octet past the end of the buffer
before rejecting the string.

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agoJSON: Fix parsing of a number from the end of the buffer
Jouni Malinen [Sat, 9 Feb 2019 23:33:42 +0000 (01:33 +0200)] 
JSON: Fix parsing of a number from the end of the buffer

Avoid reading one octet past the end of the buffer when parsing a number
that is at the very end of the buffer.

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agotests: JSON parser fuzzer
Jouni Malinen [Sat, 9 Feb 2019 19:38:56 +0000 (21:38 +0200)] 
tests: JSON parser fuzzer

test-json can be used for fuzz testing the JSON parser implementation in
src/utils/json.c.

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agoTLS: Fix X.509 certificate name conversion into empty string
Jouni Malinen [Sat, 9 Feb 2019 23:51:51 +0000 (01:51 +0200)] 
TLS: Fix X.509 certificate name conversion into empty string

If none of the supported name attributes are present, the name string
was nul terminated only at the end. Add an explicit nul termination at
the end of the last written (or beginning of the buffer, if nothing is
written) to avoid writing uninitialized data to debug log.

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agoTLS: Fix ASN.1 parsing with no room for the header
Jouni Malinen [Sat, 9 Feb 2019 23:34:24 +0000 (01:34 +0200)] 
TLS: Fix ASN.1 parsing with no room for the header

Explicitly check the remaining buffer length before trying to read the
ASN.1 header values. Attempt to parse an ASN.1 header when there was not
enough buffer room for it would have started by reading one or two
octets beyond the end of the buffer before reporting invalid data at the
following explicit check for buffer room.

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agoTLS: Fix AlertDescription for missing partial processing case
Jouni Malinen [Sat, 9 Feb 2019 23:08:07 +0000 (01:08 +0200)] 
TLS: Fix AlertDescription for missing partial processing case

tlsv1_record_receive() did not return error here and as such, &alert was
not set and must not be used. Report internal error instead to avoid use
of uninitialized memory.

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agotests: TLS fuzzing tool
Jouni Malinen [Sat, 9 Feb 2019 19:07:24 +0000 (21:07 +0200)] 
tests: TLS fuzzing tool

Add test-tls program that can be used for fuzzing the internal TLS
client and server implementations. This tool can write client or server
messages into a file as an initialization step and for the fuzzing step,
that file (with potential modifications) can be used to replace the
internally generated message contents.

The TEST_FUZZ=y build parameter is used to make a special build where a
hardcoded random number generator and hardcoded timestamp are used to
force deterministic behavior for the TLS operations.

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agotests: Add a simple HTTPS server for TLS testing
Jouni Malinen [Sat, 9 Feb 2019 15:05:36 +0000 (17:05 +0200)] 
tests: Add a simple HTTPS server for TLS testing

This makes it easier to use TLS testing tools against the internal TLS
implementation.

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agoTLS server: Check credentials have been configured before using them
Jouni Malinen [Sat, 9 Feb 2019 16:06:33 +0000 (18:06 +0200)] 
TLS server: Check credentials have been configured before using them

Allow ServerHello to be built without local credential configuration.

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agoTLS server: Local failure information on verify_data mismatch
Jouni Malinen [Sat, 9 Feb 2019 16:05:45 +0000 (18:05 +0200)] 
TLS server: Local failure information on verify_data mismatch

Mark connection state FAILED in this case even though TLS Alert is not
sent.

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agoTLS server: Add internal callbacks get_failed, get_*_alerts
Jouni Malinen [Sat, 9 Feb 2019 15:58:43 +0000 (17:58 +0200)] 
TLS server: Add internal callbacks get_failed, get_*_alerts

These can be used to implement cleaner termination of the handshake in
case of failures.

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agoTLS server: More complete logging of ClientHello decode errors
Jouni Malinen [Sat, 9 Feb 2019 15:30:02 +0000 (17:30 +0200)] 
TLS server: More complete logging of ClientHello decode errors

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agoTLS client: Fix peer certificate event checking for probing
Jouni Malinen [Sat, 9 Feb 2019 14:10:47 +0000 (16:10 +0200)] 
TLS client: Fix peer certificate event checking for probing

conn->cred might be NULL here, so check for that explicitly before
checking whether conn->cred->cert_probe is set. This fixes a potential
NULL pointer dereference when going through peer certificates with
event_cb functionality enabled.

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agoOpenSSL: Add more handshake message names to debug
Jouni Malinen [Sat, 9 Feb 2019 21:58:58 +0000 (23:58 +0200)] 
OpenSSL: Add more handshake message names to debug

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agotests: Explicitly flush stdin for python3
Masashi Honma [Fri, 8 Feb 2019 22:51:10 +0000 (07:51 +0900)] 
tests: Explicitly flush stdin for python3

Without this flush(), test does not run.

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
6 years agotests: Encode VM input for python3
Masashi Honma [Fri, 8 Feb 2019 22:51:09 +0000 (07:51 +0900)] 
tests: Encode VM input for python3

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
6 years agotests: Decode VM output for python3
Masashi Honma [Fri, 8 Feb 2019 22:51:08 +0000 (07:51 +0900)] 
tests: Decode VM output for python3

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
6 years agotests: Change handling of reading non blocked empty stream for python3
Masashi Honma [Fri, 8 Feb 2019 22:51:07 +0000 (07:51 +0900)] 
tests: Change handling of reading non blocked empty stream for python3

The result of reading non blocked empty stream is different between
python2 and 3. The python2 sends "[Errno 11] Resource temporarily
unavailable" exception. The python3 could read "None" without
exception, so handle this "None" case as well.

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
6 years agotests: EAP-TLS and TLS 1.3
Jouni Malinen [Sat, 9 Feb 2019 22:10:53 +0000 (00:10 +0200)] 
tests: EAP-TLS and TLS 1.3

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agonl80211: Use wpa_ssid_txt() for debug messages more consistently
Jouni Malinen [Sat, 9 Feb 2019 22:06:26 +0000 (00:06 +0200)] 
nl80211: Use wpa_ssid_txt() for debug messages more consistently

Print the SSID with printf escaping instead of wpa_hexdump_ascii()
format to clean up the debug log a bit. This was already done for number
of SSID debug prints.

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agoNote HT overrides in debug log only if set
Jouni Malinen [Sat, 9 Feb 2019 22:00:35 +0000 (00:00 +0200)] 
Note HT overrides in debug log only if set

This makes the debug log cleaner by removing the mostly confusing prints
about HT override parameters if they are not actually used.

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years agoP2P: Update find_start timer only when p2p_scan is started.
Purushottam Kushwaha [Fri, 1 Feb 2019 11:46:40 +0000 (17:16 +0530)] 
P2P: Update find_start timer only when p2p_scan is started.

p2p->find_start timer was updated on each p2p_find call irrespective of
p2p_find being successful/failed/rejected. For cases where p2p_find was
in progress/pending, another call to p2p_find would be rejected but
p2p->find_start timer would still be updated.

p2p->find_start is maintained in wpa_supplicant to reject the kernel
scan entries before the p2p->find_start time. In above scenario, some of
the scan entries could be discarded even if the Probe Respons frame(s)
were received during the last scan/p2p_find.

This commit changes this to update the p2p->find_start timer only when
call to p2p_find is successful, i.e., a new scan is actually started.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agotests: hwsim: macsec: correct configuration reference
Johannes Berg [Wed, 6 Feb 2019 09:43:49 +0000 (10:43 +0100)] 
tests: hwsim: macsec: correct configuration reference

You need CONFIG_DRIVER_MACSEC_LINUX, not CONFIG_MACSEC_LINUX,
so fix this in the messages.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agoMBO: Move the WNM-Notification subtype definitions to common location
Jouni Malinen [Thu, 31 Jan 2019 10:57:04 +0000 (12:57 +0200)] 
MBO: Move the WNM-Notification subtype definitions to common location

Do not use a separate enum for MBO WNM-Notification Request frame
subtype values since these share the same number space with the Hotspot
2.0 ones.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agoHS 2.0: Update the T&C Acceptance subtype value
Jouni Malinen [Thu, 31 Jan 2019 10:54:33 +0000 (12:54 +0200)] 
HS 2.0: Update the T&C Acceptance subtype value

The previously used value 2 was already assigned for another purpose
(MBO non-preferred channel report), so the newer T&C Acceptable
definition needs to be updated with a unique value.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years agotests: Make /etc/alternatives work in VM
Johannes Berg [Sat, 2 Feb 2019 22:38:35 +0000 (23:38 +0100)] 
tests: Make /etc/alternatives work in VM

In recent Debian versions, ebtables is an alias managed by
the alternatives(8) mechanism. This means /usr/sbin/ebtables
is a symlink to /etc/alternatives/ebtables, which in turn
links to the real binary.

As we mount a tmpfs over /etc, we cannot access this.

Fix this by bind-mounting the real /etc to /tmp/etc and
adding a symlink from /etc/alternatives to this.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agotests: Add sigma_dut to .gitignore
Johannes Berg [Sat, 2 Feb 2019 22:16:07 +0000 (23:16 +0100)] 
tests: Add sigma_dut to .gitignore

Evidently this file must exist when running the sigma_dut
dependent tests, add it to .gitignore so it's not seen as
making the tree "unclean" when it is added manually.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agotests: Build hs20-osu-client
Johannes Berg [Sat, 2 Feb 2019 22:16:05 +0000 (23:16 +0100)] 
tests: Build hs20-osu-client

For tests, build the HS 2.0 OSU client (without browser to avoid
having webkit/curl dependencies).

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agoHS 2.0: Add QUIET=1 support for building hs20-osu-client
Johannes Berg [Sat, 2 Feb 2019 22:16:05 +0000 (23:16 +0100)] 
HS 2.0: Add QUIET=1 support for building hs20-osu-client

Add QUIET=1 support to its Makefile and add the created binary to a
.gitignore file.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agotests: Remove useless test list from run-tests.py help
Johannes Berg [Sat, 2 Feb 2019 22:16:04 +0000 (23:16 +0100)] 
tests: Remove useless test list from run-tests.py help

There's no point in printing out a 3k+ long list, just remove it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agotests: Add test reconnecting on assoc failure
Johannes Berg [Sat, 2 Feb 2019 22:16:03 +0000 (23:16 +0100)] 
tests: Add test reconnecting on assoc failure

Add a test that drops the authentication frame, so that
hostapd thinks the station is unknown, and then sends one
by itself, so the station thinks it's associated. This
tests mostly the kernel's capability to recover from this
scenario.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agoAdd FT-PSK to GET_CAPABILITY key_mgmt
Masashi Honma [Tue, 5 Feb 2019 21:06:44 +0000 (06:06 +0900)] 
Add FT-PSK to GET_CAPABILITY key_mgmt

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>