]> git.ipfire.org Git - thirdparty/hostap.git/log
thirdparty/hostap.git
5 years agotests: Radio measurement capability with roaming
Jouni Malinen [Sat, 1 Dec 2018 18:15:50 +0000 (20:15 +0200)] 
tests: Radio measurement capability with roaming

This verifies that radio measurement capabilities are negotiated
correctly for the reassociation cases with and without FT.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoFT: Fix Reassociation Request IEs during FT protocol
Jouni Malinen [Sat, 1 Dec 2018 18:10:54 +0000 (20:10 +0200)] 
FT: Fix Reassociation Request IEs during FT protocol

The previous implementation ended up replacing all pending IEs prepared
for Association Request frame with the FT specific IEs (RSNE, MDE, FTE)
when going through FT protocol reassociation with the wpa_supplicant
SME. This resulted in dropping all other IEs that might have been
prepared for the association (e.g., Extended Capabilities, RM Enabled
Capabilities, Supported Operating Classes, vendor specific additions).

Fix this by replacing only the known FT specific IEs with the
appropriate values for FT protocol while maintaining other already
prepared elements.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: Do not generate /tmp/hwsim-tests-*.tar.gz in VM case
Jouni Malinen [Sat, 1 Dec 2018 14:44:53 +0000 (16:44 +0200)] 
tests: Do not generate /tmp/hwsim-tests-*.tar.gz in VM case

There is no point in building this tarball in /tmp that is on the
ramdisk of the VM since it will go away when the VM exits.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoUse more consistent Action frame RX handling in both AP mode paths
Jouni Malinen [Sat, 1 Dec 2018 11:19:47 +0000 (13:19 +0200)] 
Use more consistent Action frame RX handling in both AP mode paths

Both handle_action() and hostapd_action_rx() are used for processing
received Action frames depending on what type of driver architecture is
used (MLME in hostapd vs. driver) and which build options were used to
build hostapd. These functions had a bit different sequence for checking
the frame and printing debug prints. Make those more consistent by
checking that the frame includes the category-specific action field and
some payload. Add a debug print for both functions to make it easier to
see which path various Action frames use.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoFT: Check session_timeout pointer consistently
Jouni Malinen [Fri, 30 Nov 2018 19:07:19 +0000 (21:07 +0200)] 
FT: Check session_timeout pointer consistently

Avoid smatch warning on this even thought the only caller of the
function uses a non-NULL pointer in all cases.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoFix hostapd testing functionality for setting key/seq
Jouni Malinen [Fri, 30 Nov 2018 19:03:08 +0000 (21:03 +0200)] 
Fix hostapd testing functionality for setting key/seq

Use sizeof() correctly on seq[].

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoEAP DB: Use NULL to clear a pointer
Jouni Malinen [Fri, 30 Nov 2018 16:00:31 +0000 (18:00 +0200)] 
EAP DB: Use NULL to clear a pointer

Avoid a sparse warning from use of a plain integer.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP: Check own_bi/peer_bi pointers more consistently
Jouni Malinen [Fri, 30 Nov 2018 15:57:35 +0000 (17:57 +0200)] 
DPP: Check own_bi/peer_bi pointers more consistently

This gets rid of smatch warnings about a dereference before check.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoFix indentation level
Jouni Malinen [Fri, 30 Nov 2018 15:56:56 +0000 (17:56 +0200)] 
Fix indentation level

This gets rid of smatch warnings about inconsistent indenting.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoOpenSSL: Include sha512.h to match function prototypes
Jouni Malinen [Fri, 30 Nov 2018 15:38:35 +0000 (17:38 +0200)] 
OpenSSL: Include sha512.h to match function prototypes

This gets rid of sparse warnings.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agomacsec_linux: Make create_transmit_sc() handler use matching arguments
Jouni Malinen [Fri, 30 Nov 2018 15:36:46 +0000 (17:36 +0200)] 
macsec_linux: Make create_transmit_sc() handler use matching arguments

The currently unused conf_offset parameter used a mismatching type (enum
vs. unsigned int) compared to the prototype.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agomacsec_linux: Use NULL to clear a pointer
Jouni Malinen [Fri, 30 Nov 2018 15:32:35 +0000 (17:32 +0200)] 
macsec_linux: Use NULL to clear a pointer

Avoid a sparse warning from use of a plain integer.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agomacsec_qca: Mark macsec_qca_set_transmit_next_pn() static
Jouni Malinen [Fri, 30 Nov 2018 15:31:30 +0000 (17:31 +0200)] 
macsec_qca: Mark macsec_qca_set_transmit_next_pn() static

This function is not used outside this C file. Mark it static to avoid a
warning from sparse.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoSAE: Fix external authentication on big endian platforms
Ashok Ponnaiah [Fri, 30 Nov 2018 15:26:26 +0000 (17:26 +0200)] 
SAE: Fix external authentication on big endian platforms

Need to handle the little endian 16-bit fields properly when building
and parsing Authentication frames.

Fixes: 5ff39c1380d9 ("SAE: Support external authentication offload for driver-SME cases")
Signed-off-by: Ashok Ponnaiah <aponnaia@codeaurora.org>
5 years agotests: DPP invalid legacy parameters
Jouni Malinen [Fri, 30 Nov 2018 15:17:03 +0000 (17:17 +0200)] 
tests: DPP invalid legacy parameters

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP: Reject invalid no-psk/pass legacy configurator parameters
Jouni Malinen [Fri, 30 Nov 2018 15:14:49 +0000 (17:14 +0200)] 
DPP: Reject invalid no-psk/pass legacy configurator parameters

Instead of going through the configuration exchange, reject invalid
legacy configurator parameters explicitly. Previously, configuring
legacy (psk/sae) parameters without psk/pass resulted in a config object
that used a zero length passphrase. With this change, that config object
is not sent and instead, either the initialization attempts is rejected
or the incoming initialization attempt is ignored.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: DPP protocol testing - Auth Conf RX processing failure
Jouni Malinen [Fri, 30 Nov 2018 12:21:35 +0000 (14:21 +0200)] 
tests: DPP protocol testing - Auth Conf RX processing failure

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: DPP Auth Resp AES-SIV issue
Jouni Malinen [Fri, 30 Nov 2018 12:10:12 +0000 (14:10 +0200)] 
tests: DPP Auth Resp AES-SIV issue

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: More DPP incompatible roles coverage
Jouni Malinen [Fri, 30 Nov 2018 11:46:15 +0000 (13:46 +0200)] 
tests: More DPP incompatible roles coverage

Cover the Configurator/Configurator case in addition Enrollee/Enrollee.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: DPP and Auth Resp(status) build failure
Jouni Malinen [Fri, 30 Nov 2018 11:39:19 +0000 (13:39 +0200)] 
tests: DPP and Auth Resp(status) build failure

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: DPP bootstrap key autogen issues
Jouni Malinen [Fri, 30 Nov 2018 11:30:08 +0000 (13:30 +0200)] 
tests: DPP bootstrap key autogen issues

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoOWE: Fix a compiler warning in non-testing build
Jouni Malinen [Tue, 27 Nov 2018 18:49:53 +0000 (20:49 +0200)] 
OWE: Fix a compiler warning in non-testing build

The new conf variable was used only within the CONFIG_TESTING_OPTIONS
block and as such, added a warning about unused variable into
non-testing builds. Fix that by using that variable outside the
conditional block as well.

Fixes: a22e235fd0df ("OWE: Add testing RSNE for OWE assoc response with driver SME/MLME")
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: DPP protocol testing cases for Auth Resp status-not-OK cases
Jouni Malinen [Tue, 27 Nov 2018 15:21:22 +0000 (17:21 +0200)] 
tests: DPP protocol testing cases for Auth Resp status-not-OK cases

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDPP: Fix no-Status protocol testing in Auth Resp error case
Jouni Malinen [Tue, 27 Nov 2018 15:20:41 +0000 (17:20 +0200)] 
DPP: Fix no-Status protocol testing in Auth Resp error case

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: Additional DPP AES-SIV local failure coverage
Jouni Malinen [Tue, 27 Nov 2018 15:00:24 +0000 (17:00 +0200)] 
tests: Additional DPP AES-SIV local failure coverage

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: DPP QR Code and keygen failure
Jouni Malinen [Tue, 27 Nov 2018 14:50:36 +0000 (16:50 +0200)] 
tests: DPP QR Code and keygen failure

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: DPP local failure on hashing public key for PKEX bootstrap info
Jouni Malinen [Tue, 27 Nov 2018 14:41:25 +0000 (16:41 +0200)] 
tests: DPP local failure on hashing public key for PKEX bootstrap info

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: DPP QR Code and unsupported curve
Jouni Malinen [Tue, 27 Nov 2018 14:39:21 +0000 (16:39 +0200)] 
tests: DPP QR Code and unsupported curve

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDefine QCA_NL80211_VENDOR_SUBCMD_LINK_PROPERTIES also as an event
Sunil Dutt [Wed, 21 Nov 2018 13:49:53 +0000 (19:19 +0530)] 
Define QCA_NL80211_VENDOR_SUBCMD_LINK_PROPERTIES also as an event

This commit enhances QCA_NL80211_VENDOR_SUBCMD_LINK_PROPERTIES to
also be an event, aimed to notify the link status (EX: connected
stations status on an AP link).

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: Additional DPP bootstrapping URI parsing coverage
Jouni Malinen [Mon, 26 Nov 2018 19:35:23 +0000 (21:35 +0200)] 
tests: Additional DPP bootstrapping URI parsing coverage

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: DPP invalid attribute checks
Jouni Malinen [Mon, 26 Nov 2018 18:43:30 +0000 (20:43 +0200)] 
tests: DPP invalid attribute checks

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agonl80211: Use netlink connect socket for disconnect (ext auth)
Cedric Izoard [Mon, 26 Nov 2018 07:44:02 +0000 (07:44 +0000)] 
nl80211: Use netlink connect socket for disconnect (ext auth)

When external authentication is used, a specific netlink socket is used
to send the connect command. If the same socket is not used for
disconnect command, cfg80211 will discard the command. This constraint
was added into the kernel in commit bad292973363 ("nl80211: Reject
disconnect commands except from conn_owner"). That requires an update
for the hostap.git commit 40a68f33844f ("nl80211: Create a netlink
socket handle for the Connect interface").

Add a new flag into struct i802_bss to indicate if the special
nl_connect socket was used for the connect command. When sending
disconnect command this flag is tested to select the correct socket.

Signed-off-by: Cedric Izoard <cedric.izoard@ceva-dsp.com>
5 years agoexternal-auth: Check key_mgmt when selecting SSID
Cedric Izoard [Mon, 26 Nov 2018 11:47:37 +0000 (11:47 +0000)] 
external-auth: Check key_mgmt when selecting SSID

When selecting SSID to start external authentication procedure also
check the key_mgmt field as several network configuration may be defined
for the same SSID/BSSID pair. The external authentication mechanism is
only available for SAE.

Signed-off-by: Cedric Izoard <cedric.izoard@ceva-dsp.com>
5 years agotests: Call remove_group() after other cleanup is done
Avraham Stern [Wed, 22 Aug 2018 16:49:07 +0000 (19:49 +0300)] 
tests: Call remove_group() after other cleanup is done

The call to remove_group() may fail, in which case all following
cleanup is skipped. This may result in failing many tests since
cleanup did not complete successfully.

Fix this by calling remove_group() after other cleanup is done so
even it fails it will not affect the following tests.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
5 years agodrivers: Document struct wpa_signal_info
Emmanuel Grumbach [Wed, 5 Sep 2018 17:44:32 +0000 (20:44 +0300)] 
drivers: Document struct wpa_signal_info

Add documentation to the wpa_signal_info structure.
Add a define for an invalid noise value.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
5 years agotests: hostapd configuration reload on SIGHUP with bss remove/add
Jouni Malinen [Sun, 25 Nov 2018 22:53:53 +0000 (00:53 +0200)] 
tests: hostapd configuration reload on SIGHUP with bss remove/add

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoFix hostapd config file reloading with BSS addition/removal
Jouni Malinen [Sun, 25 Nov 2018 22:51:38 +0000 (00:51 +0200)] 
Fix hostapd config file reloading with BSS addition/removal

BSS additional/removal cases were not considered at all in the previous
implementation of hostapd configuration file reloading on SIGHUP. Such
changes resulted in num_bss values getting out of sync in runtime data
and configuration data and likely dereferencing of freed memory (e.g.,
when removing a BSS).

Fix this by forcing a full disable/enable sequence for the interface if
any BSS entry is added/removed or if an interface name changes between
the old and the new configuration.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoFix a typo in a comment
Jouni Malinen [Sun, 25 Nov 2018 22:37:24 +0000 (00:37 +0200)] 
Fix a typo in a comment

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: DPP Connector testing with ECDSA signature in Python
Jouni Malinen [Sun, 25 Nov 2018 20:01:35 +0000 (22:01 +0200)] 
tests: DPP Connector testing with ECDSA signature in Python

Implement ECDSA signing functionality in the Python test script for
generating a valid signedConnector. This allows coverage of DPP config
object testing to be increased more easily.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: More DPP Config Object protocol testing coverage
Jouni Malinen [Sun, 25 Nov 2018 16:50:29 +0000 (18:50 +0200)] 
tests: More DPP Config Object protocol testing coverage

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoDPP: Fix a debug print to use quotation marks consistently
Jouni Malinen [Sun, 25 Nov 2018 15:31:49 +0000 (17:31 +0200)] 
DPP: Fix a debug print to use quotation marks consistently

The "DPP: Unexpected JWK kty" debug print missed one of the quotation
marks.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: Additional coverage for DPP GAS error cases
Jouni Malinen [Sun, 25 Nov 2018 11:53:05 +0000 (13:53 +0200)] 
tests: Additional coverage for DPP GAS error cases

These test cases found number of error handling issues in the DPP/GAS
implementation.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoDPP: Fix error path handling for GAS Comeback Response building
Jouni Malinen [Sun, 25 Nov 2018 11:51:26 +0000 (13:51 +0200)] 
DPP: Fix error path handling for GAS Comeback Response building

A local memory allocation failuring during GAS Comeback Response frame
generation could result in freeing the response context without removing
it from the list. This would result in dereferencing freed memory when
processing the next comeback request.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoDPP: Fix memory leaks in GAS server error path handling
Jouni Malinen [Sun, 25 Nov 2018 11:49:44 +0000 (13:49 +0200)] 
DPP: Fix memory leaks in GAS server error path handling

If local memory allocation for the GAS response failed, couple of error
paths ended up leaking some memory maintaining the state for the
exchange. Fix that by freeing the context properly.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoDPP: Fix GAS client error case handling
Jouni Malinen [Sun, 25 Nov 2018 11:33:39 +0000 (13:33 +0200)] 
DPP: Fix GAS client error case handling

The GAS client processing of the response callback for DPP did not
properly check for GAS query success. This could result in trying to
check the Advertisement Protocol information in failure cases where that
information is not available and that would have resulted in
dereferencing a NULL pointer. Fix this by checking the GAS query result
before processing with processing of the response.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: More coverage for ATTACH command parameter setting
Jouni Malinen [Sun, 25 Nov 2018 10:02:07 +0000 (12:02 +0200)] 
tests: More coverage for ATTACH command parameter setting

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: D-Bus introspection with busctl
Jouni Malinen [Sat, 24 Nov 2018 16:02:29 +0000 (18:02 +0200)] 
tests: D-Bus introspection with busctl

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agodbus: Expose availability of SHA384 on D-Bus
Lubomir Rintel [Sun, 7 Oct 2018 14:57:27 +0000 (16:57 +0200)] 
dbus: Expose availability of SHA384 on D-Bus

This lets us know whether we can attempt to use FT-EAP-SHA384.

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
5 years agodbus: Expose availability of FT on D-Bus
Lubomir Rintel [Sun, 7 Oct 2018 14:57:10 +0000 (16:57 +0200)] 
dbus: Expose availability of FT on D-Bus

This lets us know whether we can attempt to use FT-PSK, FT-EAP,
FT-EAP-SHA384, FT-FILS-SHA256 or FT-FILS-SHA384.

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
5 years agotests: D-Bus Get/Set Pmf
Lubomir Rintel [Sun, 7 Oct 2018 14:59:40 +0000 (16:59 +0200)] 
tests: D-Bus Get/Set Pmf

Based on Jouni Malinen's [76055b4c6 "tests: D-Bus Get/Set Pmf"], modified
to use the correct "s" signature for the "Pmf" property.

Removed the negative test cases, because the synthesized property doens't
seem to do error checking upon being set.

Signed-off-by: Jouni Malinen <j@w1.fi>
Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
5 years agoRevert "D-Bus: Implement Pmf property"
Lubomir Rintel [Sun, 7 Oct 2018 14:59:39 +0000 (16:59 +0200)] 
Revert "D-Bus: Implement Pmf property"

This reverts commit adf8f45f8af27a9ac9429ecde81776b19b6f9224.

It is basically all wrong. The Pmf property did exist, with a signature of
"s" as documented in doc/dbus.doxygen. It was synthesized from
global_fields[].

The patch added a duplicate one, with a signature of "u", in violation
of D-Bus specification and to bemusement of tools that are careful
enough:

  $ busctl introspect fi.w1.wpa_supplicant1 /fi/w1/wpa_supplicant1/Interfaces/666
  Duplicate property

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
5 years agoRevert "tests: D-Bus Get/Set Pmf"
Lubomir Rintel [Sun, 7 Oct 2018 14:59:38 +0000 (16:59 +0200)] 
Revert "tests: D-Bus Get/Set Pmf"

This is wrong. The Pmf property has a "s" signature.

This reverts commit 76055b4c6115620421313038b6128f3b93d5160e.

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
5 years agomesh: Add Category and Action field to maximum buffer length
Jouni Malinen [Sat, 24 Nov 2018 11:36:54 +0000 (13:36 +0200)] 
mesh: Add Category and Action field to maximum buffer length

Make the buf_len calculation match more closely with the following
wpa_buf*() operations. The extra room from the existing elements was
apparently sufficiently large to cover this, but better add the two
octet header explicitly.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agomesh: Fix off-by-one in buf length calculation
Bob Copeland [Fri, 23 Nov 2018 15:15:42 +0000 (10:15 -0500)] 
mesh: Fix off-by-one in buf length calculation

The maximum size of a Mesh Peering Management element in the case
of an AMPE close frame is actually 24 bytes, not 23 bytes, plus the
two bytes of the IE header (IEEE Std 802.11-2016, 9.4.2.102). Found by
inspection.

The other buffer components seem to use large enough extra room in their
allocations to avoid hitting issues with the full buffer size even
without this fix.

Signed-off-by: Bob Copeland <bobcopeland@fb.com>
5 years agoexamples: Fix shellcheck warnings in wps-ap-cli
Davide Caratti [Mon, 10 Sep 2018 11:00:36 +0000 (13:00 +0200)] 
examples: Fix shellcheck warnings in wps-ap-cli

use 'printf' instead of 'echo -n', to suppress the following warning:

In POSIX sh, echo flags are undefined. [SC2039]

Signed-off-by: Davide Caratti <davide.caratti@gmail.com>
5 years agotests: Store the correct PID in hostapd-test.pid file
Andrei Otcheretianski [Tue, 23 Oct 2018 11:07:05 +0000 (14:07 +0300)] 
tests: Store the correct PID in hostapd-test.pid file

The hwsim's start.sh script spawns hostapd process using "sudo".
Since sudo forks a child process, $! holds the pid of sudo itself.
Fix that by storing the PID of the child process instead.
Since in VM "sudo" is replaced with a dummy script, pass an additional
argument to run-all.sh and start.sh scripts to indicate that they are
running inside a VM.

This is needed to fix ap_config_reload and ap_config_reload_file test
cases on some platforms where sudo is apparently not relaying the
signals properly.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
5 years agotests: Fix ap_acl_deny test
Ayala Beker [Tue, 23 Oct 2018 11:23:52 +0000 (14:23 +0300)] 
tests: Fix ap_acl_deny test

In ap_acl_deny test, the AP doesn't send probe responses during scan due
to ACL reject. As the result, dev[0] might miss the AP's Beacon frame
because the dwell time is too short. Make the test more robust and
trigger passive scan, and by that increase the probability of hearing
the AP.

Signed-off-by: Ayala Beker <ayala.beker@intel.com>
5 years agonl80211: Use correct u8 size for NL80211_ATTR_SMPS_MODE
Johannes Berg [Fri, 26 Oct 2018 13:50:48 +0000 (15:50 +0200)] 
nl80211: Use correct u8 size for NL80211_ATTR_SMPS_MODE

Back in December 2017, Jouni fixed the output side since that was
causing a kernel message to be printed, but the input side should
also be fixed, otherwise it will not work correctly on big-endian
platforms.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 years agoFix dpp_configurator_get_key command name in hostapd_cli
Damodaran, Rohit (Contractor) [Thu, 15 Nov 2018 14:20:32 +0000 (14:20 +0000)] 
Fix dpp_configurator_get_key command name in hostapd_cli

The option to get DPP configurator key in hostapd_cli was named
incorrectly. It was wrongly pointing to dpp_configurator_remove. Fix
this by using the correct name.

Signed-off-by: Rohit Damodaran <Rohit_Damodaran@comcast.com>
5 years agoHS 2.0: Update HS2.0 AP version RADIUS attribute Version field
Jouni Malinen [Fri, 9 Nov 2018 21:38:31 +0000 (23:38 +0200)] 
HS 2.0: Update HS2.0 AP version RADIUS attribute Version field

Use HS20_VERSION macro to determine if R3 should be indicated instead of
R2.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: Mark OSU BSS explicitly in sigma_dut_ap_hs20
Jouni Malinen [Fri, 9 Nov 2018 16:10:28 +0000 (18:10 +0200)] 
tests: Mark OSU BSS explicitly in sigma_dut_ap_hs20

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: ap_hs20_osen to test group cipher selection in SME case
Jouni Malinen [Fri, 9 Nov 2018 16:09:34 +0000 (18:09 +0200)] 
tests: ap_hs20_osen to test group cipher selection in SME case

Go through the group cipher selection in both the wpa_supplicant and
driver SME cases.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoHS 2.0: Generate AssocReq OSEN IE based on AP advertisement
Jouni Malinen [Fri, 9 Nov 2018 16:07:16 +0000 (18:07 +0200)] 
HS 2.0: Generate AssocReq OSEN IE based on AP advertisement

Parse the OSEN IE from the AP to determine values used in the AssocReq
instead of using hardcoded cipher suites. This is needed to be able to
set the group cipher based on AP advertisement now that two possible
options exists for this (GTK_NOT_USED in separate OSEN BSS; CCMP or
GTK_NOT_USED in shared BSS case). Furthermore, this is a step towards
allowing other ciphers than CCMP to be used with OSEN.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDefine new QCA vendor command for coex priority config
Sachin Ahuja [Mon, 29 Oct 2018 11:31:12 +0000 (17:01 +0530)] 
Define new QCA vendor command for coex priority config

Add QCA_NL80211_VENDOR_SUBCMD_COEX_CONFIG vendor command
to set the priorities among different types of traffic of
WLAN/BT/Zigbee during coex scenarios.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoAdd QCA vendor event to indicate throughput changes
vamsi krishna [Wed, 31 Oct 2018 21:50:21 +0000 (03:20 +0530)] 
Add QCA vendor event to indicate throughput changes

Add interface for drivers to report changes in TX/RX throughput
dynamically to user space. This information can be used by userspace
tools to tune kernel's TCP parameters in order to achieve peak
throughput. The driver may optionally provide guidance on which TCP
parameters to be configured for optimal performance along with the
values to be configured.

The TCP parameters that need to be tuned for peak performance are not
interface specific. Based on the guidance from the driver and
considering the other interfaces that may be affected with the new
configurations, a userspace tool has to choose the values to be
configured for these parameters to achieve optimal performance across
interfaces.

The throughput levels informed by the driver with this event are only
for providing guidance on TCP parameter tuning from userspace. The
driver may change the thresholds used to decide low or medium or high
throughput levels based on several parameters based on the PHY layer
capacity in the current connection, the number of packets being
dispatched per second, or the number of packets pending in queues, etc.
The throughput levels may not be consistent with the actual throughput
of the link.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: Use more correct OSU_METHOD value in sigma_dut_ap_hs20
Jouni Malinen [Tue, 6 Nov 2018 00:04:09 +0000 (02:04 +0200)] 
tests: Use more correct OSU_METHOD value in sigma_dut_ap_hs20

The OSU Providers List includes two providers, so there should be two
OSU_METHOD values listed just like there was two OSU_SERVER_URI URLs.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: Use bridge in sigma_dut_ap_eap_osen
Jouni Malinen [Mon, 5 Nov 2018 22:46:23 +0000 (00:46 +0200)] 
tests: Use bridge in sigma_dut_ap_eap_osen

This is needed to allow sigma_dut to enable ap_isolate=1. In addition,
verify that the two associated STAs with RSN(EAP) and OSEN cannot
exchange frames between them.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoAdd test config QCA vendor attribute for action frame Tx in TB PPDU
Kiran Kumar Lokere [Wed, 26 Sep 2018 00:45:28 +0000 (17:45 -0700)] 
Add test config QCA vendor attribute for action frame Tx in TB PPDU

Add a new wifi test config QCA vendor attribute to configure action
frame transmission in HE trigger based PPDU.
This is used for testbed configuration.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDefine test config QCA vendor attribute for HE SU PPDU Tx config
Kiran Kumar Lokere [Wed, 26 Sep 2018 00:24:38 +0000 (17:24 -0700)] 
Define test config QCA vendor attribute for HE SU PPDU Tx config

Add a new wifi test config QCA vendor attribute to configure HE
single user PPDU transmission.
This is used for testbed configuration.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoDefine test config QCA vendor attribute for HE OM control config
Kiran Kumar Lokere [Fri, 21 Sep 2018 00:39:23 +0000 (17:39 -0700)] 
Define test config QCA vendor attribute for HE OM control config

Add a new wifi test config QCA vendor attributes to configure HE
operating mode control field bandwidth, number of spatial streams, and
UL MU disable configuration. Define a new attribute to clear the
previously set HE OM control field configuration. This is used for
testbed configuration.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: sigma_dut AP configuration for Hotspot 2.0
Jouni Malinen [Thu, 1 Nov 2018 15:10:40 +0000 (17:10 +0200)] 
tests: sigma_dut AP configuration for Hotspot 2.0

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoHS 2.0: Fix Terms and Conditions URL handling
Jouni Malinen [Tue, 30 Oct 2018 17:15:11 +0000 (19:15 +0200)] 
HS 2.0: Fix Terms and Conditions URL handling

Do not try to determine the length of the T&C Server URL before checking
that the URL is available. This got broken in a change to move the
handling to the AS. hostapd could potentially have hit a NULL pointer
dereference if the authentication server sent an unconsistent set of T&C
information.

Fixes: d4e39c51f8bb ("HS 2.0: Move Terms and Conditions Server URL generation from AP to AS")
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoOCE: Move OCE checks to IE formation from hostapd initialization
Ankita Bajaj [Tue, 16 Oct 2018 14:32:19 +0000 (20:02 +0530)] 
OCE: Move OCE checks to IE formation from hostapd initialization

Earlier, the OCE flags were checked during hostapd initialization. This
doesn't address few cases like for example when the interface is added
from control interface. Move the OCE flag checks to the functions that
are forming the MBO/OCE IEs to cover all the different paths for
enabling a BSS. Also use macros as appropriate for readability.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoHS 2.0: Do not require devinfo.xml for all hs20-osu-client operations
Jouni Malinen [Tue, 30 Oct 2018 13:29:12 +0000 (15:29 +0200)] 
HS 2.0: Do not require devinfo.xml for all hs20-osu-client operations

hs20-osu-client refused to do anything if it could not find devinfo.xml
from the current working directory. This is a bit excessive since that
file was used in init_ctx() only to fill in ctx->devid which is used
when constructing OMA DM messages.

Move the check for ctx->devid into OMA DM specific code so that other
hs20-osu-client functionality can be used without the devinfo.xml file.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: WNM Collocated Interference Reporting
Jouni Malinen [Tue, 30 Oct 2018 11:59:31 +0000 (13:59 +0200)] 
tests: WNM Collocated Interference Reporting

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoWNM: Collocated Interference Reporting
Jouni Malinen [Tue, 30 Oct 2018 12:00:00 +0000 (14:00 +0200)] 
WNM: Collocated Interference Reporting

Add support for negotiating WNM Collocated Interference Reporting. This
allows hostapd to request associated STAs to report their collocated
interference information and wpa_supplicant to process such request and
reporting. The actual values (Collocated Interference Report Elements)
are out of scope of hostapd and wpa_supplicant, i.e., external
components are expected to generated and process these.

For hostapd/AP, this mechanism is enabled by setting
coloc_intf_reporting=1 in configuration. STAs are requested to perform
reporting with "COLOC_INTF_REQ <addr> <Automatic Report Enabled> <Report
Timeout>" control interface command. The received reports are indicated
as control interface events "COLOC-INTF-REPORT <addr> <dialog token>
<hexdump of report elements>".

For wpa_supplicant/STA, this mechanism is enabled by setting
coloc_intf_reporting=1 in configuration and setting Collocated
Interference Report Elements as a hexdump with "SET coloc_intf_elems
<hexdump>" control interface command. The hexdump can contain one or
more Collocated Interference Report Elements (each including the
information element header). For additional testing purposes, received
requests are reported with "COLOC-INTF-REQ <dialog token> <automatic
report enabled> <report timeout>" control interface events and
unsolicited reports can be sent with "COLOC_INTF_REPORT <hexdump>".

This commit adds support for reporting changes in the collocated
interference (Automatic Report Enabled == 1 and partial 3), but not for
periodic reports (2 and other part of 3).

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agonl80211: Read reg-domain information from a specific wiphy
Peng Xu [Thu, 18 Oct 2018 19:03:25 +0000 (12:03 -0700)] 
nl80211: Read reg-domain information from a specific wiphy

If driver supports self-managed regulatory domain, read reg-domain
information for that specific wiphy interface instead the global
information which may be different which such drivers. This fixes issues
where a regulatory update with a self-managed regulatory domain driver
ended up building incorrect list of supported channels for upper layer
hostapd/wpa_supplicant operations.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agonl80211: Add support for self-managed regulatory device
Peng Xu [Thu, 18 Oct 2018 18:17:05 +0000 (11:17 -0700)] 
nl80211: Add support for self-managed regulatory device

Add a flag indicating if the device has the self-managed regulatory
support. Set the flag if NL80211_ATTR_WIPHY_SELF_MANAGED_REG attribute
is set when reading wiphy info.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoEnable the close-on-exec flag for the debug log file descriptor
Karol Babioch [Sun, 14 Oct 2018 19:58:58 +0000 (21:58 +0200)] 
Enable the close-on-exec flag for the debug log file descriptor

On Linux this flag will make sure that no file descriptor is
accidentally leaked into potential child processes. While this is not a
problem right now, it is considered to be good practice these days when
dealing with file descriptors on Linux.

Signed-off-by: Karol Babioch <karol@babioch.de>
5 years agoCreate debug log file with more sane file permissions
Karol Babioch [Tue, 16 Oct 2018 15:50:12 +0000 (17:50 +0200)] 
Create debug log file with more sane file permissions

Previously the file permissions for the debug log file were not
explicitly set. Instead it was implicitly relying on a secure umask,
which in most cases would result in a file that is world-readable. This
is a violation of good practices, since not every user should have
access to sensitive information that might be contained in the debug log
file.

Explicitly set sane default file permissions in case the file is newly
created.

Unfortunately the fopen(3) function does not provide such a facility, so
the approach needs to be changed in the following way:

1) The file descriptor needs to be created manually using the open(3)
function with the correct flags and the desired mode set.

2) fdopen(3) can then be used on the file descriptor to associate a file
stream with it.

Note: This modification will not change the file permissions of any
already existing debug log files, and only applies to newly created
ones.

Signed-off-by: Karol Babioch <karol@babioch.de>
5 years agotests: Make autogo_interworking test more robust
Andrei Otcheretianski [Wed, 22 Aug 2018 17:31:44 +0000 (20:31 +0300)] 
tests: Make autogo_interworking test more robust

P2P related configuration should be done on a global control interface.
This way this test can be reused also when a dedicated P2P device
interface is used.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
5 years agoAP: Place the WPA IE in the correct order
Ilan Peer [Thu, 23 Aug 2018 13:52:33 +0000 (16:52 +0300)] 
AP: Place the WPA IE in the correct order

In case the protocol used for the BSS is WPA, the WPA vendor IE should
be placed after all the non vendor IEs. Fix this for Beacon and Probe
Response frames.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
5 years agoSME: Fix order of WPA IE in association request
Ilan Peer [Thu, 23 Aug 2018 13:52:32 +0000 (16:52 +0300)] 
SME: Fix order of WPA IE in association request

In case that the protocol used for association is WPA the WPA IE was
inserted before other (non vendor specific) IEs. This is not in
accordance to the standard that states that vendor IEs should be placed
after all the non vendor IEs are placed. In addition, this would cause
the low layers to fail to properly order information elements.

To fix this, if the protocol used is WPA, store the WPA IE and reinsert
it after all the non vendor specific IEs were placed.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
5 years agotests: AP Channel Switch and DISABLE command before completion
Jouni Malinen [Fri, 19 Oct 2018 17:55:18 +0000 (20:55 +0300)] 
tests: AP Channel Switch and DISABLE command before completion

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agohostapd: Reset channel switch parameters on interface disable
Sriram R [Fri, 14 Sep 2018 11:06:06 +0000 (16:36 +0530)] 
hostapd: Reset channel switch parameters on interface disable

Previously, when an AP interface was disabled through a control
interface DISABLE command during a channel switch window, the interface
could not be reenabled due to beacon setup failure (which validates if
CSA is in progress).

Fix this by clearing channel switch parameters while disabling the
hostapd interface.

Signed-off-by: Sriram R <srirrama@codeaurora.org>
5 years agoDefine vendor specific NDP attribute for peer NDPE support
Peng Xu [Mon, 15 Oct 2018 21:08:35 +0000 (14:08 -0700)] 
Define vendor specific NDP attribute for peer NDPE support

Add NAN NDP attribute QCA_WLAN_VENDOR_ATTR_PEER_NDPE_SUPPORT which
indicates if NDP remote peer supports NDPE attribute or not.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoHS 2.0: Record policy update into users table
Jouni Malinen [Fri, 19 Oct 2018 16:00:37 +0000 (19:00 +0300)] 
HS 2.0: Record policy update into users table

This makes it easier to track whether a policy update has been
successfully completed.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoHS 2.0: Rename PPS/Credential1 node to Cred01
Jouni Malinen [Fri, 19 Oct 2018 15:07:37 +0000 (18:07 +0300)] 
HS 2.0: Rename PPS/Credential1 node to Cred01

This makes it a bit easier to use existing hardcoded PPS MO files for
testing purposes when the subscription remediation and policy update
operations target the same path.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoHS 2.0: Fix SubscriptionUpdate UpdateMethod value in OSU server
Jouni Malinen [Fri, 19 Oct 2018 15:00:02 +0000 (18:00 +0300)] 
HS 2.0: Fix SubscriptionUpdate UpdateMethod value in OSU server

This node was modified long time ago to include "SPP-" prefix. Fix the
OSU server implementation to use the correct value.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoHS 2.0: OSU server test functionality for incorrect behavior (policy)
Jouni Malinen [Fri, 19 Oct 2018 14:57:39 +0000 (17:57 +0300)] 
HS 2.0: OSU server test functionality for incorrect behavior (policy)

Extend test=<value> special incorrect behavior testing capabilities in
the OSU server to include the fingerprint of the policy update trust
root: test=corrupt_polupd_hash.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoHS 2.0: OSU server test functionality for incorrect behavior
Jouni Malinen [Wed, 17 Oct 2018 16:08:12 +0000 (19:08 +0300)] 
HS 2.0: OSU server test functionality for incorrect behavior

Add a mechanism to allow special incorrect behavior to be requested from
OSU server by adding an optional parameter test=<value> to the initial
signup URL. This is for protocol testing purposes for the OSU client.

This commit adds two special behavior cases: corrupt_aaa_hash and
corrupt_subrem_hash. These can be used to generate PPS MO with invalid
CertSHA256Fingerprint values for AAAServerTrustRoot and
SubscriptionUpdate nodes.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agoHS 2.0: Reject PPS MO if polupd or AAA trust root is invalid
Jouni Malinen [Wed, 17 Oct 2018 16:03:18 +0000 (19:03 +0300)] 
HS 2.0: Reject PPS MO if polupd or AAA trust root is invalid

Previously, this was done only for the subscription remediation/update
trust root. The other downloaded files were also verified, but the OSU
server was not notified if the files were found to be invalid.

Modify hs20-osu-client behavior to explicitly notify the OSU server if
any of the three trust root types cannot be successfully downloaded.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: Work around tshark bug in wpas_mesh_max_peering
Jouni Malinen [Wed, 17 Oct 2018 09:33:11 +0000 (12:33 +0300)] 
tests: Work around tshark bug in wpas_mesh_max_peering

It looks like tshark parser was broken at some point for
wlan.mesh.config.cap which is now (tshark 2.6.3) pointing to incorrect
field (same as wlan.mesh.config.ps_protocol). This used to work with
tshark 2.2.6.

For now, assume the capability field ends up being the last octet of the
frame.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years agotests: Update tshark wlan_mgmt compatibility code for new version
Jouni Malinen [Tue, 16 Oct 2018 15:21:07 +0000 (18:21 +0300)] 
tests: Update tshark wlan_mgmt compatibility code for new version

It looks like at least tshark 2.6.3 uses a different error message for
unknown display filter fields:
tshark: Neither "wlan_mgt.fixed.category_code" nor "4" are field or protocol names.
and a different status exit code (2 instead of 1).

Add a new handler for this combination to allow automatic wlan_mgt to
wlan conversion to happen.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agoAP: Warn about VLAN interface name truncations
Andrei Otcheretianski [Wed, 22 Aug 2018 17:47:32 +0000 (20:47 +0300)] 
AP: Warn about VLAN interface name truncations

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
5 years agonl80211: Warn about interface name truncations
Andrei Otcheretianski [Wed, 22 Aug 2018 17:47:31 +0000 (20:47 +0300)] 
nl80211: Warn about interface name truncations

This is something useful to know and also eliminates format truncation
warnings.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
5 years agotests: Make ap_reconnect_auth_timeout test more robust
Andrei Otcheretianski [Wed, 22 Aug 2018 17:31:45 +0000 (20:31 +0300)] 
tests: Make ap_reconnect_auth_timeout test more robust

This test starts two identical APs and assumes a connection to the first
one, though it is not necessary true. Fix that by starting the second AP
only after the connection is established.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
5 years agotests: ap_vht_csa_vht40 to check for unexpected disconnection
Jouni Malinen [Tue, 16 Oct 2018 09:44:48 +0000 (12:44 +0300)] 
tests: ap_vht_csa_vht40 to check for unexpected disconnection

This test case had an error that hit an unexpected disconnection. Add an
explicit check to verify that this does not happen anymore.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years agotests: Fix ap_vht_csa_vht40 test
Andrei Otcheretianski [Wed, 22 Aug 2018 17:11:17 +0000 (20:11 +0300)] 
tests: Fix ap_vht_csa_vht40 test

The channel configuration in CHAN_SWITCH command was incorrect. This
resulted in switching to HT40+ channel, while announcing HT40- in the
secondary channel IE. This caused a disconnection after the channel
switch. Fix that.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
5 years agoRSN: Use COMPACT_MACSTR to match MAC2STR
Johannes Berg [Wed, 22 Aug 2018 16:49:03 +0000 (19:49 +0300)] 
RSN: Use COMPACT_MACSTR to match MAC2STR

We shouldn't open-code the %02x... when we have COMPACT_MACSTR.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>