mech_eap.git
12 years agoUse sched_scan in driver init
Luciano Coelho [Tue, 27 Sep 2011 19:21:31 +0000 (22:21 +0300)]
Use sched_scan in driver init

This patch uses sched_scan, if available, when the driver is
initialized. It also adds a couple of cancel operations where
appropriate.

Signed-off-by: Luciano Coelho <coelho@ti.com>
12 years agonl80211: Add scheduled scan support
Luciano Coelho [Tue, 27 Sep 2011 19:21:30 +0000 (22:21 +0300)]
nl80211: Add scheduled scan support

This commit adds scheduled scan support in the nl80211 driver.

Signed-off-by: Luciano Coelho <coelho@ti.com>
12 years agoAdd scheduled scan driver operations
Luciano Coelho [Tue, 27 Sep 2011 19:21:29 +0000 (22:21 +0300)]
Add scheduled scan driver operations

In new Linux kernel versions (>=3.0), nl80211 adds scheduled scan
capability. In order to use this feature to its full extent, we need
to support it in the wpa_supplicant core, so that it can also be used
by other drivers.

This commit adds initial scheduled scan support operations and events.

Signed-off-by: Luciano Coelho <coelho@ti.com>
12 years agoReorganize P2P and WPS scan code
Luciano Coelho [Sat, 15 Oct 2011 14:35:04 +0000 (17:35 +0300)]
Reorganize P2P and WPS scan code

Move some code to separate functions to reorganize the P2P and WPS
handling during scans. This makes the code a bit cleaner and is
needed for the scheduled scan implementation to avoid duplicated code.

Signed-off-by: Luciano Coelho <coelho@ti.com>
12 years agoFix object file list for hlr_auc_gw
Mukesh Agrawal [Sat, 15 Oct 2011 13:52:51 +0000 (16:52 +0300)]
Fix object file list for hlr_auc_gw

If CONFIG_NO_RANDOM_POOL is unset, src/crypto/random.o is linked
into hlr_auc_gw. However, in this configuration, random.o requires
symbols defined in src/utils/eloop.o. So add eloop.o to the object
file list for hlr_auc_gw.

12 years agoedit: Fix history prev/next selection
Jouni Malinen [Sat, 15 Oct 2011 11:03:35 +0000 (14:03 +0300)]
edit: Fix history prev/next selection

Commit 19ec1f262e67fe7094365d53ee177f900afdaad5 tried to fix some
cases for history prev selection, but it broke others. Fix this
properly by using a separate entry for the current edit line that
is not yet in history buffer.

12 years agonl80211: Add debug print for channel changes
Jouni Malinen [Sat, 15 Oct 2011 10:29:56 +0000 (13:29 +0300)]
nl80211: Add debug print for channel changes

12 years agoFix some forgotten comments in set_beacon to set_ap change
Jouni Malinen [Sat, 15 Oct 2011 10:15:24 +0000 (13:15 +0300)]
Fix some forgotten comments in set_beacon to set_ap change

12 years agonl80211: Use shorter monitor interface name for P2P GO
Jithu Jance [Sat, 15 Oct 2011 10:07:30 +0000 (13:07 +0300)]
nl80211: Use shorter monitor interface name for P2P GO

Currently the P2P Interface name[p2p-%s-%d] is reset when the P2P
Interface name reaches the "IFNAMSIZ" limit. Monitor interface name is
derived from p2p interface name with the addition of few characters
[mon.p2p-%s-%d] and hence Monitor interface name hits IFNAMSIZ limit
before P2P Interface name. Rename the monitor interface name to
mon-%s-%d to reduce the length to same with p2p-%s-%d.

12 years agoDisconnect STA when it fails to get added in kernel driver/firmware
Yogesh Ashok Powar [Sat, 15 Oct 2011 09:41:28 +0000 (12:41 +0300)]
Disconnect STA when it fails to get added in kernel driver/firmware

Data path for stations that get successfully associated to the
hostapd but fail to get added in the driver/firmware, will not
work. In such cases, hostapd should deauth and disconnect such
stations. In such scenario, hostapd should disconnect the STAs.

Sample output with following patch
wlan0: STA 0c:74:c2:9a:4c:59 IEEE 802.11: authenticated
wlan0: STA 0c:74:c2:9a:4c:59 IEEE 802.11: associated (aid 1)
wlan0: AP-STA-CONNECTED 0c:74:c2:9a:4c:59
wlan0: STA 0c:74:c2:9a:4c:59 IEEE 802.11: Could not add STA to kernel driver
wlan0: STA 0c:74:c2:9a:4c:59 IEEE 802.11: deauthenticated due to local deauth request

Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com>
Signed-off-by: Nishant Sarmukadam <nishants@marvell.com>
12 years agoFix NT-hash password use with integrated authentication server
B. J [Sat, 15 Oct 2011 09:13:27 +0000 (12:13 +0300)]
Fix NT-hash password use with integrated authentication server

The password_hash parameter was not copied in case of the integrated
authentication server (but was for RADIUS server). This broke EAP
authentication when the user entry used NT-hash.

12 years agoP2P: Fix wpabuf reuse on p2p_group_notif_noa()
Janusz Dziedzic [Wed, 12 Oct 2011 22:06:11 +0000 (01:06 +0300)]
P2P: Fix wpabuf reuse on p2p_group_notif_noa()

This currently unused function would have triggered wpabuf overflows
due to incorrect variable being reset to zero in the case the old
NoA wpabuf was large enough for the new data.

12 years agoP2P: Cleanup AP callbacks when removing the group
Janusz Dziedzic [Wed, 12 Oct 2011 18:06:39 +0000 (21:06 +0300)]
P2P: Cleanup AP callbacks when removing the group

Clear the P2P GO callback parameters when removing the group to avoid
using these for non-P2P AP mode.

This is a fix for the bug I found in the following scenario:

A) p2p_group_add
A) p2p_group_remove wlan0
A) add_n
A) set_n 0 ssid "testap"
A) set_n 0 key_mgmt NONE
A) set_n 0 mode 2
A) set_n 0 frequency 2412
A) enable_n 0

B) try connect to testap

Authentication request will be always rejected because of
HOSTAPD_ACL_REJECT and not cleaned callbacks when group removed.

12 years agoEAPOL auth: Disconnect after IEEE 802.1X failure
Jouni Malinen [Wed, 12 Oct 2011 17:07:16 +0000 (20:07 +0300)]
EAPOL auth: Disconnect after IEEE 802.1X failure

The EAPOL authenticator was previously forcing disconnection in the WPS
use case. However, this can be benefitial operation with any IEEE 802.1X
authentication mechanism and need not be limited to WPS. This helps some
use cases like EAP-FAST where provisioning may require two
authentication runs if the authentication server does not allow the PAC
provisioning step to be used for normal data connection. While the
station would be free to decide to re-associate in such a case, not all
stations do and as such, it helps if the AP does that instead of leaving
the association up with EAPOL state machine in HELD state for 60
seconds.

12 years agoEAP-FAST: Allow unprotected EAP-Failure in provisioning case
Jouni Malinen [Wed, 12 Oct 2011 17:05:02 +0000 (20:05 +0300)]
EAP-FAST: Allow unprotected EAP-Failure in provisioning case

While EAP-FAST uses protected success notification, RFC 5422, Section
3.5 points out a possibility of EAP-Failure being sent out even after
protected success notification in case of provisioning. Change the
EAP-FAST peer implementation to accept that exception to the protected
success notification. This allows the station to re-connect more quickly
to complete EAP-FAST connection in the case the server rejects the
initial attempt by only allowing it to use to provision a new PAC.

12 years agoP2P: Do not change SSID during GO negotiation
Jouni Malinen [Tue, 11 Oct 2011 15:29:31 +0000 (18:29 +0300)]
P2P: Do not change SSID during GO negotiation

If GO Negotiation Request (or in theory, also GO Negotiation Response)
frame is delivered multiple time for processing, the SSID of the group
could end up getting changed. This could result in possible issues if
the peer ended up using different SSID. To avoid this, make sure the
SSID does not get changed unless the negotiation is for a new group.

12 years agoClear OKC-based PMKSA caching entries if PMK is changed
Jouni Malinen [Sun, 2 Oct 2011 16:36:37 +0000 (19:36 +0300)]
Clear OKC-based PMKSA caching entries if PMK is changed

Whenever PMK gets changed (e.g., due to re-authentication), all PMKSA
caching entries that were created using the previous PMK needs to be
replaced. Previously, only the entry for the current AP was cleared.
Flush the other entries based on network_ctx matches to get rid of the
OKC entries. These entries can then be re-creating using OKC with the
new PMK.

12 years agodbus: Export max scan ssids supported by driver
Mohamed Abbas [Sun, 2 Oct 2011 10:27:09 +0000 (13:27 +0300)]
dbus: Export max scan ssids supported by driver

This is needed for network managers that want to know how
many SSIDs they can scan at the same time.

12 years agoSync with wireless-testing.git linux/nl80211.h
Jouni Malinen [Sun, 2 Oct 2011 10:16:42 +0000 (13:16 +0300)]
Sync with wireless-testing.git linux/nl80211.h

12 years agoDo not re-associate on SELECT_NETWORK to current network
Jithu Jance [Sun, 2 Oct 2011 10:12:43 +0000 (13:12 +0300)]
Do not re-associate on SELECT_NETWORK to current network

Signed-off-by: Jithu Jance <jithu@broadcom.com>
12 years agoAP: Use QoS nullfunc for connection poll
Johannes Berg [Sat, 1 Oct 2011 18:04:11 +0000 (21:04 +0300)]
AP: Use QoS nullfunc for connection poll

When polling a station that has been inactive for a while, hostapd currently
always uses a null data frame. This is a bit strange with uAPSD clients
(though it seems to mostly work) since the EOSP bit can never be set in a
non-QoS frame. Make hostapd use QoS null data frames for probing when the
station is a QoS STA.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
12 years agoP2P: Refresh peer entries on Probe Request RX
Marek Kwaczynski [Sat, 1 Oct 2011 17:40:14 +0000 (20:40 +0300)]
P2P: Refresh peer entries on Probe Request RX

Do not expire P2P peer entries if Probe Request frames are received from
them.

12 years agoWPS: Send AP Settings as a wrapped Credential attribute to ctrl_iface
Zhi Chen [Fri, 30 Sep 2011 19:26:37 +0000 (22:26 +0300)]
WPS: Send AP Settings as a wrapped Credential attribute to ctrl_iface

Wrap self-generated WPS credential for new AP settings and send that to
control interface to provide the needed information in
WPS-NEW-AP-SETTINGS for external processing.

12 years agoAllow wildcard SSID to be used with WPA-PSK if bssid is set
Zhi Chen [Fri, 30 Sep 2011 19:01:42 +0000 (22:01 +0300)]
Allow wildcard SSID to be used with WPA-PSK if bssid is set

This allows the AP to be selected based on the BSSID when WPA-PSK
is used with a passphrase. The PSK will be derived from the passphrase
after the SSID has been learned from scan results.

12 years agoFT: Add driver wrappers for FT with driver-based MLME/SME
Shan Palanisamy [Thu, 29 Sep 2011 21:05:29 +0000 (00:05 +0300)]
FT: Add driver wrappers for FT with driver-based MLME/SME

12 years agoGAS: Use off-channel operations for requests
Jouni Malinen [Thu, 29 Sep 2011 16:22:08 +0000 (19:22 +0300)]
GAS: Use off-channel operations for requests

This separates off-channel Action frame TX/RX from P2P into a generic
implementation that can now be used both for P2P and GAS needs.

12 years agoGAS: Add a generic GAS query module
Jouni Malinen [Wed, 28 Sep 2011 16:44:25 +0000 (19:44 +0300)]
GAS: Add a generic GAS query module

This implements GAS request mechanism that is aimed at being used to
replace use case specific GAS/ANQP implementations in the future.
Compared to the earlier implementation in P2P SD, this implementation
includes support for multiple concurrent requests and more thorough
validation of frames against the pending query data.

GAS header processing, including comeback and reassembly, are handled
within gas_query.c and the users of this module will only need to
provide the Query Request and process the (possibly reassembled)
Query Response.

12 years agoMove GAS/ANQP build routines to a separate file from P2P
Jouni Malinen [Tue, 27 Sep 2011 14:28:46 +0000 (17:28 +0300)]
Move GAS/ANQP build routines to a separate file from P2P

GAS/ANQP is a generic protocol and in no way specific to P2P, so move
routines used to build GAS/ANQP frames to a separate file that can be
shared for other uses than just P2P service discovery.

12 years agoP2P: Provide mechanism for figuring out p2p_scan_ie() buffer need
Jouni Malinen [Thu, 28 Apr 2011 13:14:35 +0000 (16:14 +0300)]
P2P: Provide mechanism for figuring out p2p_scan_ie() buffer need

The new function, p2p_scan_ie_buf_len(), can be used to figure out
how large a buffer needs to be allocated for p2p_scan_ie() use. This
makes it easier to add new data into the buffer without forcing all
callers to be updated to use a larger buffer.

12 years agoP2P: Fix group formation after previous commit
Jouni Malinen [Thu, 29 Sep 2011 18:48:07 +0000 (21:48 +0300)]
P2P: Fix group formation after previous commit

p2p_in_progress() have to ignore P2P_PROVISIONING state to allow
station mode (which includes P2P client) scan to work.

12 years agoP2P: Do not request station mode scans during P2P operations
Jouni Malinen [Thu, 29 Sep 2011 13:53:55 +0000 (16:53 +0300)]
P2P: Do not request station mode scans during P2P operations

The P2P search mechanism depends on the same scan functionality that
is used for station mode scans. If these operations are being used
at the same time, scan result processing is not handled properly.
Avoid unexpected behavior by delaying station mode scan requests
if a P2P operation is in progress.

Among other things, this allows the station mode connection attempt
to be continued after a P2P find or group formation has been completed
if the interface is available (i.e., when the P2P group uses a
separate virtual interface).

12 years agoP2P: Do not leave P2P scan handler registered if scan fails
Jouni Malinen [Thu, 29 Sep 2011 13:52:23 +0000 (16:52 +0300)]
P2P: Do not leave P2P scan handler registered if scan fails

If the initial attempt to start a scan for p2p_find fails, an error
is reported. However, the P2P scan handler and search state was
left behind. That can result in unexpected behavior when the next
non-P2P scan results are indicated. Avoid this by clearing the
P2P search state on failure.

12 years agoDo not enable bgscan when driver takes care of BSS selection
Jouni Malinen [Mon, 26 Sep 2011 12:17:01 +0000 (15:17 +0300)]
Do not enable bgscan when driver takes care of BSS selection

There is no need to request periodic bgscans when the driver claims
to have capability for roaming within ESS. Ignoring the bgscan
configuration allows the same configuration file to be used both
with drivers the handle roaming and with drivers that don't.

12 years agoSupport driver-based BSS selection in ap_scan=1 mode
Jouni Malinen [Mon, 26 Sep 2011 11:57:23 +0000 (14:57 +0300)]
Support driver-based BSS selection in ap_scan=1 mode

If the driver indicates that it supports BSS selection (including
roaming within an ESS) with WPA_DRIVER_FLAGS_BSS_SELECTION, modify
ap_scan=1 mode to behave like ap_scan=2 mode for BSS selection.

The initial scan is still done to avoid the need for strict
configuration of or security parameters (e.g., to figure out whether
TKIP or CCMP is being used as the group cipher). However, when
requesting the driver to connect, the bssid and freq parameters are
not provided to leave the driver in control of selecting which BSS
to use and to allow the driver to decide when to roam.

12 years agonl80211: Add driver flag for firmware-based BSS selection
Vivek Natarajan [Mon, 26 Sep 2011 11:26:55 +0000 (14:26 +0300)]
nl80211: Add driver flag for firmware-based BSS selection

This new flag can be used to change wpa_supplicant behavior in the
default ap_scan=1 mode to move BSS selection into the driver (likely
firmware). This commit is only adding the flag; separate commits
will be used to change the actual connection/roaming behavior.

12 years agoRename and fix ANQP definitions to match IEEE Std 802.11u-2011
Jouni Malinen [Thu, 8 Sep 2011 17:52:23 +0000 (20:52 +0300)]
Rename and fix ANQP definitions to match IEEE Std 802.11u-2011

12 years agoatheros: Allow flattened driver include file directories
Mathieu Olivari [Mon, 26 Sep 2011 08:49:22 +0000 (11:49 +0300)]
atheros: Allow flattened driver include file directories

Remove the full driver path to the driver header file to make it
easier to use common include directory for all driver headers.

12 years agoRemove EAP-TTLSv1 and TLS/IA
Jouni Malinen [Sun, 25 Sep 2011 18:28:32 +0000 (21:28 +0300)]
Remove EAP-TTLSv1 and TLS/IA

These protocols seem to be abandoned: latest IETF drafts have expired
years ago and it does not seem likely that EAP-TTLSv1 would be
deployed. The implementation in hostapd/wpa_supplicant was not complete
and not fully tested. In addition, the TLS/IA functionality was only
available when GnuTLS was used. Since GnuTLS removed this functionality
in 3.0.0, there is no available TLS/IA implementation in the latest
version of any supported TLS library.

Remove the EAP-TTLSv1 and TLS/IA implementation to clean up unwanted
complexity from hostapd and wpa_supplicant. In addition, this removes
any potential use of the GnuTLS extra library.

12 years agoGnuTLS: Fix build bit various GnuTLS versions
Jouni Malinen [Sun, 25 Sep 2011 16:32:28 +0000 (19:32 +0300)]
GnuTLS: Fix build bit various GnuTLS versions

This fixes some build issues in GnuTLS wrapper to be compatible with
at least following GnuTLS versions: 2.2.5, 2.4.3, 2.6.6, 2.8.6,
2.10.5, 2.12.11, 3.0.3.

12 years agoTLS: Add support for TLS v1.1 (RFC 4346) with internal TLS
Jouni Malinen [Sun, 25 Sep 2011 14:24:46 +0000 (17:24 +0300)]
TLS: Add support for TLS v1.1 (RFC 4346) with internal TLS

This is disabled by defautl and can be enabled with CONFIG_TLSV11=y
build configuration parameter.

12 years agoTLS: Do not enforce in-place processing in tlsv1_record_send()
Jouni Malinen [Sun, 25 Sep 2011 14:11:52 +0000 (17:11 +0300)]
TLS: Do not enforce in-place processing in tlsv1_record_send()

In preparation for record layer format changes, modify
tlsv1_record_send() to use separate buffers for payload
and the output message.

12 years agoTLS: Add protection against record layer CBC attacks
Jouni Malinen [Sun, 25 Sep 2011 13:57:35 +0000 (16:57 +0300)]
TLS: Add protection against record layer CBC attacks

Instead of using separate bad_record_mac and decryption_failed alerts,
use only bad_record_mac alert regardless of how the CBC decryption
failed. This provides less information to attackers that could modify
packets. In addition, instead of returning immediately on error, run
through the MAC check to make timing attacks more difficult.

12 years agoTLS: Avoid unnecessary copying of encrypted data at record layer
Jouni Malinen [Sun, 25 Sep 2011 13:52:46 +0000 (16:52 +0300)]
TLS: Avoid unnecessary copying of encrypted data at record layer

When the received data will be decrypted, there is no need to first
copy it and then handle decryption in-place when decryption step can
take care of both operations.

12 years agoTLS: Fix record layer protocol version validation
Jouni Malinen [Sun, 25 Sep 2011 13:48:06 +0000 (16:48 +0300)]
TLS: Fix record layer protocol version validation

TLS v1.0 and v1.1 RFCs were not exactly clear on the use of the
protocol version in record later. As such, accept any {03,xx} value
to remain compatible with existing implementations and new protocol
versions.

12 years agoP2P: Fix a race condition in some P2P command sequencies
Jouni Malinen [Thu, 22 Sep 2011 19:43:03 +0000 (22:43 +0300)]
P2P: Fix a race condition in some P2P command sequencies

The p2p->drv_in_listen variable is used to track Listen state operations
in the driver. This is cleared when the driver reports that the Listen
state has ended (p2p_listen_end() gets called). However, it is possible
that the driver does not indicate that if the Listen state is canceled.
This can apparently happen in some cases where p2p_connect command is
issues while the Listen state is in progress.

Work around this issue by clearing p2p->drv_in_listen when Listen state
is stopped as part of p2p_stop operation. This allows the P2P module to
process CONNECT_LISTEN timeout in p2p_timeout_connect_listen() to move
to CONNECT state, e.g., when starting GO Negotiation after Device
Discoverability mechanism.

12 years agoatheros: Fix WEXT SIOCGIWESSID use with WE-21 and newer
Subrat Dash [Thu, 22 Sep 2011 12:42:03 +0000 (15:42 +0300)]
atheros: Fix WEXT SIOCGIWESSID use with WE-21 and newer

The "too long" buffer (32+1 octets) prevented AP from starting up with
32 octet SSID with WE-21 and newer. Fix this by reducing the
SIOCGIWESSID buffer length.

12 years agoD-Bus/P2P: Treat PIN as string
Reinette Chatre [Tue, 13 Sep 2011 16:27:29 +0000 (09:27 -0700)]
D-Bus/P2P: Treat PIN as string

wpa_supplicant returns the PIN in reply to the connect method. Treating
this value as an integer runs the risk of not returning the correct
value if the first digit(s) happens to be a zero(es). To return the
correct PIN it needs to be returned as a string.

Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: Angie Chinchilla <angie.v.chinchilla@intel.com>
12 years agowpa_supplicant: AP mode, set drv_flags
Janusz Dziedzic [Wed, 21 Sep 2011 07:28:38 +0000 (09:28 +0200)]
wpa_supplicant: AP mode, set drv_flags

In AP/P2P_GO mode we should have correct hostapd drv_flags.

12 years agoD-Bus/P2P: Support all discovery types
Reinette Chatre [Fri, 26 Aug 2011 23:55:58 +0000 (16:55 -0700)]
D-Bus/P2P: Support all discovery types

The default discovery type is to search for devices only on social
channels. Expand this to also support an initial full scan followed by the
scan of social channels as well as the progressive scan that scans through
all the channels in the Search state rounds. This does not change the
default of scanning only social channels although there is currently a
discrepancy wrt the default used by wpa_cli, which is the full scan first.

Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: Angie Chinchilla <angie.v.chinchilla@intel.com>
12 years agoD-Bus: Fix memory leak when using array of array of bytes
Reinette Chatre [Fri, 26 Aug 2011 23:55:29 +0000 (16:55 -0700)]
D-Bus: Fix memory leak when using array of array of bytes

When parsing a dict entry which is an array of an array of bytes the entry
representing the dict entry has DBUS_TYPE_ARRAY as its type and
WPAS_DBUS_TYPE_ARRAY as its array_type. The function freeing this parsed
data incorrectly tested the entry type for WPAS_DBUS_TYPE_ARRAY while doing
no testing of this value for array_type. This results in a memory leak
whenever a D-Bus message with this type of data is parsed.

Messages affected are:
fi.w1.wpa_supplicant1.Interface.P2PDevice
using RequestedDeviceTypes with Find method
using SecondaryDeviceTypes or VendorExtension with P2PDeviceProperties

fi.w1.wpa_supplicant1.Group
using WPSVendorExtensions with Properties property

All of the above messages are parsed with the same function,
wpa_dbus_dict_get_entry, so the assignment of the entry's type and
array_type is consistent. The parsed data is also consistently freed with
the same function, wpa_dbus_dict_entry_clear, so we can use the same checks
to free the data correctly.

Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: Angie Chinchilla <angie.v.chinchilla@intel.com>
12 years agoP2P: Fix action done handling for driver-based off-channel TX
Johannes Berg [Tue, 20 Sep 2011 09:59:09 +0000 (11:59 +0200)]
P2P: Fix action done handling for driver-based off-channel TX

The action done handling needs to abort an off-channel period since one
might have been used for example for GO negotiation and after action
done the code assumes it can start a new off-channel period.

This fixes a bug I introduced when adding support for
in-kernel off-channel transmissions.

Reported-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
12 years agoFix typos found by codespell
Pavel Roskin [Wed, 21 Sep 2011 21:43:59 +0000 (00:43 +0300)]
Fix typos found by codespell

Signed-off-by: Pavel Roskin <proski@gnu.org>
12 years agodoc: Use correct path for kerneldoc2doxygen.pl
Pavel Roskin [Wed, 21 Sep 2011 14:59:19 +0000 (10:59 -0400)]
doc: Use correct path for kerneldoc2doxygen.pl

Refer to kerneldoc2doxygen.pl as doc/kerneldoc2doxygen.pl since doxygen
is run in the top-level source directory.

Signed-off-by: Pavel Roskin <proski@gnu.org>
12 years agowext: Remove write-only variable ap_num
Pavel Roskin [Wed, 21 Sep 2011 14:59:07 +0000 (10:59 -0400)]
wext: Remove write-only variable ap_num

Signed-off-by: Pavel Roskin <proski@gnu.org>
12 years agonl80211: Support PMKSA candidate events
Jouni Malinen [Wed, 21 Sep 2011 13:14:41 +0000 (16:14 +0300)]
nl80211: Support PMKSA candidate events

This adds support for RSN pre-authentication with nl80211 interface and
drivers that handle roaming internally (i.e., wpa_supplicant is not
responsible for requesting scan results that provide the needed
information without these events).

12 years agoSync with wireless-testing.git linux/nl80211.h
Jouni Malinen [Wed, 21 Sep 2011 13:14:00 +0000 (16:14 +0300)]
Sync with wireless-testing.git linux/nl80211.h

12 years agowlantest: Verify that comeback assoc resp includes correct type
Jouni Malinen [Tue, 20 Sep 2011 17:13:18 +0000 (20:13 +0300)]
wlantest: Verify that comeback assoc resp includes correct type

The Timeout Interval element needs to use Association Comeback time
for the case when (Re)Association Response frame uses Status Code 30.
Verify this before incrementing the (re)assocresp_comeback counters.

12 years agonl80211: Work around EALREADY from connect command
Jouni Malinen [Sun, 18 Sep 2011 18:26:55 +0000 (21:26 +0300)]
nl80211: Work around EALREADY from connect command

cfg80211 does not currently allow NL80211_CMD_CONNECT when there
is already an association. This can result in wpa_supplicant being
unable to request a connection if the interface is already in
connected state. Work around this by requesting disconnection if
the connect command fails with EALREADY error. This allows
wpa_supplicant to recover from the unexpected state and complete
the connect request on next attempt.

12 years agoeapol_test: Add option for writing server certificate chain to a file
Jouni Malinen [Sat, 17 Sep 2011 19:42:54 +0000 (22:42 +0300)]
eapol_test: Add option for writing server certificate chain to a file

eapol_test command line argument -o<file> can now be used to request
the received server certificate chain to be written to the specified
file. The certificates will be written in PEM format. [Bug 391]

12 years agoRSN: Add a debug message when considing addition of OKC entry
Jouni Malinen [Fri, 16 Sep 2011 15:45:15 +0000 (18:45 +0300)]
RSN: Add a debug message when considing addition of OKC entry

12 years agoFix proactive_key_caching configuration to WPA code
Jouni Malinen [Fri, 16 Sep 2011 15:44:06 +0000 (18:44 +0300)]
Fix proactive_key_caching configuration to WPA code

The proactive_key_caching parameter was missed in mapping the
config_ssid data into the WPA state machine configuration. This
prevented addition of PMKSA cache entries based on PMKSA caching
candidate events.

12 years agoSync with wireless-testing.git linux/nl80211.h
Jouni Malinen [Fri, 16 Sep 2011 14:13:08 +0000 (17:13 +0300)]
Sync with wireless-testing.git linux/nl80211.h

12 years agowpa_supplicant AP: Set static WEP keys if configured
Jouni Malinen [Thu, 15 Sep 2011 12:04:46 +0000 (15:04 +0300)]
wpa_supplicant AP: Set static WEP keys if configured

This is needed to configure static WEP keys to the driver through the
hostapd configuration structures.

12 years agoAP: Set pairwise/group cipher for non-WPA modes
Jouni Malinen [Thu, 15 Sep 2011 12:02:59 +0000 (15:02 +0300)]
AP: Set pairwise/group cipher for non-WPA modes

This is needed to avoid confusing configuration in some nl80211
drivers that the new AP mode configuration alternatives for
setting security policy.

12 years agoFix AP build without CONFIG_WPS=y
Jouni Malinen [Mon, 12 Sep 2011 19:23:45 +0000 (22:23 +0300)]
Fix AP build without CONFIG_WPS=y

Make the WPS processing of (Re)Association Request frame IEs conditional
on WPS support. This fixes a build issue with wps_is_20() not being
defined and makes the non-WPS build a bit smaller.

12 years agoRemove time.h include from utils/includes.h
Jouni Malinen [Mon, 12 Sep 2011 19:15:13 +0000 (22:15 +0300)]
Remove time.h include from utils/includes.h

os_*() wrappers should be used instead of functions from time.h.
Removing the header from includes.h enforces this. os_unix.c can
include this its uses are valid wrapper calls. wps_upnp.c uses
gmtime() for which there is no os_*() wrapper available yet, so
allow it to use time.h, too. Similarly, allow dump_state.c to
use time.h for ctime().

12 years agoRemove references to time_t/time()
Per Ekman [Mon, 12 Sep 2011 19:14:30 +0000 (22:14 +0300)]
Remove references to time_t/time()

Use os_time() in AP mode instead of direct time() calls.

12 years agonl80211: Cancel not yet started r-o-c
Johannes Berg [Sat, 10 Sep 2011 19:57:41 +0000 (22:57 +0300)]
nl80211: Cancel not yet started r-o-c

Currently, the following can happen:

1) P2P state machine requests R-O-C
2) user changes their mind and aborts
3) P2P state machine aborts R-O-C
4) driver_nl80211 rejects abort since there
   was no notification about the start yet
5) R-O-C period start notification from kernel
6) P2P state machine requests new R-O-C
7) this overlaps with old R-O-C -- iwlwifi driver
   can't handle that and returns -EBUSY
8) state machine stops dead in its tracks

The reason is that the abort isn't going through properly. Instead of
tracking whether a R-O-C is active in driver_nl80211, track whether one
was requested to avoid this scenario.

Reported-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
12 years agoP2P: Remove CCK supported rates when running P2P scan
Rajkumar Manoharan [Sat, 10 Sep 2011 19:40:30 +0000 (22:40 +0300)]
P2P: Remove CCK supported rates when running P2P scan

This allows drivers to disable CCK rates from Probe Request frames.
For nl80211, this is currently applying only to the supported rates
element(s), but this mechanism could be extended to address TX rate
control masking, too, to lessen need for global rate disabling.

Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
12 years agonl80211: Automatically use concurrent P2P if possible
Johannes Berg [Sat, 10 Sep 2011 18:52:21 +0000 (21:52 +0300)]
nl80211: Automatically use concurrent P2P if possible

Since the kernel can now advertise P2P concurrent support by advertising
interface combinations, we can take advantage of that and automatically
use P2P_CONCURRENT / P2P_MGMT_AND_NON_P2P for drivers that advertise
support.

Keep driver_param=use_p2p_group_interface=1 for anyone not advertising
interface combinations in their drivers yet.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
12 years agoMake sure wpa_proto gets cleared for WPS and non-WPA connections
Edward Lu [Thu, 8 Sep 2011 14:51:08 +0000 (17:51 +0300)]
Make sure wpa_proto gets cleared for WPS and non-WPA connections

This is needed to fix the wpa_proto association parameter for drivers
that select AP based on security parameters internally.

12 years agoP2P: Allow advertisement config methods to be limited
Jouni Malinen [Thu, 8 Sep 2011 13:48:06 +0000 (16:48 +0300)]
P2P: Allow advertisement config methods to be limited

The default config methods was hardcoded to claim support for
PushButton, Display, and Keypad. While these are supported by
most P2P devices, there may be some cases where it is convenient
to be able to disable a specific config method. Use config_methods
configuration parameter to set the default values for Config Methods
in the P2P Device Info attribute.

12 years agoP2P: Remove Label config method
Jouni Malinen [Thu, 8 Sep 2011 13:40:03 +0000 (16:40 +0300)]
P2P: Remove Label config method

The P2P specification (3.1.4.3) disallows use of the Label configuration
method between two P2P devices. This was previously enforced at upper
level, but the obsolete code can be removed from wpa_supplicant. This
adds a bit more strict enforcement of the policy, but should not result
in practical differences since no known P2P implementation uses Label
config method.

12 years agoFlush PMKSA cache entries and invalidate EAP state on network changes
Jouni Malinen [Wed, 7 Sep 2011 14:46:00 +0000 (17:46 +0300)]
Flush PMKSA cache entries and invalidate EAP state on network changes

If a network configuration block is removed or modified, flush
all PMKSA cache entries that were created using that network
configuration. Similarly, invalidate EAP state (fast re-auth).

The special case for OKC on wpa_supplicant reconfiguration
(network_ctx pointer change) is now addressed as part of the
PMKSA cache flushing, so it does not need a separate mechanism
for clearing the network_ctx values in the PMKSA cache.

12 years agoCall wpas_notify_network_removed() on REMOVE_NETWORK
Jouni Malinen [Wed, 7 Sep 2011 14:44:00 +0000 (17:44 +0300)]
Call wpas_notify_network_removed() on REMOVE_NETWORK

This was done for the case where all networks are being removed,
but the case where a single network is removed was forgotten.

12 years agoClear driver PMKSA cache entry on PMKSA cache expiration
Jouni Malinen [Wed, 7 Sep 2011 13:31:09 +0000 (16:31 +0300)]
Clear driver PMKSA cache entry on PMKSA cache expiration

If the driver maintains its own copy of the PMKSA cache, we need to
clear an entry from the driver whenever wpa_supplicant is dropping
an old PMKSA cache entry.

12 years agoFix SIM/USIM simulator build to include AES encryption function
Jouni Malinen [Wed, 7 Sep 2011 13:17:08 +0000 (16:17 +0300)]
Fix SIM/USIM simulator build to include AES encryption function

12 years agoFix Deauth/Disassoc callback handling with test frames
Jouni Malinen [Tue, 6 Sep 2011 18:03:02 +0000 (21:03 +0300)]
Fix Deauth/Disassoc callback handling with test frames

The Deauth/Disassoc TX status callbacks were ending up kicking the
station entry from kernel driver when test functionality was used to
inject Deauth/Disassoc frames from the AP with the purpose of leaving
the local association in place. Fix this by using STA flags to figure
out whether there was a pending callback for the frame that we need
to act on.

In addition, add forgotten functionality for the Disassoc TX status
callback to match the behavior with Deauth.

12 years agoWPS: Add 'wpa_cli wps_pin get' for generating random PINs
Jouni Malinen [Fri, 2 Sep 2011 18:29:06 +0000 (21:29 +0300)]
WPS: Add 'wpa_cli wps_pin get' for generating random PINs

This can be used, e.g., in a UI to generate a PIN without
starting WPS (or P2P) operation.

12 years agonl80211: Fix WPA_VERSIONS attribute for Connect command
Jouni Malinen [Fri, 2 Sep 2011 17:40:23 +0000 (20:40 +0300)]
nl80211: Fix WPA_VERSIONS attribute for Connect command

The previous code was trying to figure out which WPA version is
used based on the extra IEs requested for Association Request. That
did not work properly in cases where non-WPA networks are used with
some extra IEs. Fix this by using more robust mechanism for passing
the WPA versions from core wpa_supplicant to the driver_ops
associate().

12 years agoAndroid: Include libcrypto and libssl only if CONFIG_TLS=openssl
Jouni Malinen [Fri, 2 Sep 2011 13:16:22 +0000 (16:16 +0300)]
Android: Include libcrypto and libssl only if CONFIG_TLS=openssl

12 years agoAndroid: Modify wireless_copy.h to fix Android build
Jouni Malinen [Thu, 1 Sep 2011 15:51:09 +0000 (18:51 +0300)]
Android: Modify wireless_copy.h to fix Android build

12 years agoReduce debug verbosity on global ctrl_iface PING command
Jouni Malinen [Thu, 1 Sep 2011 15:16:37 +0000 (18:16 +0300)]
Reduce debug verbosity on global ctrl_iface PING command

This matches with the earlier change that did the same for the
per-interface ctrl_iface commands.

12 years agoWPS: Set Probe Request config methods based on configuration
Bharat Chakravarty [Thu, 1 Sep 2011 12:24:45 +0000 (15:24 +0300)]
WPS: Set Probe Request config methods based on configuration

Instead of hardcoding the Config Methods attribute value in Probe
Request frames, set this based on the configured parameter
config_methods to allow correct set of methods to be advertised.

12 years agoWPS: Set RF bands based on driver capabilities
Bharat Chakravarty [Wed, 31 Aug 2011 14:53:55 +0000 (17:53 +0300)]
WPS: Set RF bands based on driver capabilities

Instead of hardcoding support for both 2.4 GHz and 5 GHz bands,
use driver capabilities to figure out which bands are supported.

12 years agoWPS ER: Fix UPnP XML Device Description parser to find correct device
Jouni Malinen [Wed, 31 Aug 2011 10:56:03 +0000 (13:56 +0300)]
WPS ER: Fix UPnP XML Device Description parser to find correct device

The device description file may include multiple devices. Improve the
simplistic parser by first trying to find the WFADevice:1 device before
fetching the device parameters. While this is still far from complete
XML parsing, this should address the most common root device
specifications.

12 years agonl80211: Support AP mode probe/action frame TX/RX without monitor iface
Jouni Malinen [Mon, 29 Aug 2011 11:26:55 +0000 (14:26 +0300)]
nl80211: Support AP mode probe/action frame TX/RX without monitor iface

This allows non-mac80211 drivers to report received Probe Request
frames to user space and Probe Response and Action frames to be sent
from user space when using AP/P2P GO mode.

12 years agoDelay STA entry removal until Deauth/Disassoc TX status in AP mode
Jouni Malinen [Sun, 28 Aug 2011 20:07:02 +0000 (23:07 +0300)]
Delay STA entry removal until Deauth/Disassoc TX status in AP mode

This allows the driver to use PS buffering of Deauthentication and
Disassociation frames when the STA is in power save sleep. The STA
entry (and PTK) will be removed from the kernel only after the
Deauth/Disassoc has been transmitted (e.g., when the STA wakes up).
A hardcoded two second timeout is used to limit the length of this
window should the driver fail to deliver the frame (e.g., the STA
is out of range and does not wake up). The kernel STA entry is
marked unauthorized during the wait to avoid accepting Data
frames from the STA that we have decided to disconnect.

This behavior is available only with drivers that provide TX status
events for Deauth/Disassoc frames (nl80211 at this point). Other
drivers continue to use the previous behavior where the STA entry
is removed immediately.

12 years agoEAP: Add "expanded" EAP type to get_name functions
Jouni Malinen [Sun, 28 Aug 2011 16:23:16 +0000 (19:23 +0300)]
EAP: Add "expanded" EAP type to get_name functions

12 years agowlantest: Allow injection of unprotected frames to unknown BSS
Jouni Malinen [Sun, 28 Aug 2011 16:19:38 +0000 (19:19 +0300)]
wlantest: Allow injection of unprotected frames to unknown BSS

12 years agoWPS: Wait for EAPOL-Start unless WPS 2.0 station as workaround
Jouni Malinen [Sun, 28 Aug 2011 16:16:59 +0000 (19:16 +0300)]
WPS: Wait for EAPOL-Start unless WPS 2.0 station as workaround

Extend the code that waits for the station to send EAPOL-Start before
initiating EAPOL authenticator operations to cover the case where the
station includes WPS IE in (Re)Association Request frame if that IE
does not include support for WPS 2.0. While this should not really
be needed, this may help with some deployed WPS 1.0 stations that do
not support EAPOL operations correctly and may get confused of the
EAP-Request/Identity packets that would show up twice if EAPOL-Start
is transmitted.

12 years agoProvide extra IEs for AP mode management frames with set_ap
Jouni Malinen [Fri, 26 Aug 2011 18:14:25 +0000 (21:14 +0300)]
Provide extra IEs for AP mode management frames with set_ap

Drivers that build Beacon, Probe Response, and (Re)Association
Response frames can use this information to and WPS and P2P IE
when needed.

12 years agoAdd support for setting SSID hiding mode through set_ap()
Jouni Malinen [Fri, 26 Aug 2011 18:12:47 +0000 (21:12 +0300)]
Add support for setting SSID hiding mode through set_ap()

12 years agoAdd crypto parameters to set_ap() command separately
Jouni Malinen [Fri, 26 Aug 2011 18:11:42 +0000 (21:11 +0300)]
Add crypto parameters to set_ap() command separately

This helps drivers that build the Beacon and Probe Response frames
internally.

12 years agoSync with include/linux/nl80211.h in wireless-testing.git
Jouni Malinen [Fri, 26 Aug 2011 18:09:08 +0000 (21:09 +0300)]
Sync with include/linux/nl80211.h in wireless-testing.git

12 years agoWPS: Drop responses from ER to a STA that is not in WPS protocol
Jouni Malinen [Fri, 12 Aug 2011 08:58:32 +0000 (11:58 +0300)]
WPS: Drop responses from ER to a STA that is not in WPS protocol

If an ER tries to send a message to a STA that is not in the middle
of WPS protocol, do not try to deliver that. This can help with issues
where an ER takes long time to reply to M1 and another Registrar has
already completed negotiation.

12 years agoMake sure that EAP callbacks are not done if state machine has been removed
Jouni Malinen [Fri, 12 Aug 2011 08:56:44 +0000 (11:56 +0300)]
Make sure that EAP callbacks are not done if state machine has been removed

It is possible to get a response for a pending EAP callback after the
EAP state machine has already completed its work or has timed out. For
those cases, make sure that the callback function is not delivered since
it could result in NULL pointer dereferences.

12 years agoWPS: Fix M2/M2D Config Methods to include PushButton even if PBC not in use
Jouni Malinen [Thu, 11 Aug 2011 14:03:57 +0000 (17:03 +0300)]
WPS: Fix M2/M2D Config Methods to include PushButton even if PBC not in use

The Config Methods attribute in M2 and M2D messages is supposed to
indicate which configuration methods are supported by the Registrar. As
such, it should not depend on whether PBC mode is currently active or
not. That will only affect the Selected Registrar Config Methods and
Device Password ID attributes.

12 years agoWPS: Fix default virt/phy pushbutton config method setting
Jouni Malinen [Thu, 11 Aug 2011 13:51:40 +0000 (16:51 +0300)]
WPS: Fix default virt/phy pushbutton config method setting

Instead of always adding PHY PushButton config method, only add this
if neither virtual nor physical push button is advertised.

12 years agoAdd SSID as a separate item in AP mode Beacon setup
Jouni Malinen [Wed, 10 Aug 2011 10:29:32 +0000 (13:29 +0300)]
Add SSID as a separate item in AP mode Beacon setup

This makes it easier for drivers that need the SSID to get it from the
Beacon setup operation without having to parse the Beacon IEs.