]> git.ipfire.org Git - thirdparty/hostap.git/log
thirdparty/hostap.git
11 years agoP2P: Allow p2p_cancel to be used to stop p2p_connect-join operation
Jouni Malinen [Tue, 18 Dec 2012 08:39:34 +0000 (10:39 +0200)] 
P2P: Allow p2p_cancel to be used to stop p2p_connect-join operation

p2p_cancel did not properly cancel a pending p2p_connect-join operation.
Address the different steps in that process: initial scan, Provision
Discovery exchange before connection, and WPS provisioning step
(including the scans before WPS).

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

11 years agoInterworking: Default to EAP-MSCHAPv2 with EAP-PEAP
Jouni Malinen [Mon, 17 Dec 2012 21:27:15 +0000 (23:27 +0200)] 
Interworking: Default to EAP-MSCHAPv2 with EAP-PEAP

If the NAI Realm list indicates that EAP-PEAP is used, use EAP-MSCHAPv2
as the Phase 2 method by default if the NAI Realm list does not specify
the tunneled method.

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

11 years agoFix initialization of ap_table_{max_size,expiration_time}
Sven Eckelmann [Mon, 17 Dec 2012 15:45:26 +0000 (17:45 +0200)] 
Fix initialization of ap_table_{max_size,expiration_time}

The config says that the default for ap_table_max_size is 255 and the
default for ap_table_expiration_time is 60. But the code doesn't reflect
the default values mentioned in the sample config file.

These variables completely disable the code for Overlapping Legacy BSS
Condition by default when they are not correctly initialized. WFA
certification requires this feature and therefore an AP would have
failed the certification process unless they were initialized manually
using the configuration file.

Signed-hostap: Sven Eckelmann <sven@open-mesh.com>
Signed-hostap: Simon Wunderlich <simon@open-mesh.com>

11 years agohostapd: Android: Force group access to ctrl_iface directory
Pontus Fuchs [Mon, 17 Dec 2012 14:30:44 +0000 (16:30 +0200)] 
hostapd: Android: Force group access to ctrl_iface directory

Same fix as d49ea68284fdb8516d7e0903e526aac484c18c49 in
wpa_supplicant.

From original commit:

wpa_supplicant is started from /init.*.rc on Android and that seems
to be using umask 0077 which would leave the control interface
directory without group access. This breaks things since Wi-Fi
framework assumes that this directory can be accessed by other
applications in the wifi group. Fix this by adding group access even
if umask value would prevent this.

Signed-hostap: Pontus Fuchs <pontus.fuchs@gmail.com>

11 years agohostapd: Don't chown control interface to root
Pontus Fuchs [Mon, 17 Dec 2012 14:27:04 +0000 (16:27 +0200)] 
hostapd: Don't chown control interface to root

If ctrl_interface_group in the config file is set hostapd tries to
chown the dir and socket to uid 0. This causes the chown to fail
if hostapd is run as non-root.

Signed-hostap: Pontus Fuchs <pontus.fuchs@gmail.com>

11 years agoWPS: Add RF bands attribute conditionally to Probe Response frame
Jouni Malinen [Mon, 17 Dec 2012 14:08:23 +0000 (16:08 +0200)] 
WPS: Add RF bands attribute conditionally to Probe Response frame

WSC IE in Beacon and Probe Response frames should behave consistently
as far as the RF Bands attribute is concerned. Use the same dualband
condition for adding this into Probe Response frames since the value
is not really needed if the AP is not a dualband AP.

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

11 years agoWPS: Use wps_rf_bands parameter to determine dualband functionality
Jouni Malinen [Mon, 17 Dec 2012 14:06:10 +0000 (16:06 +0200)] 
WPS: Use wps_rf_bands parameter to determine dualband functionality

If separate hostapd processes are used for different RF bands, the
dualband parameter for WPS was not set correctly. Allow dualband
indication (mainly, addition of RF bands attribute for PBC session
overlap detection) also based on wps_rf_bands value (if set to "ag").

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

11 years agoHS 2.0: Fix sp_type check in ctrl_iface status command
Jouni Malinen [Mon, 17 Dec 2012 10:12:13 +0000 (12:12 +0200)] 
HS 2.0: Fix sp_type check in ctrl_iface status command

Commit e99b4f3a14755473d6d0e2413de6d82e785a6a30 added functionality to
check whether the current association is with the home SP. This commit
did not take into account that the domain name ANQP information could be
NULL and that could result to a NULL pointer dereference. Fix that by
validation that domain_names != NULL before calling
domain_name_list_contains().

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

11 years agoWNM: Add support for SSID List element matching
Jouni Malinen [Sun, 16 Dec 2012 19:22:24 +0000 (21:22 +0200)] 
WNM: Add support for SSID List element matching

This allows Probe Request frame processing to compare the configured
SSID to the SSID List element in addition to the SSID element.

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

11 years agoAdd support for advertising UTF-8 SSID extended capability
Jouni Malinen [Sun, 16 Dec 2012 18:46:51 +0000 (20:46 +0200)] 
Add support for advertising UTF-8 SSID extended capability

This field can be used to indicate that UTF-8 encoding is used in the
SSID field.

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

11 years agoWNM: Skip os_memcpy in wnmtfs_ie is NULL
Jouni Malinen [Sun, 16 Dec 2012 17:48:39 +0000 (19:48 +0200)] 
WNM: Skip os_memcpy in wnmtfs_ie is NULL

It is cleaner to skip the memcpy call instead of trusting on the
length parameter being 0 in this case.

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

11 years agoWNM: Fix GTK/IGTK encoding in WNM-Sleep Mode Exit frame
Jouni Malinen [Sun, 16 Dec 2012 17:46:10 +0000 (19:46 +0200)] 
WNM: Fix GTK/IGTK encoding in WNM-Sleep Mode Exit frame

These subelements do not use AES key wrap (MFP is used instead).

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

11 years agoFix wpa_supplicant CONFIG_AP=y build with WNM enabled
Jouni Malinen [Sun, 16 Dec 2012 17:31:36 +0000 (19:31 +0200)] 
Fix wpa_supplicant CONFIG_AP=y build with WNM enabled

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

11 years agoWNM: Fix memory leak on error path
Jouni Malinen [Sun, 16 Dec 2012 17:31:25 +0000 (19:31 +0200)] 
WNM: Fix memory leak on error path

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

11 years agoWNM: Fix AP logic on when to include GTK/IGTK in WNM-Sleep Mode exit
Jouni Malinen [Sun, 16 Dec 2012 17:27:09 +0000 (19:27 +0200)] 
WNM: Fix AP logic on when to include GTK/IGTK in WNM-Sleep Mode exit

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

11 years agoWNM: Use defined macros for WNM-Sleep Mode Action Type values (AP)
Jouni Malinen [Sun, 16 Dec 2012 17:20:02 +0000 (19:20 +0200)] 
WNM: Use defined macros for WNM-Sleep Mode Action Type values (AP)

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

11 years agoWNM: Enable WNM-Sleep Mode configuration with hostapd SME/MLME
Jouni Malinen [Sun, 16 Dec 2012 17:16:17 +0000 (19:16 +0200)] 
WNM: Enable WNM-Sleep Mode configuration with hostapd SME/MLME

This allows hostapd to process WNM-Sleep Mode Request when using the
internal SME/MLME.

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

11 years agoWNM: Use CONFIG_WNM more consistently
Jouni Malinen [Sun, 16 Dec 2012 16:22:54 +0000 (18:22 +0200)] 
WNM: Use CONFIG_WNM more consistently

Replace CONFIG_IEEE80211V with CONFIG_WNM to get more consistent build
options for WNM-Sleep Mode operations. Previously it was possible to
define CONFIG_IEEE80211V without CONFIG_WNM which would break the build.
In addition, IEEE 802.11v has been merged into IEEE Std 802.11-2012 and
WNM is a better term to use for this new functionality anyway.

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

11 years agoWNM: Split WNM-Sleep Mode Response processing into separate functions
Jouni Malinen [Sun, 16 Dec 2012 11:05:19 +0000 (13:05 +0200)] 
WNM: Split WNM-Sleep Mode Response processing into separate functions

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

11 years agoWNM: Use defined macros for WNM-Sleep Mode Action Type values
Jouni Malinen [Sun, 16 Dec 2012 10:57:38 +0000 (12:57 +0200)] 
WNM: Use defined macros for WNM-Sleep Mode Action Type values

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

11 years agoWNM: Remove unnecessary extra indentation level
Jouni Malinen [Sun, 16 Dec 2012 10:51:02 +0000 (12:51 +0200)] 
WNM: Remove unnecessary extra indentation level

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

11 years agoWNM: Fix GTK/IGTK parsing for WNM-Sleep Mode Response frame
Jouni Malinen [Sun, 16 Dec 2012 10:48:34 +0000 (12:48 +0200)] 
WNM: Fix GTK/IGTK parsing for WNM-Sleep Mode Response frame

These fields do not use AES keywrap. Instead, they are protected with
management frame protection (and not included if PMF is disabled).

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

11 years agoWNM: Add WNM-Sleep Mode into Extended Capabilities element
Jouni Malinen [Sun, 16 Dec 2012 10:45:59 +0000 (12:45 +0200)] 
WNM: Add WNM-Sleep Mode into Extended Capabilities element

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

11 years agonl80211: Register to process WNM-Sleep Mode Response frames
Jouni Malinen [Sun, 16 Dec 2012 10:42:26 +0000 (12:42 +0200)] 
nl80211: Register to process WNM-Sleep Mode Response frames

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

11 years agowlantest: Process TX status frames as RX frames too
Jouni Malinen [Sun, 16 Dec 2012 10:35:07 +0000 (12:35 +0200)] 
wlantest: Process TX status frames as RX frames too

This is needed to allow capture files from the mac80211 cooked monitor
mode interface to be processed properly. Without this, the locally
generated frames may not get processed.

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

11 years agoWNM: Accept GTK update version of WNM-Sleep Response status
Jouni Malinen [Sun, 16 Dec 2012 10:33:55 +0000 (12:33 +0200)] 
WNM: Accept GTK update version of WNM-Sleep Response status

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

11 years agoWNM: Use Dialog Token value 1 in WNM-Sleep Mode Request
Jouni Malinen [Sun, 16 Dec 2012 10:32:53 +0000 (12:32 +0200)] 
WNM: Use Dialog Token value 1 in WNM-Sleep Mode Request

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

11 years agoWNM: Add option for passing TFS request from external programs
Jouni Malinen [Sun, 16 Dec 2012 10:31:16 +0000 (12:31 +0200)] 
WNM: Add option for passing TFS request from external programs

The optional tfs_req=<hex dump> parameter can be added for the wnm_sleep
command to specify the TFS request element to use in the WNM-Sleep Mode
Request frame.

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

11 years agoWNM: Remove unnecessary path component from includes
Jouni Malinen [Sun, 16 Dec 2012 10:29:44 +0000 (12:29 +0200)] 
WNM: Remove unnecessary path component from includes

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

11 years agoWNM: Add ctrl_iface command for sending WNM-Sleep Mode Request
Jouni Malinen [Sun, 16 Dec 2012 10:29:10 +0000 (12:29 +0200)] 
WNM: Add ctrl_iface command for sending WNM-Sleep Mode Request

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

11 years agoWNM: Fix CONFIG_WNM use in Makefile
Jouni Malinen [Sun, 16 Dec 2012 10:28:19 +0000 (12:28 +0200)] 
WNM: Fix CONFIG_WNM use in Makefile

This code was within ifdef CONFIG_AP and did not get included unless
AP mode support was also enabled.

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

11 years agoWNM: Remove unused variable
Jouni Malinen [Sun, 16 Dec 2012 10:27:38 +0000 (12:27 +0200)] 
WNM: Remove unused variable

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

11 years agoInterworking: Allow SSID-based network exclusion for credentials
Jouni Malinen [Sun, 16 Dec 2012 10:01:50 +0000 (12:01 +0200)] 
Interworking: Allow SSID-based network exclusion for credentials

The new excluded_ssid parameter within a cred block can be used to
excluded networks from matching with credentials.

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

11 years agoInterworking: Fix cred saving
Jouni Malinen [Sun, 16 Dec 2012 10:00:52 +0000 (12:00 +0200)] 
Interworking: Fix cred saving

Number of cred block fields were not saved when wpa_supplicant is
writing the configuration file.

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

11 years agoInterworking: Default to TTLS/MSCHAPv2 for NAI Realm list matching
Jouni Malinen [Sun, 16 Dec 2012 10:00:06 +0000 (12:00 +0200)] 
Interworking: Default to TTLS/MSCHAPv2 for NAI Realm list matching

If the AP does not advertize EAP parameters, default to TTLS/MSCHAPv2
when using username/password credentials.

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

11 years agoFix REAUTHENTICATE command after PMKSA caching
Jouni Malinen [Sun, 25 Nov 2012 20:05:32 +0000 (22:05 +0200)] 
Fix REAUTHENTICATE command after PMKSA caching

The current PMKSA cache entry needs to be clear to allow EAPOL
reauthentication to be started in case this association used PMKSA
caching.

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

11 years agoPMKSA: Clear current cache entry on disassociation
Dan Williams [Sun, 25 Nov 2012 19:53:55 +0000 (21:53 +0200)] 
PMKSA: Clear current cache entry on disassociation

Signed-hostap: Dan Williams <dcbw@redhat.com>

11 years agoPMKSA: Make deauthentication due to cache entry removal more granular
Dan Williams [Sun, 25 Nov 2012 19:27:18 +0000 (21:27 +0200)] 
PMKSA: Make deauthentication due to cache entry removal more granular

Expiry can always trigger a deauthentication, but otherwise,
deauthentication should only happen when the *current* cache entry is
removed and not being replaced. It should not happen when the current
PMK just happens to match the PMK of the entry being removed, since
multiple entries can have the same PMK when OKC is used and these
entries are often removed at different times.

This fixes an issue where eviction of the oldest inactive entry due to
adding a newer entry to a full cache caused a deauthentication when the
entry being removed had the same PMK as the current entry.

Signed-hostap: Dan Williams <dcbw@redhat.com>

11 years agoRemove unnecessary PMKSA cache list modification
Jouni Malinen [Sun, 25 Nov 2012 17:45:54 +0000 (19:45 +0200)] 
Remove unnecessary PMKSA cache list modification

pmksa_cache_free_entry() takes care of updated the list head pointer
(pmksa->pmksa), so no need to do this change in the caller.

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

11 years agoUse a shared function for freeing PSK list
Jouni Malinen [Sun, 25 Nov 2012 16:01:55 +0000 (18:01 +0200)] 
Use a shared function for freeing PSK list

There is no need to duplicate this code in multiple locations.

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

11 years agoUse RADIUS shared secret consistently in RX handler
Jouni Malinen [Sun, 25 Nov 2012 15:52:56 +0000 (17:52 +0200)] 
Use RADIUS shared secret consistently in RX handler

Use the shared_secret pointer from RADIUS client implementation instead
of getting this from hostapd configuration data.

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

11 years agoKeep and use list of PSKs per station for RADIUS-based PSK
Michael Braun [Sun, 25 Nov 2012 15:49:25 +0000 (17:49 +0200)] 
Keep and use list of PSKs per station for RADIUS-based PSK

This adds support for multiple PSKs per station when using a RADIUS
authentication server to fetch the PSKs during MAC address
authentication step. This can be useful if multiple users share a
device but each user has his or her own private passphrase.

Signed-hostap: Michael Braun <michael-dev@fami-braun.de>

11 years agoCache a list of PSK entries for RADIUS-based PSK delivery
Michael Braun [Sun, 25 Nov 2012 15:41:13 +0000 (17:41 +0200)] 
Cache a list of PSK entries for RADIUS-based PSK delivery

Signed-hostap: Michael Braun <michael-dev@fami-braun.de>

11 years agoExtend radius_msg_get_tunnel_password() to support multiple passwords
Michael Braun [Sun, 25 Nov 2012 15:19:04 +0000 (17:19 +0200)] 
Extend radius_msg_get_tunnel_password() to support multiple passwords

The new function parameter can now be used to specify which password to
return.

Signed-hostap: Michael Braun <michael-dev@fami-braun.de>

11 years agoRemove unneeded header file inclusion
Jouni Malinen [Sun, 25 Nov 2012 15:06:38 +0000 (17:06 +0200)] 
Remove unneeded header file inclusion

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

11 years agoUse a shared function for requesting a new connection
Jouni Malinen [Sun, 25 Nov 2012 14:30:30 +0000 (16:30 +0200)] 
Use a shared function for requesting a new connection

Both the ctrl_iface and D-Bus interface use similar functionality to
request a new connection. Combine these to a single function to avoid
need to maintain duplicated implementation.

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

11 years agoRemove unused function prototype
Jouni Malinen [Sun, 25 Nov 2012 14:27:19 +0000 (16:27 +0200)] 
Remove unused function prototype

This function was not added, so the prototype should not have been here
either.

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

11 years agoMaintain maximum blacklist count over list clear operations
Jouni Malinen [Sun, 25 Nov 2012 14:20:44 +0000 (16:20 +0200)] 
Maintain maximum blacklist count over list clear operations

wpas_connection_failed() uses the blacklist count to figure out a
suitable time to wait for the next scan. This mechanism did not work
properly in cases where the temporary blacklist gets cleared due to no
other BSSes being available. Address this by maintaining an additional
count of blacklisting values over wpa_blacklist_clear() calls. In
addition, add one more step in the count to timeout mapping to go to 10
second interval if more than four failures are seen.

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

11 years agoDocument wpa_s->scan_req
Jouni Malinen [Sun, 25 Nov 2012 13:55:32 +0000 (15:55 +0200)] 
Document wpa_s->scan_req

Use an enum with documented values to make it easier to understand how
wpa_s->scan_req is used.

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

11 years agoMark sme_send_authentication() static
Jouni Malinen [Sun, 25 Nov 2012 13:47:43 +0000 (15:47 +0200)] 
Mark sme_send_authentication() static

This function is not used outside sme.c.

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

11 years agoP2P: Avoid multi-channel scans when they are not needed
Jouni Malinen [Sun, 25 Nov 2012 10:47:43 +0000 (12:47 +0200)] 
P2P: Avoid multi-channel scans when they are not needed

If the driver does not support multi-channel concurrency and a virtual
interface that shares the same radio with the current interface is
operating there may not be need to scan other channels apart from the
current operating channel on the other virtual interface. Filter out
other channels in case we are trying to find a connection for a station
interface when we are not configured to prefer station connection and a
concurrent operation is already in process.

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

11 years agoIndicate if PMF was negotiated for the connection
Jouni Malinen [Sat, 24 Nov 2012 20:45:17 +0000 (22:45 +0200)] 
Indicate if PMF was negotiated for the connection

Add pmf=1/2 to wpa_supplicant STATUS command output to indicate that PMF
was negotiated for the connect (1 = optional in this BSS, 2 = required
in this BSS).

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

11 years agoInterworking: Enable key_mgmt WPA-EAP-SHA256 if PMF is enabled
Jouni Malinen [Sat, 24 Nov 2012 20:31:17 +0000 (22:31 +0200)] 
Interworking: Enable key_mgmt WPA-EAP-SHA256 if PMF is enabled

If the global pmf=1/2 parameter is used to enable PMF for Interworking
networks, add WPA-EAP-SHA256 to the temporary network block to allow
connection to PMF required APs.

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

11 years agoAllow PMF to be enabled by default
Jouni Malinen [Sat, 24 Nov 2012 20:21:29 +0000 (22:21 +0200)] 
Allow PMF to be enabled by default

Previously, PMF (protected management frames, IEEE 802.11w) could be
enabled only with a per-network parameter (ieee80211w). The new global
parameter (pmf) can now be used to change the default behavior to be PMF
enabled (pmf=1) or required (pmf=2) for network blocks that do not
override this with the ieee80211w parameter.

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

11 years agoAllow OBSS scan and 20/40 coex reports to non-SME drivers
Amitkumar Karwar [Sat, 24 Nov 2012 16:08:48 +0000 (18:08 +0200)] 
Allow OBSS scan and 20/40 coex reports to non-SME drivers

We enable this feature for non-SME drivers as well if
they explicitly indicate need for it.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
11 years agoSync with linux/nl80211.h in wireless-testing.git
Jouni Malinen [Sat, 24 Nov 2012 16:04:55 +0000 (18:04 +0200)] 
Sync with linux/nl80211.h in wireless-testing.git

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

11 years agohostapd: Add second VHT frequency segment config
Johannes Berg [Sat, 24 Nov 2012 16:02:29 +0000 (18:02 +0200)] 
hostapd: Add second VHT frequency segment config

Add the configuration option vht_oper_centr_freq_seg1_idx
for the second segment of an 80+80 MHz channel and use it
when building the VHT operation IE.

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

11 years agohostapd: Add VHT PHY selector if VHT is required
Johannes Berg [Sat, 24 Nov 2012 15:27:16 +0000 (17:27 +0200)] 
hostapd: Add VHT PHY selector if VHT is required

If VHT is required, add the VHT PHY selector to
the (extended) supported rates IE.

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

11 years agoVerify that the selected BSS has a better signal level before roaming
Robert Shade [Sat, 24 Nov 2012 15:17:50 +0000 (17:17 +0200)] 
Verify that the selected BSS has a better signal level before roaming

This prevents situations like the following where we roam to a
lesser quality BSS just because the signal level delta is over our
threshold.

wlan0: Considering within-ESS reassociation
wlan0: Current BSS: 00:24:6c:74:0a:40 level=-51
wlan0: Selected BSS: 00:24:6c:74:0a:e0 level=-64
wlan0: Request association: reassociate: 0  selected: 00:24:6c:74:0a:e0
    bssid: 00:24:6c:74:0a:40  pending: 00:00:00:00:00:00  wpa_state: COMPLETED

Signed-hostap: Robert Shade <robert.shade@gmail.com>

11 years agoDo not double free cfg struct if netlink_init() fails
Pontus Fuchs [Sat, 24 Nov 2012 14:47:20 +0000 (16:47 +0200)] 
Do not double free cfg struct if netlink_init() fails

If netlink_init() fails on socket create or bind the cfg struct
provided as parameter is freed by netlink_init(). Callers of
netlink_init() also free this struct on their error paths leading
to double free.

Signed-hostap: Pontus Fuchs <pontus.fuchs@gmail.com>

11 years agoHS 2.0: Add Home SP FQDN and roaming/home to status command
Jouni Malinen [Thu, 22 Nov 2012 18:51:49 +0000 (20:51 +0200)] 
HS 2.0: Add Home SP FQDN and roaming/home to status command

This allows the ctrl_iface STATUS information to be used to determine
which Home SP credential (domain in the cred block) was used and whether
the network is operated by the home SP.

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

11 years agoHS 2.0: Add REMOVE_CRED sp_fqdn=<FQDN> command
Jouni Malinen [Thu, 22 Nov 2012 16:04:57 +0000 (18:04 +0200)] 
HS 2.0: Add REMOVE_CRED sp_fqdn=<FQDN> command

This allows credential entries to be removed based on SP FQDN without
having to iterate through the configured entries from an external
program to figure out which credentials should be removed for a specific
SP.

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

11 years agoHS 2.0: Remove temporary network block on cred block removal
Jouni Malinen [Thu, 22 Nov 2012 15:53:27 +0000 (17:53 +0200)] 
HS 2.0: Remove temporary network block on cred block removal

If the credential that was used to create a temporary HS 2.0 network
block is removed, remove the network block, too.

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

11 years agoHS 2.0: Maintain a copy of HS 2.0 Indication from Association Request
Jouni Malinen [Wed, 21 Nov 2012 22:19:17 +0000 (00:19 +0200)] 
HS 2.0: Maintain a copy of HS 2.0 Indication from Association Request

This allows the AP to figure out whether a station is a HS 2.0 STA
during the association and access any information that the STA may have
included in this element.

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

11 years agoAndroid: Force group access to ctrl_iface directory
Jouni Malinen [Fri, 23 Nov 2012 15:05:47 +0000 (17:05 +0200)] 
Android: Force group access to ctrl_iface directory

wpa_supplicant is started from /init.*.rc on Android and that seems
to be using umask 0077 which would leave the control interface
directory without group access. This breaks things since Wi-Fi
framework assumes that this directory can be accessed by other
applications in the wifi group. Fix this by adding group access even
if umask value would prevent this.

In most cases, this issue was not hit since the control interface
directory is normally created by that same init.*.rc file with suitable
mode and wpa_supplicant is killed in the way that does not allow it to
remove the file. However, if wpa_supplicant is allowed stop cleanly, it
will remove the directory and the next start could result with the Wi-Fi
framework not being able to use Wi-Fi (and GUI not showing Wi-Fi getting
enabled).

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

11 years agoP2P: Increase the maximum number of PD Request retries
Sunil Dutt [Thu, 22 Nov 2012 22:57:59 +0000 (00:57 +0200)] 
P2P: Increase the maximum number of PD Request retries

Change the maximum retry limit from 10 to 120 to match the behavior
used with GO Negotiation Request frames when trying to start GO
Negotiation with a peer that does not acknowledge frames (e.g., due
to being in sleep or on another channel most of the time).

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

11 years agoP2P: Remove PD-before-join-timeout mechanism
Sunil Dutt [Thu, 22 Nov 2012 23:14:15 +0000 (01:14 +0200)] 
P2P: Remove PD-before-join-timeout mechanism

The PD Request retry limit can be used to achieve the same behavior,
so drop this duplicated timeout mechanism and control the timeout
based on MAX_PROV_DISC_REQ_RETRIES.

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

11 years agoP2P: Retry PD Request in join-a-running-group case
Jouni Malinen [Thu, 22 Nov 2012 22:53:42 +0000 (00:53 +0200)] 
P2P: Retry PD Request in join-a-running-group case

The GO may be in sleep when we send a PD Request frame to indicate that
we are about to join a running group. Previously, this frame was not
retried more than normal low level retries. This can result in the GO
not getting the frame especially in cases where concurrent multi-channel
operations or aggressive sleep schedule is used since most drivers do
not yet synchronize with the GO's NoA before association.

Increase the likelihood of the GO receiving the PD Request frame by
retransmitting it similarly to the PD-for-GO-Negotiation case. Start
the actual join operation only after these retries have failed to get
an acknowledgment from the GO to give the connection attempt a chance
to succeed if the driver implements better NoA synchronization for it.

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

11 years agoP2P: Set user_initiated_pd separately from the join parameter
Sunil Dutt [Thu, 22 Nov 2012 22:48:58 +0000 (00:48 +0200)] 
P2P: Set user_initiated_pd separately from the join parameter

p2p_prov_disc_req() used the join parameter to figure out whether the PD
request was a user initiated or not. This does not cover all use cases
of PD, so add a separate parameter to allow caller to indicate whether
the user requested the operation.

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

11 years agoAndroid: Fix AP builds to include the new eap_user_db.c
Jouni Malinen [Wed, 21 Nov 2012 15:55:36 +0000 (17:55 +0200)] 
Android: Fix AP builds to include the new eap_user_db.c

This is needed to fix the builds after commit
ee431d77a51b361b4697f2b737bcf46a1860a6fe.

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

11 years agoFix wpa_supplicant compilation after adding eap_user database
Vladimir Kondratiev [Wed, 21 Nov 2012 15:49:47 +0000 (17:49 +0200)] 
Fix wpa_supplicant compilation after adding eap_user database

Commit ee431d77a51b361b4697f2b737bcf46a1860a6fe broke wpa_supplicant
compilation:

../src/ap/ieee802_1x.o: In function `ieee802_1x_get_eap_user':
/../src/ap/ieee802_1x.c:1689: undefined reference to `hostapd_get_eap_user'
collect2: error: ld returned 1 exit status
make: *** [wpa_supplicant] Error 1

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
11 years agoAdd preliminary support for using SQLite for eap_user database
Jouni Malinen [Tue, 20 Nov 2012 22:47:47 +0000 (00:47 +0200)] 
Add preliminary support for using SQLite for eap_user database

CONFIG_SQLITE=y option can now be used to allow the eap_user_file text
file to be replaced with a SQLite database
(eap_user_file=sqlite:/path/to/sqlite.db). hostapd.eap_user_sqlite
shows an example of how the database tables can be created for this
purpose. This commit does not yet include full functionality of the
text file format, but at least basic EAP-TTLS/MSCHAPv2 style
authentication mechanisms with plaintext passwords can be used for
tests.

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

11 years agonl80211: Add support for TDLS request event from the driver
Jouni Malinen [Mon, 19 Nov 2012 15:00:07 +0000 (17:00 +0200)] 
nl80211: Add support for TDLS request event from the driver

The NL80211_CMD_TDLS_OPER command can be used as an event based on a
recent cfg80211 commit, so add code to map that to internal
wpa_supplicant event to request TDLS link setup/teardown.

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

11 years agowpa_cli: Accept more arguments for set_network
Jouni Malinen [Mon, 19 Nov 2012 12:04:42 +0000 (14:04 +0200)] 
wpa_cli: Accept more arguments for set_network

Some network parameters, e.g., auth_alg and eap use a space separated
list of values without quotation marks. To allow these to be entered
from the interactive mode, change set_network command to allow more than
three arguments.

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

11 years agoUpdate ChangeLog files to match the current implementation
Jouni Malinen [Sun, 18 Nov 2012 19:30:38 +0000 (21:30 +0200)] 
Update ChangeLog files to match the current implementation

This commit adds description of the main changes from the forking of
hostap-1.git for 1.x releases to the current master branch snapshot.

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

11 years agohostapd: Fix a regression in TKIP countermeasures processing
Jouni Malinen [Sun, 18 Nov 2012 11:06:03 +0000 (13:06 +0200)] 
hostapd: Fix a regression in TKIP countermeasures processing

Commit 296a34f0c1730416bf2a61ab78690be43d82a3c0 changed hostapd to
remove the internal STA entry at the beginning of TKIP countermeasures.
However, this did not take into account the case where this is triggered
by an EAPOL-Key error report from a station. In such a case, WPA
authenticator state machine may continue processing after having
processed the error report. This could result in use of freed memory.
Fix this by stopping WPA processing if the STA entry got removed.

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

11 years agoWPS: Add a workaround for PBC session overlap detection
Jouni Malinen [Thu, 15 Nov 2012 17:59:04 +0000 (19:59 +0200)] 
WPS: Add a workaround for PBC session overlap detection

Some deployed station implementations implement WPS incorrectly and
end up causing PBC session overlap issues by indicating active PBC
mode in a scan after the WPS provisioning step. Work around this by
ignoring active PBC indication in a Probe Request from a station that
completed PBC provisioning during the last five seconds.

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

11 years agoRemove unused disassociate() driver_ops
Jouni Malinen [Wed, 14 Nov 2012 22:06:12 +0000 (00:06 +0200)] 
Remove unused disassociate() driver_ops

Commits 07783eaaa05c07e2c0071780ed3ebf7d0abfe4b5 and
3da372fae8b25a4aec12245b05680646f3bd0ccd removed the only users of the
disassociate() driver operation, so these driver wrapper functions can
also be removed now.

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

11 years agoFix forgotten no-CONFIG_WPS=y wrapper
Jouni Malinen [Wed, 14 Nov 2012 11:05:53 +0000 (13:05 +0200)] 
Fix forgotten no-CONFIG_WPS=y wrapper

Commit 620c783753bddd37988269314862dc7e4a62f700 modified
wpas_wps_ssid_wildcard_ok() prototype, but forgot to update the
non-WPS-build wrapper. Fix that to match with the new bss parameter
type and remove the now unused declaration of wpa_scan_res.

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

11 years agoAllow OKC to be enabled by default
Jouni Malinen [Mon, 12 Nov 2012 18:07:53 +0000 (20:07 +0200)] 
Allow OKC to be enabled by default

Previously, OKC (opportunistic key caching, a.k.a. proactive key
caching) could be enabled only with a per-network parameter
(proactive_key_caching). The new global parameter (okc) can now be used
to change the default behavior to be OKC enabled (okc=1) for network
blocks that do not override this with the proactive_key_caching
parameter.

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

11 years agoP2P: Avoid extra group interface creation on GO reinvocation
Jouni Malinen [Sun, 11 Nov 2012 18:45:27 +0000 (20:45 +0200)] 
P2P: Avoid extra group interface creation on GO reinvocation

If separate group interfaces are used, the pending group interface got
removed unnecessarily when stopping find operations when accepting an
invitation to reinvoke the group in GO role. This resulted in the group
interfaces getting created twice. Avoid this unnecessary extra operation
by skipping removal of the pending interface in the reinvocation
sequence.

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

11 years agoHide strict-aliasing warning with gcc 4.7
Jouni Malinen [Sun, 11 Nov 2012 18:29:20 +0000 (20:29 +0200)] 
Hide strict-aliasing warning with gcc 4.7

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

11 years agonl80211: Avoid strict-aliasing warning with gcc 4.7
Jouni Malinen [Sun, 11 Nov 2012 18:28:27 +0000 (20:28 +0200)] 
nl80211: Avoid strict-aliasing warning with gcc 4.7

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

11 years agobgscan_learn: Prevent infinite busy looping
Pawel Kulakowski [Sun, 11 Nov 2012 14:26:36 +0000 (16:26 +0200)] 
bgscan_learn: Prevent infinite busy looping

In highly congested network (BSSes almost on every channel
within ESS) we have hit a bug when wpa_supplicant become
completly irresponsive, infinite looping on while loop.

When probe_idx was equal 0 and we are not able to probe
new frequency, following condition were never fulfilled:
"if (!in_array(freqs, data->supp_freqs[idx]))"

Signed-hostap: Pawel Kulakowski <pawel.kulakowski@tieto.com>

11 years agodbus: Do not quote scan_freq and freq_list
Robert Shade [Sun, 11 Nov 2012 14:21:16 +0000 (16:21 +0200)] 
dbus: Do not quote scan_freq and freq_list

scan_freq and freq_list are not parsed by wpa_config_parse_freqs if
quoted.

Signed-hostap: Robert Shade <robert.shade@gmail.com>

11 years agonl80211: Roam correctly through cfg80211 without SME
Christopher Wiley [Sun, 11 Nov 2012 14:15:29 +0000 (16:15 +0200)] 
nl80211: Roam correctly through cfg80211 without SME

Change the nl80211 driver in wpa_supplicant to correctly handle
connecting to a new AP through cfg80211 without SME capability. As
before, the driver will disconnect from the previously associated AP,
but now we attempt to immediately connect to our intended AP. This
prevents us from blacklisting the AP we were trying to connect to
because of a semantic mismatch between cfg80211 and wpa_supplicant. The
disconnect/connect patch generates a local disconnect nl80211 event
which we discard because we're already correctly tracking the pending
association request.

In detail:

cfg80211 does not support connecting to a new BSS while already
connected to another BSS, if the underlying driver doesn't support
separate authenticate and associate commands. wpa_supplicant is written
to expect that this is a supported operation, except for a little error
handling that disconnects from the current BSS when roaming fails and
relies on autoconnect logic to reconnect later. However, this failure to
connect is incorrectly attributed to the new AP we attempted to
associate with, rather than a local condition in cfg80211.

The combined effect of these two conditions is that full-mac drivers
accessible through cfg80211 but without SME capability take a long time
to roam across BSS's because wpa_supplicant will:
1) Fail to associate for local reasons
2) Disconnect and return that the association request failed
3) Blacklist the association target (incorrectly)
4) Do a scan
5) Pick a less desirable AP to associate with

Signed-hostap: Christoper Wiley <wiley@chromium.org>

11 years agoFix a typo in a comment
Jouni Malinen [Sun, 11 Nov 2012 14:09:36 +0000 (16:09 +0200)] 
Fix a typo in a comment

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

11 years agoatheros: Remove redundant l2_packet_get_own_addr call
Baruch Siach [Sun, 11 Nov 2012 14:07:28 +0000 (16:07 +0200)] 
atheros: Remove redundant l2_packet_get_own_addr call

Commit deca6eff74411b8c93e7c7c31406de7367a0b540 added a redundant call
to l2_packet_get_own_addr. Use the information we already have in
atheros_init.

Signed-hostap: Baruch Siach <baruch@tkos.co.il>

11 years agoEAP-SIM/AKA server: Fix memory leak in error path
Jouni Malinen [Sun, 11 Nov 2012 11:15:49 +0000 (13:15 +0200)] 
EAP-SIM/AKA server: Fix memory leak in error path

If identity round limit is reached, EAP-SIM/AKA session is terminated.
This needs to free the allocated message.

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

11 years agoCheck hapd_iface more consistently in hostapd_disable_iface()
Jouni Malinen [Sun, 11 Nov 2012 11:11:15 +0000 (13:11 +0200)] 
Check hapd_iface more consistently in hostapd_disable_iface()

There is no point in the hapd_iface == NULL validate after this pointer
has been dereferences, so move the code dereferencing hapd_iface after
the check.

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

11 years agoWPS: Remove deprecated UFD config method and OOB ctrl_iface
Jouni Malinen [Sun, 11 Nov 2012 11:01:06 +0000 (13:01 +0200)] 
WPS: Remove deprecated UFD config method and OOB ctrl_iface

The UFD (USB flash drive) configuration method was deprecated in WSC
2.0. Since this is not known to be used, remove the UFD implementation
from hostapd and wpa_supplicant to allow the WPS implementation to be
cleaned up. This removes the now unused OOB operations and ctrl_iface
commands that had already been deprecated by the new NFC operations.

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

11 years agoP2P: Reduce redundant PSK generation for GO
Masashi Honma [Sun, 11 Nov 2012 09:39:24 +0000 (11:39 +0200)] 
P2P: Reduce redundant PSK generation for GO

The PSK generation done by pbkdf2_sha1() is one of the longest CPU time
users according to our profiling from boot to GO started.

So I have reduced some steps.

I could boot a GO by this command sequence.
-------------
add_net
set_network 0 ssid '"DIRECT-XX"'
set_network 0 psk
'"123456789012345678901234567890123456789012345678901234567890123"'
set_network 0 proto RSN
set_network 0 key_mgmt WPA-PSK
set_network 0 pairwise CCMP
set_network 0 auth_alg OPEN
set_network 0 mode 3
set_network 0 disabled 2
p2p_group_add persistent=0 freq=2412
-------------

By this sequence, pbkdf2_sha1() was called three times and the function
calculates the same value each time. Reduce number of calls to
pbkdf2_sha1() from 3 to 1 by caching the previous result.

Signed-hostap: Masashi Honma <masashi.honma at gmail.com>

11 years agonew_dbus_handlers: Clear errno
Paul Stewart [Sun, 11 Nov 2012 09:18:31 +0000 (11:18 +0200)] 
new_dbus_handlers: Clear errno

There are a few instances where dbus handlers test the value
of errno to test whether strtoul completes successfully.
Since strtoul does not clear errno, and there's no strong
reason to suspect that errno is already clear, it is safer
to clear it right before calling strtoul.  Also, any failure
in strtoul (setting errno non-zero) should be considered a
failure.

While testing using dbus-send, I found that a malformed
network path can cause a crash due to net_id being left
NULL.  We should test for this before calling strtoul
on it.

Tested with:

dbus-send --system --dest=fi.w1.wpa_supplicant1 --print-reply \
    /fi/w1/wpa_supplicant1/Interfaces/0 \
    org.freedesktop.DBus.Properties.Get \
    string:fi.w1.wpa_supplicant1.Interface string:Networks
dbus-send --system --dest=fi.w1.wpa_supplicant1 --print-reply \
   /fi/w1/wpa_supplicant1/Interfaces/0 \
   fi.w1.wpa_supplicant1.Interface.RemoveNetwork \
   objpath:/fi/w1/wpa_supplicant1/Interfaces/0/Networks/0
dbus-send --system --dest=fi.w1.wpa_supplicant1 --print-reply \
   /fi/w1/wpa_supplicant1/Interfaces/0 \
   fi.w1.wpa_supplicant1.Interface.RemoveNetwork \
   objpath:/fi/w1/wpa_supplicant1/Interfaces/0/Networks/0
dbus-send --system --dest=fi.w1.wpa_supplicant1 --print-reply \
   /fi/w1/wpa_supplicant1/Interfaces/0 \
   fi.w1.wpa_supplicant1.Interface.RemoveNetwork \
   objpath:/fi/w1/wpa_supplicant1/Interfaces/0

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

11 years agoRemove unused wpa_supplicant_disassociate()
Jouni Malinen [Mon, 5 Nov 2012 15:05:37 +0000 (17:05 +0200)] 
Remove unused wpa_supplicant_disassociate()

This function is now unused after the last couple of commits that
removed the last uses, so remove this to keep code simpler since all
places that disassociate, can use deauthentication instead.

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

11 years agoUse deauthentication instead of disassociation on RSN element mismatch
Jouni Malinen [Mon, 5 Nov 2012 15:01:07 +0000 (17:01 +0200)] 
Use deauthentication instead of disassociation on RSN element mismatch

Even though the standard currently describes disassociation to be used
for RSN element mismatch between Beacon/Probe Response frames and
EAPOL-Key msg 3/4, this is unnecessary difference from other cases that
deauthenticate. In addition, there is no point in leaving the 802.11
Authentication in place in this case. To keep things simpler, use
deauthentication here to get rid of the only use of
wpa_sm_disassociate().

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

11 years agoUse deauthentication instead of disassociation if not associated
Jouni Malinen [Mon, 5 Nov 2012 14:55:30 +0000 (16:55 +0200)] 
Use deauthentication instead of disassociation if not associated

cfg80211/mac80211 may reject disassociation command if association has
not yet been formed. Use deauthentication in cases where it is possible
that we are associating at the moment the command is issued.

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

11 years agoUse wpa_drv_{disassociate,deauthenticate} while waiting for connection
Jouni Malinen [Mon, 5 Nov 2012 14:42:28 +0000 (16:42 +0200)] 
Use wpa_drv_{disassociate,deauthenticate} while waiting for connection

wpa_supplicant_{disassociate,deauthenticate}() need to inform the driver
about decision to disconnect even if this happens during the time when
the driver is still trying to complete association. During that time,
wpa_s->bssid is not set, so the code in these functions needs to figure
out the correct BSSID based on that field or wpa_s->pending_bssid. In
addition, it is possible that the BSSID is not even known at
wpa_supplicant at this point in time when using drivers that perform BSS
selection internally. In those cases, the disconnect command needs to be
sent to the driver without the BSSID.

This fixes issues where the driver (or cfg80211 in particular) may be
left in mismatching state with wpa_supplicant when disconnection (e.g.,
due to a ctrl_iface command) happens between connection request and
association event.

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

11 years agoWPS: Add support for NFC connection handover with nfcpy
Jouni Malinen [Sun, 4 Nov 2012 14:04:42 +0000 (16:04 +0200)] 
WPS: Add support for NFC connection handover with nfcpy

This helper script can now handle both reading of a NFC tag and
initiation of NFC connection handover if a peer NFC device is touched.

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

11 years agoWPS: Move NFC tag processing into a separate function
Jouni Malinen [Sun, 4 Nov 2012 13:56:46 +0000 (15:56 +0200)] 
WPS: Move NFC tag processing into a separate function

This makes it cleaner to add processing of other NFC operations to the
python script.

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

11 years agoWPS: Move wpactrl setup into a separate function
Jouni Malinen [Sun, 4 Nov 2012 13:53:33 +0000 (15:53 +0200)] 
WPS: Move wpactrl setup into a separate function

This makes it easier to share this functionality for new NFC use cases.

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