mech_eap.git
7 years agomesh: Write close reason from Mesh Peering Close to debug log
Jouni Malinen [Tue, 28 Jun 2016 19:44:28 +0000 (22:44 +0300)]
mesh: Write close reason from Mesh Peering Close to debug log

This makes it a bit easier to understand the debug log entries related
to tearing down a mesh connection.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agomesh: Remove GTKdata and IGTKdata from Mesh Peering Confirm/Close
Jouni Malinen [Tue, 28 Jun 2016 19:23:42 +0000 (22:23 +0300)]
mesh: Remove GTKdata and IGTKdata from Mesh Peering Confirm/Close

These optional fields are supposed to be included in the Authenticated
Mesh Peering Exchange element only in Mesh Peering Open frames.
Previously, these were incorrectly included in Mesh Peering
Confirm/Close frames and also required to be present in all these
frames.

While this commit changes the receive processing to ignore the
unexpected extra fields, it should be noted that the previous
implementation required the fields to be present and as such, the fixed
implementation is not compatible with it for secure mesh.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agotests: Secure mesh network connectivity failure
Jouni Malinen [Tue, 28 Jun 2016 17:52:21 +0000 (20:52 +0300)]
tests: Secure mesh network connectivity failure

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agotests: Mesh peering management protocol testing for peer addition
Jouni Malinen [Tue, 28 Jun 2016 17:08:52 +0000 (20:08 +0300)]
tests: Mesh peering management protocol testing for peer addition

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agotests: Open mesh network connectivity, no_auto on both peers
Jouni Malinen [Tue, 28 Jun 2016 17:40:37 +0000 (20:40 +0300)]
tests: Open mesh network connectivity, no_auto on both peers

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agotests: Add TEST_FAIL() to hostapd_get_aid()
Jouni Malinen [Tue, 28 Jun 2016 17:44:26 +0000 (20:44 +0300)]
tests: Add TEST_FAIL() to hostapd_get_aid()

This allows additional testing coverage for AID unavailability cases.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agotests: Mark 525 tests as remote compatible
Jonathan Afek [Thu, 23 Jun 2016 17:16:36 +0000 (20:16 +0300)]
tests: Mark 525 tests as remote compatible

After successfully passing the 525 tests on a remote setup mark the
tests as remote compatible.

Signed-off-by: Jonathan Afek <jonathanx.afek@intel.com>
7 years agotests: Add general filter for remote tests execution
Jonathan Afek [Thu, 23 Jun 2016 17:16:35 +0000 (20:16 +0300)]
tests: Add general filter for remote tests execution

Add a new function decorator for the test functions so that they can be
marked as remote compatible tests. Add a general filter to the remote
tests execution script to only execute tests that are remote compatible.

Signed-off-by: Jonathan Afek <jonathanx.afek@intel.com>
7 years agotests: Use general cmd_execute() for bridge setup commands
Jonathan Afek [Thu, 23 Jun 2016 17:16:29 +0000 (20:16 +0300)]
tests: Use general cmd_execute() for bridge setup commands

The hwsim tests used to execute shell commands in the tests using the
subprocess python module. Use the cmd_execute() general function for
executing shell commands to setup bridge so that this would also work on
remote setups.

Signed-off-by: Jonathan Afek <jonathanx.afek@intel.com>
7 years agotests: Use cmd_execute() for iw connect command
Jonathan Afek [Thu, 23 Jun 2016 17:16:29 +0000 (20:16 +0300)]
tests: Use cmd_execute() for iw connect command

The hwsim tests used to execute shell commands in the tests using the
subprocess python module. Use the cmd_execute() general function for
executing "iw connect ..." commands so that this would also work on
remote setups.

Signed-off-by: Jonathan Afek <jonathanx.afek@intel.com>
7 years agotests: Use cmd_execute() for ip link set up/down commands
Jonathan Afek [Thu, 23 Jun 2016 17:16:29 +0000 (20:16 +0300)]
tests: Use cmd_execute() for ip link set up/down commands

The hwsim tests used to execute shell commands in the tests using the
subprocess python module. Use the cmd_execute() general function for
executing "ip link set up/down" commands so that this would also work on
remote setups.

Signed-off-by: Jonathan Afek <jonathanx.afek@intel.com>
7 years agotests: Use cmd_execute() for iw station get command
Jonathan Afek [Thu, 23 Jun 2016 17:16:29 +0000 (20:16 +0300)]
tests: Use cmd_execute() for iw station get command

The hwsim tests used to execute shell commands in the tests using the
subprocess python module. Use the cmd_execute() general function for
executing "iw ... station get" commands so that this would also work on
remote setups.

Signed-off-by: Jonathan Afek <jonathanx.afek@intel.com>
7 years agotests: Use cmd_execute() in find_wpas_process()
Jonathan Afek [Thu, 23 Jun 2016 17:16:29 +0000 (20:16 +0300)]
tests: Use cmd_execute() in find_wpas_process()

The hwsim tests used to execute shell commands in the tests using the
subprocess python module. Use the cmd_execute() general function for
executing "ps ax" so that this would also work on remote setups.

Signed-off-by: Jonathan Afek <jonathanx.afek@intel.com>
7 years agotests: Use cmd_execute() for ip addr add/del
Jonathan Afek [Thu, 23 Jun 2016 17:16:29 +0000 (20:16 +0300)]
tests: Use cmd_execute() for ip addr add/del

The hwsim tests used to execute shell commands in the tests using the
subprocess python module. Use the cmd_execute() general function for
executing "ip addr add/del .." so that this would also work on remote
setups.

Signed-off-by: Jonathan Afek <jonathanx.afek@intel.com>
7 years agotests: Use cmd_execute() for iw scan
Jonathan Afek [Thu, 23 Jun 2016 17:16:29 +0000 (20:16 +0300)]
tests: Use cmd_execute() for iw scan

The hwsim tests used to execute shell commands in the tests using the
subprocess python module. Use the cmd_execute() general function for
executing "iw scan .." so that this would also work on remote setups.

Signed-off-by: Jonathan Afek <jonathanx.afek@intel.com>
7 years agotests: Use cmd_execute() for iw reg set 00
Jonathan Afek [Thu, 23 Jun 2016 17:16:29 +0000 (20:16 +0300)]
tests: Use cmd_execute() for iw reg set 00

The hwsim tests used to execute shell commands in the tests using the
subprocess python module. Use the cmd_execute() general function for
executing "iw reg set 00" so that this would also work on remote setups.

Signed-off-by: Jonathan Afek <jonathanx.afek@intel.com>
7 years agotests: Remove unused import subprocess
Jonathan Afek [Thu, 23 Jun 2016 17:16:29 +0000 (20:16 +0300)]
tests: Remove unused import subprocess

Number of files imported subprocess without using anything from subprocess.

Signed-off-by: Jonathan Afek <jonathanx.afek@intel.com>
7 years agotests: Add the forgotten wlantest_setup() call to a TDLS test
Jonathan Afek [Thu, 23 Jun 2016 17:16:34 +0000 (20:16 +0300)]
tests: Add the forgotten wlantest_setup() call to a TDLS test

One TDLS test case was using wlantest without doing the setup first.
This makes the test not work on real hardware. Fix the issue by adding
the wlantest setup to the test.

Signed-off-by: Jonathan Afek <jonathanx.afek@intel.com>
7 years agotests: Use cmd_execute() in set_powersave()
Jonathan Afek [Thu, 23 Jun 2016 17:16:30 +0000 (20:16 +0300)]
tests: Use cmd_execute() in set_powersave()

hwsim_utils.set_powersace() used to do file operations locally in
python. Start using the cmd_execute() general function for file
operations so that this would also work on remote setups.

Signed-off-by: Jonathan Afek <jonathanx.afek@intel.com>
7 years agotests: Wait for CTRL-EVENT-CHANNEL-SWITCH event in ap_csa tests
Jouni Malinen [Mon, 27 Jun 2016 17:24:52 +0000 (20:24 +0300)]
tests: Wait for CTRL-EVENT-CHANNEL-SWITCH event in ap_csa tests

This verifies that the channel switch is reported by the station and
replaces the fixed sleep before a traffic test by wait for the actual
switch operation to complete.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoAdd CTRL-EVENT-CHANNEL-SWITCH event to indicate channel changes
Jouni Malinen [Mon, 27 Jun 2016 17:24:06 +0000 (20:24 +0300)]
Add CTRL-EVENT-CHANNEL-SWITCH event to indicate channel changes

This provides information of the channel switch to wpa_supplicant
control interface monitors.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agotests: Use shell in local cmd_execute() only if needed
Jouni Malinen [Mon, 27 Jun 2016 17:10:23 +0000 (20:10 +0300)]
tests: Use shell in local cmd_execute() only if needed

The generic cmd_execute() function was introduced in a manner that
converted the argument array to a string and used shell to run the
command unconditionally. This is not really desirable, so move back to
using the command array by default and use the single command string
with a shell only when really needed.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agotests: Use cmd_execute() in ap_ht clear_scan_cache()
Jonathan Afek [Tue, 7 Jun 2016 13:42:41 +0000 (16:42 +0300)]
tests: Use cmd_execute() in ap_ht clear_scan_cache()

The ap_ht tests used to execute shell commands in the tests using the
subprocess python module. Complete the move to using the cmd_execute()
general function for executing shell commands so that this would also
work on remote setups.

Signed-off-by: Jonathan Afek <jonathanx.afek@intel.com>
7 years agotests: Use cmd_execute() function in ap_ht40_scan_not_affected
Jonathan Afek [Tue, 7 Jun 2016 13:42:41 +0000 (16:42 +0300)]
tests: Use cmd_execute() function in ap_ht40_scan_not_affected

The ap_ht tests used to execute shell commands in the tests using the
subprocess python module. Start using the cmd_execute() general function
for executing shell commands so that this would also work on remote
setups.

Signed-off-by: Jonathan Afek <jonathanx.afek@intel.com>
7 years agotests: Use the cmd_execute() function in ap_ht for iw reg set
Jonathan Afek [Tue, 7 Jun 2016 13:42:41 +0000 (16:42 +0300)]
tests: Use the cmd_execute() function in ap_ht for iw reg set

The ap_ht tests used to execute iw reg set command using the subprocess
python module. Start using the cmd_execute() general function for
executing shell commands so that this would also work on remote setups.

Signed-off-by: Jonathan Afek <jonathanx.afek@intel.com>
7 years agotests: Use apdev[0] more consistently in ap_ht
Jonathan Afek [Tue, 7 Jun 2016 13:42:41 +0000 (16:42 +0300)]
tests: Use apdev[0] more consistently in ap_ht

The test cases ap_ht40_5ghz_invalid_pair and ap_ht40_5ghz_disabled_sec
mixed use of apdev[0] and apdev[1] while only needing a single AP. This
works when both the devices are on the same host (e.g., with
mac80211_hwsim), but not when using separate remote hosts. Fix this by
using apdev[0] more consistently in these test cases.

Signed-off-by: Jonathan Afek <jonathanx.afek@intel.com>
7 years agotests: Remove trailing whitespace
Jonathan Afek [Tue, 7 Jun 2016 13:42:41 +0000 (16:42 +0300)]
tests: Remove trailing whitespace

Signed-off-by: Jonathan Afek <jonathanx.afek@intel.com>
7 years agotests: Pass full apdev to clear_scan_cache()
Jonathan Afek [Tue, 7 Jun 2016 13:42:41 +0000 (16:42 +0300)]
tests: Pass full apdev to clear_scan_cache()

This is a step towards enabling the needed commands to be run on a
remote host.

Signed-off-by: Jonathan Afek <jonathanx.afek@intel.com>
7 years agotests: Initialize hapd variable before try-finally uses
Jonathan Afek [Thu, 23 Jun 2016 17:16:32 +0000 (20:16 +0300)]
tests: Initialize hapd variable before try-finally uses

Some TDLS and WPS test cases reference the hapd variable in the finally
block even if the test failed before assigning the value to this
variable. This makes the code in the finally block to fail on
referencing this variable. Assign None to the hapd variable before
starting the tests to avoid this.

Signed-off-by: Jonathan Afek <jonathanx.afek@intel.com>
7 years agotests: GAS failure cases
Jouni Malinen [Mon, 27 Jun 2016 09:30:53 +0000 (12:30 +0300)]
tests: GAS failure cases

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoGAS: Fix double-free on an error path
Jouni Malinen [Mon, 27 Jun 2016 15:30:11 +0000 (18:30 +0300)]
GAS: Fix double-free on an error path

If radio_add_work() fails, gas_query_req() ended up freeing the query
payload and returning an error. This resulted in also the caller trying
to free the query payload. Fix this by not freeing the buffer within
gas_query_req() in error case to be consistent with the other error
cases.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoGAS: Remove unused gas_query_cancel()
Jouni Malinen [Mon, 27 Jun 2016 13:31:03 +0000 (16:31 +0300)]
GAS: Remove unused gas_query_cancel()

This function was added with the initial GAS implementation, but there
was no user for it at the time and no clear use now either, so remove
the unused function and the related GAS query reason code.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agotests: GAS/ANQP query protected vs. not protected
Jouni Malinen [Mon, 27 Jun 2016 10:34:19 +0000 (13:34 +0300)]
tests: GAS/ANQP query protected vs. not protected

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoGAS: Check protected/unprotected drop after action code check
Jouni Malinen [Mon, 27 Jun 2016 10:14:28 +0000 (13:14 +0300)]
GAS: Check protected/unprotected drop after action code check

Apply the GAS specific rule of using Protected Dual of Public Action
frame only after having checked that the action code indicates this to
be a GAS response. Previously, non-GAS Public Action frames could have
been incorrectly dropped because of this check if received during an
association with PMF enabled.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoGAS: Report GAS-QUERY-DONE event on initial req TX failure
Jouni Malinen [Mon, 27 Jun 2016 10:01:05 +0000 (13:01 +0300)]
GAS: Report GAS-QUERY-DONE event on initial req TX failure

The GAS-QUERY-DONE event with result=INTERNAL_ERROR was reported on most
other error cases, but the failure triggered by not being able to
transmit a GAS Initial Request stopped the query silently. Make this
more consistent with other error cases by reporting the same event.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agotests: GAS query deleted at deinit
Jouni Malinen [Mon, 27 Jun 2016 09:51:20 +0000 (12:51 +0300)]
tests: GAS query deleted at deinit

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoOpenSSL: Update to match the modified DH_get0_key() API
Jouni Malinen [Fri, 24 Jun 2016 21:35:17 +0000 (00:35 +0300)]
OpenSSL: Update to match the modified DH_get0_key() API

OpenSSL 1.1.0 (master branch) apparently ended up modifying the API
after the beta 2 release that was supposed to complete the work. Mark
the variables const to fix the compilation with the modified OpenSSL
API.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoD-Bus: Make the CurrentAuthMode property getter more robust
Jouni Malinen [Fri, 24 Jun 2016 20:49:08 +0000 (23:49 +0300)]
D-Bus: Make the CurrentAuthMode property getter more robust

Now that mesh sets wpa_s->wpa_state = WPA_COMPLETED, it looks like this
getter can get called with wpa_s->current_ssid = NULL. That could result
in NULL pointer dereference, so need to protect that specific case.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agotests: D-Bus DeviceFoundProperties signal
Jouni Malinen [Fri, 24 Jun 2016 15:38:36 +0000 (18:38 +0300)]
tests: D-Bus DeviceFoundProperties signal

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoD-Bus: Add DeviceFoundProperties signal for discovered peers
Nishant Chaprana [Mon, 20 Jun 2016 04:48:21 +0000 (10:18 +0530)]
D-Bus: Add DeviceFoundProperties signal for discovered peers

This signal sends the peer properties to applications for discovered
peers. The signature of this event is "oa{sv}". This event is needed
because the current DeviceFound signal provides only the peer object
path. If there are many peers in range there will be many DeviceFound
signals and for each DeviceFound signal, applications would need to use
GetAll to fetch peer properties. Doing this many times would create
extra load over application as well as over wpa_supplicant, so it is
better to send peer properties in the event so that applications can
extract found peer information without extra steps.

The existing DeviceFound signal is left as-is to avoid changing its
signature.

The issue is not applicable to the control interface because the
P2P-DEVICE-FOUND event includes peer info in it, but over D-Bus
interface DeviceFound provides only the peer object.

Signed-off-by: Nishant Chaprana <n.chaprana@samsung.com>
7 years agotests: wpa_state == COMPLETED in mesh
Jouni Malinen [Fri, 24 Jun 2016 15:24:37 +0000 (18:24 +0300)]
tests: wpa_state == COMPLETED in mesh

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agomesh: Mark wpa_state COMPLETED when mesh join has been performed
Maital Hahn [Mon, 20 Jun 2016 13:27:21 +0000 (16:27 +0300)]
mesh: Mark wpa_state COMPLETED when mesh join has been performed

In mesh interface, the wpa_supplicant state was either
DISCONNECT/SCANNING in non-secured connection or AUTHENTICATING in
secured connection. The latter prevented the scan. Update the
wpa_supplicant state in mesh to be COMPLETED upon initialization. This
is similar to the P2P GO case.

Signed-off-by: Maital Hahn <maitalm@ti.com>
7 years agotests: wpa_supplicant AP mode - WPS operations with fragmentation
Jouni Malinen [Fri, 24 Jun 2016 15:09:07 +0000 (18:09 +0300)]
tests: wpa_supplicant AP mode - WPS operations with fragmentation

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agowpa_supplicant: Configurable EAP fragment size in AP mode
Lior David [Sat, 16 Jan 2016 16:57:54 +0000 (18:57 +0200)]
wpa_supplicant: Configurable EAP fragment size in AP mode

In wpa_supplicant AP mode, allow configuration of the EAP fragment size
using the fragment_size member of network block (wpa_ssid), similar to
the fragment_size in hostapd configuration. bss->fragment_size default
value of 0 is treated specially in some EAP code paths (such as MTU
initialization in eap_pwd_init). In order to preserve the existing
behavior, bss->fragment_size will only be set if the network block
specified a value different from the default which is
DEFAULT_FRAGMENT_SIZE(1398) bytes.

Signed-off-by: Lior David <qca_liord@qca.qualcomm.com>
7 years agoAssign vendor specific elements for early HE testing
Jouni Malinen [Fri, 24 Jun 2016 14:59:47 +0000 (17:59 +0300)]
Assign vendor specific elements for early HE testing

These elements can be used for pre-standard publication testing of HE
before P802.11ax draft assigns the element ID. The payload of these
vendor specific elements is defined by the latest P802.11ax draft.
Please note that the draft is still work in progress and the element
payload is subject to change.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoPAE: Use big endian version in current_peer_id.mn to be more consistent
Jouni Malinen [Fri, 24 Jun 2016 14:53:29 +0000 (17:53 +0300)]
PAE: Use big endian version in current_peer_id.mn to be more consistent

This gets rid of sparse warnings related to mismatching annotation and
byte swapping.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoPAE: Use sci->port more consistently
Jouni Malinen [Fri, 24 Jun 2016 14:48:27 +0000 (17:48 +0300)]
PAE: Use sci->port more consistently

This is now annotated as be16, so use it as such in all cases instead of
first storing host byte order value and then swapping that to big endian
in other instances of the same structure. This gets rid of number of
sparse warnings.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agowired: Silence sparse warning on redefinition of IFNAMSIZ
Jouni Malinen [Fri, 24 Jun 2016 14:36:17 +0000 (17:36 +0300)]
wired: Silence sparse warning on redefinition of IFNAMSIZ

driver_wired.c pulls in utils/common.h before net/if.h as a workaround
for NetBSD build. This results in IFNAMSIZ getting redefined and sparse
warning about this. Silence that warning by undefining the IFNAMSIZ
definition from common.h to allow the one from net/if.h being used. In
addition, remove duplicated inclusion of net/if.h.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoMove extern declarations for ext_password backends into a header file
Jouni Malinen [Fri, 24 Jun 2016 14:30:26 +0000 (17:30 +0300)]
Move extern declarations for ext_password backends into a header file

This gets rid of a sparse warning and also allows the compatibility of
the declarations to be verified (a missing const declaration is fixed
here as well).

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoMove extern declarations for autoscan modules into a header file
Jouni Malinen [Fri, 24 Jun 2016 14:28:39 +0000 (17:28 +0300)]
Move extern declarations for autoscan modules into a header file

This gets rid of number of sparse warnings and also allows the
compatibility of the declarations to be verified.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoMove extern declarations for bgscan modules into a header file
Jouni Malinen [Fri, 24 Jun 2016 14:27:12 +0000 (17:27 +0300)]
Move extern declarations for bgscan modules into a header file

This gets rid of number of sparse warnings and also allows the
compatibility of the declarations to be verified.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoMove extern declarations for driver ops into a header file
Jouni Malinen [Fri, 24 Jun 2016 14:24:17 +0000 (17:24 +0300)]
Move extern declarations for driver ops into a header file

This gets rid of number of sparse warnings and also allows the
compatibility of the declarations to be verified (number of missing
const declarations are fixed here as well).

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agonl80211: Mark wpa_driver_nl80211_get_macaddr() static
Jouni Malinen [Fri, 24 Jun 2016 14:09:46 +0000 (17:09 +0300)]
nl80211: Mark wpa_driver_nl80211_get_macaddr() static

This function is not used outside this file.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoFix a debug print in p2p_manager_disconnect()
Jouni Malinen [Thu, 23 Jun 2016 22:58:33 +0000 (01:58 +0300)]
Fix a debug print in p2p_manager_disconnect()

fc2str() expects to get the 16-bit frame control value in host byte
order.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoMark internal functions static
Jouni Malinen [Thu, 23 Jun 2016 22:57:58 +0000 (01:57 +0300)]
Mark internal functions static

These functions are not called outside this file.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoOpenSSL: Silence sparse warnings in fips186_2_prf()
Jouni Malinen [Thu, 23 Jun 2016 22:53:27 +0000 (01:53 +0300)]
OpenSSL: Silence sparse warnings in fips186_2_prf()

Use WPA_PUT_BE32() instead of inplace conversion with host_to_be32() to
avoid sparse warnings.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agodhcp_snoop: Silence a sparse warning
Jouni Malinen [Thu, 23 Jun 2016 22:47:54 +0000 (01:47 +0300)]
dhcp_snoop: Silence a sparse warning

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agondisc_snoop: Include ndisc_snoop.h to check prototypes
Jouni Malinen [Thu, 23 Jun 2016 22:47:02 +0000 (01:47 +0300)]
ndisc_snoop: Include ndisc_snoop.h to check prototypes

This allows the compiler to check that function prototypes match the
implementation. In addition, this gets rid of sparse warnings.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoTNCS: Mark functions static
Jouni Malinen [Thu, 23 Jun 2016 22:46:33 +0000 (01:46 +0300)]
TNCS: Mark functions static

These are called through function pointers, so no need to make the
function symbols directly available outside this file.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoPAE: Mark ieee802_1x_kay_deinit_data_key() static
Jouni Malinen [Thu, 23 Jun 2016 22:40:24 +0000 (01:40 +0300)]
PAE: Mark ieee802_1x_kay_deinit_data_key() static

This function is not used outside this file.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoPAE: Use be16/be32 instead of u16/u32 for spartse
Jouni Malinen [Thu, 23 Jun 2016 22:38:48 +0000 (01:38 +0300)]
PAE: Use be16/be32 instead of u16/u32 for spartse

This converts some of the PAE code to use a design that gets rid
unnecessary warnings from sparse and allows more thorough validation of
byte order operations.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoTNCC: Mark functions static
Jouni Malinen [Thu, 23 Jun 2016 22:38:04 +0000 (01:38 +0300)]
TNCC: Mark functions static

These are called through function pointers, so no need to make the
function symbols directly available outside this file.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agotests: Declare module test functions in a header file
Jouni Malinen [Thu, 23 Jun 2016 15:19:00 +0000 (18:19 +0300)]
tests: Declare module test functions in a header file

This gets rid of number of warnings from sparse.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agotests: Mark some module test arrays static
Jouni Malinen [Thu, 23 Jun 2016 15:11:35 +0000 (18:11 +0300)]
tests: Mark some module test arrays static

These are not used outside the source code file.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoradiotap: Silence sparse warnings about byte order swapping
Jouni Malinen [Thu, 23 Jun 2016 15:06:37 +0000 (18:06 +0300)]
radiotap: Silence sparse warnings about byte order swapping

These little endian fields were not marked properly and the type case in
the get_unaligned_* helper macros were causing warnings from sparse.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoFST: Make fst_action_names static
Jouni Malinen [Thu, 23 Jun 2016 14:48:48 +0000 (17:48 +0300)]
FST: Make fst_action_names static

This is not used outside this file.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoFST: Fix byte order of couple of fields on big endian hosts
Jouni Malinen [Thu, 23 Jun 2016 14:46:40 +0000 (17:46 +0300)]
FST: Fix byte order of couple of fields on big endian hosts

Couple of fsts_id and llt fields were not properly swapped from host
byte order to little endian byte order used in the frames. Fix this and
use the le32 type to make this more consistent and verifiable with
sparse.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoMark wpas_data_test_rx() static
Jouni Malinen [Thu, 23 Jun 2016 10:43:20 +0000 (13:43 +0300)]
Mark wpas_data_test_rx() static

This is not called from outside ctrl_iface.c.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoFix byte order for CONFIG_VHT_OVERRIDES parameters
Jouni Malinen [Thu, 23 Jun 2016 10:41:18 +0000 (13:41 +0300)]
Fix byte order for CONFIG_VHT_OVERRIDES parameters

The VHT parameters were not swapped properly on big endian systems.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoOpenSSL: Pull in header files to check function prototypes
Jouni Malinen [Thu, 23 Jun 2016 10:35:26 +0000 (13:35 +0300)]
OpenSSL: Pull in header files to check function prototypes

Since crypto_openssl.c is now implementing couple of functions
internally, pull in the relevant header files md5.h and aes_wrap.h to
make sure the function declaration are consistent.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoFST: Mark wpa_supplicant callback functions get_peer_{first,next} static
Jouni Malinen [Thu, 23 Jun 2016 10:32:29 +0000 (13:32 +0300)]
FST: Mark wpa_supplicant callback functions get_peer_{first,next} static

These are used only through function pointers, so no need to keep the
functions non-static.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoTDLS: Declare tdls_testing as extern in a header file
Jouni Malinen [Thu, 23 Jun 2016 10:31:04 +0000 (13:31 +0300)]
TDLS: Declare tdls_testing as extern in a header file

This gets rid of a sparse warning with CONFIG_TDLS_TESTING builds.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agotrace: Define externs in a header file
Jouni Malinen [Thu, 23 Jun 2016 10:28:54 +0000 (13:28 +0300)]
trace: Define externs in a header file

This gets rid of some unnecessary strace warnings from test builds.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoUndefine __bitwise before defining it for sparse
Jouni Malinen [Thu, 23 Jun 2016 10:23:46 +0000 (13:23 +0300)]
Undefine __bitwise before defining it for sparse

This gets rid of a compiler warning due to a bit different construction
in linux/types.h.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoFix hostapd_sta_add() call to use NULL as the pointer instead of 0
Jouni Malinen [Thu, 23 Jun 2016 10:14:17 +0000 (13:14 +0300)]
Fix hostapd_sta_add() call to use NULL as the pointer instead of 0

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoMBO: Mark verify_channel() static
Jouni Malinen [Thu, 23 Jun 2016 10:13:54 +0000 (13:13 +0300)]
MBO: Mark verify_channel() static

This function is not used outside mbo.c.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoWNM: Use NULL instead of 0 as the pointer return value
Jouni Malinen [Thu, 23 Jun 2016 10:11:01 +0000 (13:11 +0300)]
WNM: Use NULL instead of 0 as the pointer return value

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agotests: ap_ciphers tests start using general cmd_execute() function
Jonathan Afek [Tue, 7 Jun 2016 13:42:43 +0000 (16:42 +0300)]
tests: ap_ciphers tests start using general cmd_execute() function

The ap_ciphers tests used to do file operations locally in python. Start
using the cmd_execute() general function for file operations so that
this would also work on remote setups.

Signed-off-by: Jonathan Afek <jonathanx.afek@intel.com>
7 years agotests: Add functions to execute shell commands on interface host
Jonathan Afek [Tue, 7 Jun 2016 13:42:40 +0000 (16:42 +0300)]
tests: Add functions to execute shell commands on interface host

Add the feature to execute shell commands on each wpa_supplicant/hostapd
interface host. When executing remote tests the interfaces are not all
on a single host so when executing shell commands the test needs to
execute the command on the host which the interface relevant for the
command is on. This patch enables tests to execute the command on the
relevant host.

Signed-off-by: Jonathan Afek <jonathanx.afek@intel.com>
7 years agoctrl_iface: BSS command to skip info items if parsing fails
Jonathan Afek [Tue, 14 Jun 2016 10:31:18 +0000 (13:31 +0300)]
ctrl_iface: BSS command to skip info items if parsing fails

In some cases parsing of the mesh scan info for a BSS or the P2P scan
info can fail. One reason can be that the Beacon/Probe Response frame
contained malformed length vendor IEs which are not parsed when adding
to the BSS table. Instead of skipping the whole BSS of the BSS command,
just skip the part that failed to parse.

Signed-off-by: Jonathan Afek <jonathanx.afek@intel.com>
7 years agotests: mesh_scan_oom to support partial BSS result reporting
Jouni Malinen [Sun, 19 Jun 2016 20:47:01 +0000 (23:47 +0300)]
tests: mesh_scan_oom to support partial BSS result reporting

The next commit modifies the BSS command behavior to report partial
results for a BSS, so mesh_scan_oom needs to allow a BSS entry to be
returned as long as it does not include the mesh information.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agotests: WPA2-Enterprise connection using EAP-GPSK and wildcard SSID
Jouni Malinen [Sun, 19 Jun 2016 19:41:23 +0000 (22:41 +0300)]
tests: WPA2-Enterprise connection using EAP-GPSK and wildcard SSID

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoHS 2.0R2: No longer use HTTP_RAW_POST_DATA
Cedric Izoard [Tue, 14 Jun 2016 12:51:47 +0000 (12:51 +0000)]
HS 2.0R2: No longer use HTTP_RAW_POST_DATA

As HTTP_RAW_POST_DATA is deprecated, use php://input instead.

Signed-off-by: Cedric Izoard <cedric.izoard@ceva-dsp.com>
7 years agocurl: Don't free memory for subjectAltName before calling callback
Cedric Izoard [Tue, 14 Jun 2016 12:49:00 +0000 (12:49 +0000)]
curl: Don't free memory for subjectAltName before calling callback

Freeing memory for subjectAltName in parse_cert(), will give cert_cb
pointers to freed memory zone that may already been overwritten. Memory
for subjectAltName is released in parse_cert_free().

Signed-off-by: Cedric Izoard <cedric.izoard@ceva-dsp.com>
7 years agotests: More wpa_supplicant AP mode coverage
Jouni Malinen [Sun, 19 Jun 2016 19:00:20 +0000 (22:00 +0300)]
tests: More wpa_supplicant AP mode coverage

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agotests: Mesh with various pairwise and group ciphers
Jouni Malinen [Sat, 18 Jun 2016 19:42:37 +0000 (22:42 +0300)]
tests: Mesh with various pairwise and group ciphers

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agomesh: Use MESH_CAP_* macros for mesh capability
Masashi Honma [Tue, 14 Jun 2016 03:31:16 +0000 (12:31 +0900)]
mesh: Use MESH_CAP_* macros for mesh capability

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
7 years agomesh: Ignore crowded peer
Masashi Honma [Tue, 14 Jun 2016 03:31:15 +0000 (12:31 +0900)]
mesh: Ignore crowded peer

The "Accepting Additional Mesh Peerings bit == 0" means the peer cannot
accept any more peers, so suppress attempt to open a connection to such
a peer.

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
7 years agomesh: Select pairwise and group cipher based on network profile
Jouni Malinen [Sat, 18 Jun 2016 19:21:33 +0000 (22:21 +0300)]
mesh: Select pairwise and group cipher based on network profile

This allows the previously hardcoded CCMP cipher to be replaced in the
network profile for mesh.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agomesh: Avoid use of hardcoded cipher
Jouni Malinen [Sat, 18 Jun 2016 19:14:37 +0000 (22:14 +0300)]
mesh: Avoid use of hardcoded cipher

This moves pairwise, group, and management group ciphers to various mesh
data structures to avoid having to hardcode cipher in number of places
through the code. While CCMP and BIP are still the hardcoded ciphers,
these are now set only in one location.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agomesh: Clean up AMPE element encoding and parsing
Jouni Malinen [Sat, 18 Jun 2016 11:11:23 +0000 (14:11 +0300)]
mesh: Clean up AMPE element encoding and parsing

The AMPE element includes number of optional and variable length fields
and those cannot really be represented by a fixed struct
ieee80211_ampe_ie. Remove the optional fields from the struct and
build/parse these fields separately.

This is also adding support for IGTKdata that was completely missing
from the previous implementation. In addition, Key RSC for MGTK is now
filled in and used when configuring the RX MGTK for a peer.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agomesh: Do not use RX MGTK as RX IGTK
Jouni Malinen [Sat, 18 Jun 2016 12:50:14 +0000 (15:50 +0300)]
mesh: Do not use RX MGTK as RX IGTK

The previous implementation was incorrect in forcing the MGTK to be used
as the IGTK as well. Define new variable for storing IGTK and use that,
if set, to configure IGTK to the driver. This commit does not yet fix
AMPE element parsing to fill in this information.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agomesh: Use variable length MGTK for RX
Jouni Malinen [Sat, 18 Jun 2016 11:45:35 +0000 (14:45 +0300)]
mesh: Use variable length MGTK for RX

This extends the data structures to allow variable length MGTK to be
stored for RX. This is needed as an initial step towards supporting
different cipher suites.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agomesh: Generate a separate TX IGTK if PMF is enabled
Jouni Malinen [Sat, 18 Jun 2016 11:41:59 +0000 (14:41 +0300)]
mesh: Generate a separate TX IGTK if PMF is enabled

Previous implementation was incorrectly using MGTK also as the IGTK and
doing this regardless of whether PMF was enabled. IGTK needs to be a
independent key and this commit does that at the local TX side.

The current AMPE element construction and parsing is quite broken, so
this does not get add the IGTKdata field there.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agomesh: Support variable length TX MGTK
Jouni Malinen [Sat, 18 Jun 2016 11:39:43 +0000 (14:39 +0300)]
mesh: Support variable length TX MGTK

This is an initial step in supporting multiple cipher suites.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agomesh: Add variable length MTK support
Jouni Malinen [Sat, 18 Jun 2016 11:35:35 +0000 (14:35 +0300)]
mesh: Add variable length MTK support

This is needed as a part in enabling support for different pairwise
ciphers in mesh.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agomesh: Coding style cleanup for MTK derivation
Jouni Malinen [Sat, 18 Jun 2016 11:27:29 +0000 (14:27 +0300)]
mesh: Coding style cleanup for MTK derivation

Clean up the mesh_rsn_derive_mtk() function by using proper macros and
pointer to the location within the context block.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agomesh: Fix MTK derivation to use AKM suite selector
Jouni Malinen [Sat, 18 Jun 2016 11:21:48 +0000 (14:21 +0300)]
mesh: Fix MTK derivation to use AKM suite selector

mesh_rsn_derive_mtk() was hardcoded to use GCMP (even though CCMP was
hardcoded elsewhere) cipher suite selector instead of the selected AKM
suite selector. This resulted in incorrect MTK getting derived. Fix this
by used the SAE AKM suite selector in the input to the KDF.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agomesh: Coding style cleanup for AEK derivation
Jouni Malinen [Sat, 18 Jun 2016 11:19:42 +0000 (14:19 +0300)]
mesh: Coding style cleanup for AEK derivation

Clean up the mesh_rsn_derive_aek() function by using proper macros and
pointer to the location within the context block.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agomesh: Fix AEK derivation to use AKM suite selector
Jouni Malinen [Sat, 18 Jun 2016 11:17:34 +0000 (14:17 +0300)]
mesh: Fix AEK derivation to use AKM suite selector

mesh_rsn_derive_aek() was hardcoded to use GCMP (even though CCMP was
hardcoded elsewhere) cipher suite selector instead of the selected AKM
suite selector. This resulted in incorrect AEK getting derived. Fix this
by used the SAE AKM suite selector in the input to the KDF.

Signed-off-by: Jouni Malinen <j@w1.fi>