]> git.ipfire.org Git - thirdparty/hostap.git/log
thirdparty/hostap.git
5 years agotests: urlopen() compatibility for python3
Masashi Honma [Mon, 4 Feb 2019 00:13:31 +0000 (02:13 +0200)] 
tests: urlopen() compatibility for python3

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
5 years agotests: Extend build_wsc_attr() to accept both bytes and str objects
Jouni Malinen [Sun, 3 Feb 2019 23:48:43 +0000 (01:48 +0200)] 
tests: Extend build_wsc_attr() to accept both bytes and str objects

This is needed for python3.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: Fix struct.unpack() call for a single octet with python3
Jouni Malinen [Sun, 3 Feb 2019 23:46:32 +0000 (01:46 +0200)] 
tests: Fix struct.unpack() call for a single octet with python3

python3 needs this to be a bytes object, not the first octet of that
object.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: Remove forgotten development time print
Jouni Malinen [Sun, 3 Feb 2019 23:22:45 +0000 (01:22 +0200)] 
tests: Remove forgotten development time print

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: Open Hotspot 2.0 icon files in binary modes for python3
Masashi Honma [Sun, 3 Feb 2019 23:15:36 +0000 (01:15 +0200)] 
tests: Open Hotspot 2.0 icon files in binary modes for python3

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
5 years agotests: Encode/decode base64 operations for python3
Masashi Honma [Sun, 3 Feb 2019 16:33:00 +0000 (18:33 +0200)] 
tests: Encode/decode base64 operations for python3

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
5 years agotests: python3 compatible way of importing gobject for D-Bus testing
Jouni Malinen [Sun, 3 Feb 2019 15:16:28 +0000 (17:16 +0200)] 
tests: python3 compatible way of importing gobject for D-Bus testing

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: Use floor division (//) to avoid issues with python3
Jouni Malinen [Sun, 3 Feb 2019 13:06:05 +0000 (15:06 +0200)] 
tests: Use floor division (//) to avoid issues with python3

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: Decode Popen output in wmediumd test sets for python3
Masashi Honma [Thu, 31 Jan 2019 08:16:12 +0000 (17:16 +0900)] 
tests: Decode Popen output in wmediumd test sets for python3

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
5 years agotests: python3 compatible str/bytes ord()
Jouni Malinen [Sun, 3 Feb 2019 10:44:17 +0000 (12:44 +0200)] 
tests: python3 compatible str/bytes ord()

Need to skip ord() for python3 when going through bytes object (instead
of str object in python2).

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: Replace str.translate() with str.replace()
Jouni Malinen [Sun, 3 Feb 2019 10:24:49 +0000 (12:24 +0200)] 
tests: Replace str.translate() with str.replace()

This is needed for python3 since the two argument version of
str.translate() is not available for unicode. Furthermore, these cases
of delete colons from the string are simple enough for replace.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: Fix erp_home_realm_oom error on python3
Masashi Honma [Thu, 31 Jan 2019 08:15:55 +0000 (17:15 +0900)] 
tests: Fix erp_home_realm_oom error on python3

Only python3 warns to this bug.

TypeError: '>' not supported between instances of 'type' and 'int'
Exception: '>' not supported between instances of 'type' and 'int'

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
5 years agotests: Explicit str/bytes conversion for key_lifetime_in_memory
Jouni Malinen [Sat, 2 Feb 2019 16:50:13 +0000 (18:50 +0200)] 
tests: Explicit str/bytes conversion for key_lifetime_in_memory

This is needed for python3.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: Explicit str/bytes conversion in sigma_dut_venue_url
Jouni Malinen [Sat, 2 Feb 2019 16:29:11 +0000 (18:29 +0200)] 
tests: Explicit str/bytes conversion in sigma_dut_venue_url

This is needed for python3.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: Replace str.decode('hex') with binascii.unhexlify() for python3
Masashi Honma [Sat, 2 Feb 2019 16:01:41 +0000 (18:01 +0200)] 
tests: Replace str.decode('hex') with binascii.unhexlify() for python3

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: Replace str.encode('hex') with binascii.hexlify() for python3
Masashi Honma [Sat, 2 Feb 2019 16:19:35 +0000 (18:19 +0200)] 
tests: Replace str.encode('hex') with binascii.hexlify() for python3

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: Decode Popen() output for python3
Masashi Honma [Thu, 31 Jan 2019 08:16:02 +0000 (17:16 +0900)] 
tests: Decode Popen() output for python3

Need to do this to avoid issues with following operations that assume
the output to be a str object.

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
5 years agotests: Use 'b' prefix to mark Bytes literals explicitly for python3
Masashi Honma [Sat, 2 Feb 2019 15:52:25 +0000 (17:52 +0200)] 
tests: Use 'b' prefix to mark Bytes literals explicitly for python3

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: Decode subprocess.check_output() return value for python3
Masashi Honma [Thu, 31 Jan 2019 08:15:42 +0000 (17:15 +0900)] 
tests: Decode subprocess.check_output() return value for python3

Explicit conversion to str is needed here for python3 compatibility.

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
5 years agotests: rfkill with python3 compatible version
Masashi Honma [Thu, 31 Jan 2019 08:15:43 +0000 (17:15 +0900)] 
tests: rfkill with python3 compatible version

Update rfkill helpers to not depend on python2 implicit conversions.

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
5 years agotests: nl80211 attr with python3 compatible version
Masashi Honma [Thu, 31 Jan 2019 08:15:43 +0000 (17:15 +0900)] 
tests: nl80211 attr with python3 compatible version

Update nl80211 attribute building helpers to not depend on
python2 implicit conversions.

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
5 years agotests: HWSimController class with python3 compatible version
Masashi Honma [Thu, 31 Jan 2019 08:15:43 +0000 (17:15 +0900)] 
tests: HWSimController class with python3 compatible version

Update class HWSimController and netlink helpers to not depend on
python2 implicit conversions.

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
5 years agotests: Explicitly encode str to bytes when needed for python3
Masashi Honma [Sat, 2 Feb 2019 14:25:57 +0000 (16:25 +0200)] 
tests: Explicitly encode str to bytes when needed for python3

Avoid implicit conversion errors when constructing bytes objects or
passing a str object to a function that needs a bytes object.

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: Fix failure for WPA-EAP-SUITE-B-192 key_mgmt
Masashi Honma [Thu, 31 Jan 2019 08:16:14 +0000 (17:16 +0900)] 
tests: Fix failure for WPA-EAP-SUITE-B-192 key_mgmt

The wpas_config_file_key_mgmt fails with this error if wpa_supplicant is
built without CONFIG_SUITEB192=y:

Exception: SET_NETWORK failed
Exception: SET_NETWORK failed

Skip the WPA-EAP-SUITE-B-192 case if it is not supported in
wpa_supplicant so that the rest of the key_mgmt test coverage is
included.

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
5 years agotests: Explicit str/bytes conversion for socket operations for python3
Masashi Honma [Thu, 31 Jan 2019 08:16:15 +0000 (17:16 +0900)] 
tests: Explicit str/bytes conversion for socket operations for python3

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: Read binary file in add_log_file() for python3
Jouni Malinen [Sat, 2 Feb 2019 11:08:08 +0000 (13:08 +0200)] 
tests: Read binary file in add_log_file() for python3

python3 requires sqlite3.Binary() input to be bytes instead of str, so
open the files for binary mode reading.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: Convert tshark output to string object for python3
Jouni Malinen [Sat, 2 Feb 2019 11:05:16 +0000 (13:05 +0200)] 
tests: Convert tshark output to string object for python3

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: Convert binascii.hexlify() output to a string object for python3
Masashi Honma [Sat, 2 Feb 2019 11:01:36 +0000 (13:01 +0200)] 
tests: Convert binascii.hexlify() output to a string object for python3

This is needed in cases the hexlify() output is used to concatenate with
a string or used in string comparisons.

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agowpaspy: Convert to/from str to bytes as needed for python3
Jouni Malinen [Sat, 2 Feb 2019 10:49:23 +0000 (12:49 +0200)] 
wpaspy: Convert to/from str to bytes as needed for python3

The control interface commands use mostly ASCII or UTF-8 strings, so
convert input/output to strings/bytes as needed for the socket
operations with python3.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: Decode Popen() output values for python3
Masashi Honma [Sun, 3 Feb 2019 15:57:21 +0000 (17:57 +0200)] 
tests: Decode Popen() output values for python3

Explicit conversion to str is needed here for python3 compatibility.

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
5 years agotests: Decode command execution output to a str for python3
Jouni Malinen [Sat, 2 Feb 2019 10:48:30 +0000 (12:48 +0200)] 
tests: Decode command execution output to a str for python3

Need to convert from bytes to str to allow the following string
operations to work with python3.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: Remove trailing semicolons from python code
Jouni Malinen [Sat, 2 Feb 2019 10:10:53 +0000 (12:10 +0200)] 
tests: Remove trailing semicolons from python code

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: Use python3 compatible libraries
Masashi Honma [Thu, 31 Jan 2019 08:15:41 +0000 (17:15 +0900)] 
tests: Use python3 compatible libraries

This patch is made by using 2to3 command with some modifications.

$ find . -name *.py | xargs 2to3 -f imports -w -n

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
5 years agotests: Remove unused import statements
Jouni Malinen [Sat, 2 Feb 2019 09:35:13 +0000 (11:35 +0200)] 
tests: Remove unused import statements

These were not used at all and caused unnecessary operations and in some
cases, compatibility issues with python3.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: python3 requires a raw string due to the backslash
Masashi Honma [Thu, 31 Jan 2019 08:15:40 +0000 (17:15 +0900)] 
tests: python3 requires a raw string due to the backslash

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
5 years agotests: Enable ERP testing with PEAP
Jouni Malinen [Fri, 1 Feb 2019 22:06:04 +0000 (00:06 +0200)] 
tests: Enable ERP testing with PEAP

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoPEAP: Explicitly clear temporary keys from memory when using CMK
Jouni Malinen [Fri, 1 Feb 2019 22:01:29 +0000 (00:01 +0200)] 
PEAP: Explicitly clear temporary keys from memory when using CMK

The case of PEAPv0 with crypto binding did not clear some of the
temporary keys from stack/heap when those keys were not needed anymore.
Clear those explicitly to avoid unnecessary caching of keying material.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoEAP-PEAP: Derive EMSK and use 128-octet derivation for MSK
Jouni Malinen [Fri, 1 Feb 2019 21:52:28 +0000 (23:52 +0200)] 
EAP-PEAP: Derive EMSK and use 128-octet derivation for MSK

Derive EMSK when using EAP-PEAP to enable ERP. In addition, change the
MSK derivation for EAP-PEAP to always derive 128 octets of key material
instead of the 64 octets to cover just the MSK. This is needed with the
PRF used in TLS 1.3 since the output length is mixed into the PRF
context.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: wpasupplicant: Refactor code duplication in wait_global_event()
Johannes Berg [Fri, 1 Feb 2019 20:31:59 +0000 (21:31 +0100)] 
tests: wpasupplicant: Refactor code duplication in wait_global_event()

This code is identical to the wait_event() code, except for the
mon/global_mon instance. Create a _wait_event() function that
encapsulates this, and use it for both.

While at it, fix the bug in wait_global_event() where in the case
of not having a global_mon it always returns None.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 years agotests: vm-run: Create a symlink to the latest logs
Johannes Berg [Fri, 1 Feb 2019 20:04:01 +0000 (21:04 +0100)] 
tests: vm-run: Create a symlink to the latest logs

This is useful when running a test multiple times, looking at
log output etc. to not have to pick out the right directory
each and every time.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 years agoDPP: Clear dpp_listen_freq on remain-on-channel failure
Jouni Malinen [Wed, 30 Jan 2019 10:28:43 +0000 (12:28 +0200)] 
DPP: Clear dpp_listen_freq on remain-on-channel failure

If the DPP_LISTEN command failed due to the driver rejecting the
remain-on-channel request, wpa_s->dpp_listen_freq was left set to the
requested listen frequency and this resulted in the next DPP_LISTEN for
the same frequency reporting "DPP: Already listening on .." even when
the driver was not really listening on that frequency. Fix this by
clearing wpa_s->dpp_listen_freq in the error case.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoP2P: Allow the avoid channels for P2P discovery/negotiation
Purushottam Kushwaha [Fri, 28 Dec 2018 12:42:00 +0000 (18:12 +0530)] 
P2P: Allow the avoid channels for P2P discovery/negotiation

The avoid channels are notified through
QCA_NL80211_VENDOR_SUBCMD_AVOID_FREQUENCY allow minimal traffic, so
enhance the P2P behavior accordingly by considering these avoid
frequencies for P2P discovery/negotiation as long as they are not in
disallowed frequencies list.

Additionally, do not return failure when none of social channels are
available as operation channel, rather, mark the op_channel/op_reg_class
to 0 as this would anyway get selected during the group formation in
p2p_prepare_channel.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: WNM-Sleep Mode Request bounds checking for empty contents
Jouni Malinen [Mon, 29 Oct 2018 19:10:27 +0000 (21:10 +0200)] 
tests: WNM-Sleep Mode Request bounds checking for empty contents

The wnm_sleep_mode_proto test case was already covering number of
invalid WNM-Sleep Mode Request frame cases, but it was missing the
shortest possible case with a missing Dialog Token field. Add that as a
regression test case for bounds checking in
ieee802_11_rx_wnmsleep_req().

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoWNM: Fix WNM-Sleep Mode Request bounds checking
Jouni Malinen [Mon, 29 Oct 2018 18:48:07 +0000 (20:48 +0200)] 
WNM: Fix WNM-Sleep Mode Request bounds checking

ieee802_11_rx_wnmsleep_req() might have been called for a short frame
that has no more payload after the Public Action field, i.e., with len
== 0. The bounds checking for the payload length was done only for the
information elements while the one octet Dialog Token field was read
unconditionally. In the original implementation, this could have
resulted in reading one octet beyond the end of the received frame data.

This case has not been reachable after the commit e0785ebbbd18 ("Use
more consistent Action frame RX handling in both AP mode paths"), but it
is better to address the specific issue in ieee802_11_rx_wnmsleep_req()
as well for additional protection against accidential removal of the
check and also to have something that can be merged into an older
version (pre-v2.7) if desired. The comments below apply for such older
versions where the case could have been reachable.

Depending on driver interface specific mechanism used for fetching the
frame, this could result in reading one octet beyond the end of a
stack/hash buffer or reading an uninitialized octet from within a
buffer. The actual value that was read as the Dialog Token field is not
used since the function returns immediately after having read this value
when there is no information elements following the field.

This issue was initially added in commit d32d94dbf47a ("WNM: Add
WNM-Sleep Mode implementation for AP") (with CONFIG_IEEE80211V=y build
option) and it remained in place during number of cleanup and fix
changes in this area and renaming of the build parameter to
CONFIG_WNM=y. The impacted function was not included in any default
build without one of the these optional build options being explicitly
enabled. CONFIG_WNM=y is still documented as "experimental and not
complete implementation" in hostapd/defconfig. In addition, commit
114f2830d2c2 ("WNM: Ignore WNM-Sleep Mode Request in wnm_sleep_mode=0
case") made this function exit before the impact read if WNM-Sleep Mode
support was not explicitly enabled in runtime configuration
(wnm_sleep_mode=1 in hostapd.conf). Commit e0785ebbbd18 ("Use more
consistent Action frame RX handling in both AP mode paths") made this
code unreachable in practice.

Add an explicit check that the frame has enough payload before reading
the Dialog Token field in ieee802_11_rx_wnmsleep_req().

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: EAP-TLS and server reloading CRL from ca_cert
Jouni Malinen [Sun, 27 Jan 2019 16:48:16 +0000 (18:48 +0200)] 
tests: EAP-TLS and server reloading CRL from ca_cert

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agocrl_reload_interval: Add CRL reloading support
Jared Bents [Wed, 16 Jan 2019 15:15:01 +0000 (09:15 -0600)] 
crl_reload_interval: Add CRL reloading support

This patch adds a new flag 'crl_reload_interval' to reload CRL
periodically. This can be used to reload ca_cert file and the included
CRL information on every new TLS session if difference between the last
reload and the current time in seconds is greater than
crl_reload_interval.

This reloading is used for cases where check_crl is 1 or 2 and the CRL
is included in the ca_file.

Signed-off-by: Paresh Chaudhary <paresh.chaudhary@rockwellcollins.com>
Signed-off-by: Jared Bents <jared.bents@rockwellcollins.com>
5 years agotests: WPA2-PSK AP with PSK from a file (keyid and reload)
Jouni Malinen [Sat, 26 Jan 2019 15:42:15 +0000 (17:42 +0200)] 
tests: WPA2-PSK AP with PSK from a file (keyid and reload)

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoAP: Add wpa_psk_file reloading in runtime
Michal Kazior [Wed, 16 Jan 2019 12:35:20 +0000 (13:35 +0100)] 
AP: Add wpa_psk_file reloading in runtime

The wpa_psk_file can now be modified and hostapd can be told to re-read
it with the control interface RELOAD_WPA_PSK command:

 $ hostapd_cli reload_wpa_psk

It must be noted special care must be taken if WPS is configured
(wps_state=2, eap_server=1) because WPS appends PMKs to the
wpa_psk_file.

Signed-off-by: Michal Kazior <michal@plume.com>
5 years agoAP: Allow identifying which passphrase station used with wpa_psk_file
Michal Kazior [Wed, 16 Jan 2019 12:35:19 +0000 (13:35 +0100)] 
AP: Allow identifying which passphrase station used with wpa_psk_file

It is now possible to optionally specify keyid for
each wpa_psk_file entry:

 keyid=something 00:00:00:00:00:00 secretpassphrase

When station connects and the passphrase it used
has an associated keyid it will be appended to the
AP-STA-CONNECTED event string:

 wlan0: AP-STA-CONNECTED 00:36:76:21:dc:7b keyid=something

It's also possible to retrieve it through the control interface:

 $ hostapd_cli all_sta
 Selected interface 'ap0'
 00:36:76:21:dc:7b
 ...
 keyid=something

New hostapd is able to read old wpa_psk_file. However, old hostapd will
not be able to read the new wpa_psk_file if it includes keyids.

Signed-off-by: Michal Kazior <michal@plume.com>
5 years agoAP: Expose PMK outside of wpa_auth module
Michal Kazior [Wed, 16 Jan 2019 12:35:18 +0000 (13:35 +0100)] 
AP: Expose PMK outside of wpa_auth module

This doesn't change any behavior on its own. It's going to be used to
expose per-station keyids and allow reloading passphrases in runtime.

Signed-off-by: Michal Kazior <michal@plume.com>
5 years agotests: Modify pmksa_cache test sets for python3
Masashi Honma [Thu, 24 Jan 2019 07:46:19 +0000 (16:46 +0900)] 
tests: Modify pmksa_cache test sets for python3

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
5 years agotests: Modify ocv test sets for python3
Masashi Honma [Thu, 24 Jan 2019 07:46:15 +0000 (16:46 +0900)] 
tests: Modify ocv test sets for python3

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
5 years agotests: ap_eap test requires more memory in VM
Masashi Honma [Thu, 24 Jan 2019 07:45:54 +0000 (16:45 +0900)] 
tests: ap_eap test requires more memory in VM

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
5 years agotests: Python3 does not allow mixed indentation
Masashi Honma [Thu, 24 Jan 2019 07:45:49 +0000 (16:45 +0900)] 
tests: Python3 does not allow mixed indentation

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
5 years agotests: Remove deprecated statement for python3 compatibility
Masashi Honma [Thu, 24 Jan 2019 07:45:48 +0000 (16:45 +0900)] 
tests: Remove deprecated statement for python3 compatibility

This patch is made by using 2to3 command.

find . -name *.py | xargs 2to3 -f future -w -n

This was not really needed in this file for python2 compatibility.

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
5 years agotests: Use int instead of long for python3 compatibility
Masashi Honma [Thu, 24 Jan 2019 07:45:47 +0000 (16:45 +0900)] 
tests: Use int instead of long for python3 compatibility

This patch is made by using 2to3 command.

$ find . -name *.py | xargs 2to3 -f long -w -n

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
5 years agotests: Use python3 compatible raise statement
Masashi Honma [Thu, 24 Jan 2019 07:45:46 +0000 (16:45 +0900)] 
tests: Use python3 compatible raise statement

This patch is made by using 2to3 command.

find . -name *.py | xargs 2to3 -f raise -w -n

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
5 years agotests: Use python3 compatible function attribute
Masashi Honma [Thu, 24 Jan 2019 07:45:45 +0000 (16:45 +0900)] 
tests: Use python3 compatible function attribute

This patch is made by using 2to3 command.

$ find . -name *.py | xargs 2to3 -f funcattrs -w -n

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
5 years agotests: Use python3 compatible range operation
Masashi Honma [Thu, 24 Jan 2019 07:45:44 +0000 (16:45 +0900)] 
tests: Use python3 compatible range operation

This patch is made by using 2to3 command.

$ find . -name *.py | xargs 2to3 -f xrange -w -n

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
5 years agotests: Use python3 compatible dict operation
Masashi Honma [Thu, 24 Jan 2019 07:45:43 +0000 (16:45 +0900)] 
tests: Use python3 compatible dict operation

This patch is made by using 2to3 command.

$ find . -name *.py | xargs 2to3 -f dict -w -n

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
5 years agotests: Use python3 compatible print statement
Masashi Honma [Thu, 24 Jan 2019 07:45:42 +0000 (16:45 +0900)] 
tests: Use python3 compatible print statement

This patch is made by using 2to3 command.

$ find . -name *.py | xargs 2to3 -f print -w -n

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
5 years agotests: Use python3 compatible "except" statement
Masashi Honma [Thu, 24 Jan 2019 07:45:41 +0000 (16:45 +0900)] 
tests: Use python3 compatible "except" statement

This patch is made by using 2to3 command.

$ find . -name *.py | xargs 2to3 -f except -w -n

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
5 years agoWrite multi_ap_backhaul_sta to wpa_supplicant config
Daniel Golle [Wed, 23 Jan 2019 05:18:25 +0000 (06:18 +0100)] 
Write multi_ap_backhaul_sta to wpa_supplicant config

The network configration option multi_ap_backhaul_sta was added without
adding it to wpa_config_write_network(). Hence the value of this option
was not included when writing the configuration file. Fix this by
including it in wpa_config_write_network().

Fixes: 5abc7823b ("wpa_supplicant: Add Multi-AP backhaul STA support")
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
5 years agodbus: Document more possible BSS/RSA/KeyMgmt values
Lubomir Rintel [Wed, 23 Jan 2019 09:38:49 +0000 (10:38 +0100)] 
dbus: Document more possible BSS/RSA/KeyMgmt values

This is probably not ideal, since it would be better if it ended up
being autogenerated somehow, but at least it's somewhat of an
improvement.

Also added a comment that encourages keeping the docs in sync.

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
5 years agoCheck supported types in wpas_mac_addr_rand_scan_set()
Lior David [Mon, 21 Jan 2019 16:28:42 +0000 (18:28 +0200)] 
Check supported types in wpas_mac_addr_rand_scan_set()

When setting scan with randomized MAC, check the requested scan type
against supported types, to ensure callers will not set an unsupported
type, since this can cause scan/connect failures later. It is better to
do this in wpas_mac_addr_rand_scan_set() instead of control interface
specific code to apply the constraint on all possible interfaces using
this setting.

Signed-off-by: Lior David <liord@codeaurora.org>
5 years agoFix test compilation error related to sme_event_unprot_disconnect()
Lior David [Tue, 22 Jan 2019 15:24:35 +0000 (17:24 +0200)] 
Fix test compilation error related to sme_event_unprot_disconnect()

sme_event_unprot_disconnect() is only defined with CONFIG_IEEE80211W, so
the CONFIG_TESTING_OPTIONS command UNPROT_DEAUTH can be defined only
with builds that enable IEEE 802.11w support.

Signed-off-by: Lior David <liord@codeaurora.org>
5 years agotests: SAE and password identifier (exclusively)
Jouni Malinen [Wed, 23 Jan 2019 22:01:17 +0000 (00:01 +0200)] 
tests: SAE and password identifier (exclusively)

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoSAE: Advertise Password Identifier use
Jouni Malinen [Wed, 23 Jan 2019 22:00:28 +0000 (00:00 +0200)] 
SAE: Advertise Password Identifier use

Support the new Extended Capabilities field bits 81 and 82 to indicate
whether SAe Password Identifiers are in use.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoHS 2.0 server: Command line option to fetch the version information
Jouni Malinen [Wed, 23 Jan 2019 10:34:57 +0000 (12:34 +0200)] 
HS 2.0 server: Command line option to fetch the version information

This can be used to report automatically generated version strings from
the SPP server.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoHS 2.0 server: Alternative subrem updateNode for certificate credentials
Jouni Malinen [Tue, 22 Jan 2019 23:03:46 +0000 (01:03 +0200)] 
HS 2.0 server: Alternative subrem updateNode for certificate credentials

The new subrem field in the users database can now be used to issue an
alternative subscription remediation updateNode for clients using
certificate credentials. The data file for this case is similar to the
policy update files, but it starts with the managementTreeURI value in
the first line.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoHS 2.0 server: Use noMOUpdate in client certificate subrem
Jouni Malinen [Tue, 22 Jan 2019 21:31:06 +0000 (23:31 +0200)] 
HS 2.0 server: Use noMOUpdate in client certificate subrem

There is no point in trying to update the Credential node with the
existing contents in case of subscription remediation using a client
certificate instead of a username/password credential, so use the
noMOUpdate in that case.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoFILS: Remove notes about experimental implementation
Jouni Malinen [Tue, 22 Jan 2019 11:33:48 +0000 (13:33 +0200)] 
FILS: Remove notes about experimental implementation

The standard amendment has been published and there has been sufficient
amount of interoperability testing for FILS to expect the protocol not
to be changed anymore, so remove the notes claiming this to be
experimental and not suitable for production use.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: Update README to refer to parallel-vm.py
Jouni Malinen [Tue, 22 Jan 2019 11:27:31 +0000 (13:27 +0200)] 
tests: Update README to refer to parallel-vm.py

parallel-vm.sh was removed earlier.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agodbus: Expose support of SAE key management in BSS properties
Lubomir Rintel [Tue, 22 Jan 2019 08:36:12 +0000 (09:36 +0100)] 
dbus: Expose support of SAE key management in BSS properties

This is going to be useful for NetworkManager and likely others.

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
5 years agoRevert "mesh: Apply channel attributes before setup interface"
Masashi Honma [Tue, 15 Jan 2019 11:43:41 +0000 (20:43 +0900)] 
Revert "mesh: Apply channel attributes before setup interface"

This reverts commit 2564184440d9d6041d11a8c7d50b31368634c3bd.

Commit 2564184440d9 ("mesh: Apply channel attributes before setup
interface") triggers some channel configurations to result in leaking
memory. This seems to be caused by hapd->started not getting set when
going through a callback to start hostapd operation (e.g., when using
HT40 coex scan) due to hostapd_setup_bss() not getting called. This
results in hostapd_free_hapd_data() not clearing allocated
hapd->wpa_auth. This can be reproduced with the hwsim test case
mesh_secure_ocv_mix_legacy.

A more complete cleanup of the pending mesh patch for DFS support seems
to be needed to fix this properly, so the best approach for now is to
revert this patch and bring it back once rest of the mesh changes are
ready to be applied.

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
5 years agohostapd: Add support for setting pbss option from config file
Ian Archer [Fri, 18 Jan 2019 12:40:15 +0000 (12:40 +0000)] 
hostapd: Add support for setting pbss option from config file

There is currently no support for setting hostapd_bss_config.pbss from a
config file, i.e., it was used only based on automatic logic in
wpa_supplicant. This patch adds a key naturally called "pbss" which can
be used to set it.

Cc: Antony King <antony.king@bluwirelesstechnology.com>
Signed-off-by: Brendan Jackman <brendan.jackman@bluwirelesstechnology.com>
5 years agoD-Bus: Fix P2P Flush method to clear pending Action frames
Amit Khatri [Wed, 16 Jan 2019 17:46:46 +0000 (23:16 +0530)] 
D-Bus: Fix P2P Flush method to clear pending Action frames

If we call p2p_flush from ctrl_iface, before calling p2p_flush() it
calls wpas_p2p_stop_find(). Add the same call to the matching D-Bus
method to clear all pending operations.

Signed-off-by: Amit Khatri <amit7861234@gmail.com>
5 years agoAdd a vendor attribution to transfer EVM information
stonez [Thu, 17 Jan 2019 05:50:26 +0000 (13:50 +0800)] 
Add a vendor attribution to transfer EVM information

This new QCA vendor attribute indicates the EVM value in netlink.

Signed-off-by: stonez <stonez@codeaurora.org>
:100644 100644 ad5dac2... ede4fc8... M src/common/qca-vendor.h

5 years agotests: wpa_supplicant config parsing and storing for new variables
Jouni Malinen [Sat, 12 Jan 2019 17:21:45 +0000 (19:21 +0200)] 
tests: wpa_supplicant config parsing and storing for new variables

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: P2P group formation with random interface addresses
Jouni Malinen [Sat, 12 Jan 2019 17:18:02 +0000 (19:18 +0200)] 
tests: P2P group formation with random interface addresses

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoP2P: support random interface address
Jimmy Chen [Thu, 29 Nov 2018 08:46:43 +0000 (16:46 +0800)] 
P2P: support random interface address

To enhance privacy, generate a random interface for each group.

There are two configurations are introduced:
* p2p_interface_random_mac_addr
  enable interface random MAC address feature, default disable.

Signed-off-by: Jimmy Chen <jimmycmchen@google.com>
5 years agoP2P: Support random device address
Jimmy Chen [Tue, 13 Nov 2018 07:19:57 +0000 (15:19 +0800)] 
P2P: Support random device address

To enhance privacy, generate a random device address for P2P interface.
If there is no saved persistent group, it generate a new random MAC
address on bringing up p2p0. If there is saved persistent group, it will
use last MAC address to avoid breaking group reinvoke behavior.

There are two configurations are introduced:
* p2p_device_random_mac_addr
  enable device random MAC address feature, default disable.
* p2p_device_persistent_mac_addr
  store last used random MAC address.

Signed-off-by: Jimmy Chen <jimmycmchen@google.com>
5 years agotests: start.sh: fix logs/current symlink creation
Arnout Vandecappelle (Essensium/Mind) [Wed, 9 Jan 2019 12:34:11 +0000 (13:34 +0100)] 
tests: start.sh: fix logs/current symlink creation

Since 3bdc651a624, start.sh creates the logs/current symlink even if
LOGDIR was set in the environment, as is the case when using run-all.sh.
However, run-all.sh and start.sh use a separate 'date' invocation so the
resulting string may be different. Usually it is the same because the
two invocations immediately follow each other, *except* if run-all.sh
also does a build. In addition, if the user sets LOGDIR to something
else, the symlink is completely bogus.

Fix this by not relying on the 'date' invocation for creating the
symlink. Instead, use the basename of LOGDIR. To keep things consistent
with current behavior, only create the symlink if LOGDIR points to a
subdirectory of DIR/logs.

The following use cases now work reliably:
* run-all.sh with or without the -B option;
* manually calling start.sh followed by run-tests.py without setting
  LOGDIR.
* manually calling start.sh with LOGDIR set to a subdirectory of logs
  and calling run-tests.py without --logdir option (which makes it
  default to logs/current).
* run-all.sh with LOGDIR set to a subdirectory of logs.

Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
5 years agotests: Build with various LibreSSL and OpenSSL versions
Jouni Malinen [Sat, 12 Jan 2019 15:32:15 +0000 (17:32 +0200)] 
tests: Build with various LibreSSL and OpenSSL versions

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoFix build with LibreSSL
Stefan Strogin [Wed, 9 Jan 2019 11:19:53 +0000 (13:19 +0200)] 
Fix build with LibreSSL

When using LibreSSL build fails with:

../src/crypto/tls_openssl.o: in function `tls_connection_client_cert':
../src/crypto/tls_openssl.c:2817: undefined reference to `SSL_use_certificate_chain_file'
collect2: error: ld returned 1 exit status
make: *** [Makefile:1901: wpa_supplicant] Error 1

There is no such function in LibreSSL.

Signed-off-by: Stefan Strogin <stefan.strogin@gmail.com>
5 years agoP2P: Add 802.11ax support for P2P GO
Peng Xu [Fri, 21 Dec 2018 18:20:28 +0000 (10:20 -0800)] 
P2P: Add 802.11ax support for P2P GO

An optional parameter "he" is added to p2p_connect, p2p_group_add, and
p2p_invite to enable 11ax HE support. The new p2p_go_he=1 configuration
parameter can be used to request this to be enabled by default.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoClarify documentation of avoid channels expectations
Sunil Dutt [Tue, 8 Jan 2019 12:21:23 +0000 (17:51 +0530)] 
Clarify documentation of avoid channels expectations

The vendor command QCA_NL80211_VENDOR_SUBCMD_AVOID_FREQUENCY was defined
to carry the list of avoid frequencies that aim to avoid any
interference with other coexistencies. This recommendation was followed
strictly by trying to prevent WLAN traffic on the impacted channels.

This commit refines the expectation of the interface by defining this
avoid channel list to allow minimal traffic but not heavier one. For
example, P2P may still be able to use avoid list frequencies for P2P
discovery and GO negotiation if the actual group can be set up on a not
impact channel.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoHS 2.0 server: Log new username in eventlog for cert reenroll
Jouni Malinen [Wed, 9 Jan 2019 22:47:04 +0000 (00:47 +0200)] 
HS 2.0 server: Log new username in eventlog for cert reenroll

Make it easier to find the new username (and the new serial number from
it) when a user entry is renamed at the conclusion of client certificate
re-enrollment sequence.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoHE: Add MU EDCA Parameter Set element (AP)
Siva Mullati [Mon, 7 Jan 2019 09:26:24 +0000 (14:56 +0530)] 
HE: Add MU EDCA Parameter Set element (AP)

Add support for configuring parameters for the MU EDCA Parameter Set
element per IEEE P802.11ax/D3.0.

Signed-off-by: Siva Mullati <siva.mullati@intel.com>
5 years agoeapol_test: Start the identifier at an initial random value
Martin Stanislav [Mon, 1 Oct 2018 14:59:03 +0000 (16:59 +0200)] 
eapol_test: Start the identifier at an initial random value

Start the (EAP request) identifier at an initial random value
as recommended by RFC 3748 in section 4.1 Request and Response
on page 21.

Signed-off-by: Martin Stanislav <ms@uakom.sk>
5 years agodrivers: Set CONFIG_LIBNL32=y automatically based on pkg-config
Jouni Malinen [Tue, 8 Jan 2019 11:31:55 +0000 (13:31 +0200)] 
drivers: Set CONFIG_LIBNL32=y automatically based on pkg-config

If the libnl version is not specified explicitly with CONFIG_LIBNL*, try
to check for the most likely case today with pkg-config.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agodrivers: Move libnl related build flags to separate ifdef block
Andrey Kartashev [Fri, 14 Sep 2018 09:17:29 +0000 (11:17 +0200)] 
drivers: Move libnl related build flags to separate ifdef block

Fix compilation issue if we want to build wpa_supplicant without any
wireless connectivity but only with MACSec support via Linux kernel
driver.

Signed-off-by: Andrey Kartashev <a.s.kartashev@gmail.com>
5 years agomka: New MI should only be generated when peer's key is invalid
Mike Siedzik [Tue, 8 Jan 2019 03:49:54 +0000 (22:49 -0500)] 
mka: New MI should only be generated when peer's key is invalid

Two recent changes to MKA create a situation where a new MI is generated
every time a SAK Use parameter set is decoded.  The first change moved
invalid key detection from ieee802_1x_decode_basic_body() to
ieee802_1x_kay_decode_mpkdu():

  commit db9ca18bbff1 ("mka: Do not ignore MKPDU parameter set decoding failures")

The second change forces the KaY to generate a new MI when an invalid
key is detected:

  commit a8aeaf41df95 ("mka: Change MI if key invalid")

The fix is to move generation of a new MI from the old invalid key
detection location to the new location.

Fixes: a8aeaf41df95 ("mka: Change MI if key invalid")
Signed-off-by: Michael Siedzik <msiedzik@extremenetworks.com>
5 years agonl80211: Indicate 802.1X 4-way handshake offload in connect
Arend van Spriel [Mon, 7 Jan 2019 11:14:41 +0000 (12:14 +0100)] 
nl80211: Indicate 802.1X 4-way handshake offload in connect

Upon issuing a connect request we need to indicate that we want the
driver to offload the 802.1X 4-way handshake for us. Indicate it if
the driver capability supports the offload.

Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
5 years agodrivers: Add separate driver flags for 802.1X and PSK 4-way HS offloads
Arend van Spriel [Mon, 7 Jan 2019 11:14:40 +0000 (12:14 +0100)] 
drivers: Add separate driver flags for 802.1X and PSK 4-way HS offloads

Allow drivers to indicate support for offloading 4-way handshake for
either IEEE 802.1X (WPA2-Enterprise; EAP) and/or WPA/WPA2-PSK
(WPA2-Personal) by splitting the WPA_DRIVER_FLAGS_4WAY_HANDSHAKE flag
into two separate flags.

Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
5 years agotests: DFS CAC interrupted and restarted
Jouni Malinen [Mon, 7 Jan 2019 22:36:07 +0000 (00:36 +0200)] 
tests: DFS CAC interrupted and restarted

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoDFS: Restart pending CAC on interface enable
Zefir Kurtisi [Mon, 7 Jan 2019 10:58:08 +0000 (11:58 +0100)] 
DFS: Restart pending CAC on interface enable

When an interface is re-enabled after it was disabled during CAC, it
won't ever get active since hostapd is waiting for a CAC_FINISHED while
kernel side is waiting for a CMD_RADAR_DETECT to start a CAC.

This commit checks for a pending CAC when an interface is enabled and if
so restarts its DFS processing.

Signed-off-by: Zefir Kurtisi <zefir.kurtisi@neratec.com>
5 years agotests: Supported operating classes with constraints
Jouni Malinen [Mon, 7 Jan 2019 22:17:32 +0000 (00:17 +0200)] 
tests: Supported operating classes with constraints

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoUse freq_list to constrain supported operating class information
Ben Greear [Fri, 24 Aug 2018 19:01:28 +0000 (12:01 -0700)] 
Use freq_list to constrain supported operating class information

If a station is configured to allow only a subset of frequencies for an
association, the supported operating classes may need to be more limited
than what the hardware supports.

Signed-off-by: Ben Greear <greearb@candelatech.com>
5 years agoUse disable_ht/vht to constrain supported operating class information
Ben Greear [Fri, 24 Aug 2018 20:27:44 +0000 (13:27 -0700)] 
Use disable_ht/vht to constrain supported operating class information

If user has disabled HT or VHT, those related operating classes
should not be advertised as supported.

Signed-off-by: Ben Greear <greearb@candelatech.com>