mech_eap.git
12 years agoP2P: Add WpsFailed signal in P2P D-Bus
Jayant Sane [Sat, 25 Jun 2011 08:47:04 +0000 (11:47 +0300)]
P2P: Add WpsFailed signal in P2P D-Bus

Signal is triggered if an error occurs during WPS provisioning phase.

Signed-off-by: Jean-Michel.Bachot <jean-michelx.bachot@intel.com>
Signed-off-by: Jayant Sane <jayant.sane@intel.com>
12 years agoP2P: More complete persistent group management over D-Bus
Jayant Sane [Fri, 24 Jun 2011 08:20:19 +0000 (11:20 +0300)]
P2P: More complete persistent group management over D-Bus

Extend commit c2762e410fa319f75a174aeb12343beddf99fce4 to allow
applications to manage (add/remove) persistent groups and accepted
network object paths while invoking a persistent group.

12 years agoP2P: Add dissasoc_low_ack in P2P device properties
Jayant Sane [Thu, 23 Jun 2011 18:35:20 +0000 (21:35 +0300)]
P2P: Add dissasoc_low_ack in P2P device properties

This can be used to activate the keep alive mechanism enabled in
mac80211. Allows to trigger Peer Disconnected signal if signal is lost
on a P2P peer.

Signed-off-by: Jean-Michel Bachot <jean-michelx.bachot@linux.intel.com>
Signed-off-by: Jayant Sane <jayant.sane@intel.com>
12 years agoP2P: Fix P2P device signal level type in D-Bus
Jayant Sane [Thu, 23 Jun 2011 18:31:22 +0000 (21:31 +0300)]
P2P: Fix P2P device signal level type in D-Bus

Signed-off-by: Fabien Marotte <fabienx.marotte@intel.com>
Signed-off-by: Jayant Sane <jayant.sane@intel.com>
12 years agoP2P: Show P2P peer signal level in D-Bus P2P device properties
Jayant Sane [Thu, 23 Jun 2011 18:29:10 +0000 (21:29 +0300)]
P2P: Show P2P peer signal level in D-Bus P2P device properties

Move level parameter from p2p_device to p2p_device_info in order to
expose this information and modify D-Bus P2P handler to return this new
parameter through the P2P device properties.

Signed-off-by: Fabien Marotte <fabienx.marotte@intel.com>
Signed-off-by: Jayant Sane <jayant.sane@intel.com>
12 years agoP2P: Update D-Bus network object semantics during group formation
Jayant Sane [Thu, 23 Jun 2011 18:25:13 +0000 (21:25 +0300)]
P2P: Update D-Bus network object semantics during group formation

Do not emit network objects during P2P group formation since such
network objects can confuse certain apps. Instead, a persistent group
object is created to allow apps to keep track of persistent groups.
Persistent group objects only represent the info needed to recreate the
group.

Also fixes a minor bug in the handling of persistent group objects
during WPS operations.

Signed-off-by: Jayant Sane <jayant.sane@intel.com>
12 years agoP2P: Enable P2P capability advertisement on D-Bus
Jayant Sane [Thu, 23 Jun 2011 17:51:27 +0000 (20:51 +0300)]
P2P: Enable P2P capability advertisement on D-Bus

Append "P2P" to capability information if supported by device.

Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: Jayant Sane <jayant.sane@intel.com>
12 years agohostapd: Don't mask out non-symmetric STA HT caps
Helmut Schaa [Thu, 23 Jun 2011 17:18:21 +0000 (20:18 +0300)]
hostapd: Don't mask out non-symmetric STA HT caps

Previously hostapd just masked the STAs HT caps with its own. However,
some HT caps are not symmetric and as such need to be handled
different.

hostapd shouldn't overwrite the STAs SMPS mode as otherwise the driver
cannot know it has to use RTS/CTS to wake the receiver from dynamic
SMPS for MCS rates > 7.

hostapd shouldn't mask the RX and TX STBC caps with it's own. They are
already handled in a special case below.

Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
12 years agoFix CONFIG_NO_WPA_PASSPHRASE=y build
Jouni Malinen [Thu, 23 Jun 2011 16:53:45 +0000 (19:53 +0300)]
Fix CONFIG_NO_WPA_PASSPHRASE=y build

Need to define CONFIG_NO_PBKDF2 even though the crypto cleanup moved
the function to a separate file since there is conditional code in
wpa_supplicant/config.c. In addition, wpa_passphrase should not be
built at all if passphrase functionality is removed.

12 years agoAdd notes for CONFIG_WPS_ER build configuration option
Jouni Malinen [Thu, 23 Jun 2011 16:30:13 +0000 (19:30 +0300)]
Add notes for CONFIG_WPS_ER build configuration option

[Bug 407]

12 years agoUse nl80211 as an example instead of WEXT
Jouni Malinen [Thu, 23 Jun 2011 16:28:14 +0000 (19:28 +0300)]
Use nl80211 as an example instead of WEXT

12 years agoAdd a copyright and license statement for a radiotap header file
Jouni Malinen [Thu, 23 Jun 2011 13:39:26 +0000 (16:39 +0300)]
Add a copyright and license statement for a radiotap header file

This file is a part of the radiotap parser that Andy Green agreed to
relicense under the BSD license (per email, 11 Aug 2007 07:42:05
+0100). The copyright/license statement was updated in radiotap.c,
but this radiotap_iter.h file was forgotten at that point.

12 years agobsd: Fix set_key() sequence number endian issue
Zhu Yi [Thu, 23 Jun 2011 12:47:21 +0000 (15:47 +0300)]
bsd: Fix set_key() sequence number endian issue

In set_key handler, the seq[8] is in little endian order defined by
WPA. BSD kernel uses a u_int64_t value ik_keyrsc to represent it
internally. The kernel expects the native endian order for the value.
Thus, we need to detect the endian order and swap bytes when
necessary.

12 years agoFix AP selection to check privacy mismatch and IBSS with WPA/RSN IE
Jouni Malinen [Thu, 23 Jun 2011 12:39:00 +0000 (15:39 +0300)]
Fix AP selection to check privacy mismatch and IBSS with WPA/RSN IE

These checks were previously skipped if the scan result included WPA
or RSN IE. However, that can result in selecting a network that does
not match local configuration in some cases.

12 years agoFix hostapd build without NEED_AP_MLME=y
Jouni Malinen [Wed, 22 Jun 2011 18:45:14 +0000 (21:45 +0300)]
Fix hostapd build without NEED_AP_MLME=y

12 years agoAdd EVENT_RX_ACTION handler for hostapd
Jouni Malinen [Tue, 21 Jun 2011 17:55:46 +0000 (20:55 +0300)]
Add EVENT_RX_ACTION handler for hostapd

This fixes an issue with SA Query Response frames not being processed
anymore after wpa_supplicant started registering a handler for those.
This handler registration is in generic driver_nl80211.c code, so
hostapd uses it, too.

12 years agoRemove a compiler warning on uninitialized variable
Jouni Malinen [Tue, 21 Jun 2011 17:54:17 +0000 (20:54 +0300)]
Remove a compiler warning on uninitialized variable

This is not really ever used, but better keep the compiler output
cleaner.

12 years agoP2P: Start GO without extra scan step
Jouni Malinen [Tue, 21 Jun 2011 08:47:03 +0000 (11:47 +0300)]
P2P: Start GO without extra scan step

There are some corner cases, where the wpa_supplicant_req_scan() call
may end up scheduling a scan even if we are about to start a GO. Avoid
this by explicitly marking the GO network to be selected for the next
connection.

12 years agonl80211: Add support for driver-based PMKSA cache
Jouni Malinen [Mon, 20 Jun 2011 07:17:33 +0000 (10:17 +0300)]
nl80211: Add support for driver-based PMKSA cache

Implement PMKSA cache operations add, remove, and flush using nl80211
commands NL80211_CMD_{SET,DEL,FLUSH}_PMKSA to support PMKSA caching
with drivers that select the AP and generate the RSN IE internally.

12 years agoFix non-P2P D-Bus build
Jouni Malinen [Mon, 20 Jun 2011 06:02:41 +0000 (09:02 +0300)]
Fix non-P2P D-Bus build

12 years agoFix CONFIG_AP=y build without CONFIG_P2P=y
Jouni Malinen [Mon, 20 Jun 2011 05:58:32 +0000 (08:58 +0300)]
Fix CONFIG_AP=y build without CONFIG_P2P=y

13 years agoDBus: Fix some typos on comments
Jouni Malinen [Sun, 12 Jun 2011 22:09:32 +0000 (15:09 -0700)]
DBus: Fix some typos on comments

13 years agoDBus: Add support for P2P primitives
Johannes Berg [Sun, 12 Jun 2011 22:08:19 +0000 (15:08 -0700)]
DBus: Add support for P2P primitives

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 years agoDBus: Refactor array adding, add binary arrays
Johannes Berg [Sun, 12 Jun 2011 21:47:49 +0000 (14:47 -0700)]
DBus: Refactor array adding, add binary arrays

Some new code we're working on will require the dbus type "aay" (an
array of arrays of bytes). To add this, refactor the array code to
reduce code duplication by given a type string to the array starting
code, and also add code to create and parse such arrays from or into an
array of struct wpabuf respectively.

Since there's no unique DBus type for this, add a "fake"
WPAS_DBUS_TYPE_BINARRAY type that is separate from the regular DBus
types for parsing.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 years agoDBus: Move wpas_dbus_new_decompose_object_path()
Fabien Marotte [Sun, 12 Jun 2011 21:41:41 +0000 (14:41 -0700)]
DBus: Move wpas_dbus_new_decompose_object_path()

Moved wpas_dbus_new_decompose_object_path from dbus_new_handlers.c
to dbus_new_helpers.c.

Signed-off-by: Fabien Marotte <fabienx.marotte@linux.intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 years agoP2P: Add group started notification
Jean-Michel Bachot [Sun, 12 Jun 2011 21:35:37 +0000 (14:35 -0700)]
P2P: Add group started notification

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 years agoP2P: Add wpas_notify_p2p_provision_discovery()
Johannes Berg [Sun, 12 Jun 2011 21:31:56 +0000 (14:31 -0700)]
P2P: Add wpas_notify_p2p_provision_discovery()

Add a notification for P2P provision discovery status/result.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 years agoP2P: Add callback for provision discovery failure
Jayant Sane [Sun, 12 Jun 2011 21:26:22 +0000 (14:26 -0700)]
P2P: Add callback for provision discovery failure

When provision discovery fails, this new callback will be called
so P2P users can react to the failure.

Signed-off-by: Jayant Sane <jayant.sane@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 years agoP2P: Retry provision discovery requests in IDLE state
Jayant Sane [Sun, 12 Jun 2011 21:20:39 +0000 (14:20 -0700)]
P2P: Retry provision discovery requests in IDLE state

Since the peer may not be in Listen state when the provision discovery
request is sent, try to send the request again number of times when in
IDLE state. This was already done when p2p_find is in progress, but this
commit adds retries to the case where no other P2P operations are in
progress.

Signed-off-by: Jayant Sane <jayant.sane@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 years agoFix a compiler warning on WPS-AP-without-UPnP builds
Jouni Malinen [Tue, 31 May 2011 17:11:25 +0000 (20:11 +0300)]
Fix a compiler warning on WPS-AP-without-UPnP builds

13 years agorandom: Add support for maintaining internal entropy store over restarts
Jouni Malinen [Tue, 31 May 2011 17:07:11 +0000 (20:07 +0300)]
random: Add support for maintaining internal entropy store over restarts

This can be used to avoid rejection of first two 4-way handshakes every
time hostapd (or wpa_supplicant in AP/IBSS mode) is restarted. A new
command line parameter, -e, can now be used to specify an entropy file
that will be used to maintain the needed state.

13 years agoRemove compiler warning for non-P2P builds
Jouni Malinen [Fri, 27 May 2011 16:06:05 +0000 (19:06 +0300)]
Remove compiler warning for non-P2P builds

13 years agonl80211: Re-order functions to group AP/hostapd specific code
Jouni Malinen [Fri, 27 May 2011 16:02:04 +0000 (19:02 +0300)]
nl80211: Re-order functions to group AP/hostapd specific code

Get rid of separate ifdef/endif blocks for AP specific and hostapd
specific code, i.e., only have one main block of code for each case.

13 years agonl80211: Enable more AP callbacks for non-hostapd AP mode
Jouni Malinen [Fri, 27 May 2011 15:54:36 +0000 (18:54 +0300)]
nl80211: Enable more AP callbacks for non-hostapd AP mode

Some of these are required for proper functionality (like
get_seqnum); others may not be needed yet, but including them
allows some extra ifdef/endif blocks to be removed.

13 years agonl80211: Implement set_rate_sets for non-hostapd AP case
Eliad Peller [Fri, 27 May 2011 15:41:46 +0000 (18:41 +0300)]
nl80211: Implement set_rate_sets for non-hostapd AP case

.set_rate_sets is not defined for non-hostapd, which prevents
configuring basic_rates when working as P2P GO.

Signed-off-by: Eliad Peller <eliad@wizery.com>
13 years agoatheros: Fix auth_alg configuration for static WEP
Ken Zhu [Fri, 20 May 2011 15:27:53 +0000 (18:27 +0300)]
atheros: Fix auth_alg configuration for static WEP

When IEEE 802.1X is not enabled, driver_atheros.c needs to know how
to set authentication algorithms for static WEP.

13 years agoFix regression in RSN pre-authentication candidate list generation
Jouni Malinen [Thu, 19 May 2011 14:52:46 +0000 (17:52 +0300)]
Fix regression in RSN pre-authentication candidate list generation

Processing of the scan results for RSN pre-authentication candidates
was moved to happen before the network was selected. This resulted in
all candidates being dropped due to no SSID having been configured.
Fix this by moving the processing to happen after the network has
been selected. Since the raw scan results are not available at that
point, use the BSS table instead of scan results to fetch the
information.

13 years agoWPS UPnP: Fix UPnP initialization for non-bridge case with some drivers
Vinay Adella [Thu, 19 May 2011 09:55:47 +0000 (12:55 +0300)]
WPS UPnP: Fix UPnP initialization for non-bridge case with some drivers

If the driver wrapper is setting up the interface up only at commit(),
UPnP initialization fails. Fix that by moving UPnP setup to happen after
the driver commit() call.

13 years agoWPS: Add a workaround for Windows 7 capability discovery for PBC
Jouni Malinen [Tue, 17 May 2011 16:53:02 +0000 (19:53 +0300)]
WPS: Add a workaround for Windows 7 capability discovery for PBC

Windows 7 uses incorrect way of figuring out AP's WPS capabilities by
acting as a Registrar and using M1 from the AP. The config methods
attribute in that message is supposed to indicate only the configuration
method supported by the AP in Enrollee role, i.e., to add an external
Registrar. For that case, PBC shall not be used and as such, the
PushButton config method is removed from M1 by default. If pbc_in_m1=1
is included in the configuration file, the PushButton config method is
left in M1 (if included in config_methods parameter) to allow Windows 7
to use PBC instead of PIN (e.g., from a label in the AP).

13 years agoAdd TDLS support to Android.mk
Dmitry Shmidt [Mon, 16 May 2011 19:29:43 +0000 (22:29 +0300)]
Add TDLS support to Android.mk

13 years agoBetter messages when channel cannot be used in AP mode
Ben Greear [Mon, 16 May 2011 19:01:11 +0000 (22:01 +0300)]
Better messages when channel cannot be used in AP mode

Log messages letting user know that the channel cannot
be used because it is flagged unusable.

Signed-off-by: Ben Greear <greearb@candelatech.com>
13 years agoInclude nl80211 driver wrapper in default configuration for hostapd
Jouni Malinen [Mon, 16 May 2011 18:07:47 +0000 (21:07 +0300)]
Include nl80211 driver wrapper in default configuration for hostapd

13 years agoP2P: Include operating class 124 (channels 149,153,157,161)
Jouni Malinen [Mon, 16 May 2011 18:07:05 +0000 (21:07 +0300)]
P2P: Include operating class 124 (channels 149,153,157,161)

When using the p2p_oper_reg_class configuration option instead of
p2p_group_add freq parameter, the operating class 124 was not
processed correctly. Include that class in the list of 5 GHz classes
for the p2p_oper_reg_class to resolve this.

13 years agoWPS: Remove obsolete note about lack for WPS ER support
Jouni Malinen [Mon, 16 May 2011 18:06:08 +0000 (21:06 +0300)]
WPS: Remove obsolete note about lack for WPS ER support

13 years agoUpdate BSS table entry if roaming event indicates frequency change
Jouni Malinen [Mon, 16 May 2011 16:19:30 +0000 (19:19 +0300)]
Update BSS table entry if roaming event indicates frequency change

This is needed to make sure the frequency in the BSS table entry
remains up-to-date if the AP changes its operating frequency.

13 years agonl80211: Filter out duplicated BSS table entries from scan results
Jouni Malinen [Mon, 16 May 2011 16:18:42 +0000 (19:18 +0300)]
nl80211: Filter out duplicated BSS table entries from scan results

cfg80211 maintains separate BSS table entries for APs if the same
BSSID,SSID pair is seen on multiple channels. wpa_supplicant does
not use frequency as a separate key in the BSS table, so filter out
duplicated entries. Prefer associated BSS entry in such a case in
order to get the correct frequency into the BSS table.

13 years agonl80211: Fetch assoc_freq from scan table for connect event
Jouni Malinen [Mon, 16 May 2011 15:35:42 +0000 (18:35 +0300)]
nl80211: Fetch assoc_freq from scan table for connect event

When kernel-based SME is used, use the scan table to find a BSS entry
for the associated AP when processing connected event.

13 years agoEnable CONFIG_DRIVER_NL80211=y in the default configuration
Jouni Malinen [Thu, 21 Apr 2011 17:41:01 +0000 (20:41 +0300)]
Enable CONFIG_DRIVER_NL80211=y in the default configuration

nl80211 should be preferred over WEXT with any recent Linux kernel
version.

13 years agoAdd workaround for race condition with AssocResp TX status
Jouni Malinen [Fri, 15 Apr 2011 16:26:28 +0000 (19:26 +0300)]
Add workaround for race condition with AssocResp TX status

It may take some time for the TX status to be delivered for a
(Re)Association Response frame and if any Data frames are received
during that time, they may end up getting dropped as Class 3 frames in
not-associated state. This results in a Disassociation frame being sent
to the station and it assuming that the association has been lost.

Work around the issue by remembering that the (Re)Association Request
has already been accepted and skip the Deauth/Disassoc sending because
of the possible Class 3 frames before the TX status callback is
received.

13 years agoAdd 'signal_poll' command interface
Dmitry Shmidt [Fri, 15 Apr 2011 15:52:01 +0000 (18:52 +0300)]
Add 'signal_poll' command interface

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
13 years agoPrevent explicit scan command during scan or association
Dmitry Shmidt [Fri, 15 Apr 2011 15:40:29 +0000 (18:40 +0300)]
Prevent explicit scan command during scan or association

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
13 years agohostapd: Fix interfaces.iface initialization
Guy Eilam [Fri, 15 Apr 2011 15:13:04 +0000 (18:13 +0300)]
hostapd: Fix interfaces.iface initialization

Set all the interfaces.iface pointers to NULL after the allocation of
that memory block for cases those pointers are accessed during each of
the interfaces initialization process (hostapd_interface_init()). One
example for such case is during WPS initialization when the code tries
to fetch the uuid from each of the interfaces.

Signed-off-by: Guy Eilam <guy@wizery.com>
13 years agoUpdate driver country info on 'SET country <value>'
Jouni Malinen [Fri, 15 Apr 2011 14:00:01 +0000 (17:00 +0300)]
Update driver country info on 'SET country <value>'

13 years agobsd: Add support for setting HT values in IFM_MMASK
Yi Zhu [Thu, 14 Apr 2011 19:22:24 +0000 (22:22 +0300)]
bsd: Add support for setting HT values in IFM_MMASK

13 years agoAdd sanity checks for fseek and ftell return values
Jouni Malinen [Thu, 14 Apr 2011 17:22:21 +0000 (20:22 +0300)]
Add sanity checks for fseek and ftell return values

In theory, these calls could fail, but it is not really likely to
happen in practice in the use case here. Anyway, check that they do
not return an error before accepting the length of the file.

13 years agoIBSS RSN: peer->addr is an array so it cannot be NULL
Jouni Malinen [Thu, 14 Apr 2011 17:18:12 +0000 (20:18 +0300)]
IBSS RSN: peer->addr is an array so it cannot be NULL

13 years agoWPS: Fix off-by-one check in vendor extension parsing
Jouni Malinen [Thu, 14 Apr 2011 17:02:31 +0000 (20:02 +0300)]
WPS: Fix off-by-one check in vendor extension parsing

13 years agodriver_test: Check set_ssid len before trying to hexdump the SSID
Jouni Malinen [Thu, 14 Apr 2011 16:52:26 +0000 (19:52 +0300)]
driver_test: Check set_ssid len before trying to hexdump the SSID

13 years agoTDLS: Verify that scan results for BSS are available before using them
Jouni Malinen [Thu, 14 Apr 2011 16:50:26 +0000 (19:50 +0300)]
TDLS: Verify that scan results for BSS are available before using them

13 years agoWPS: Use strict validation of (Re)AssocReq only if IEs are known
Jouni Malinen [Wed, 13 Apr 2011 23:58:35 +0000 (02:58 +0300)]
WPS: Use strict validation of (Re)AssocReq only if IEs are known

13 years agoWPS: Use strict validation of (Re)AssocResp only if IEs are known
Jouni Malinen [Wed, 13 Apr 2011 23:55:38 +0000 (02:55 +0300)]
WPS: Use strict validation of (Re)AssocResp only if IEs are known

13 years agoOpenSSL: Use consistent SSL_get_app_data validation in tls_verify_cb
Jouni Malinen [Wed, 13 Apr 2011 23:50:52 +0000 (02:50 +0300)]
OpenSSL: Use consistent SSL_get_app_data validation in tls_verify_cb

The returned value cannot really be NULL, but better keep this
function consistent on whether the returned value is checked or not.

13 years agoAvoid theoretical NULL pointer dereference during TLS reassemble
Jouni Malinen [Wed, 13 Apr 2011 23:45:14 +0000 (02:45 +0300)]
Avoid theoretical NULL pointer dereference during TLS reassemble

This function does not get called with in_data == NULL in practice, but
it seems to be at least partly prepared for that case, so better make it
consistent by handling the NULL value throughout the function.

13 years agoAdd sanity checks to EVENT_RX_PROBE_REQ event data
Jouni Malinen [Wed, 13 Apr 2011 23:39:25 +0000 (02:39 +0300)]
Add sanity checks to EVENT_RX_PROBE_REQ event data

Both the SA and IEs from the received Probe Request frames must be
included and the Probe Request RX callback functions may assume that
these are not NULL.

13 years agoAvoid theoretical NULL pointer dereference from debug code
Jouni Malinen [Wed, 13 Apr 2011 23:32:07 +0000 (02:32 +0300)]
Avoid theoretical NULL pointer dereference from debug code

The change to use wpa_dbg() in wpa_sm_parse_own_wpa_ie() could result
in a NULL pointer dereference if the function were called when WPA
state machine has not been initialized. While this cannot really
happen in practice, it is better to be prepared for that since that
was the case before the wpa_dbg() change.

13 years agoDistinguish empty concatenated vendor-specific IE from missing one
Jouni Malinen [Wed, 13 Apr 2011 23:25:43 +0000 (02:25 +0300)]
Distinguish empty concatenated vendor-specific IE from missing one

When comparing BSS table entries, handle empty concatenated
vendor-specific IE differently from completely missing IE. This
does not change anything for the only currently compared IE that
can be fragmented (WPS IE), but it is better to have the generic
code here ready for any possible new IE that could be used in
with zero-length data.

13 years agoP2P: Fix memory leak in UPnP service discovery request processing
Jouni Malinen [Wed, 13 Apr 2011 22:33:26 +0000 (01:33 +0300)]
P2P: Fix memory leak in UPnP service discovery request processing

13 years agoUse type cast to get rid of implicit sign extension
Jouni Malinen [Wed, 13 Apr 2011 22:27:38 +0000 (01:27 +0300)]
Use type cast to get rid of implicit sign extension

The size_t value here can be 64-bit and result in implicit sign
extension. In this particular case, that gets masked out by
host_to_be32(), so there is no practical difference, but it is better
to get rid of the 64-bit variable explicitly.

13 years agoTNC: Fix TNC_{TNCC,TNCS}_ReportMessageTypes copy type
Jouni Malinen [Wed, 13 Apr 2011 20:10:21 +0000 (23:10 +0300)]
TNC: Fix TNC_{TNCC,TNCS}_ReportMessageTypes copy type

The supportedTypes parameter is a list of TNC_MessageType values
and the buffer to be copied should use size of TNC_MessageType, not
TNC_MessageTypeList. In practice, these are of same length on most
platforms, so this is not a critical issue, but anyway, the correct
type should be used.

13 years agoTDLS: Validate FTIE length before processing it
Jouni Malinen [Wed, 13 Apr 2011 19:14:22 +0000 (22:14 +0300)]
TDLS: Validate FTIE length before processing it

This avoids reading past the end of the IE buffer should the FTIE
be too short. In addition, one debug hexdump was using uninitialized
pointer to the FTIE buffer, so fixed it to use the pointer from the
parse data.

13 years agoP2P: Clear go_dev_addr for group started events if it is not known
Jouni Malinen [Wed, 13 Apr 2011 19:03:52 +0000 (22:03 +0300)]
P2P: Clear go_dev_addr for group started events if it is not known

Better make sure the address value included in the event message gets
cleared in case the GO Device Address is not known for some reason.
Previously, this could potentially have been some random data from
stack should we ever hit the case where wpa_s->current_ssid is not
set (which should not really happen in normal use cases).

13 years agoMake the example action script less likely to result in failures
Jouni Malinen [Wed, 13 Apr 2011 16:55:34 +0000 (19:55 +0300)]
Make the example action script less likely to result in failures

Use "=" instead of "==" and add an example statement between "then"
and "fi".

13 years agobsd: Fix buffer size for routing socket with IPv6 disabled
Yi Zhu [Tue, 12 Apr 2011 20:09:14 +0000 (23:09 +0300)]
bsd: Fix buffer size for routing socket with IPv6 disabled

AF_INET6 is not always enabled by default, so use AF_INET instead. In
addition, use the old fixed length, 2048, as a failover value if the
sysctl fails for any reason.

13 years agoMake scan interval configurable
Dmitry Shmidt [Mon, 11 Apr 2011 20:14:38 +0000 (23:14 +0300)]
Make scan interval configurable

It is now possible to configure the the time in seconds that
wpa_supplicant waits before requesting a new scan after failing to find
a suitable network in scan results.

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
13 years agoFix WPS AP mode regression
Jouni Malinen [Mon, 11 Apr 2011 16:22:49 +0000 (19:22 +0300)]
Fix WPS AP mode regression

Commit 03d3f28a698ec2c269fed35b88be30373595eee2 broke initialization of
EAPOL authenticator state machines since an error value from
wpa_auth_sta_key_mgmt() (-1) was not handled properly and the fixed
wpa_key_mgmt_wpa_psk() identified the value as a PSK-based AKM because
of all bits being set to 1. The special error value needs to handled
separately to avoid skipping EAPOL state machine initialization.

13 years agoFix #ifdef check for older openssl versions
Adam Kent [Mon, 11 Apr 2011 15:37:12 +0000 (18:37 +0300)]
Fix #ifdef check for older openssl versions

Small compile fix for older versions of openssl that do not have SHA256
support and hence do not define OPENSSL_NO_SHA256.

13 years agoRemove references to time_t/time()/random()
Per Ekman [Mon, 11 Apr 2011 15:33:48 +0000 (18:33 +0300)]
Remove references to time_t/time()/random()

Replace direct calls in AP mode code with os_*() wrappers.

13 years agoReturn NULL instead of 0 as the pointer on error case
Jouni Malinen [Fri, 8 Apr 2011 16:16:20 +0000 (19:16 +0300)]
Return NULL instead of 0 as the pointer on error case

13 years agoFix WPA/WPA2 AP rejection on parameter mismatch
Jouni Malinen [Fri, 8 Apr 2011 16:13:58 +0000 (19:13 +0300)]
Fix WPA/WPA2 AP rejection on parameter mismatch

If WPA/WPA2 was enabled in the configuration, the non-WPA exception
could allow an incorrect AP to be selected from scan results. Do
not use the exception if WPA/WPA2 is enabled in configuration.

13 years agoFix wpa_key_mgmt_*() helper functions to handle multiple bits
Jouni Malinen [Fri, 8 Apr 2011 16:11:54 +0000 (19:11 +0300)]
Fix wpa_key_mgmt_*() helper functions to handle multiple bits

These can be used in some cases with a bitfield having multiple
AKMs enabled (e.g., WPA-PSK and WPA-PSK-SHA256). Address those
cases by checking whether any of the matching AKM are included.

13 years agoatheros: Add support for IEEE 802.11w configuration
Mahesh Palivela [Fri, 8 Apr 2011 09:06:27 +0000 (12:06 +0300)]
atheros: Add support for IEEE 802.11w configuration

13 years agonl80211: Add support for auth_alg auto-selection with connect command
Jouni Malinen [Thu, 7 Apr 2011 11:53:40 +0000 (14:53 +0300)]
nl80211: Add support for auth_alg auto-selection with connect command

When the SME is in the driver or cfg80211, the automatic selection
of auth_alg is done by leaving out the NL80211_ATTR_AUTH_TYPE
attribute from the NL80211_CMD_CONNECT command.

13 years agoTDLS: Disable teardown MIC validation workaround
Jouni Malinen [Thu, 7 Apr 2011 11:48:46 +0000 (14:48 +0300)]
TDLS: Disable teardown MIC validation workaround

This MIC is required to be correct if the keys are set, so reject
the message if it does not have a valid MIC.

13 years agodbus: Add support to get/set the country code
Sam Leffler [Mon, 4 Apr 2011 22:24:26 +0000 (01:24 +0300)]
dbus: Add support to get/set the country code

Add an Interface.Country property and support to get/set the value.

Signed-off-by: Sam Leffler <sleffler@chromium.org>
13 years agoFix a typo in a MIB variable in hostapd ctrl_interface
Jouni Malinen [Mon, 4 Apr 2011 22:21:27 +0000 (01:21 +0300)]
Fix a typo in a MIB variable in hostapd ctrl_interface

13 years agowpa_s AP mode: Fix regression in P2P AP mode setup
Jouni Malinen [Mon, 4 Apr 2011 09:50:26 +0000 (12:50 +0300)]
wpa_s AP mode: Fix regression in P2P AP mode setup

Commit c76e5d7f9b7a4ed8c201f280a04e579d52765572 moved the
ap_configured_cb() call into a completion callback from AP mode code.
However, this callback can be called before hostap_setup_interface()
returns. In that case, the ap_configured_cb() ended up getting
called before the wpa_supplicant connection information was updated.
Fix this by reordering code to set up everything before calling
hostapd_setup_interface().

13 years agonl80211: Send EAPOL frames as QoS data frames for QoS aware clients
Felix Fietkau [Sat, 2 Apr 2011 19:03:05 +0000 (22:03 +0300)]
nl80211: Send EAPOL frames as QoS data frames for QoS aware clients

This should fix EAPOL reauthentication and rekeying timeout issues
with Intel clients when using WMM (e.g., with IEEE 802.11n). These
stations do not seem to be able to handle EAPOL data frames as
non-QoS Data frames after the initial setup.

This adds STA flags to hapd_send_eapol() driver op to allow
driver_nl80211.c to mark the EAPOL frames as QoS Data frame
when injecting it through the monitor interface.

13 years agobgscan_simple: Reschedule first fast scan
Paul Stewart [Thu, 31 Mar 2011 15:06:09 +0000 (18:06 +0300)]
bgscan_simple: Reschedule first fast scan

If the scan interval switches to the short interval soon after a
scan, bgscan_simple should not immediately scan again. However,
it should also make sure that the next scan occurs no later than
the new, short scan interval.

Signed-off-by: Paul Stewart <pstew@google.com>
13 years agobgscan_simple: Time out short scan interval
Paul Stewart [Thu, 31 Mar 2011 15:04:48 +0000 (18:04 +0300)]
bgscan_simple: Time out short scan interval

We gain diminishing returns by the short scan interval. The short
scan interval is used to hunt for a better AP if the RSSI of the
current AP drops. However, if we never roam, and the AP continues
to have low RSSI, at some point we should give up and return to
the slow background scan rate, otherwise we waste a lot of power.

Signed-off-by: Paul Stewart <pstew@google.com>
13 years agobgscan-simple: Poll for signal in init
Paul Stewart [Thu, 31 Mar 2011 15:02:37 +0000 (18:02 +0300)]
bgscan-simple: Poll for signal in init

It is not guaranteed that we will get a CQM signal shortly after setting
up monitoring. In order to establish the correct initial background
scanning rate, poll directly for the signal strength.

Signed-off-by: Paul Stewart
13 years agodriver: Function to directly poll signal quality
Paul Stewart [Thu, 31 Mar 2011 14:56:48 +0000 (17:56 +0300)]
driver: Function to directly poll signal quality

This provides a means for the supplicant to directly request signal
quality metrics from the driver. This is useful, for example for
background scan algorithms that might ask desire this information
out-of-band with CQM events.

Signed-off-by: Paul Stewart <pstew@google.com>
13 years agodbus: Add "excessive" to debug_strings
Paul Stewart [Thu, 31 Mar 2011 14:38:08 +0000 (17:38 +0300)]
dbus: Add "excessive" to debug_strings

The "debug_strings" private array in dbus_new_handles.c has fallen out
of sync with wpa_debug.h. Add the new "excessive" level to the head of
the list, realigning everything.

Signed-off-by: Paul Stewart <pstew@google.com>
13 years agoP2P: add a missing 'return' after building IE from an empty string
Eliad Peller [Wed, 30 Mar 2011 14:08:42 +0000 (17:08 +0300)]
P2P: add a missing 'return' after building IE from an empty string

When building IE from an empty string and CONFIG_WPS_STRICT is
not defined, redundant 2 bytes are being added to the string.

We have to return right after building the "dummy" string.

Signed-off-by: Eliad Peller <eliad@wizery.com>
13 years agoWork around SNonce updates on EAPOL-Key 1/4 retransmission
Jouni Malinen [Tue, 29 Mar 2011 14:39:12 +0000 (17:39 +0300)]
Work around SNonce updates on EAPOL-Key 1/4 retransmission

Some deployed supplicants update their SNonce for every receive
EAPOL-Key message 1/4 even when these messages happen during the
same 4-way handshake. Furthermore, some of these supplicants fail
to use the first SNonce that they sent and derive an incorrect PTK
using another SNonce that does not match with what the authenticator
is using from the first received message 2/4. This results in
failed 4-way handshake whenever the EAPOL-Key 1/4 retransmission
timeout is reached. The timeout for the first retry is fixed to
100 ms in the IEEE 802.11 standard and that seems to be short
enough to make it difficult for some stations to get the response
out before retransmission.

Work around this issue by increasing the initial EAPOL-Key 1/4
timeout by 1000 ms (i.e., total timeout of 1100 ms) if the station
acknowledges reception of the EAPOL-Key frame. If the driver does
not indicate TX status for EAPOL frames, use longer initial
timeout (1000 ms) unconditionally.

13 years agoAdd driver capa flag for EAPOL TX status and store capa in hostapd
Jouni Malinen [Tue, 29 Mar 2011 14:36:06 +0000 (17:36 +0300)]
Add driver capa flag for EAPOL TX status and store capa in hostapd

13 years agoP2P: Store more WPS attributes for peers
Jouni Malinen [Mon, 28 Mar 2011 12:27:10 +0000 (15:27 +0300)]
P2P: Store more WPS attributes for peers

Store Manufacturer, Model Name, Model Number, and Serial Number
attributes for P2P peers and expose these through the existing
peer information mechanisms.

13 years agoP2P: Add more WPS attributes into Listen state Probe Response
Jouni Malinen [Mon, 28 Mar 2011 12:24:12 +0000 (15:24 +0300)]
P2P: Add more WPS attributes into Listen state Probe Response

Configure more WPS attributes in the P2P module and use them
when generating WSC IE for Probe Response frames in Listen state.

13 years agoTDLS: Allow TDLS to be disabled at runtime for testing purposes
Jouni Malinen [Thu, 24 Mar 2011 18:44:17 +0000 (20:44 +0200)]
TDLS: Allow TDLS to be disabled at runtime for testing purposes

Control interface command 'SET tdls_disabled <1/0>' can now be used
to disable/enable TDLS at runtime. This is mainly for testing
purposes.

13 years agoRSN IBSS: Restart IBSS state machines for each new IBSS
Jouni Malinen [Wed, 23 Mar 2011 19:15:46 +0000 (21:15 +0200)]
RSN IBSS: Restart IBSS state machines for each new IBSS

Change the old design of running a single long living RSN IBSS
instance to keep a separate instance for each IBSS connection.
This fixes number of issues in getting keys set properly for
new connections and is in general quite a bit more correct
design.

13 years agonl80211: Implement deauth for IBSS as leave IBSS command
Jouni Malinen [Wed, 23 Mar 2011 19:15:22 +0000 (21:15 +0200)]
nl80211: Implement deauth for IBSS as leave IBSS command