mech_eap.git
12 years agoAndroid: Update libnl use to match with Android ICS
Jouni Malinen [Tue, 15 Nov 2011 16:37:10 +0000 (18:37 +0200)]
Android: Update libnl use to match with Android ICS

The libnl_2 library uses static linking and different path for
header files in the Android ICS release.

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

12 years agoAndroid: Fix D-Bus P2P interface location in Android.mk
Jouni Malinen [Tue, 15 Nov 2011 16:35:58 +0000 (18:35 +0200)]
Android: Fix D-Bus P2P interface location in Android.mk

This was supposed to be in the new D-Bus interface block, not in
the old one.

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

12 years agoAndroid: Fix hostapd_cli build
Jouni Malinen [Tue, 15 Nov 2011 16:34:57 +0000 (18:34 +0200)]
Android: Fix hostapd_cli build

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

12 years agoAndroid: Fix hostapd build
Jouni Malinen [Tue, 15 Nov 2011 16:34:09 +0000 (18:34 +0200)]
Android: Fix hostapd build

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

12 years agowlantest: Fix handling of PTK rekeying
Jouni Malinen [Mon, 14 Nov 2011 20:33:26 +0000 (22:33 +0200)]
wlantest: Fix handling of PTK rekeying

Use a temporary PTK buffer during 4-way handshake when rekeying PTK
so that the new EAPOL-Key frame MIC values are checked against the
new PTK and frames are decrypted using the old PTK. Take the new
PTK into use once msg 4/4 is processed and clear RSC counters at
that point (including moving of RSC update to avoid setting RSC
based on the msg 4/4).

In addition, add a workaround to handle supplicant implementations that
set Secure bit to one during PTK rekeying 4-way handshake in msg 2/4.
This was previously assumed to be msg 4/4, but the key data contents
can be used to figure out whether this is msg 2/4 even if the Secure
bit is set to one.

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

12 years agoDo not add P2P IE into Beacon/Probe Response if P2P is disabled
Jouni Malinen [Mon, 14 Nov 2011 14:26:45 +0000 (16:26 +0200)]
Do not add P2P IE into Beacon/Probe Response if P2P is disabled

P2P IE was incorrectly added in wpa_supplicant AP mode even if P2P
function was not actually enabled.

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

12 years agoAP: Only enable WPS for open and WPA/WPA2-Personal configuration
Jouni Malinen [Mon, 14 Nov 2011 14:16:29 +0000 (16:16 +0200)]
AP: Only enable WPS for open and WPA/WPA2-Personal configuration

When wpa_supplicant AP mode is used, WPS was enabled by default
regardless of security mode. This is not desired for WEP, so change
the AP configuration to enable WPS only for open and WPA/WPA2-Personal
networks.

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

12 years agoFix P2P IE configuration for GO mode
Jouni Malinen [Mon, 14 Nov 2011 14:10:54 +0000 (16:10 +0200)]
Fix P2P IE configuration for GO mode

Commit c2ff13c533306ac06f08fd03fca9e04cc994cabd broke this with a
copy-paste typo that ended up adding the Probe Request P2P IE into the
Beacon frame (i.e., Beacon frame had two P2P IEs while Probe Response
had none).

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

12 years agoMake crypto_hash_init() easier for static analyzers
Jouni Malinen [Sun, 13 Nov 2011 21:24:08 +0000 (23:24 +0200)]
Make crypto_hash_init() easier for static analyzers

Avoid zero-length memset at the end of the buffer. This is not really
needed, but it makes the code a bit easier for static analyzers.

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

12 years agoMake crypto_hash_init() easier for static analyzers
Jouni Malinen [Sun, 13 Nov 2011 21:19:19 +0000 (23:19 +0200)]
Make crypto_hash_init() easier for static analyzers

Avoid zero-length memset at the end of the buffer. This is not really
needed, but it makes the code a bit easier for static analyzers.

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

12 years agoMake radius_msg_add_attr_user_password() easier for static analyzers
Jouni Malinen [Sun, 13 Nov 2011 21:14:57 +0000 (23:14 +0200)]
Make radius_msg_add_attr_user_password() easier for static analyzers

Explicitly validate data_len so that static analyzers do not get
confused about the padlen validation. This is not really needed, but it
makes the code a bit easier for static analyzers.

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

12 years agoMake fips186_2_prf() easier for static analyzers
Jouni Malinen [Sun, 13 Nov 2011 20:59:33 +0000 (22:59 +0200)]
Make fips186_2_prf() easier for static analyzers

Explicitly validate seed_len to skip memset call with zero length
of copied data at the end of the buffer. This is not really needed,
but it makes the code a bit easier for static analyzers.

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

12 years agoMake phase2_method initialization easier for static analyzers
Jouni Malinen [Sun, 13 Nov 2011 20:47:14 +0000 (22:47 +0200)]
Make phase2_method initialization easier for static analyzers

data->phase2_method cannot really be NULL if
eap_fast_init_phase2_method() returns success, but this construction
seems to be too difficult for some static analyzers. While this change
is not really needed in practice, it makes it easier to go through
warnings from such analyzers.

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

12 years agoMake time_adv use easier for static analyzers
Jouni Malinen [Sun, 13 Nov 2011 20:45:16 +0000 (22:45 +0200)]
Make time_adv use easier for static analyzers

hapd->time_adv cannot really be NULL if hostapd_update_time_adv()
returns success, but this construction seems to be too difficult
for some static analyzers. While this change is not really needed
in practice, it makes it easier to go through warnings from such
analyzers.

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

12 years agonl80211: Verify that global driver pointer is not NULL
Jouni Malinen [Sun, 13 Nov 2011 20:39:57 +0000 (22:39 +0200)]
nl80211: Verify that global driver pointer is not NULL

driver_nl80211.c assumes that global driver pointer is set, so better
make this more consistent.

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

12 years agoP2P: Verify that assoc req IEs are available for group update
Jouni Malinen [Sun, 13 Nov 2011 20:33:32 +0000 (22:33 +0200)]
P2P: Verify that assoc req IEs are available for group update

Do not call p2p_group_notif_assoc() if the driver did not return
IEs from the association request.

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

12 years agoRemove unnecessary include file inclusion
Jouni Malinen [Sun, 13 Nov 2011 20:13:04 +0000 (22:13 +0200)]
Remove unnecessary include file inclusion

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

12 years agoUse shared SHA-256 define for the block size
Jouni Malinen [Sun, 13 Nov 2011 19:43:31 +0000 (21:43 +0200)]
Use shared SHA-256 define for the block size

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

12 years agoMake sha256_process() easier for static analyzers
Jouni Malinen [Sun, 13 Nov 2011 19:36:23 +0000 (21:36 +0200)]
Make sha256_process() easier for static analyzers

md->curlen cannot indicate full buffer size here since the buffered
data is processed whenever the full block size of data is available.
Avoid invalid warnings from static analyzers on memcpy() outside the
buffer length by verifying that curlen is smaller than block size.

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

12 years agoTLS: Fix double-free on error path
Jouni Malinen [Sun, 13 Nov 2011 18:57:32 +0000 (20:57 +0200)]
TLS: Fix double-free on error path

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

12 years agodbus: Remove unused default string for bridge_ifname
Jouni Malinen [Sun, 13 Nov 2011 18:54:44 +0000 (20:54 +0200)]
dbus: Remove unused default string for bridge_ifname

wpa_s->bridge_ifname is an array and cannot be NULL.

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

12 years agoAdd REAUTHENTICATE ctrl_iface command
Jouni Malinen [Sun, 13 Nov 2011 17:47:51 +0000 (19:47 +0200)]
Add REAUTHENTICATE ctrl_iface command

This can be used to trigger EAPOL reauthentication which can be useful
for testing purposes.

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

12 years agoUse a pre-processor macro to simplify event_to_string()
Jouni Malinen [Sun, 13 Nov 2011 17:06:37 +0000 (19:06 +0200)]
Use a pre-processor macro to simplify event_to_string()

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

12 years agoPrint human readable driver event names
Ben Greear [Sun, 13 Nov 2011 17:01:38 +0000 (19:01 +0200)]
Print human readable driver event names

This makes it easier to understand the event related logs.

Signed-hostap: Ben Greear <greearb@candelatech.com>

12 years agoMove wpa_scan_results_free() into shared C file
Jouni Malinen [Sun, 13 Nov 2011 16:56:26 +0000 (18:56 +0200)]
Move wpa_scan_results_free() into shared C file

Replace the inline helper function with a new C file that can be used
for common driver API related function.

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

12 years agoCorrect a spelling mistake
Fu Yingang [Sun, 13 Nov 2011 16:35:15 +0000 (18:35 +0200)]
Correct a spelling mistake

The word "targer" in the comments for pending_bssid of
wpa_supplicant data structure should be "target".

12 years agoPEAP: Verify peap_prfplus() result
Jouni Malinen [Sun, 13 Nov 2011 09:29:17 +0000 (11:29 +0200)]
PEAP: Verify peap_prfplus() result

This function can fail in theory since the SHA-1 functions are
allowed to return an error. While this does not really happen in
practice (we would not get this far if SHA-1 does not work), it is
cleaner to include the error handling here to keep static analyzers
happier. [Bug 421]

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

12 years agoRemove station functionality from hostap and madwifi driver wrappers
Jouni Malinen [Sun, 13 Nov 2011 09:13:13 +0000 (11:13 +0200)]
Remove station functionality from hostap and madwifi driver wrappers

This has been obsoleted by the more generic Linux WEXT (driver_wext.c)
support. The hostap and madwifi driver wrappers can now be used only
with hostapd. The old station interface remains available in releases up
to 1.x.

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

12 years agoRemove unmaintained driver wrappers
Jouni Malinen [Sun, 13 Nov 2011 08:57:46 +0000 (10:57 +0200)]
Remove unmaintained driver wrappers

The driver wrappers broadcom, iphone, osx, and ralink have not been
maintained for a while and it does not look like they will be in the
future either. As such, remove them from the development branch. The
previous versions will be included in older releases up to 1.x.

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

12 years agoAdd test-https for testing internal TLS client functionality
Jouni Malinen [Sun, 13 Nov 2011 08:49:27 +0000 (10:49 +0200)]
Add test-https for testing internal TLS client functionality

This tool can be used to test the internal TLS client implementation
against HTTPS servers.

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

12 years agoTLS: Add preliminary support for partial message processing
Jouni Malinen [Sun, 13 Nov 2011 08:47:04 +0000 (10:47 +0200)]
TLS: Add preliminary support for partial message processing

Reassemble partial TLS records to make the internal TLS client
implementation more convenient for stream sockets.

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

12 years agoTLS: Fix block cipher padding validation
Jouni Malinen [Sun, 13 Nov 2011 08:42:06 +0000 (10:42 +0200)]
TLS: Fix block cipher padding validation

The padding validation was done on the last padding-length octets in the
buffer which misses the first padding octet (the last octet is the
padding length). Fix the starting offset for the comparison loop to get
the first octet verified. [Bug 420]

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

12 years agoTLS: Clean up TLS record layer processing
Jouni Malinen [Sat, 5 Nov 2011 11:04:02 +0000 (13:04 +0200)]
TLS: Clean up TLS record layer processing

Return number of user input bytes from tlsv1_record_receive() to
move this detail into the proper record layer processing. In addition,
ignore unknown content types at record layer and allow processing to
continue after warning level TLS alerts to provide minimal workaround
for closure alerts.

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

12 years agoAdd random.c into libcrypto.a
Jouni Malinen [Sat, 5 Nov 2011 11:02:31 +0000 (13:02 +0200)]
Add random.c into libcrypto.a

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

12 years agoFix test-x509v3 build
Jouni Malinen [Fri, 4 Nov 2011 20:10:54 +0000 (22:10 +0200)]
Fix test-x509v3 build

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

12 years agoMove AP events for STA connected/disconnected into one function
Jouni Malinen [Thu, 3 Nov 2011 20:17:41 +0000 (22:17 +0200)]
Move AP events for STA connected/disconnected into one function

Instead of trying to remember to add wpa_msg() calls for every possible
path where a STA becomes authorized or unauthorized, use
ap_sta_set_authorized() to send these events more consistently.

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

12 years agoFix some recent wpa_msg() calls in hostapd use correct context
Jouni Malinen [Thu, 3 Nov 2011 20:04:17 +0000 (22:04 +0200)]
Fix some recent wpa_msg() calls in hostapd use correct context

wpa_msg() has to use hapd->msg_ctx instead of hapd as the context
pointer to work properly in wpa_supplicant AP mode.

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

12 years agohostapd: Send an event when an inactive station is removed
Nicolas Cavallari [Thu, 3 Nov 2011 19:58:22 +0000 (21:58 +0200)]
hostapd: Send an event when an inactive station is removed

Currently, there is no events over the control interface
when a AP disconnects a station due to inactivity.  With
this patch, an "AP-STA-DISCONNECTED" event will be sent.

Signed-hostap: Nicolas Cavallari <nicolas.cavallari@lri.fr>

12 years agondis: Work around lack of C99 designated initializers in MSVC
Jouni Malinen [Thu, 3 Nov 2011 16:45:21 +0000 (18:45 +0200)]
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>

12 years agowpa_cli: Fix compiler warnings on unused functions
Jouni Malinen [Thu, 3 Nov 2011 16:02:28 +0000 (18:02 +0200)]
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>

12 years agoInclude time.h to fix Windows builds
Jouni Malinen [Thu, 3 Nov 2011 16:00:57 +0000 (18:00 +0200)]
Include time.h to fix Windows builds

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

12 years agoRemove obsoleted Qt3-based wpa_gui
Jouni Malinen [Thu, 3 Nov 2011 15:48:31 +0000 (17:48 +0200)]
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>

12 years agoRemove kerneldoc2doxygen.pl from hostap.git
Jouni Malinen [Thu, 3 Nov 2011 11:02:04 +0000 (13:02 +0200)]
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>

12 years agoUpdate version number to 2.0-devel
Jouni Malinen [Thu, 3 Nov 2011 10:19:44 +0000 (12:19 +0200)]
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>

12 years agodbus: Fix some build combination without new D-Bus interface
Jouni Malinen [Wed, 2 Nov 2011 08:48:26 +0000 (10:48 +0200)]
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>

12 years agoFix Android library configuration with OpenSSL build
Jouni Malinen [Tue, 1 Nov 2011 08:39:49 +0000 (10:39 +0200)]
Fix Android library configuration with OpenSSL build

Commit bf9d5518d55e314cad2dbac0715ce151b2807691 did not split
LOCAL_SHARED_LIBRARIES properly and ended up removing the needed
libraries.

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

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>