mech_eap.git
8 years agowpa_cli: Skip action script execution when eloop termination is pending
Jouni Malinen [Wed, 22 Jul 2015 14:10:32 +0000 (17:10 +0300)]
wpa_cli: Skip action script execution when eloop termination is pending

Try to exit more quickly by avoiding execution of the action script for
any pending events if the process is requested to be killed. This may
help in avoiding hitting the two second SIGALRM workaround in eloop in
case some of the action scripts block for long period of time.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoeloop: Try to terminate more quickly on SIGINT and SIGTERM
Jouni Malinen [Wed, 22 Jul 2015 14:05:46 +0000 (17:05 +0300)]
eloop: Try to terminate more quickly on SIGINT and SIGTERM

It was possible for the SIGINT/SIGTERM signal to be received while
processing a pending timeout/socket/signal event and then get stuck in
the following select() call before processing the signal event. If no
other events show up within the two second SIGALRM trigger, process will
be terminated forcefully even though there would have been possibility
to do clean termination assuming no operationg blocked for that two
second time.

Handle this more cleanly by checking for eloop.pending_terminate before
starting the select()/poll()/epoll_wait() wait for the following event.
Terminate the loop if pending signal handling requests termination.

In addition, make eloop_terminated() return 1 on eloop.pending_terminate
in addition to eloop.terminate since the process will be terminated
shortly and there is no point in starting additional processing.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoAdd QCA vendor definitions for multi-port concurrency
Ahmad Kholaif [Tue, 21 Jul 2015 20:11:43 +0000 (13:11 -0700)]
Add QCA vendor definitions for multi-port concurrency

Introduce definitions for QCA vendor specific subcommands and attributes
to support multiport concurrency.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agohostapd: Mark config parameter name const
Jouni Malinen [Tue, 21 Jul 2015 10:46:00 +0000 (13:46 +0300)]
hostapd: Mark config parameter name const

The functions parsing configuration parameters do not modify the name of
the parameter, so mark that function argument constant. In theory, the
value should also be const, but at least for now, number of the parser
functions end up modifying this to simplify parsing.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: hostapd DUP_NETWORK
Anton Nayshtut [Sun, 19 Jul 2015 17:09:18 +0000 (20:09 +0300)]
tests: hostapd DUP_NETWORK

This test checks the functionality of DUP_NETWORK global control
inteface command.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agohostapd: Add DUP_NETWORK global control interface command
Anton Nayshtut [Mon, 20 Jul 2015 10:38:01 +0000 (13:38 +0300)]
hostapd: Add DUP_NETWORK global control interface command

This adds a new global control interface command DUP_NETWORK with the
following syntax:

DUP_NETWORK src_ifname dst_ifname param

The currently supported parameters:
  wpa
  wpa_key_mgmt
  wpa_pairwise
  rsn_pairwise
  wpa_passphrase
  wpa_psk

The specified configuration parameter is copied from the source
interface to the destination interface. The main use for this is to
allow cloning of security configuration without having to expose the
keys from the hostapd process.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agohostapd: Introduce hostapd_ctrl_iface_get_key_mgmt()
Anton Nayshtut [Sun, 19 Jul 2015 14:21:57 +0000 (17:21 +0300)]
hostapd: Introduce hostapd_ctrl_iface_get_key_mgmt()

This function will be used in DUP_NETWORK command implementation.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agohostapd: Introduce hostapd_interfaces_get_hapd()
Anton Nayshtut [Sun, 19 Jul 2015 09:13:23 +0000 (12:13 +0300)]
hostapd: Introduce hostapd_interfaces_get_hapd()

This function will be used in DUP_NETWORK command implementation.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoAdd QCA vendor command for updating gateway parameters
Ravi Joshi [Fri, 17 Jul 2015 00:45:41 +0000 (17:45 -0700)]
Add QCA vendor command for updating gateway parameters

Add vendor command for updating gateway parameters to the driver.

Signed-off-by: Ravi Joshi <ravij@qca.qualcomm.com>
8 years agoFST: Include fst/fst.h explicitly into wpa_supplicant/ctrl_iface.c
Jouni Malinen [Tue, 21 Jul 2015 10:15:24 +0000 (13:15 +0300)]
FST: Include fst/fst.h explicitly into wpa_supplicant/ctrl_iface.c

This header file is needed to get struct fst_iface_cfg and struct
fst_wpa_obj defined. While it does currently get pulled in through
ap/hostapd.h and ap/ap_config.h, a more explicit inclusion may be a
cleaner option for future.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoMove ap_list_timer() to use common AP periodic cleanup mechanism
Jouni Malinen [Mon, 20 Jul 2015 10:42:35 +0000 (13:42 +0300)]
Move ap_list_timer() to use common AP periodic cleanup mechanism

This reduces number of periodic eloop timeouts when AP mode operations
are in progress.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoMove hostapd_acl_expire() to use common AP periodic cleanup mechanism
Jouni Malinen [Mon, 20 Jul 2015 10:39:22 +0000 (13:39 +0300)]
Move hostapd_acl_expire() to use common AP periodic cleanup mechanism

This reduces number of periodic eloop timeouts when AP mode operations
are in progress.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoAdd shared periodic cleanup function for AP mode
Jouni Malinen [Mon, 20 Jul 2015 10:33:30 +0000 (13:33 +0300)]
Add shared periodic cleanup function for AP mode

This new mechanism can be used to combine multiple periodic AP
(including P2P GO) task into a single eloop timeout to minimize number
of wakeups for the process. hostapd gets its own periodic caller and
wpa_supplicant uses the previously added timer to trigger these calls.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoUse a single cleanup timer per wpa_supplicant process
Jouni Malinen [Mon, 20 Jul 2015 10:11:31 +0000 (13:11 +0300)]
Use a single cleanup timer per wpa_supplicant process

Previously, one timeout per process (by default every 30 seconds) was
used P2P peer expiration and another per-interface timeout (every 10
seconds) was used to expire BSS entries. Merge these to a single
per-process timeout that triggers every 10 seconds to minimize number of
process wakeups due to periodic operations.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: Use codecov build hostapd/wpa_supplicant in FST tests
Jouni Malinen [Sun, 19 Jul 2015 20:10:55 +0000 (23:10 +0300)]
tests: Use codecov build hostapd/wpa_supplicant in FST tests

Try to use the special build for --codecov purposes, if present, instead
of hardcoding the hostapd/wpa_supplicant binary to the default location.
This is needed to collect code coverage correctly.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: wpa_supplicant ctrl_iface network OOM in string parsing
Jouni Malinen [Sun, 19 Jul 2015 19:36:35 +0000 (22:36 +0300)]
tests: wpa_supplicant ctrl_iface network OOM in string parsing

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Additional module tests for src/utils
Jouni Malinen [Sun, 19 Jul 2015 17:25:41 +0000 (20:25 +0300)]
tests: Additional module tests for src/utils

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: wpa_supplicant control interface wait for client
Jouni Malinen [Sun, 19 Jul 2015 19:04:07 +0000 (22:04 +0300)]
tests: wpa_supplicant control interface wait for client

This test case is also adding code coverage for process daemonizing and
Linux tracing.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: UUID parsing error cases
Jouni Malinen [Sun, 19 Jul 2015 17:52:11 +0000 (20:52 +0300)]
tests: UUID parsing error cases

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: NFC connection handover to form a new P2P group and IP pool OOM
Jouni Malinen [Sun, 19 Jul 2015 14:28:44 +0000 (17:28 +0300)]
tests: NFC connection handover to form a new P2P group and IP pool OOM

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: WPS ER OOM in XML processing
Jouni Malinen [Sun, 19 Jul 2015 13:44:51 +0000 (16:44 +0300)]
tests: WPS ER OOM in XML processing

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Initial AP configuration and OOM during PSK generation
Jouni Malinen [Sun, 19 Jul 2015 13:31:12 +0000 (16:31 +0300)]
tests: Initial AP configuration and OOM during PSK generation

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoEAP server: Force FAILURE if EAP method buildReq fails
Jouni Malinen [Sun, 19 Jul 2015 13:29:29 +0000 (16:29 +0300)]
EAP server: Force FAILURE if EAP method buildReq fails

Previously, this resulted in unnecessary wait and retransmission of the
previous EAP-Request. Change that to trigger immediate transmission of
EAP-Failure and disconnection since the EAP method cannot really recover
from this state.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agohostap: Remove special handling for protocol version 3 on RX
Jouni Malinen [Sat, 18 Jul 2015 20:24:16 +0000 (23:24 +0300)]
hostap: Remove special handling for protocol version 3 on RX

This functionality was removed from the Host AP driver in May 2003, so
there is not any point in maintaining this in hostapd either.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agohlr_auc_gw: Hide a bogus static analyzer warning
Jouni Malinen [Sat, 18 Jul 2015 19:53:07 +0000 (22:53 +0300)]
hlr_auc_gw: Hide a bogus static analyzer warning

For some reason, snprintf() was not seen as sufficient to remove
potentially tainted string from fgets() before passing this to rename().
This does not make much sense, but anyway, try to get rid of the warning
by using a separate buffer for the internally written file names.
(CID 72690)

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: FST-MANAGER TEST_REQUEST error cases
Jouni Malinen [Sat, 18 Jul 2015 16:29:39 +0000 (19:29 +0300)]
tests: FST-MANAGER TEST_REQUEST error cases

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoFST: Fix FST-MANAGER TEST_REQUEST parsing
Jouni Malinen [Sat, 18 Jul 2015 16:28:38 +0000 (19:28 +0300)]
FST: Fix FST-MANAGER TEST_REQUEST parsing

The space separator between the command and the parameter was not
skipped properly and the first integer ended up being interpreted as 0
in all cases.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: FST protocol testing for Ack Response
Jouni Malinen [Sat, 18 Jul 2015 15:53:06 +0000 (18:53 +0300)]
tests: FST protocol testing for Ack Response

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoFST: Remove unreachable code in fst_session_handle_tear_down()
Jouni Malinen [Sat, 18 Jul 2015 15:09:57 +0000 (18:09 +0300)]
FST: Remove unreachable code in fst_session_handle_tear_down()

fst_session_is_in_progress() is already checked as part of
fst_find_session_in_progress() before calling
fst_session_handle_action(). This is the only call path that can reach
fst_session_handle_tear_down() and as such, fst_session_is_in_progress()
cannot return 0 here.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: FST protocol testing for Setup Response
Jouni Malinen [Sat, 18 Jul 2015 15:08:51 +0000 (18:08 +0300)]
tests: FST protocol testing for Setup Response

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Speed up fst_proto by waiting for MGMT-TX-STATUS event
Jouni Malinen [Sat, 18 Jul 2015 16:04:55 +0000 (19:04 +0300)]
tests: Speed up fst_proto by waiting for MGMT-TX-STATUS event

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoFST: Remove duplicated dl_list_empty() check befor dl_list_first()
Jouni Malinen [Sat, 18 Jul 2015 13:29:44 +0000 (16:29 +0300)]
FST: Remove duplicated dl_list_empty() check befor dl_list_first()

dl_list_first() takes care of this already, so there is no need to do a
separate check here.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoFST: Use EINVAL more consistently as a negative return value
Jouni Malinen [Sat, 18 Jul 2015 13:26:19 +0000 (16:26 +0300)]
FST: Use EINVAL more consistently as a negative return value

There was a mix of EINVAL and -EINVAL returns through the FST
implementation. Make this more consistent by always returning -EINVAL in
error cases.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoFST: Mark get_mb_ie() return value const
Jouni Malinen [Sat, 18 Jul 2015 13:16:26 +0000 (16:16 +0300)]
FST: Mark get_mb_ie() return value const

The caller is not expected to free or modify the value since this is
returning a reference to a buffer maintained by the upper layer.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoFST: Replace print_mb_ies() with wpa_snprintf_hex()
Jouni Malinen [Sat, 18 Jul 2015 13:09:42 +0000 (16:09 +0300)]
FST: Replace print_mb_ies() with wpa_snprintf_hex()

There is no need to add new functions with more or less identical
functionality of an already available helper function.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: FST-MANAGER TEST_REQUEST GET_FSTS_ID and ID not found
Jouni Malinen [Sat, 18 Jul 2015 13:01:35 +0000 (16:01 +0300)]
tests: FST-MANAGER TEST_REQUEST GET_FSTS_ID and ID not found

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: FST-MANAGER SESSION_RESPOND failure
Jouni Malinen [Sat, 18 Jul 2015 12:56:20 +0000 (15:56 +0300)]
tests: FST-MANAGER SESSION_RESPOND failure

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: FST-MANAGER SESSION_ADD OOM
Jouni Malinen [Sat, 18 Jul 2015 12:36:49 +0000 (15:36 +0300)]
tests: FST-MANAGER SESSION_ADD OOM

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: FST-MANAGER SESSION_SET parameter parsing error cases
Jouni Malinen [Sat, 18 Jul 2015 09:51:06 +0000 (12:51 +0300)]
tests: FST-MANAGER SESSION_SET parameter parsing error cases

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoFST: Mark format_session_state_extra() static
Jouni Malinen [Sat, 18 Jul 2015 09:40:23 +0000 (12:40 +0300)]
FST: Mark format_session_state_extra() static

This is not used outside fst_ctrl_iface.c.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: FST-ATTACH OOM in fst_iface_create()
Jouni Malinen [Sat, 18 Jul 2015 08:13:20 +0000 (11:13 +0300)]
tests: FST-ATTACH OOM in fst_iface_create()

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Use direct fst_test_common access
Jouni Malinen [Sat, 18 Jul 2015 08:02:46 +0000 (11:02 +0300)]
tests: Use direct fst_test_common access

There is no need to go through fst_module_aux to reach fst_test_common
since both of these get imported here.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: FST attach with llt=0
Jouni Malinen [Sat, 18 Jul 2015 08:01:44 +0000 (11:01 +0300)]
tests: FST attach with llt=0

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Verify wpa parameter in hostapd GET_CONFIG
Jouni Malinen [Fri, 17 Jul 2015 21:20:23 +0000 (00:20 +0300)]
tests: Verify wpa parameter in hostapd GET_CONFIG

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agohostapd: Add current wpa parameter into GET_CONFIG output
Mohammed Shafi Shajakhan [Thu, 25 Jun 2015 12:42:49 +0000 (18:12 +0530)]
hostapd: Add current wpa parameter into GET_CONFIG output

This can be used, e.g., by an action script to update new WPS
settings for the AP.

Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qti.qualcomm.com>
8 years agohostapd_cli: Allow PID file to be specified
Mohammed Shafi Shajakhan [Thu, 25 Jun 2015 12:42:48 +0000 (18:12 +0530)]
hostapd_cli: Allow PID file to be specified

This can help when running multiple hostapd_cli instances
per interface and need to kill them correspondingly.

Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qti.qualcomm.com>
8 years agotests: Add coverage for new vht_capab values
Jouni Malinen [Fri, 17 Jul 2015 21:00:20 +0000 (00:00 +0300)]
tests: Add coverage for new vht_capab values

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agohostapd: Extend the sounding and BF steering capabilities
Vivek Natarajan [Wed, 15 Jul 2015 11:58:22 +0000 (17:28 +0530)]
hostapd: Extend the sounding and BF steering capabilities

Depending on the number of antennas, the txbf sounding
and steering capabilites need to be extended.

Signed-off-by: Vivek Natarajan <nataraja@qti.qualcomm.com>
8 years agotests: Add hostapd interface with driver specified
Jouni Malinen [Fri, 17 Jul 2015 20:57:04 +0000 (23:57 +0300)]
tests: Add hostapd interface with driver specified

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoAllow driver to be set in hostapd through global control interface
PavanKumar N [Mon, 13 Jul 2015 05:21:07 +0000 (10:51 +0530)]
Allow driver to be set in hostapd through global control interface

This extends the hostapd global control interface ADD command to allow
driver wrapper to be specified ("ADD <ifname> <ctrl_iface> <driver>").
Previously, this case that did not use a configuration file allowed only
the default driver wrapper to be used.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoDrop CONFIG_TI_COMPILER ifdefs
Jouni Malinen [Fri, 17 Jul 2015 18:57:07 +0000 (21:57 +0300)]
Drop CONFIG_TI_COMPILER ifdefs

This experimental support for Texas Instruments C compiler was never
fully completed and it has not really been used in close to ten years,
so drop this to simply the header files.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoWPS: Avoid bogus static analyzer warning in ndef_parse_record()
Jouni Malinen [Fri, 17 Jul 2015 17:43:17 +0000 (20:43 +0300)]
WPS: Avoid bogus static analyzer warning in ndef_parse_record()

Use a local variable and check the record payload length validity before
writing it into record->payload_length in hopes of getting rid of a
bogus static analyzer warning. The negative return value was sufficient
to avoid record->payload_length being used, but that seems to be too
complex for some analyzers. (CID 122668)

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoFST: Avoid using pointer to mgmt->u.action.u.fst_action
Jouni Malinen [Fri, 17 Jul 2015 17:37:15 +0000 (20:37 +0300)]
FST: Avoid using pointer to mgmt->u.action.u.fst_action

Typecasting &mgmt->u.action.u.fst_action to a struct pointer for various
FST Action frame payloads seemed to be triggering static analyzer
warnings about bounds checking since sizeof(mgmt->u.action.u.fst_action)
== 1 even though that is really a variable length structure. Try to
avoid this by calculating the pointer for the beginning of the frame
instead of variable length struct. (CID 125642)

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoP2P: Clear p2p->ssid_set on flush
Jouni Malinen [Fri, 17 Jul 2015 17:32:13 +0000 (20:32 +0300)]
P2P: Clear p2p->ssid_set on flush

It was possible for the previously set SSID to remain in place between
test cases (e.g., in sequence "p2ps_connect_adv_go_persistent
p2p_set_ssid_postfix") and the P2P SSID postfix not getting used
properly. Make this less likely to occur by clearing the old SSID in
p2p_flush().

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: FST session create OOM
Jouni Malinen [Fri, 17 Jul 2015 16:11:00 +0000 (19:11 +0300)]
tests: FST session create OOM

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: FST send action OOM
Jouni Malinen [Fri, 17 Jul 2015 15:56:55 +0000 (18:56 +0300)]
tests: FST send action OOM

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: FST AP configuration and OOM
Jouni Malinen [Fri, 17 Jul 2015 14:21:55 +0000 (17:21 +0300)]
tests: FST AP configuration and OOM

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: FST protocol testing
Jouni Malinen [Fri, 17 Jul 2015 10:02:50 +0000 (13:02 +0300)]
tests: FST protocol testing

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoFST: Remove the IE header len/size macros
Jouni Malinen [Fri, 17 Jul 2015 15:36:03 +0000 (18:36 +0300)]
FST: Remove the IE header len/size macros

These are confusing when the style used with the couple of FST IE checks
differs from the rest of hostapd/wpa_supplicant implementation.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoFST: Clean up fst_group_update_ie()
Jouni Malinen [Fri, 17 Jul 2015 13:59:09 +0000 (16:59 +0300)]
FST: Clean up fst_group_update_ie()

None of the callers passed in cleaning_up == TRUE, so drop that unused
code path.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoFST: Move fst_mbie_get_peer_addr() into fst_group.c
Jouni Malinen [Fri, 17 Jul 2015 13:55:08 +0000 (16:55 +0300)]
FST: Move fst_mbie_get_peer_addr() into fst_group.c

There is no need for this function to be an inline function in a header
file since it is used only within fst_group.c.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoFST: Show FST IE update details in debug log
Jouni Malinen [Fri, 17 Jul 2015 13:25:09 +0000 (16:25 +0300)]
FST: Show FST IE update details in debug log

This makes it more convenient to debug FST IE updates.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoFST: Clear hostapd fst_ies on FST-DETACH to avoid use of freed memory
Jouni Malinen [Fri, 17 Jul 2015 13:24:11 +0000 (16:24 +0300)]
FST: Clear hostapd fst_ies on FST-DETACH to avoid use of freed memory

This is needed in the corner case of FST-DETACH being used without
stopping the AP instance.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoFST: Fix FST Action frame length validation
Jouni Malinen [Fri, 17 Jul 2015 10:00:17 +0000 (13:00 +0300)]
FST: Fix FST Action frame length validation

Commit 717333f4e4d027c69e7c1241dc124ef7d59a6c85 ('FST: Add the Fast
Session Transfer (FST) module') performed incorrect frame length
validation for Setup Request (did not remove 24+1 header from
consideration) and did not include payload validation for other FST
Action frames. Fix these by explicitly verifying that the payload of
these frames is sufficiently long before reading the values from there.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoFT: Register RRB l2_packet only if FT-over-DS is enabled
Jouni Malinen [Thu, 16 Jul 2015 22:15:28 +0000 (01:15 +0300)]
FT: Register RRB l2_packet only if FT-over-DS is enabled

There is no need to waste resources for this packet socket if FT-over-DS
is disabled or when operating P2P GO or AP mode in wpa_supplicant.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoDocument hostapd ft_over_ds configuration parameter
Jouni Malinen [Thu, 16 Jul 2015 22:13:07 +0000 (01:13 +0300)]
Document hostapd ft_over_ds configuration parameter

This had been forgotten from hostapd.conf.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: WPA2-PSK-FT RRB protocol testing
Jouni Malinen [Thu, 16 Jul 2015 22:08:25 +0000 (01:08 +0300)]
tests: WPA2-PSK-FT RRB protocol testing

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: hostapd global-to-local control interface redirection
Anton Nayshtut [Mon, 22 Jun 2015 08:27:13 +0000 (11:27 +0300)]
tests: hostapd global-to-local control interface redirection

This implements basic global-to-local control interface command
redirection tests.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agohostapd: Add global to local control interface redirection
Anton Nayshtut [Thu, 16 Jul 2015 10:29:29 +0000 (13:29 +0300)]
hostapd: Add global to local control interface redirection

This patch implements global to local control interface redirection in
the same way as it's done for wpa_supplicant. Any global control
interface command beginning with "IFNAME=..." will be routed to the
corresponding local control interface handler.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agohostapd: Add hostapd_ctrl_iface_receive_process()
Anton Nayshtut [Thu, 16 Jul 2015 10:19:49 +0000 (13:19 +0300)]
hostapd: Add hostapd_ctrl_iface_receive_process()

The newly introduced function will be used in followup commits to handle
requests redirected from the global control interface.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: wpa_supplicant ctrl_iface DUP_NETWORK (global)
Jouni Malinen [Thu, 16 Jul 2015 15:05:09 +0000 (18:05 +0300)]
tests: wpa_supplicant ctrl_iface DUP_NETWORK (global)

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoAdd global wpa_supplicant DUP_NETWORK command
Anton Nayshtut [Wed, 17 Jun 2015 13:15:39 +0000 (16:15 +0300)]
Add global wpa_supplicant DUP_NETWORK command

This command allows network variables to be copied from one network to
another when the networks belong to different radios. This is similar to
the per-interface DUP_NETWORK command. On the global control interface,
the command syntax is as follows:

DUP_NETWORK <src ifname> <dst ifname> <src network id> <dst network id> <variable name>

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: Silence unnecessary get_driver_status() prints
Jouni Malinen [Thu, 16 Jul 2015 09:46:01 +0000 (12:46 +0300)]
tests: Silence unnecessary get_driver_status() prints

Commit 53606b105c6df3c2f3a154b055ac142d5c380251 ('tests: Wait for scan
to complete on all interfaces in reset()') added option of passing
ifname to get_driver_status(). This could result in FAIL-NO-IFNAME-MATCH
returns that get printed out in "Ignore unexpected status-driver line"
messages if the interface is not found. Check for this case to avoid
that unnecessary print.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: FST with RSN
Jouni Malinen [Tue, 9 Jun 2015 18:31:09 +0000 (21:31 +0300)]
tests: FST with RSN

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: FST AP setup failing due to OOM
Jouni Malinen [Tue, 9 Jun 2015 11:57:05 +0000 (14:57 +0300)]
tests: FST AP setup failing due to OOM

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: FST control interface behavior
Jouni Malinen [Tue, 9 Jun 2015 09:19:47 +0000 (12:19 +0300)]
tests: FST control interface behavior

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: Add FST module tests
Anton Nayshtut [Tue, 5 Aug 2014 15:25:59 +0000 (18:25 +0300)]
tests: Add FST module tests

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoFST: Testing support
Anton Nayshtut [Thu, 4 Dec 2014 17:20:56 +0000 (19:20 +0200)]
FST: Testing support

This patch introduces infrastructure needed for FST module tests.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agonl80211: Register for FST Action frames (STA)
Anton Nayshtut [Sun, 16 Nov 2014 15:28:53 +0000 (17:28 +0200)]
nl80211: Register for FST Action frames (STA)

wpa_supplicant will process these Action frames for FST operations.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoFST: wpa_supplicant build rules
Anton Nayshtut [Sun, 16 Nov 2014 15:28:53 +0000 (17:28 +0200)]
FST: wpa_supplicant build rules

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoFST: wpa_supplicant control interface
Anton Nayshtut [Sun, 16 Nov 2014 15:28:53 +0000 (17:28 +0200)]
FST: wpa_supplicant control interface

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoFST: Send FST Action frame for processing (wpa_supplicant)
Anton Nayshtut [Sun, 16 Nov 2014 15:28:53 +0000 (17:28 +0200)]
FST: Send FST Action frame for processing (wpa_supplicant)

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoFST: Integration into wpa_supplicant
Anton Nayshtut [Sun, 16 Nov 2014 15:28:53 +0000 (17:28 +0200)]
FST: Integration into wpa_supplicant

This commit integrates the FST into the wpa_supplicant.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoFST: wpa_supplicant [FST] flag for BSS in scan results
Anton Nayshtut [Sun, 16 Nov 2014 15:28:53 +0000 (17:28 +0200)]
FST: wpa_supplicant [FST] flag for BSS in scan results

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoFST: wpa_supplicant configuration parameters
Anton Nayshtut [Sun, 16 Nov 2014 15:28:53 +0000 (17:28 +0200)]
FST: wpa_supplicant configuration parameters

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoFST: Do not prune STAs belonging to the same FST
Anton Nayshtut [Wed, 21 Jan 2015 13:30:48 +0000 (15:30 +0200)]
FST: Do not prune STAs belonging to the same FST

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoFST: Add hostapd_cli fst command
Anton Nayshtut [Wed, 21 Jan 2015 13:30:48 +0000 (15:30 +0200)]
FST: Add hostapd_cli fst command

This can be used to issue FST-MANAGER control interface commands.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoFST: Add build rules for hostapd
Anton Nayshtut [Wed, 21 Jan 2015 13:30:48 +0000 (15:30 +0200)]
FST: Add build rules for hostapd

This patch integrates the FST into the hostapd.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoFST: Add FST IEs into AP mode management frames
Anton Nayshtut [Wed, 21 Jan 2015 13:30:48 +0000 (15:30 +0200)]
FST: Add FST IEs into AP mode management frames

This adds the FST IEs received from the FST module into Beacon, Probe
Response, and (Re)Association Response frames.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoFST: Send FST Action frames to AP mode processing
Anton Nayshtut [Wed, 21 Jan 2015 13:30:48 +0000 (15:30 +0200)]
FST: Send FST Action frames to AP mode processing

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoFST: hostapd control interface
Anton Nayshtut [Wed, 21 Jan 2015 13:30:48 +0000 (15:30 +0200)]
FST: hostapd control interface

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoFST: Integration into hostapd
Anton Nayshtut [Wed, 21 Jan 2015 13:30:48 +0000 (15:30 +0200)]
FST: Integration into hostapd

This commit integrates the FST into the hostapd.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoFST: Store MB IEs from (Re)Association Request
Anton Nayshtut [Wed, 21 Jan 2015 13:30:48 +0000 (15:30 +0200)]
FST: Store MB IEs from (Re)Association Request

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoFST: hostapd configuration parameters
Anton Nayshtut [Wed, 21 Jan 2015 13:30:48 +0000 (15:30 +0200)]
FST: hostapd configuration parameters

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoParsing of multi band element
Anton Nayshtut [Wed, 21 Jan 2015 13:30:48 +0000 (15:30 +0200)]
Parsing of multi band element

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoFST: Add the Fast Session Transfer (FST) module
Anton Nayshtut [Wed, 18 Feb 2015 14:59:21 +0000 (16:59 +0200)]
FST: Add the Fast Session Transfer (FST) module

Fast Session Transfer (FST) is the transfer of a session from a channel
to another channel in a different frequency band. The term "session"
refers to non-physical layer state information kept by a pair of
stations (STAs) that communicate directly (i.e., excludes forwarding).

The FST is implemented in accordance with IEEE Std 802.11ad-2012.

Definitions

 * FST interface - an interface for which FST functionality is enabled
 * FST group - a bunch of FST interfaces representing single
multi-band STA
 * FST peer - a multi-band capable STA connected
 * FST module - multi-band operation functionality implemented in
accordance with IEEE Std 802.11ad-2012 (see 10.32
Multi-band operation) as a part of hostapd/wpa_supplicant
 * FST manager - an external application that implements custom FST
related logic, using the FST module's interfaces
accessible via CLI or D-Bus

This commit introduces only the FST module. Integration of the FST
module into the hostapd/wpa_supplicant and corresponding CLI/D-Bus
interfaces and FST related tests are covered in separate commits.

FST manager application is out of scope of these commits.

As FST aggregates a few interfaces into FST group, the FST module uses
global CLI for both commands and notifications. It also exposes
alternative non-interface based D-Bus subtree for this purposes.

Configuration and Initialization

 * FST functionality can enabled by compilation flag (CONFIG_FST)
 * hostapd/wpa_supplicant controlling multiple interfaces are used for
   FST
 * once enabled by compilation, the FST can be enabled for specific
   interfaces in the configuration files
 * FST interfaces are aggregated in FST groups (fst_group_id config file
   entry), where each FST group:
   - represents one multi-band device
   - should have two or more FST interfaces in it
 * priority (fst_priority config file entry) must be configured for each
   FST interface. FST interface with higher priority is the interface FST
   will always try to switch to. Thus, for example, for the maximal
   throughput, it should be the fastest FST interface in the FST setup.
 * default Link Loss Timeout (LLT) value can be configured for each FST
   interface (fst_llt config file entry). It represents LLT to be used
   by FST when this interface is active.
 * FST interfaces advertise the Multi-band capability by including the
   Multi-band element in the corresponding frames

FST CLI commands:

 * fst list_groups - list FST groups configured.
 * fst list_ifaces - list FST interfaces which belong to specific group
 * fst iface_peers - list Multi-Band STAs connected to specific interface
 * fst list_sessions - list existing FST sessions
 * fst session_get - get FST session info
 * fst session_add - create FST session object
 * fst session_set - set FST session parameters (old_iface, new_iface,
                     peer_addr, llt)
 * fst session_initiate - initiate FST setup
 * fst session_respond - respond to FST setup establishemnt attempt by
                         counterpart
 * fst session_transfer - initiate FST switch
 * fst session_teardown - tear down FST Setup but leave the session object
  for reuse
 * fst session_remove - remove FST session object

FST CLI notifications:
  * FST-EVENT-PEER - peer state changed (CONNECT/DISCONNECT)
  * FST-EVENT-SESSION - FST session level notification with following
                        sub-events:
     - EVENT_FST_SESSION_STATE - FST session state changed
     - EVENT_FST_ESTABLISHED - previously initiated FST session became
                               established
     - EVENT_FST_SETUP - new FST session object created due to FST session
                         negotiation attempt by counterpart

All the FST CLI commands and notifications are also implemented on D-Bus
for wpa_supplicant.

IEEE 802.11 standard compliance

FST module implements FST setup statemachine in compliance with IEEE
802.11ad (P802.11-REVmc/D3.3), as it described in 10.32 Multi-band
operation (see also Figure 10-34 - States of the FST setup protocol).

Thus, for example, the FST module initiates FST switch automatically
when FST setup becomes established with LLT=0 in accordance with
10.32.2.2 Transitioning between states.

At the moment, FST module only supports non-transparent STA-based FST
(see 10.32.1 General).

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoAdd IEEE 802.11ad element descriptions
Anton Nayshtut [Wed, 18 Feb 2015 14:59:21 +0000 (16:59 +0200)]
Add IEEE 802.11ad element descriptions

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoAdd is_multicast_ether_addr()
Anton Nayshtut [Tue, 27 Jan 2015 14:30:08 +0000 (16:30 +0200)]
Add is_multicast_ether_addr()

This helper function can be used to check whether a MAC address is a
multicast (including broadcast) address.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agohostapd: Global control interface notifications
Anton Nayshtut [Sun, 16 Nov 2014 14:52:49 +0000 (16:52 +0200)]
hostapd: Global control interface notifications

This commit implements hostapd global control interface notifications
infrastructure. hostapd global control interface clients issue
ATTACH/DETACH commands to register and deregister with hostapd
correspondingly - the same way as for any other hostapd/wpa_supplicant
control interface.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agonl80211: Generic Linux master interface support for hostapd
Anton Nayshtut [Wed, 4 Mar 2015 10:12:36 +0000 (12:12 +0200)]
nl80211: Generic Linux master interface support for hostapd

Previously, hostapd only supported the case of EAPOL frames receiving
from interfaces enslaved into bridge. This commit adds support for any
Linux master (teaming, openvswitch, bonding, etc.) to be detected.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>