Commit graph

3296 commits

Author SHA1 Message Date
Jouni Malinen 39e7d718f6 ndis: Work around lack of C99 designated initializers in MSVC
Use a driver_ndis.c specific initialization function to fill in the
wpa_driver_ops information to make it easier to modify struct
wpa_driver_ops in the future. Being able to build driver_ndis.c
with MSVC was the only reason for having to maintain the same order
of function pointers in struct wpa_driver_ops and for having to
update driver_ndis.c for all changes in that structure.

Signed-hostap: Jouni Malinen <j@w1.fi>
2011-11-03 18:45:21 +02:00
Jouni Malinen 4877e1fcf9 wpa_cli: Fix compiler warnings on unused functions
Some of the parameter completion functions are only used if
CONFIG_P2P=y.

Signed-hostap: Jouni Malinen <j@w1.fi>
2011-11-03 18:02:28 +02:00
Jouni Malinen d33ce0d5b5 Include time.h to fix Windows builds
Signed-hostap: Jouni Malinen <j@w1.fi>
2011-11-03 18:00:57 +02:00
Jouni Malinen 67a5206482 Remove obsoleted Qt3-based wpa_gui
This code has not been maintained for years and there is no plan on
doing so either in the future. The Qt4-based wpa_gui-qt4 version can be
used as a replacement for this older wpa_gui version.

Signed-hostap: Jouni Malinen <j@w1.fi>
2011-11-03 17:48:31 +02:00
Jouni Malinen c4a893c340 Remove kerneldoc2doxygen.pl from hostap.git
This is a separate tool for preparing source code files for Doxygen.
It does not need to be distributed with hostap.git and it can now be
downloaded separately from http://w1.fi/tools/kerneldoc2doxygen-hostap.pl
by anyone who wants to build the developers' documents with Doxygen.

Signed-hostap: Jouni Malinen <j@w1.fi>
2011-11-03 13:02:04 +02:00
Jouni Malinen 75b51fde2d Update version number to 2.0-devel
hostap.git is now a development branch for 2.0 with 1.x releases
having been forked to hostap-1.git.

Signed-hostap: Jouni Malinen <j@w1.fi>
2011-11-03 12:19:44 +02:00
Jouni Malinen 2cc5ebdd33 dbus: Fix some build combination without new D-Bus interface
Include common/defs.h to get full enum definitions to avoid compiler
errors without CONFIG_CTRL_IFACE_DBUS_NEW.

Signed-hostap: Jouni Malinen <j@w1.fi>
2011-11-02 10:48:26 +02:00
Jouni Malinen 406edc84cb Fix Android library configuration with OpenSSL build
Commit bf9d5518d5 did not split
LOCAL_SHARED_LIBRARIES properly and ended up removing the needed
libraries.

Signed-hostap: Jouni Malinen <j@w1.fi>
2011-11-01 10:39:49 +02:00
Jouni Malinen 1bbff09ec5 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>
2011-10-30 22:37:12 +02:00
Yoni Divinsky 9354e59480 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>
2011-10-30 22:19:49 +02:00
Olivier Sobrie 6f75536fc9 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>
2011-10-30 22:10:40 +02:00
Pavel Roskin 9339bd5cd2 random: Improve error messages about writing to entropy file 2011-10-30 21:50:22 +02:00
Jouni Malinen aa820e02cc 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>
2011-10-30 21:08:34 +02:00
Gary Morain 577db0aedd 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.
2011-10-30 21:08:21 +02:00
Jouni Malinen fbc72d32c6 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>
2011-10-30 12:53:20 +02:00
Jouni Malinen ec02780529 Move Michael MIC error report processing into separate function
Signed-hostap: Jouni Malinen <j@w1.fi>
2011-10-30 12:53:20 +02:00
Jouni Malinen 01a1749156 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>
2011-10-30 12:53:20 +02:00
Dan Williams e9c3c1afed 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>
2011-10-30 12:04:24 +02:00
Dan Williams 7de5688d68 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>
2011-10-30 12:04:24 +02:00
Dan Williams 81c57e221d 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>
2011-10-30 12:04:24 +02:00
Dan Williams a9022616ae 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>
2011-10-30 12:04:24 +02:00
Dan Williams 9ef1aaae24 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>
2011-10-30 12:04:24 +02:00
Jouni Malinen af72d17e72 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>
2011-10-30 12:02:20 +02:00
Jouni Malinen a6d94e1b56 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>
2011-10-30 11:46:13 +02:00
Jouni Malinen d1dd48e3c9 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>
2011-10-29 23:02:47 +03:00
Jouni Malinen b3af99d202 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>
2011-10-29 22:46:58 +03:00
Jouni Malinen 97bcd562eb 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>
2011-10-29 22:25:28 +03:00
Jouni Malinen 1dea5882be 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>
2011-10-29 22:12:26 +03:00
Eliad Peller 083590503b 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>
2011-10-29 22:00:07 +03:00
Jouni Malinen b106173a82 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>
2011-10-29 21:49:46 +03:00
Rajkumar Manoharan 970fa12ea2 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>
2011-10-29 21:23:27 +03:00
Daniel Drake 4483f23e15 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>
2011-10-29 19:26:33 +03:00
Jouni Malinen 266e2ee3cf 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>
2011-10-29 19:26:07 +03:00
Jouni Malinen eb32192b72 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.
2011-10-29 13:43:43 +03:00
Jouni Malinen f127282232 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.
2011-10-29 12:24:03 +03:00
Jouni Malinen 451c367d06 Remove unused valid_bss_mask driver_ops 2011-10-29 11:34:29 +03:00
Jouni Malinen 735f652237 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.
2011-10-29 11:24:53 +03:00
Evan Broder c48183fca2 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>
2011-10-29 00:23:54 +03:00
Jouni Malinen 767885423b wpa_cli: Argument completion for p2p_group_remove
Track active P2P groups and complete p2p_group_remove argument.
2011-10-28 23:59:13 +03:00
Jouni Malinen a624f20bcd 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.
2011-10-28 23:50:37 +03:00
Johannes Berg 6604da3cf0 dl_list: Add DEFINE_DL_LIST
This allows statically defining an empty initialised list.
2011-10-28 23:03:13 +03:00
Jithu Jance b49d6ccb74 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.
2011-10-28 22:26:30 +03:00
Jithu Jance 3074d8f12d 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].
2011-10-28 22:13:18 +03:00
Jouni Malinen 8271f14a4d 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.
2011-10-28 21:17:08 +03:00
Jouni Malinen 59d249255c 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 36d84860bb.
2011-10-28 21:08:15 +03:00
Jouni Malinen d28b43f66f 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.
2011-10-28 12:13:56 +03:00
Jouni Malinen 08f6ab76a5 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.
2011-10-27 23:15:46 +03:00
Jouni Malinen c581201493 TDLS: Disable link on various error cases
This is needed to be able to return back to AP path on error cases.
2011-10-27 23:13:54 +03:00
Jouni Malinen db9af0da70 TDLS: Disable previous link to fix renegotiation 2011-10-27 23:13:14 +03:00
Jouni Malinen da30c93ab1 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.
2011-10-27 23:12:08 +03:00