mech_eap.git
10 years agoGAS: Replenish AP station session timer to 5 seconds
Kyeyoon Park [Wed, 6 Nov 2013 21:20:28 +0000 (13:20 -0800)]
GAS: Replenish AP station session timer to 5 seconds

If remaining AP session timeout is less than 5 seconds
for an existing station, replenish the timeout to 5 seconds.
This allows stations to be able to recycle a dialog token
value beyond 5 seconds for GAS exchange.

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

10 years agoeloop: Add support for replenishing a registered timeout
Kyeyoon Park [Wed, 6 Nov 2013 08:11:35 +0000 (00:11 -0800)]
eloop: Add support for replenishing a registered timeout

eloop_replenish_timeout() finds a registered matching
<handler,eloop_data,user_data> timeout. If found, replenishes
the timeout if remaining time is less than the requested time.

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

10 years agoAndroid: Remove obsolete WPA_UNICODE_SSID define
Dmitry Shmidt [Thu, 7 Nov 2013 21:57:59 +0000 (23:57 +0200)]
Android: Remove obsolete WPA_UNICODE_SSID define

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
10 years agohostapd: Allow hostapd_cli to work on Android
Jeff Johnson [Tue, 4 Sep 2012 05:12:17 +0000 (22:12 -0700)]
hostapd: Allow hostapd_cli to work on Android

Add definitions of the Android specific directories used for control
interface sockets so that hostapd_cli can connect to the Android
hostapd.

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

10 years agonl80211: Work around nl_socket_set_nonblocking on Android
Jouni Malinen [Thu, 7 Nov 2013 14:02:23 +0000 (16:02 +0200)]
nl80211: Work around nl_socket_set_nonblocking on Android

system/core/libnl_2 does not include nl_socket_set_nonblocking(), so
need to implement that to fix the build.

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

10 years agohostapd: Add option to send OBSS scan params
Paul Stewart [Wed, 4 Sep 2013 15:59:52 +0000 (08:59 -0700)]
hostapd: Add option to send OBSS scan params

Add a parameter to send the overlapping BSS scan parameter
information element. This will require clients to perform
background scans to check for neigbors overlapping this
HT40 BSS. Since the implementation is incomplete it should
only be used for testing.

Signed-hostap: Paul Stewart <pstew@chromium.org>

10 years agoAndroid: Fix compilation without BOARD_WPA_SUPPLICANT_DRIVER
Dmitry Shmidt [Mon, 11 Jun 2012 19:51:06 +0000 (12:51 -0700)]
Android: Fix compilation without BOARD_WPA_SUPPLICANT_DRIVER

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
10 years agoProhibit PNO start during assoc process and in connect state
Dmitry Shmidt [Wed, 6 Nov 2013 02:08:27 +0000 (18:08 -0800)]
Prohibit PNO start during assoc process and in connect state

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
10 years agoAndroid: Add ANDROID_P2P define under BOARD_WLAN_DEVICE
Dmitry Shmidt [Wed, 6 Nov 2013 01:07:56 +0000 (17:07 -0800)]
Android: Add ANDROID_P2P define under BOARD_WLAN_DEVICE

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
10 years agoAndroid: Fix CFLAGS -> L_CFLAGS
Dmitry Shmidt [Wed, 6 Nov 2013 00:45:35 +0000 (16:45 -0800)]
Android: Fix CFLAGS -> L_CFLAGS

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
10 years agohwsim tests: Make channel configuration for VM tests easier
Johannes Berg [Wed, 6 Nov 2013 13:11:17 +0000 (14:11 +0100)]
hwsim tests: Make channel configuration for VM tests easier

Add a CHANNELS configuration to the script running the VM
that can be added to the vm-config file to allow running
the tests with hwsim devices supporting more than a single
channel.

Eventually, with the (hopefully) upcoming dynamic work in
mac80211_hwsim, this might go away entirely, but for now
this allows testing more code paths.

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

10 years agoP2P: Allow GO P2P Device Address to be used for scan result matching
Jouni Malinen [Sat, 7 Sep 2013 22:42:53 +0000 (15:42 -0700)]
P2P: Allow GO P2P Device Address to be used for scan result matching

This is a better way of matching P2P groups based on the unique P2P
Device Address (e.g., from P2P Group ID) and SSID pair instead of using
the not necessarily unique P2P Interface Address.

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

10 years agoP2P: Add debug print of P2P Group ID SSID
Jouni Malinen [Sun, 8 Sep 2013 00:36:43 +0000 (17:36 -0700)]
P2P: Add debug print of P2P Group ID SSID

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

10 years agoWPS NFC: Add more debug for NFC Password Token matching
Jouni Malinen [Sun, 8 Sep 2013 15:09:38 +0000 (08:09 -0700)]
WPS NFC: Add more debug for NFC Password Token matching

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

10 years agoWPS NFC: Add debug log entry on OOB Dev Pw attribute addition
Jouni Malinen [Sat, 7 Sep 2013 23:59:24 +0000 (16:59 -0700)]
WPS NFC: Add debug log entry on OOB Dev Pw attribute addition

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

10 years agoInterworking: Use SSID from the BSS entry
Jouni Malinen [Wed, 6 Nov 2013 22:17:48 +0000 (00:17 +0200)]
Interworking: Use SSID from the BSS entry

There is no need to parse the IE buffer again to find the SSID of the
BSS since that information is already stored in struct wpa_bss.

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

10 years agotests: Verify disallow_aps with Interworking
Jouni Malinen [Wed, 6 Nov 2013 22:09:57 +0000 (00:09 +0200)]
tests: Verify disallow_aps with Interworking

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

10 years agoInterworking: Reject BSS based on disallow_aps
Jouni Malinen [Wed, 6 Nov 2013 22:01:48 +0000 (00:01 +0200)]
Interworking: Reject BSS based on disallow_aps

If a BSS is disallowed temporarily with disallow_aps, the network
connection is going to fail. As such, there is not much point in
allowing Interworking network selection to try to connect with such BSS.
As such, do not consider disallowed networks for automatic network
selection and reject requests to connect to them through
INTERWORKING_CONNECT.

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

10 years agotests: Verify no-duplicate-networks with Interworking connection
Jouni Malinen [Wed, 6 Nov 2013 21:35:19 +0000 (23:35 +0200)]
tests: Verify no-duplicate-networks with Interworking connection

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

10 years agoInterworking: Avoid duplicated network blocks
Jouni Malinen [Wed, 6 Nov 2013 21:32:43 +0000 (23:32 +0200)]
Interworking: Avoid duplicated network blocks

Do not add multiple network blocks for the same network from a single
credential. INTERWORKING_CONNECT used to generate a new network block
for each instance regardless of what network blocks have already been
configured. While this allows the connection to go through, it is not
efficient to leave behind potentially large number of network blocks
with the same contents (or worse, changed contents). Address this by
removing an older network block for the same credential before adding a
new one.

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

10 years agoInterworking: Do not reconnect if already connected
Jouni Malinen [Wed, 6 Nov 2013 21:20:27 +0000 (23:20 +0200)]
Interworking: Do not reconnect if already connected

If we are already connected to the selected AP with a network block
that was created based on the selected credential, do not force a
reconnection or network block update.

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

10 years agotests: Verify BSS additional/removal during HT co-ex scan
Jouni Malinen [Wed, 6 Nov 2013 13:52:40 +0000 (15:52 +0200)]
tests: Verify BSS additional/removal during HT co-ex scan

This verifies that hostapd can add and remove a secondary BSS
during an ongoing HT co-ex scan.

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

10 years agohostapd: Do not start secondary BSS unless interface is enabled
Jouni Malinen [Wed, 6 Nov 2013 11:51:26 +0000 (13:51 +0200)]
hostapd: Do not start secondary BSS unless interface is enabled

It is possible for additional BSSs to be added while the primary
interface is still in the process of determining channel parameters (HT
co-ex scan, ACS, DFS). Do not enable secondary interfaces in such state
immediately, but instead, wait for the pending operation on the primary
interface to complete. Once that's done, the added extra BSSs will also
be enabled in hostapd_setup_interface_complete().

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

10 years agohostapd: Verify hostapd_setup_bss calls
Jouni Malinen [Wed, 6 Nov 2013 11:39:41 +0000 (13:39 +0200)]
hostapd: Verify hostapd_setup_bss calls

Reject multiple calls to hostapd_setup_bss() for any specific interface.
hostapd_cleanup() must have been called first before trying to restart a
BSS.

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

10 years agohostapd: Share a single function for BSS deinit
Jouni Malinen [Wed, 6 Nov 2013 10:48:24 +0000 (12:48 +0200)]
hostapd: Share a single function for BSS deinit

hostapd_bss_deinit() takes care of freeing the associated stations and
calling hostapd_cleanup() to deinit per-BSS services.

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

10 years agoRemove unused hostapd_cleanup_iface_pre()
Jouni Malinen [Wed, 6 Nov 2013 10:44:54 +0000 (12:44 +0200)]
Remove unused hostapd_cleanup_iface_pre()

This has not been used in years and can be removed to clean up the
hostapd deinit path a bit.

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

10 years agohostapd: Add more debug prints to deinit path
Jouni Malinen [Wed, 6 Nov 2013 10:42:20 +0000 (12:42 +0200)]
hostapd: Add more debug prints to deinit path

This makes it easier to follow the various interface/BSS deinit
operations.

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

10 years agoRestore hapd->interface_added tracking to core hostapd
Jouni Malinen [Tue, 5 Nov 2013 23:38:17 +0000 (01:38 +0200)]
Restore hapd->interface_added tracking to core hostapd

This reverts parts of commit 390e489c0d9415caf103367136eaa534b559837c
that tried to enable removal of the first BSS. Since that operation is
now forced to remove all BSSs, these changes are not needed. The
hostapd_if_remove() operation in hostapd_free_hapd_data() is problematic
for the first BSS since it ends up freeing driver wrapper information
that is needed later when deinitializing the driver wrapper.

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

10 years agohostapd: Deinit ctrl_iface in case of add interface failure
Jouni Malinen [Tue, 5 Nov 2013 23:31:23 +0000 (01:31 +0200)]
hostapd: Deinit ctrl_iface in case of add interface failure

Since the control interface is now initialized as part of
hostapd_setup_interface(), it needs to be deinitialized on the error
path.

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

10 years agohostapd: Fix DETACH command debug prints to avoid use of freed memory
Jouni Malinen [Tue, 5 Nov 2013 23:15:28 +0000 (01:15 +0200)]
hostapd: Fix DETACH command debug prints to avoid use of freed memory

In case a control interface socket is detached because of sendmsg()
failing for the socket, function call to detach the socket uses a
pointer to the socket information in the structure to be freed. Reorder
code to print socket info before freeing the data to avoid use of freed
memory in case debug prints are enabled.

This is similar to the earlier wpa_supplicant fix in commit
a235aca316a8a4729735fecb00f7d7775b38d993.

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

10 years agotests: BSS removal during ongoing HT or ACS scan
Jouni Malinen [Tue, 5 Nov 2013 23:11:25 +0000 (01:11 +0200)]
tests: BSS removal during ongoing HT or ACS scan

These verify that hostapd is able to remove a BSS while the radio is
still in the progress of the initial channel parameter determination.

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

10 years agotests: Adjust BSS add/remove test cases for primary BSS constraint
Jouni Malinen [Tue, 5 Nov 2013 23:08:54 +0000 (01:08 +0200)]
tests: Adjust BSS add/remove test cases for primary BSS constraint

Since removal of the primary BSS is now going to remove all the BSSs
for a radio, these two test cases need changes to not trigger false
failures.

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

10 years agoFix removal of a BSS that has not yet been fully initialized
Jouni Malinen [Tue, 5 Nov 2013 22:57:38 +0000 (00:57 +0200)]
Fix removal of a BSS that has not yet been fully initialized

If a secondary BSS is removed while it is waiting for the primary BSS to
complete channel setup (e.g., due to HT co-ex scan, ACS, or DFS), the
hostapd_data instance has not yet been initialized. Fix the BSS removal
code to take this special case into account and not try to deinitialize
the hostapd_data instance that has not yet been started.

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

10 years agoRemove all BSSs on removal of the first one
Jouni Malinen [Tue, 5 Nov 2013 22:43:10 +0000 (00:43 +0200)]
Remove all BSSs on removal of the first one

The changes in commit 5592065850a40e235020dba79e5592b949b829b8 to allow
any BSS to be removed were a bit too early since there are still number
of areas that use the first BSS as a special case. Especially the
driver_ops API is going to require quite a bit of cleanup before removal
of the first BSS without the other BSSes of the same radio can be done
safely.

For now, force all BSSs to be removed in case the first one is removed.

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

10 years agodrivers: Do not call hostapd_logger()
Jouni Malinen [Tue, 5 Nov 2013 22:19:46 +0000 (00:19 +0200)]
drivers: Do not call hostapd_logger()

This call requires a struct hostapd_data pointer and that is not really
something that the driver wrappers should be using.

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

10 years agoRemove a compiler warning from -O0 build
Jouni Malinen [Tue, 5 Nov 2013 22:00:58 +0000 (00:00 +0200)]
Remove a compiler warning from -O0 build

It looks like abs() result is signed and gcc warns about this when
running a build with -O0 but not with -O2.

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

10 years agohostapd: Do not terminate process on dynamic interface add failure
Jouni Malinen [Tue, 5 Nov 2013 11:39:21 +0000 (13:39 +0200)]
hostapd: Do not terminate process on dynamic interface add failure

Limit the calls to eloop_terminate() to happen only for the
initialization failure from the interfaces that we specified on the
command line. This allows hostapd process to continue operating even if
a dynamically added interface fails to start up. This allows the upper
layer software to fix a configuration error and retry.

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

10 years agotests: Handle hostapd dying more gracefully
Jouni Malinen [Tue, 5 Nov 2013 11:21:58 +0000 (13:21 +0200)]
tests: Handle hostapd dying more gracefully

Catch exceptions from operations that try to remove hostapd interface
and rename the log file. If these operations fail due to socket
connection issues, hostapd has likely died or gotten stuck somewhere.
Report the test case as a failure and stop test run cleanly.

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

10 years agoP2P: Add more debug prints for frequency selection
Jouni Malinen [Tue, 5 Nov 2013 09:07:51 +0000 (11:07 +0200)]
P2P: Add more debug prints for frequency selection

This prints out get_shared_radio_freqs() results and related information
from P2P operations to make debug logs more helpful for figuring out
issues related to multi-channel concurrency.

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

10 years agoP2P: Fix bug in GO frequency selection
Ilan Peer [Sun, 3 Nov 2013 13:29:13 +0000 (15:29 +0200)]
P2P: Fix bug in GO frequency selection

When trying to choose a frequency that can be used for GO instantiation,
properly check if there are free channels that can be used.

Signed-hostap: Ilan Peer <ilan.peer@intel.com>

10 years agowpa_supplicant: Fix bug in get_shared_radio_freqs
Ilan Peer [Sun, 3 Nov 2013 13:30:27 +0000 (15:30 +0200)]
wpa_supplicant: Fix bug in get_shared_radio_freqs

The idx variable was mistakenly set to 0 at the beginning of the
interface iteration. This could result in the operating channel of the
interface calling the function from being removed from the returned
frequency array if other interfaces were operating.

Signed-hostap: Ilan Peer <ilan.peer@intel.com>

10 years agowpa_supplicant: Fix updating GO beacons on WFD subelements change
Andrei Otcheretianski [Sun, 3 Nov 2013 13:24:13 +0000 (15:24 +0200)]
wpa_supplicant: Fix updating GO beacons on WFD subelements change

When WFD Subelements are set, the IE in the Beacon frames of already
existing groups are not updated. This patch fixes this issue by setting
beacon_update to be 1 on WFD IE update.

Signed-hostap: Andrei Otcheretianski <andrei.otcheretianski@intel.com>

10 years agoEAPOL: Fix static analyzer warnings for pac_opaque_encr_key
Adriana Reus [Sun, 3 Nov 2013 13:21:30 +0000 (15:21 +0200)]
EAPOL: Fix static analyzer warnings for pac_opaque_encr_key

The allocation was not verified to complete successfully and the
allocated memory was not freed on error paths.

Signed-hostap: Adriana Reus <adriana.reus@intel.com>

10 years agobgscan: Add global bgscan configuration
Haim Dreyfuss [Sun, 3 Nov 2013 13:19:59 +0000 (15:19 +0200)]
bgscan: Add global bgscan configuration

This option can be used to globally configure bgscan parameters
for all the network blocks.

Note that this configuration will not override a network block
specific bgscan settings, but will only be used in case that
the network block does not have a valid bgscan configuration.

Signed-hostap: Haim Dreyfuss <haim.dreyfuss@intel.com>

10 years agohwsim tests: Check kernel messages for warnings/bugs
Johannes Berg [Mon, 4 Nov 2013 09:00:36 +0000 (10:00 +0100)]
hwsim tests: Check kernel messages for warnings/bugs

When a test passes but the kernel printed warnings, consider
the test to have failed.

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

10 years agoeap_proxy: Re-read IMSI from proxy in Interworking functionality
Naresh Jayaram [Fri, 1 Nov 2013 18:48:03 +0000 (20:48 +0200)]
eap_proxy: Re-read IMSI from proxy in Interworking functionality

Try to read the IMSI values through the eap_proxy layer for Interworking
functionality again if the value was not available at startup.

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

10 years agotests: HS 2.0 excluded SSID
Jouni Malinen [Mon, 4 Nov 2013 11:22:55 +0000 (13:22 +0200)]
tests: HS 2.0 excluded SSID

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

10 years agotests: HS 2.0 required roaming consortium
Jouni Malinen [Mon, 4 Nov 2013 11:11:31 +0000 (13:11 +0200)]
tests: HS 2.0 required roaming consortium

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

10 years agotests: Use dictionary as add_cred_values() parameter
Jouni Malinen [Mon, 4 Nov 2013 11:09:46 +0000 (13:09 +0200)]
tests: Use dictionary as add_cred_values() parameter

This makes it more convenient to use this function for cases that modify
credential parameters.

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

10 years agotests: Do not require hlr_auc_gw for HS 2.0 username/password
Jouni Malinen [Mon, 4 Nov 2013 10:17:32 +0000 (12:17 +0200)]
tests: Do not require hlr_auc_gw for HS 2.0 username/password

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

10 years agoAllow AP mode configuration with VHT enabled on 2.4 GHz
Jouni Malinen [Mon, 4 Nov 2013 09:51:56 +0000 (11:51 +0200)]
Allow AP mode configuration with VHT enabled on 2.4 GHz

hostapd_set_freq_param() rejected the 20 MHz channel case with
vht_enabled due to the existing validation step including only 5 GHz (to
be more exact, only >= 5000 MHz). While the behavior may not be fully
defined for 2.4 GHz, we can enable this based on driver capability
advertisement to fix automatic VHT selection for P2P use cases.
mac80211_hwsim advertises VHT for 2.4 GHz band and that resulted in
failures when trying to start GO on that band with vht=1 parameter.

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

10 years agotests: Add preliminary version of DFS test cases
Jouni Malinen [Sun, 3 Nov 2013 19:57:39 +0000 (21:57 +0200)]
tests: Add preliminary version of DFS test cases

These are still disabled by default since they require mac80211_hwsim
changes that are not yet in the upstream kernel and because the test
cases do not fully work yet. Anyway, they are quite convenient for
development use, so good to have them available in the main repository.

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

10 years agoDFS: Do not use cf1 to override freq for 20 MHz channels
Jouni Malinen [Sun, 3 Nov 2013 19:50:48 +0000 (21:50 +0200)]
DFS: Do not use cf1 to override freq for 20 MHz channels

NL80211_ATTR_CENTER_FREQ1 is defined to be used for anything but 20 MHz
bandwidth, so it could be unset for 20 MHz channels. Do not use it to
override center frequency from NL80211_ATTR_WIPHY_FREQ (if available)
for 20 MHz channels to avoid clearing frequency.

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

10 years agoDocument AP mode startup functions
Jouni Malinen [Sun, 3 Nov 2013 19:16:33 +0000 (21:16 +0200)]
Document AP mode startup functions

This provides some more details on how interfaces and BSSes are
initialized during hostapd startup.

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

10 years agotests: Add a test case for HT40 co-ex scan
Jouni Malinen [Sun, 3 Nov 2013 19:00:49 +0000 (21:00 +0200)]
tests: Add a test case for HT40 co-ex scan

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

10 years agotests: Add test cases for automatic channel selection
Jouni Malinen [Sun, 3 Nov 2013 18:50:39 +0000 (20:50 +0200)]
tests: Add test cases for automatic channel selection

This extends the Hostapd class to support monitor interface events and
STATUS command similarly to the WpaSupplicant class so that internal
hostapd state can be verified in more detail.

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

10 years agotests: Add test case for multi-BSS configuration file
Jouni Malinen [Sun, 3 Nov 2013 18:20:50 +0000 (20:20 +0200)]
tests: Add test case for multi-BSS configuration file

Verify that a single configuration file can be used to initiate multiple
BSSes in hostapd and that these BSSes can then be dynamically removed.

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

10 years agohostapd: Use correct wpa_printf verbosity level for message
Jouni Malinen [Sun, 3 Nov 2013 18:12:36 +0000 (20:12 +0200)]
hostapd: Use correct wpa_printf verbosity level for message

This configuration file message is informative and MSG_INFO should be
used instead of MSG_ERROR.

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

10 years agohostapd: Fix multi-BSS configuration file parsing regression
Jouni Malinen [Sun, 3 Nov 2013 18:01:50 +0000 (20:01 +0200)]
hostapd: Fix multi-BSS configuration file parsing regression

Commit ebd79f07c47b02b71c0ac7744a6a94a2bae92fcf broke parsing of
configuration files that use the bss parameter to specify another BSS
entry. This resulted in crashing the process with NULL pointer
dereference since the new hostapd_config::bss design requires this
function to allocate a new hostapd_bss_config structure.

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

10 years agohostapd: Use start_ctrl_iface() from hostapd_add_iface()
Jouni Malinen [Sun, 3 Nov 2013 17:11:38 +0000 (19:11 +0200)]
hostapd: Use start_ctrl_iface() from hostapd_add_iface()

Better share the same function for initializing control interface from
the two possible paths that can add a new interface to hostapd.

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

10 years agoFix AP mode QoS Map configuration to be per-BSS
Jouni Malinen [Sun, 3 Nov 2013 17:05:09 +0000 (19:05 +0200)]
Fix AP mode QoS Map configuration to be per-BSS

This is a per-BSS configuration parameter and as such, needs to be
configured to the driver from hostapd_setup_bss() instead of
hostapd_driver_init().

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

10 years agoDFS: Convert hostapd_data use to hostapd_iface
Jouni Malinen [Sun, 3 Nov 2013 16:48:03 +0000 (18:48 +0200)]
DFS: Convert hostapd_data use to hostapd_iface

DFS operations are specific to the interface (radio/wiphy), not BSS
(netdev/vif), so hostapd_iface is the appropriate element to use in
them.

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

10 years agohostapd: Fill in phyname automatically
Jouni Malinen [Sun, 3 Nov 2013 16:20:28 +0000 (18:20 +0200)]
hostapd: Fill in phyname automatically

If per-BSS configuration enabling did not provide a phy name, iface->phy
was left empty. It can be helpful to set this up automatically, so fill
that when initializing the interface.

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

10 years agohostapd: Add ctrl_iface STATUS command
Jouni Malinen [Sun, 3 Nov 2013 16:13:14 +0000 (18:13 +0200)]
hostapd: Add ctrl_iface STATUS command

This can be used to fetch runtime information about hostapd interfaces.

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

10 years agoOptimize 40 MHz HT co-ex scan on AP
Jouni Malinen [Sun, 3 Nov 2013 15:43:40 +0000 (17:43 +0200)]
Optimize 40 MHz HT co-ex scan on AP

Only scan the affected channels instead of all enabled channels when
determining whether the primary and secondary channel for HT40 needs to
be swapped. This speed up HT40 setup considerably on 5 GHz band.

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

10 years agohostapd: Add AP-ENABLED/DISABLED ctrl_iface events
Jouni Malinen [Sun, 3 Nov 2013 15:30:49 +0000 (17:30 +0200)]
hostapd: Add AP-ENABLED/DISABLED ctrl_iface events

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

10 years agohostapd: Track interface state
Jouni Malinen [Sun, 3 Nov 2013 15:25:05 +0000 (17:25 +0200)]
hostapd: Track interface state

The new hostapd_iface::state enum is used to track the current state of
the hostapd interface (a radio/wiphy).

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

10 years agohostapd: Wait for channel list update after country code change
Jouni Malinen [Sun, 3 Nov 2013 14:33:11 +0000 (16:33 +0200)]
hostapd: Wait for channel list update after country code change

If hostapd is requested to set the country code and the previous country
code differs from the new one, the channel list information from the
driver may change. This change may not be instant, so wait for an
EVENT_CHANNEL_LIST_CHANGED event before continuing interface setup with
fetching of the channel list information. This fixes issues where the
selected channel is not available based on the previous regulatory data
and update through CRDA takes some time.

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

10 years agohostapd: Add ctrl_iface events for ACS
Jouni Malinen [Sun, 3 Nov 2013 13:59:53 +0000 (15:59 +0200)]
hostapd: Add ctrl_iface events for ACS

These give status information to external observers from automatic
channel selection operations.

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

10 years agohostapd: Move ctrl_iface initialization to happen earlier
Jouni Malinen [Sun, 3 Nov 2013 13:47:01 +0000 (15:47 +0200)]
hostapd: Move ctrl_iface initialization to happen earlier

Channel determination may take considerable time when ACS or DFS is
used, so it is useful to be able to observe this process through the
control interface. Move the initialization of the control interfaces to
happen before channel determination so that this can be achieved.

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

10 years agohostapd: Remove hostapd_interface_init2()
Jouni Malinen [Sun, 3 Nov 2013 11:34:35 +0000 (13:34 +0200)]
hostapd: Remove hostapd_interface_init2()

This was an unnecessary wrapper functions for calling two functions from
a single place in the code. It is cleaner to just call those two
functions directly.

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

10 years agohostapd: Simplify interface initialization
Jouni Malinen [Sun, 3 Nov 2013 11:28:17 +0000 (13:28 +0200)]
hostapd: Simplify interface initialization

Use hostapd_interface_init2() for all interfaces instead of the
previously used different paths for per-interface-config and
per-BSS-config cases. This moves the calls to hostapd_driver_init() and
hostapd_setup_interface() to happen after all configuration files have
been read.

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

10 years agotests: Add an EAP-TLS test case
Jouni Malinen [Sun, 3 Nov 2013 10:25:44 +0000 (12:25 +0200)]
tests: Add an EAP-TLS test case

This fixes the user.key file (incorrect key was copied previously) and
adds a test case for EAP-TLS with WPA2-Enterprise.

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

10 years agotests: Add more EAP test cases
Jouni Malinen [Sun, 3 Nov 2013 09:58:38 +0000 (11:58 +0200)]
tests: Add more EAP test cases

This increases EAP method coverage for WPA2-Enterprise to include
EAP-pwd, EAP-GPSK, EAP-SAKE, EAP-EKE, EAP-IKEv2, EAP-PAX, and EAP-PSK.

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

10 years agoDFS: Add control interface events for various DFS events
Jouni Malinen [Sat, 2 Nov 2013 19:01:47 +0000 (21:01 +0200)]
DFS: Add control interface events for various DFS events

These can be useful for external programs that track the current state
of the AP.

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

10 years agohostapd: Add control interface test commands for radar detection
Jouni Malinen [Sat, 2 Nov 2013 18:44:58 +0000 (20:44 +0200)]
hostapd: Add control interface test commands for radar detection

If hostapd is build with CONFIG_TESTING_OPTIONS=y, the RADAR control
interface command can be used to test hostapd behavior on arbitrary
driver radar events.

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

10 years agonl80211: Verify radar event attributes exist before using them
Jouni Malinen [Sat, 2 Nov 2013 18:39:57 +0000 (20:39 +0200)]
nl80211: Verify radar event attributes exist before using them

While these attributes may be expected to be present always, this needs
to be verified within driver_nl80211.c since we cannot depend on the
kernel/driver working correctly.

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

10 years agotests: Add run-tests.py --no-reset
Jouni Malinen [Sat, 2 Nov 2013 18:38:40 +0000 (20:38 +0200)]
tests: Add run-tests.py --no-reset

This can be used to request the previously used default behavior where
the devices are not stopped at the end of a test case if a single test
case is run.

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

10 years agotests: hostapd behavior on dynamic addition of invalid config
Jouni Malinen [Sat, 2 Nov 2013 17:57:35 +0000 (19:57 +0200)]
tests: hostapd behavior on dynamic addition of invalid config

Verify that hostapd handles ENABLE command on invalid configuration
correctly and allows the configuration to be fixed or the interface to
be removed.

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

10 years agohostapd: Fix ENABLE failure to not remove interface
Jouni Malinen [Sat, 2 Nov 2013 17:49:01 +0000 (19:49 +0200)]
hostapd: Fix ENABLE failure to not remove interface

Previously, ENABLE command ended up freeing the hostapd_iface context on
initialization failures, but did not even remove the interface from the
list of available interfaces. This resulted in use of freed memory with
any following operation on the same interface. In addition, removing the
interface on initialization failure does not seem like the best
approach. Fix both of these issues by leaving the interface instance in
memory, but in disabled state so that the configuration can be fixed and
ENABLE used again to enable the interface or REMOVE used to remove the
interface.

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

10 years agotests: Add test cases for SAE
Jouni Malinen [Sat, 2 Nov 2013 16:10:17 +0000 (18:10 +0200)]
tests: Add test cases for SAE

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

10 years agoSAE: Fix group selection
Jouni Malinen [Sat, 2 Nov 2013 16:07:49 +0000 (18:07 +0200)]
SAE: Fix group selection

Number of regressions had shown up in wpa_supplicant implementation of
SAE group selection due to different integer array termination (-1 in
hostapd, 0 in wpa_supplicant) being used for SAE groups. The
default_groups list did not seem to use any explicit termination value.
In addition, the sae_group_index was not cleared back to 0 properly
whenever a new SAE session was started.

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

10 years agotests: Clean up output formatting with str.format()
Jouni Malinen [Sat, 2 Nov 2013 15:07:13 +0000 (17:07 +0200)]
tests: Clean up output formatting with str.format()

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

10 years agoReplace unnecessary UTF-8 characters with ASCII versions
Jouni Malinen [Sat, 2 Nov 2013 14:01:32 +0000 (16:01 +0200)]
Replace unnecessary UTF-8 characters with ASCII versions

There is no need for using UTF-8 in these files when perfectly fine
ASCII versions of these characters exist.

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

10 years agotests: Remove trailing whitespace
Jouni Malinen [Sat, 2 Nov 2013 13:40:36 +0000 (15:40 +0200)]
tests: Remove trailing whitespace

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

10 years agotests: Rename stop-wifi.sh to stop.sh
Jouni Malinen [Sat, 2 Nov 2013 13:39:25 +0000 (15:39 +0200)]
tests: Rename stop-wifi.sh to stop.sh

This makes script naming more consistent with start.sh.

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

10 years agotests: Simplify test_ap_bss_add_remove implementation
Jouni Malinen [Sat, 2 Nov 2013 11:53:23 +0000 (13:53 +0200)]
tests: Simplify test_ap_bss_add_remove implementation

Use lists and loops to avoid duplicated operations.

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

10 years agotests: Use a helper function to rename wpa_supplicant/hostapd logs
Jouni Malinen [Sat, 2 Nov 2013 11:04:06 +0000 (13:04 +0200)]
tests: Use a helper function to rename wpa_supplicant/hostapd logs

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

10 years agoConvert perror/printf calls to wpa_printf
Jouni Malinen [Sat, 2 Nov 2013 10:51:30 +0000 (12:51 +0200)]
Convert perror/printf calls to wpa_printf

This makes debug and error logging more consistent and allows them to be
directed to a file more easily.

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

10 years agotests: Always write run-tests.py debug logs a file
Jouni Malinen [Sat, 2 Nov 2013 10:20:59 +0000 (12:20 +0200)]
tests: Always write run-tests.py debug logs a file

Remove the -l command like option from run-tests.py and always enable
writing of debug level logs to files. The stdout debug verbosity is
controlled independently of the debug log files.

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

10 years agotests: Split hostapd debug log into per test case files
Jouni Malinen [Sat, 2 Nov 2013 09:53:38 +0000 (11:53 +0200)]
tests: Split hostapd debug log into per test case files

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

10 years agohostapd: Accept RELOG from global control interface
Jouni Malinen [Sat, 2 Nov 2013 09:52:35 +0000 (11:52 +0200)]
hostapd: Accept RELOG from global control interface

This makes it easier to recycle log file (-f) when no active interface
is in use.

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

10 years agohostapd: Use wpa_printf() for hostapd_logger() to stdout
Jouni Malinen [Sat, 2 Nov 2013 09:32:19 +0000 (11:32 +0200)]
hostapd: Use wpa_printf() for hostapd_logger() to stdout

This allows log-to-file (-f command line option) to be used to redirect
these messages to the same file with all the other stdout debug.

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

10 years agotests: Ignore old scan results in test_grpform_pbc
Jouni Malinen [Sat, 2 Nov 2013 09:27:16 +0000 (11:27 +0200)]
tests: Ignore old scan results in test_grpform_pbc

This is needed to avoid invalid PBC session overlap detection when
the previous test case used active PBC mode and the old BSS entry
in cfg80211 may still be valid when starting the next test case.

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

10 years agotests: Use single channel scans to speed up test cases
Jouni Malinen [Sat, 2 Nov 2013 09:22:16 +0000 (11:22 +0200)]
tests: Use single channel scans to speed up test cases

A full scan in these specific test cases does not add anything to the
coverage, so use a single channel scan for the station connection to
remove undesired extra time needed for a full scan.

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

10 years agotests: Add run-tests.py --shuffle-test
Jouni Malinen [Sat, 2 Nov 2013 08:30:37 +0000 (10:30 +0200)]
tests: Add run-tests.py --shuffle-test

This optional argument can be used to randomize the order in which the
test cases are run. This can provide more coverage on testing
interactions of common use cases in various different sequences. Such
issues have already been found even with the fixed order of test cases,
but being able to reorder the tests makes this more efficient.

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

10 years agohwsim tests: Add build script
Johannes Berg [Thu, 31 Oct 2013 15:08:01 +0000 (16:08 +0100)]
hwsim tests: Add build script

This is easier than to copy/paste from the README. We may
want to extend it later to change the .config for some
common differences between systems (e.g., libnl/libbfd).

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agohwsim tests: Prefill database in VM tests
Johannes Berg [Thu, 31 Oct 2013 15:05:11 +0000 (16:05 +0100)]
hwsim tests: Prefill database in VM tests

In some cases, e.g., with the VM tests if the VM crashes, it
can be useful to know which tests should have run but didn't
(or didn't finish). In order to catch these more easily, add
an option to prefill the database with all tests at the very
beginning of the testing (in a new NOTRUN state) and use the
option in the VM tests.

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

10 years agohwsim tests: Create results database in VM tests
Johannes Berg [Thu, 31 Oct 2013 14:36:44 +0000 (15:36 +0100)]
hwsim tests: Create results database in VM tests

Create a results.db in the output directory when running
the tests in a VM. To make that easier, create the tables
in the python script if they don't exist.

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

10 years agohwsim tests: Refactor test results reporting
Johannes Berg [Thu, 31 Oct 2013 14:02:50 +0000 (15:02 +0100)]
hwsim tests: Refactor test results reporting

Refactor the test reporting to treat the different results
(success/skip/failure) identically. This makes the timing
seem a bit longer, but cleans up the code which will allow
for adding more checks (e.g., on the captured data files)
later.

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