mech_eap.git
12 years agoProcess RSN pre-authentication candidates when skipping roam hostap-1-bp
Jouni Malinen [Sun, 30 Oct 2011 20:37:12 +0000 (22:37 +0200)]
Process RSN pre-authentication candidates when skipping roam

wpa_supplicant_rsn_preauth_scan_results() needs to be called to
update RSN pre-authentication candidates. This cannot be done before
the wpa_supplicant_connect() call on the first association, but when
trying to figure out whether to roam, it is fine to do so for the
case when roaming is skipped.

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

12 years agoConfigure new GTK/IGTK to driver in case of TKIP countermeasures
Yoni Divinsky [Sun, 30 Oct 2011 20:19:49 +0000 (22:19 +0200)]
Configure new GTK/IGTK to driver in case of TKIP countermeasures

The GTK is renewed in the hostapd after a MIC attack dissassociation
without informing the driver, causing decryption failures. This patch
sends the new GTK/IGTK to the driver after it is updated by the hostapd.

Signed-off-by: Yoni Divinsky <yoni.divinsky@ti.com>
12 years agoWPS: Send the credential when learning AP params in registrar role
Olivier Sobrie [Sun, 30 Oct 2011 20:10:40 +0000 (22:10 +0200)]
WPS: Send the credential when learning AP params in registrar role

When the supplicant acts as a registrar to learn the access point
parameters send the credentials to the wpa_cli interface after
receiving the 7th message. This is needed for proper behavior with
wps_cred_processing set to 1 or 2.

Without this patch, after the 7th message you got the WPS-CRED-RECEIVED
notification without the credentials. This was because the cred_attr and
cred_attr_len were not filled in in the wps structure.

Signed-off-by: Olivier Sobrie <olivier@sobrie.be>
12 years agorandom: Improve error messages about writing to entropy file
Pavel Roskin [Sun, 30 Oct 2011 19:50:22 +0000 (21:50 +0200)]
random: Improve error messages about writing to entropy file

12 years agoClean up debug dump for scan results sorting
Jouni Malinen [Sun, 30 Oct 2011 18:33:08 +0000 (20:33 +0200)]
Clean up debug dump for scan results sorting

There is not much need for showing the interim qsort steps, so just show
the ordered results.

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

12 years agoPrefer 5 GHz networks over 2.4 GHz networks
Gary Morain [Fri, 5 Aug 2011 23:23:12 +0000 (16:23 -0700)]
Prefer 5 GHz networks over 2.4 GHz networks

In scan.c, merge a channel's noise value into the scan results. When
comparing scan results, compute the signal-to-noise ratio and use it
when available. Prefer a 5 GHz network if its SNR is really big (> 30)
or if its SNR is relatively close to the other network's.

12 years agoIgnore Michael MIC failure reports if cipher is not TKIP
Jouni Malinen [Sun, 30 Oct 2011 10:49:26 +0000 (12:49 +0200)]
Ignore Michael MIC failure reports if cipher is not TKIP

Some stations have been reported to send EAPOL-Key Error Reports
indicating Michael MIC failures even when the cipher is not TKIP
(e.g., when the network is using only CCMP). Ignore such reports
to avoid starting TKIP countermeasures unnecessarily. This can
prevent certaint types of denial of service attacks by insiders,
but mostly this is to work around invalid station implementations.

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

12 years agoMove Michael MIC error report processing into separate function
Jouni Malinen [Sun, 30 Oct 2011 10:21:08 +0000 (12:21 +0200)]
Move Michael MIC error report processing into separate function

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

12 years agoFix TKIP countermeasures stopping in deinit paths
Jouni Malinen [Sun, 30 Oct 2011 10:43:30 +0000 (12:43 +0200)]
Fix TKIP countermeasures stopping in deinit paths

The eloop timeout to stop TKIP countermeasures has to be canceled
on deinit path to avoid leaving bogus timeouts behind.

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

12 years agoImplement control request replies for the D-Bus interface
Dan Williams [Mon, 24 Oct 2011 16:09:06 +0000 (11:09 -0500)]
Implement control request replies for the D-Bus interface

Add a D-Bus mechanism for clients to respond to the NetworkRequest
signal.

Signed-off-by: Dan Williams <dcbw@redhat.com>
12 years agoMake control response processing available to other control interfaces
Dan Williams [Mon, 24 Oct 2011 16:07:02 +0000 (11:07 -0500)]
Make control response processing available to other control interfaces

The D-Bus interface wants to use it too, so it makes sense
to have it generic.

Signed-off-by: Dan Williams <dcbw@redhat.com>
12 years agoAdd wpa_supplicant_ctrl_req_from_string()
Dan Williams [Mon, 24 Oct 2011 16:04:40 +0000 (11:04 -0500)]
Add wpa_supplicant_ctrl_req_from_string()

Converts from a string to a control request enum when input
from a control interface is received. Will be used by a
subsequent patch.

Signed-off-by: Dan Williams <dcbw@redhat.com>
12 years agodbus: Implement EAP SM control request signals
Dan Williams [Mon, 24 Oct 2011 16:03:04 +0000 (11:03 -0500)]
dbus: Implement EAP SM control request signals

Add a D-Bus signal for EAP SM requests. This signal is emitted on the
Interface object so that clients only have to listen to one object for
requests rather than to all network objects. This signal is analogous
to the socket control interface's CTRL-REQ- request.

Signed-off-by: Dan Williams <dcbw@redhat.com>
12 years agoUse an enum for EAP SM requests
Dan Williams [Mon, 24 Oct 2011 16:00:19 +0000 (11:00 -0500)]
Use an enum for EAP SM requests

Control requests will be extended for non-EAP uses later, so it makes
sense to have them be generic. Furthermore, having them defined as an
enum is easier for processing internally, and more generic for control
interfaces that may not use field names. The public ctrl_req_type /
field_name conversion function will be used later by the D-Bus control
interface too.

Signed-off-by: Dan Williams <dcbw@redhat.com>
12 years agoEAP-TTLS peer: Fix user input during implicit identity request
Jouni Malinen [Sun, 30 Oct 2011 10:02:20 +0000 (12:02 +0200)]
EAP-TTLS peer: Fix user input during implicit identity request

Special processing is needed to handle EAP user request for
identity or password at the beginning of Phase 2 when the implicit
identity request is used. data->pending_phase2_req needs to be set
to an empty buffer in that case to avoid re-processing the previous
part of TLS negotiation when the user enters the needed information.

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

12 years agoSkip rate set matching if BSS frequency is not known
Jouni Malinen [Sun, 30 Oct 2011 09:41:22 +0000 (11:41 +0200)]
Skip rate set matching if BSS frequency is not known

At least with driver_test.c, the BSS table may not include frequency
information. In such a case, we need to skip rate set matching during
BSS selection to avoid rejecting valid AP.

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

12 years agoP2P: Indicate scan during group formation as P2P probe
Jouni Malinen [Sat, 29 Oct 2011 20:02:47 +0000 (23:02 +0300)]
P2P: Indicate scan during group formation as P2P probe

The interface may not yet have been set to P2P client mode immediately
after GO Negotiation when doing the scan before association request.
Consequently, the scan request in this state has to specify that the
specific P2P probe mode is used to disable IEEE 802.11b rates.

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

12 years agonl80211: Disable IEEE 802.11b rates only for P2P iftypes
Jouni Malinen [Sat, 29 Oct 2011 19:46:58 +0000 (22:46 +0300)]
nl80211: Disable IEEE 802.11b rates only for P2P iftypes

Instead of hardcoding IEEE 802.11b rates to be disabled whenever
P2P support is built in and supported by the driver, do this only
when an interface is set to P2P mode (both when adding a new
interface and when changing the interface mode). This re-enables
use of IEEE 802.11b APs with CONFIG_P2P=y builds.

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

12 years agoRemove disable_11b_rates() driver_ops
Jouni Malinen [Sat, 29 Oct 2011 19:25:28 +0000 (22:25 +0300)]
Remove disable_11b_rates() driver_ops

This function was used unconditionally if wpa_supplicant build
includes CONFIG_P2P=y. Adding a separate driver_ops for such use
is not really useful since the driver wrappers can do the same
internally. Remove this driver_ops and move matching functionality
into driver_nl80211.c which was the only driver wrapper using
this driver_ops callback.

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

12 years agonl80211: Fix re-enabling of 802.11b rates
Jouni Malinen [Sat, 29 Oct 2011 19:12:26 +0000 (22:12 +0300)]
nl80211: Fix re-enabling of 802.11b rates

nl80211_disable_11b_rates() function was supposed to use the 'disabled'
parameter to figure out whether to disable or re-enable 802.11b rates.
In addition, the driver deinit path was now ending up re-disabling the
enabled rates at the end of the deinit operations when the interface
type was forced back to station. Both of these issues are now fixed
and the 2.4 GHz band TX rate index is cleared properly when
wpa_supplicant is stopped.

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

12 years agonl80211: disable_11b_rates on interface mode change
Eliad Peller [Sat, 29 Oct 2011 19:00:07 +0000 (22:00 +0300)]
nl80211: disable_11b_rates on interface mode change

disable_11b_rates() is called on interface addition,
but not on interface type change, resulting in 11b rates
enabled on p2p interfaces.

Signed-off-by: Eliad Peller <eliad@wizery.com>
12 years agoAdd no_cck parameter for send_action() driver_ops
Jouni Malinen [Sat, 29 Oct 2011 18:49:46 +0000 (21:49 +0300)]
Add no_cck parameter for send_action() driver_ops

This can be used to apply the no-CCK rule conditionally depending on
which frame is being sent. The no-CCK rule applies only for P2P
management frames while SA Query and FT use cases do not have similar
restrictions.

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

12 years agonl80211: Add support to disable CCK rate for P2P frames
Rajkumar Manoharan [Sat, 29 Oct 2011 18:23:27 +0000 (21:23 +0300)]
nl80211: Add support to disable CCK rate for P2P frames

Add a new attribute to specify whether to use CCK rate or not during
scan and sending management frames. This helps to send P2P probes
at non-CCK rate. This ensures that P2P probe request/response/action
frames are always sent at non-CCK rates.

Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
12 years agodbus: Raise PropertiesChanged on org.freedesktop.DBus.Properties
Daniel Drake [Sat, 29 Oct 2011 16:23:42 +0000 (19:23 +0300)]
dbus: Raise PropertiesChanged on org.freedesktop.DBus.Properties

wpa_supplicant dbus objects are currently difficult to use with
GDBusProxy. This is because they do not follow the dbus standard in
emitting the PropertiesChanged signal on the standard D-Bus properties
interface, so GDBusProxy stores stale property values.

Fix this by raising PropertiesChanged on the standard interface.
For backwards compatibility, the existing custom PropertiesChanged
signals are not removed; I anticipate them being removed in a future
major release.

See
http://lists.freedesktop.org/archives/dbus/2011-August/014593.html
for more info.

Signed-off-by: Daniel Drake <dsd@laptop.org>
12 years agomac80211_hwsim: Remove forgotten files
Jouni Malinen [Sat, 29 Oct 2011 15:27:10 +0000 (18:27 +0300)]
mac80211_hwsim: Remove forgotten files

These live in the Linux kernel tree with mac80211_hwsim.c that was
already removed from hostap.git. The notes and example configuration
files are in Documentation/networking/mac80211_hwsim directory, so
remove the unnecessarily duplicated files from hostap.git.

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

12 years agoDescribe requirements for contributions to hostap.git
Jouni Malinen [Sat, 29 Oct 2011 10:43:43 +0000 (13:43 +0300)]
Describe requirements for contributions to hostap.git

This provides explicit description of requirements for contributions
that have been assumed and less formally confirmed in the past.

12 years agoRemove www directory (w1.fi web pages)
Jouni Malinen [Sat, 29 Oct 2011 09:24:03 +0000 (12:24 +0300)]
Remove www directory (w1.fi web pages)

These are now maintained in a separate repository (hostap-www.git)
and do not need to remain in hostap.git.

12 years agoRemove unused valid_bss_mask driver_ops
Jouni Malinen [Sat, 29 Oct 2011 08:34:29 +0000 (11:34 +0300)]
Remove unused valid_bss_mask driver_ops

12 years agoRemove unconfigurable cts_protection_type
Jouni Malinen [Sat, 29 Oct 2011 08:24:53 +0000 (11:24 +0300)]
Remove unconfigurable cts_protection_type

This was included in the AP configuration parameters, but there has
been no way to set it to anything else than the default automatic
mode. Remove this parameter and just hardcode ERP determination to
follow the automatic mode.

12 years agoFor MS-CHAP, convert the password from UTF-8 to UCS-2
Evan Broder [Fri, 28 Oct 2011 21:23:54 +0000 (00:23 +0300)]
For MS-CHAP, convert the password from UTF-8 to UCS-2

The MS-CHAPv1 and MS-CHAPv2 RFCs specify that the password is a string
of "Unicode characters", which for Windows means UCS-2; thus the
password could be any even-length string of up to 512 bytes.

Instead of making the incompatible change of requiring the incoming
password to be UCS-2 encoded, assume the password is UTF-8 encoded and
convert it before using it in NtPasswordHash and
EncryptPwBlockWithPasswordHash.

Signed-off-by: Evan Broder <ebroder@mokafive.com>
12 years agowpa_cli: Argument completion for p2p_group_remove
Jouni Malinen [Fri, 28 Oct 2011 20:59:13 +0000 (23:59 +0300)]
wpa_cli: Argument completion for p2p_group_remove

Track active P2P groups and complete p2p_group_remove argument.

12 years agowpa_cli: Add completion functions for P2P peers and BSSes
Jouni Malinen [Fri, 28 Oct 2011 20:37:34 +0000 (23:37 +0300)]
wpa_cli: Add completion functions for P2P peers and BSSes

Keep a local list of found P2P peers and BSS entries and use those
to complete arguments for p2p_peer, p2p_connect, and bss commands.

12 years agodl_list: Add DEFINE_DL_LIST
Johannes Berg [Fri, 28 Oct 2011 20:03:13 +0000 (23:03 +0300)]
dl_list: Add DEFINE_DL_LIST

This allows statically defining an empty initialised list.

12 years agoP2P: Fix frequency in the P2P_EVENT_GROUP_STARTED event
Jithu Jance [Fri, 28 Oct 2011 19:26:30 +0000 (22:26 +0300)]
P2P: Fix frequency in the P2P_EVENT_GROUP_STARTED event

P2P Client did not show correct frequency in the control interface
event P2P_EVENT_GROUP_STARTED. Fix that by using the frequency from
the BSS table or association event.

12 years agoP2P: Notify device expiry via P2P-DEVICE-LOST event
Jithu Jance [Fri, 28 Oct 2011 19:13:18 +0000 (22:13 +0300)]
P2P: Notify device expiry via P2P-DEVICE-LOST event

This patch will notify applications listening over control socket about
the device expiry [from p2p peer list].

12 years agoAutomatically include WPS and AP support if P2P is enabled
Jouni Malinen [Fri, 28 Oct 2011 18:17:08 +0000 (21:17 +0300)]
Automatically include WPS and AP support if P2P is enabled

CONFIG_WPS=y and CONFIG_AP=y are required if CONFIG_P2P=y so
we may as well enable them automatically in that case.

12 years agonl80211: Ignore netlink interface down if interface is up
Jouni Malinen [Fri, 28 Oct 2011 18:08:15 +0000 (21:08 +0300)]
nl80211: Ignore netlink interface down if interface is up

The netlink event processing is delayed since they are only returned
after control returns to eloop. This can result in netlink down events
being processed at a point when the interface has is actually still
there (the first event on new interface is down) and that can result in
odd behavior especially when the resulting interface-disabled event is
delivered to AP mode interface with wpa_supplicant.

Work around this by filtering netlink down events if the matching
interface is up at the time the netlink event is processed. This fixes
an issue brought up by commit 36d84860bbe09641f782fcc21b09e5a6952b4629.

12 years agoFix WPA authenticator configuration to not leave uninitialized fields
Jouni Malinen [Fri, 28 Oct 2011 09:03:45 +0000 (12:03 +0300)]
Fix WPA authenticator configuration to not leave uninitialized fields

hostapd_wpa_auth_conf() is called on uninitialized memory and the
conditional blocks in this function may leave some fields into
uninitialized state. This can result in unexpected behavior elsewhere
since some of the variables may be used without matching #ifdef
blocks. Fix this by zeroing the memory.

12 years agoTDLS: Do not clear peer data too early for teardown
Jouni Malinen [Thu, 27 Oct 2011 20:15:46 +0000 (23:15 +0300)]
TDLS: Do not clear peer data too early for teardown

TPK will be needed to be able to generate FTIE MIC for the
teardown message, so maintain peer data for a bit longer in
case the teardown FTIE request comes back from the driver.

12 years agoTDLS: Disable link on various error cases
Jouni Malinen [Thu, 27 Oct 2011 20:13:54 +0000 (23:13 +0300)]
TDLS: Disable link on various error cases

This is needed to be able to return back to AP path on error cases.

12 years agoTDLS: Disable previous link to fix renegotiation
Jouni Malinen [Thu, 27 Oct 2011 20:13:14 +0000 (23:13 +0300)]
TDLS: Disable previous link to fix renegotiation

12 years agoTDLS: Fix concurrent initialization test code
Jouni Malinen [Thu, 27 Oct 2011 20:12:08 +0000 (23:12 +0300)]
TDLS: Fix concurrent initialization test code

Must not use data from peer TDLS Setup Request if the concurrent
initialization from us is supposed to be the one that gets completed.

12 years agoTDLS: Fix teardown on renegotiation
Jouni Malinen [Thu, 27 Oct 2011 20:10:21 +0000 (23:10 +0300)]
TDLS: Fix teardown on renegotiation

Need to disable the link when receiving TDLS Setup Request from a
peer with which a direct link has already been set up.

12 years agoTDLS: Fix long frame test for teardown
Jouni Malinen [Thu, 27 Oct 2011 20:09:23 +0000 (23:09 +0300)]
TDLS: Fix long frame test for teardown

12 years agoP2P: Stop any on-going "p2p_find" on creating an Autonomous GO
Jithu Jance [Tue, 25 Oct 2011 22:28:51 +0000 (01:28 +0300)]
P2P: Stop any on-going "p2p_find" on creating an Autonomous GO

This patch stops any on-going "p2p_find" on creating an Autonomous GO.
This is already taken care in case of invoking a persistent GO. GO as
such will be advertising via the beacons for other devices to discover.
So normally the GO doesn't need to do a p2p_find until and unless it
wants to invite a P2P Client. In case of Invite scenario, logically it
is better to do a explicit discover [via user intervention] after the GO
is created. This patch will help to reduce battery wastage [due to
p2p_find operations] in scenarios where user creates a GO and doesn't
initiate a connection.

12 years agowlantest: Add STA counters for disconnect reason 6/7 RX
Jouni Malinen [Tue, 25 Oct 2011 21:06:06 +0000 (00:06 +0300)]
wlantest: Add STA counters for disconnect reason 6/7 RX

These can be useful in tests involving association state mismatch
between the AP and the STA (i.e., STA assumes it is still associated
but the AP does not have association state). In such a case, the AP
would be sending out unprotected Deauthentication or Disassociation
frames with reason code 6 or 7 depending on what frame is triggering
this.

12 years agoInterworking: Fix Advertisement Protocol element length limit
Jay Katabathuni [Tue, 25 Oct 2011 08:31:21 +0000 (11:31 +0300)]
Interworking: Fix Advertisement Protocol element length limit

The Query Response Length Limit is not allowed to be zero when
this is sent by the AP. Use 0x7F to indicate that the limit is
based on maximum number of GAS fragments.

12 years agoP2P: Append P2P Device Address to AP-STA-CONNECTED event
Jithu Jance [Mon, 24 Oct 2011 21:13:03 +0000 (00:13 +0300)]
P2P: Append P2P Device Address to AP-STA-CONNECTED event

For P2P, the p2p_connect takes in device address argument to make a
connection. However the connected event AP-STA-CONNECTED comes with
interface address. The application listening on events would find it
difficult to map interface address to the p2p device address which is
provided for connection.

Append P2P Device Address to AP-STA-CONNECTED event for P2P Client
connection. This will help applications to easily map the P2P Interface
Address to P2P Device Address on CONNECTED event. For non-P2P case, it
will just print the usual STA MAC address alone.

Signed-off-by: Jithu Jance <jithu@broadcom.com>
12 years agoP2P: Fix wpa_supplicant crash on P2P WPS PBC overlap case
Jithu Jance [Mon, 24 Oct 2011 20:37:39 +0000 (23:37 +0300)]
P2P: Fix wpa_supplicant crash on P2P WPS PBC overlap case

Once PBC overlap detected when using dynamic group interfaces, the wpa_s
corresponding to P2P group interface is freed. This patch avoids
accessing the wpa_s data structure after it is freed. This fixes a
possible crash in P2P client role in such a case.

12 years agoP2P: Advertise Persistent Reconnect group capability
Jouni Malinen [Mon, 24 Oct 2011 14:29:37 +0000 (17:29 +0300)]
P2P: Advertise Persistent Reconnect group capability

The persistent_reconnect configuration parameter was used to decide
whether to accept invitation to re-establish a persistent group.
However, this was not being advertised in the Group Capability bitmap.
Add the Persistent Reconnect bit based on this configuration to GO
Negotiation frames and Beacon/Probe Response frames from the GO.

12 years agoTDLS: Make use of wpa_tdls_add_peer to avoid code duplication
Arik Nemtsov [Mon, 26 Sep 2011 10:55:34 +0000 (13:55 +0300)]
TDLS: Make use of wpa_tdls_add_peer to avoid code duplication

Use the wpa_tdls_add_peer function to allocate TDLS peer structures.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Cc: Kalyan C Gaddam <chakkal@iit.edu>
12 years agoTDLS: Support mgmt-frame Tx for ctrl-iface operations
Arik Nemtsov [Mon, 26 Sep 2011 10:55:33 +0000 (13:55 +0300)]
TDLS: Support mgmt-frame Tx for ctrl-iface operations

Use capability information to decide whether to perform a given TDLS
operation internally or through mgmt-frame Tx.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Cc: Kalyan C Gaddam <chakkal@iit.edu>
12 years agoTDLS: Add peer as a STA during link setup
Arik Nemtsov [Sun, 23 Oct 2011 11:02:57 +0000 (14:02 +0300)]
TDLS: Add peer as a STA during link setup

Before commencing setup, add a new STA entry to the driver representing
the peer. Later during setup, update the STA entry using information
received from the peer.

Extend sta_add() callback for adding/modifying a TDLS peer entry and
connect it to the TDLS state machine. Implement this callback for the
nl80211 driver and send peer information to kernel.

Mark TDLS peer entries with a new flag and translate it to a
corresponding nl80211 flag in the nl80211 driver.

In addition, correct TDLS related documentation in the wpa_driver_ops
structure.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Cc: Kalyan C Gaddam <chakkal@iit.edu>
12 years agoTDLS: Collect peer capabilities and supp-rates during link setup
Arik Nemtsov [Mon, 26 Sep 2011 10:55:31 +0000 (13:55 +0300)]
TDLS: Collect peer capabilities and supp-rates during link setup

Record the capabilities and supported rates of the TDLS peer during
link setup. These are given in the IEs passed in Setup Request and
Setup Response frames.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Cc: Kalyan C Gaddam <chakkal@iit.edu>
12 years agoTDLS: Implement low-ack event for lost TDLS peers
Arik Nemtsov [Mon, 26 Sep 2011 10:55:30 +0000 (13:55 +0300)]
TDLS: Implement low-ack event for lost TDLS peers

Disable the direct connection when a TDLS peer stops responding
to packets, as indicated by the "LOW ACK" event coming from a driver.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Cc: Kalyan C Gaddam <chakkal@iit.edu>
12 years agoTDLS: Support sending TDLS discovery requests
Arik Nemtsov [Mon, 26 Sep 2011 10:55:29 +0000 (13:55 +0300)]
TDLS: Support sending TDLS discovery requests

Allow sending a TDLS discovery request as a frame through the driver.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Cc: Kalyan C Gaddam <chakkal@iit.edu>
12 years agoTDLS: Support sending a teardown frame from usermode
Arik Nemtsov [Mon, 26 Sep 2011 10:55:28 +0000 (13:55 +0300)]
TDLS: Support sending a teardown frame from usermode

When a driver does not implement the TDLS_TEARDOWN operation internally,
send an explicit TDLS link teardown frame to the driver.

Change all teardown calls to use these calling semantics.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Cc: Kalyan C Gaddam <chakkal@iit.edu>
12 years agoTDLS/nl80211: Support receiving TDLS discovery response frames
Arik Nemtsov [Mon, 26 Sep 2011 10:55:27 +0000 (13:55 +0300)]
TDLS/nl80211: Support receiving TDLS discovery response frames

Register for the TDLS discovery response public action frame in nl80211.
Print out a debug message when a Discovery Resp frame is received and
validated.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Cc: Kalyan C Gaddam <chakkal@iit.edu>
12 years agoTDLS: Process discovery requests and send discovery responses
Arik Nemtsov [Mon, 26 Sep 2011 10:55:26 +0000 (13:55 +0300)]
TDLS: Process discovery requests and send discovery responses

When a discovery request is received, add the peer to the TDLS peer
cache and send a response containing minimal data. Mandatory IEs in
the discovery response frame will be filled out by the driver.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Cc: Kalyan C Gaddam <chakkal@iit.edu>
12 years agoTDLS: Get TDLS related capabilities from driver
Arik Nemtsov [Mon, 26 Sep 2011 10:55:25 +0000 (13:55 +0300)]
TDLS: Get TDLS related capabilities from driver

Put glue code in place to propagate TDLS related driver capabilities to
the TDLS state machine.

If the driver doesn't support capabilities, assume TDLS is supported
internally.

When TDLS is explicitly not supported, disable all user facing TDLS
operations.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Cc: Kalyan C Gaddam <chakkal@iit.edu>
12 years agonl80211: Implement TDLS callback functions and propagate capabilities
Arik Nemtsov [Sun, 23 Oct 2011 10:59:00 +0000 (13:59 +0300)]
nl80211: Implement TDLS callback functions and propagate capabilities

Allow passing high-level TDLS commands and TDLS frames to kernel
via new nl80211 commands.

Propagate TDLS related nl80211 capability flags from kernel and add them
as driver capability flags.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Cc: Kalyan C Gaddam <chakkal@iit.edu>
12 years agoTDLS: Use a valid dialog-token in a setup request
Arik Nemtsov [Mon, 26 Sep 2011 10:55:35 +0000 (13:55 +0300)]
TDLS: Use a valid dialog-token in a setup request

A zero dialog-token is considered invalid by IEEE Std 802.11z-2010.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Cc: Kalyan C Gaddam <chakkal@iit.edu>
12 years agoTDLS: Support setting CONFIG_TDLS_TESTING in .config
Arik Nemtsov [Mon, 26 Sep 2011 10:55:22 +0000 (13:55 +0300)]
TDLS: Support setting CONFIG_TDLS_TESTING in .config

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Cc: Kalyan C Gaddam <chakkal@iit.edu>
12 years agonl80211: Handle special TDLS direct link key index use
Jouni Malinen [Sun, 23 Oct 2011 19:12:32 +0000 (22:12 +0300)]
nl80211: Handle special TDLS direct link key index use

An ugly hack is currently used to indicate keys for TDLS direct link:
key_idx == -1. That needs to be converted to 0 for cfg80211 to accept
the key.

12 years agohwsim_test: Fix silly bug in select() result processing
Jouni Malinen [Sun, 23 Oct 2011 19:11:48 +0000 (22:11 +0300)]
hwsim_test: Fix silly bug in select() result processing

12 years agoRemove incorrect statement about get_hw_feature_data() driver_ops
Jouni Malinen [Sun, 23 Oct 2011 17:09:40 +0000 (20:09 +0300)]
Remove incorrect statement about get_hw_feature_data() driver_ops

This function is actually needed for quite a bit more than just
user space MLME implementation. The old comment here has not been
accurate for a long time, so get rid of it.

12 years agoRemove unused driver_ops client MLME functions
Jouni Malinen [Sun, 23 Oct 2011 17:07:57 +0000 (20:07 +0300)]
Remove unused driver_ops client MLME functions

These driver_ops functions set_channel, set_ssid, set_bssid,
mlme_add_sta, and mlme_remove_sta were used with the user space
MLME implementation in wpa_supplicant. That was only for testing
purposes and was removed, but these driver_ops were forgotten.
Remove them now to remove confusing driver_ops definitions.

12 years agowpa_supplicant: Check rate sets before joining BSS
Christian Lamparter [Sun, 23 Oct 2011 08:58:54 +0000 (11:58 +0300)]
wpa_supplicant: Check rate sets before joining BSS

IEEE Std 802.11-2007 7.3.2.2 demands that in order to join a BSS all
required basic rates have to be supported by the hardware.

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
12 years agowpa_supplicant: Unify hardware feature data
Christian Lamparter [Sun, 23 Oct 2011 08:58:54 +0000 (11:58 +0300)]
wpa_supplicant: Unify hardware feature data

The hardware feature data is required in several different places
throughout the code. Previously, the data was acquired and freed on
demand, but with this patch wpa_supplicant will keep a single copy
around at runtime for everyone to use.

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
12 years agoAllow driver wrappers to indicate whether HT info is known
Jouni Malinen [Sun, 23 Oct 2011 14:17:39 +0000 (17:17 +0300)]
Allow driver wrappers to indicate whether HT info is known

This is needed to be able to figure out whether the driver is known
not to support HT.

12 years agoPostpone global_init() call until first driver instance is initialized
Jouni Malinen [Sun, 23 Oct 2011 10:20:52 +0000 (13:20 +0300)]
Postpone global_init() call until first driver instance is initialized

This avoids allocating global driver state for driver wrappers that
are built in but not used. This can save some resources and avoids
failures with driver_nl80211.c that is now initializing netlink
connections for nl80211 in global_init().

12 years agoTLS: Validate RSA ClientKeyExchange length field
Jouni Malinen [Sun, 23 Oct 2011 10:04:32 +0000 (13:04 +0300)]
TLS: Validate RSA ClientKeyExchange length field

Instead of using implicit length based on the received buffer, validate
RSA ClientKeyExchange based on the explicit length field.

12 years agoRemove unused variables
Jouni Malinen [Sun, 23 Oct 2011 09:42:55 +0000 (12:42 +0300)]
Remove unused variables

12 years agodbus: Removed unused local variable
Grant Erickson [Sun, 23 Oct 2011 09:36:04 +0000 (12:36 +0300)]
dbus: Removed unused local variable

Signed-off-by: Grant Erickson <marathon96@gmail.com>
12 years agoFix hostapd_wpa_auth_send_ether() return value
Jouni Malinen [Sun, 23 Oct 2011 09:33:17 +0000 (12:33 +0300)]
Fix hostapd_wpa_auth_send_ether() return value

This was not currently used for anything, but better return the correct
value instead of hardcoded -1.

12 years agoComment out scard initialization code if PCSC_FUNCS is not set
Jouni Malinen [Sun, 23 Oct 2011 09:24:36 +0000 (12:24 +0300)]
Comment out scard initialization code if PCSC_FUNCS is not set

12 years agoRemove unused variable from os_gmtime()
Jouni Malinen [Sun, 23 Oct 2011 09:22:40 +0000 (12:22 +0300)]
Remove unused variable from os_gmtime()

12 years agonl80211: Remove some unnecessary ifdef HOSTAPD blocks
Jouni Malinen [Sat, 22 Oct 2011 19:51:49 +0000 (22:51 +0300)]
nl80211: Remove some unnecessary ifdef HOSTAPD blocks

12 years agoRemove user space client MLME
Jouni Malinen [Sat, 22 Oct 2011 19:45:38 +0000 (22:45 +0300)]
Remove user space client MLME

This code was used only with driver_test.c to allow MLME operations
in hostapd to be tested without having to use a real radio. There
are no plans on extending this to any other use than testing and
mac80211_hwsim has now obsoled the need for this type of testing.
As such, we can drop this code from wpa_supplicant to clean up the
implementation of unnecessary complexity.

12 years agoAdd CONFIG_WPS_REG_DISABLE_OPEN to defconfig
Andrii Bordunov [Sat, 22 Oct 2011 19:24:34 +0000 (22:24 +0300)]
Add CONFIG_WPS_REG_DISABLE_OPEN to defconfig

12 years agoWPS: Use ifdef blocks consistently for CONFIG_WPS_REG_DISABLE_OPEN
Andrii Bordunov [Sat, 22 Oct 2011 19:21:53 +0000 (22:21 +0300)]
WPS: Use ifdef blocks consistently for CONFIG_WPS_REG_DISABLE_OPEN

The registrar variable is used only if this macro is defined, so no
need to set it otherwise.

12 years agowpa_priv: Link in trace.o to fix CONFIG_WPA_TRACE build
Andrii Bordunov [Sat, 22 Oct 2011 19:18:54 +0000 (22:18 +0300)]
wpa_priv: Link in trace.o to fix CONFIG_WPA_TRACE build

12 years agowpa_priv: Link in ieee802_11_common.o if driver_nl80211 is used
Jouni Malinen [Sat, 22 Oct 2011 19:16:11 +0000 (22:16 +0300)]
wpa_priv: Link in ieee802_11_common.o if driver_nl80211 is used

12 years agowpa_priv: Update function arguments to fix compilation
Andrii Bordunov [Sat, 22 Oct 2011 19:11:40 +0000 (22:11 +0300)]
wpa_priv: Update function arguments to fix compilation

12 years agoShare a single wpa_scan_results_free() implementation
Jouni Malinen [Sat, 22 Oct 2011 19:09:40 +0000 (22:09 +0300)]
Share a single wpa_scan_results_free() implementation

There is not really a very good location for this anywhere, but the
function is small enough to live as an inline function for now.

12 years agoRemove unused variable and function
Andrii Bordunov [Sat, 22 Oct 2011 18:59:17 +0000 (21:59 +0300)]
Remove unused variable and function

12 years agoFix typo in comment related to EAPOL
Ben Greear [Sat, 22 Oct 2011 18:41:09 +0000 (21:41 +0300)]
Fix typo in comment related to EAPOL

Signed-off-by: Ben Greear <greearb@candelatech.com>
12 years agonl80211: Use one global ioctl socket
Ben Greear [Sat, 22 Oct 2011 18:33:58 +0000 (21:33 +0300)]
nl80211: Use one global ioctl socket

Saves sockets when using multiple VIFS in a single
wpa_supplicant process.

Signed-off-by: Ben Greear <greearb@candelatech.com>
12 years agonl80211: Use a global netlink command object
Ben Greear [Sat, 22 Oct 2011 16:00:27 +0000 (19:00 +0300)]
nl80211: Use a global netlink command object

Netlink sockets can be shared among all driver instances, saving
sockets and memory when using multiple interfaces in a single process.

12 years agonl80211: Use global nl_cb template
Ben Greear [Sat, 22 Oct 2011 15:42:42 +0000 (18:42 +0300)]
nl80211: Use global nl_cb template

All interfaces can share a single nl_cb template.

12 years agonl80211: Clean up error path in wpa_driver_nl80211_init
Ben Greear [Sat, 22 Oct 2011 15:28:06 +0000 (18:28 +0300)]
nl80211: Clean up error path in wpa_driver_nl80211_init

No need to duplicate the deinit code since wpa_driver_nl80211_deinit()
can be used here to clean up after a failure.

12 years agonl80211: Abstract handle/cache (de)allocation
Johannes Berg [Sat, 22 Oct 2011 13:56:43 +0000 (16:56 +0300)]
nl80211: Abstract handle/cache (de)allocation

This is a cleanup now and makes it easier to add more sockets in the
future.

12 years agonl80211: Fix hostapd error path
Johannes Berg [Sat, 22 Oct 2011 10:04:47 +0000 (13:04 +0300)]
nl80211: Fix hostapd error path

i802_init() tries to clean up everything manually, call
wpa_driver_nl80211_deinit() instead and also handle the
EAPOL socket properly.

12 years agonl80211: Use global netlink rtm event object
Ben Greear [Thu, 20 Oct 2011 23:03:25 +0000 (02:03 +0300)]
nl80211: Use global netlink rtm event object

Netlink sockets can be shared among all driver instances, saving lots
of sockets, spurious log messages, memory, and CPU usage when using
multiple interfaces in a single process.

12 years agohostapd: Call global_init/global_deinit driver_ops
Jouni Malinen [Sat, 22 Oct 2011 08:59:00 +0000 (11:59 +0300)]
hostapd: Call global_init/global_deinit driver_ops

Now both wpa_supplicant and hostapd allow the driver wrappers to use the
global context similarly.

12 years agonl80211: Use a wrapper for genlmsg_put
Jouni Malinen [Thu, 20 Oct 2011 22:34:54 +0000 (01:34 +0300)]
nl80211: Use a wrapper for genlmsg_put

This reduces the code size by a kilobyte or so and makes it easier
to replace the netlink instances to be shared among interfaces.

12 years agowext: Do not set SSID on disconnect on Android
Dmitry Shmidt [Fri, 21 Oct 2011 16:11:07 +0000 (19:11 +0300)]
wext: Do not set SSID on disconnect on Android

Some drivers seem to try to associate using the random SSID, so
do not use this hack on Android.

12 years agowext: Clean up the disconnect BSSID/SSID clearing
Jouni Malinen [Fri, 21 Oct 2011 16:09:25 +0000 (19:09 +0300)]
wext: Clean up the disconnect BSSID/SSID clearing

12 years agoPrevent ap_scan change during association
Dmitry Shmidt [Tue, 16 Aug 2011 18:52:06 +0000 (11:52 -0700)]
Prevent ap_scan change during association

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
12 years agoSet ANDROID_LOG_NAME depending on application
Dmitry Shmidt [Fri, 21 Oct 2011 14:26:35 +0000 (17:26 +0300)]
Set ANDROID_LOG_NAME depending on application

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>