mech_eap.git
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

13 years agoMake GKeyDoneStations counting able to recover from mismatches
Jouni Malinen [Wed, 23 Mar 2011 15:06:17 +0000 (17:06 +0200)]
Make GKeyDoneStations counting able to recover from mismatches

Previously, a bug in GKeyDoneStations count would remain in effect
until the authenticator is restarted. Make this more robust by
clearing the station count before each rekeying setup. While this
is not really supposed to be needed, there has been bugs in this
area in the past and it is safer to make the implementation recover
from such an issue automatically.

13 years agoDecrement GKeyDoneStations in WPA authenticator when STA is freed
Jouni Malinen [Wed, 23 Mar 2011 15:00:18 +0000 (17:00 +0200)]
Decrement GKeyDoneStations in WPA authenticator when STA is freed

If the STA to be freed is still included in GKeyDoneStations count,
decrement the count when the STA is freed. This does not happen in
AP mode since there is enough time to go through the authenticator
state machine to clear the STA. However, in the current RSN IBSS
implementation, the authenticator state for the STA is freed in a
way that does not allow the state machine to go through the clearing.
To address this, make sure that wpa_free_sta_sm() decrements the
GKeyDoneStations count if the STA happened to be in the process of
GTK rekeying.

13 years agonl80211: Use NL80211_CMD_DEL_STATION event to indicate IBSS peer loss
Jouni Malinen [Wed, 23 Mar 2011 13:32:55 +0000 (15:32 +0200)]
nl80211: Use NL80211_CMD_DEL_STATION event to indicate IBSS peer loss

13 years agorandom: Read /dev/random in the background with eloop read socket
Jouni Malinen [Tue, 22 Mar 2011 21:15:00 +0000 (23:15 +0200)]
random: Read /dev/random in the background with eloop read socket

This makes it more likely to be able to fetch the 20 octet seed from
/dev/random in cases where other programs may also be competing for
this.

13 years agonl80211: Do not add interface to the global list in case of failure
Johannes Berg [Tue, 22 Mar 2011 13:52:04 +0000 (15:52 +0200)]
nl80211: Do not add interface to the global list in case of failure

This avoids leaving a freed interface on the global list in case
driver initialization fails.

13 years agohostapd: Add testing mode for RSN element extensions
Jouni Malinen [Mon, 21 Mar 2011 11:59:05 +0000 (13:59 +0200)]
hostapd: Add testing mode for RSN element extensions

CFLAGS += -DCONFIG_RSN_TESTING in .config and rsn_testing=1 in
hostapd.conf can now be used to enable a testing mode that adds
extensions to RSN element. This can be used to check whether
station implementations are incompatible with future extensions
to the RSN element.

13 years agowpa_supplicant: Parameterize BSS table expiration age + count
Sam Leffler [Sun, 20 Mar 2011 10:40:59 +0000 (12:40 +0200)]
wpa_supplicant: Parameterize BSS table expiration age + count

Replace compile-time BSS cache expiration age and scan count by config
parameters that can be set via wpa_cli and the new D-Bus API. The latter
is done with interface properties BSSExpireAge and BSSExpireCount.

13 years agowpa_supplicant: Start bgscan on COMPLETED, not ASSOCIATED
Paul Stewart [Sun, 20 Mar 2011 10:27:03 +0000 (12:27 +0200)]
wpa_supplicant: Start bgscan on COMPLETED, not ASSOCIATED

Move the code snippet to switch on bgscan over to wpa_supplicant.c
from event.c, so that it can be activated on wpa_supplicant_set_state().
Also create a centralized place to switch off bgscan. bgscan is now
turned on in COMPLETED, not ASSOCIATED.

13 years agoFix a typo in a comment
Jouni Malinen [Sun, 20 Mar 2011 10:15:02 +0000 (12:15 +0200)]
Fix a typo in a comment

13 years agodbus: Add RemoveAllNetworks to the new D-Bus API
Sam Leffler [Sun, 20 Mar 2011 10:12:12 +0000 (12:12 +0200)]
dbus: Add RemoveAllNetworks to the new D-Bus API

This adds a new command to the interface to remove all configured
netblocks. Without this it's necessary to query properties on the
interface and explicitly remove each netblock.

13 years agowpa_supplicant: Search BSS list from back to front
Nathan Williams [Sun, 20 Mar 2011 10:06:36 +0000 (12:06 +0200)]
wpa_supplicant: Search BSS list from back to front

This fixes an issue seen in our wifi testbed, where we frequently
switch the SSID of the AP. wpa_supplicant's BSS list will have, for
example both <bssid, "Check11b"> (from the previous test) and <bssid,
"Check11g"> (from the current test) - note that the bssid is the same for
both. The (old) D-Bus API for fetching scan responses from wpa_supplicant
is fetch-by-bssid, so the caller (flimflam) incorrectly believes we're
associated with <bssid, "Check11b">.

13 years agodbus: Add D-Bus methods to flush the BSS cache
Sam Leffler [Sun, 20 Mar 2011 10:02:33 +0000 (12:02 +0200)]
dbus: Add D-Bus methods to flush the BSS cache

Add an "Interface.FlushBSS" method to the new D-Bus API and a "flush"
method to the old API. Both take an age parameter that is a threshold
(in seconds) for selecting entries to evict. Setting this parameter
to zero flushes all entries from the cache.

This mechanism is useful for a connection manager to clear state at
startup and on resume (where the age parameter may be used to hold
onto recent/valid data).

13 years agodbus: Add ConfigFile to AddInterface properties
Sam Leffler [Sun, 20 Mar 2011 09:52:57 +0000 (11:52 +0200)]
dbus: Add ConfigFile to AddInterface properties

This provides feature parity with the old-style D-Bus API. Explicit
properties to control global parameters is preferred but until that
happens this allows doing things like setting pkcs11_engine_path and
pkcs11_module_path via D-Bus.

13 years agoDocument CONFIG_DEBUG_SYSLOG and CONFIG_DEBUG_SYSLOG_FACILITY
Jouni Malinen [Sun, 20 Mar 2011 09:49:41 +0000 (11:49 +0200)]
Document CONFIG_DEBUG_SYSLOG and CONFIG_DEBUG_SYSLOG_FACILITY

13 years agoAdd support for setting the syslog facility from the config file
Sam Leffler [Sun, 20 Mar 2011 09:48:42 +0000 (11:48 +0200)]
Add support for setting the syslog facility from the config file

This enables setting the syslog facility at build time.

13 years agowpa_s AP mode: complete only when setup is complete
Johannes Berg [Sat, 19 Mar 2011 11:11:15 +0000 (13:11 +0200)]
wpa_s AP mode: complete only when setup is complete

The AP code might, currently only in the case of HT40, defer actual
enabling to after a scan. In this case, the wpa_s AP code gets confused.
Add a callback for it to use and make it use it to finish only when the
setup has actually completed.

With appropriate hacks in place this allows using HT40 in P2P mode.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 years agowpa_s AP mode: propagate scan event
Johannes Berg [Sat, 19 Mar 2011 11:08:08 +0000 (13:08 +0200)]
wpa_s AP mode: propagate scan event

When wpa_s scans in AP mode, it doesn't propagate the scan event to the
AP code, so that code can get stuck if it uses the callbacks there.
Simply call them where appropriate.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 years agoP2P: Add option for requested device type in P2P search/scan
Jean-Michel Bachot [Sat, 19 Mar 2011 10:57:46 +0000 (12:57 +0200)]
P2P: Add option for requested device type in P2P search/scan

With this, p2p_find can be extended to find certain requested device
types.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 years agoP2P: Use a single define for max number of vendor extensions
Jouni Malinen [Sat, 19 Mar 2011 10:20:10 +0000 (12:20 +0200)]
P2P: Use a single define for max number of vendor extensions

13 years agoP2P: Keep track of peer WPS vendor extensions
Jean-Michel Bachot [Sat, 19 Mar 2011 10:16:20 +0000 (12:16 +0200)]
P2P: Keep track of peer WPS vendor extensions

Make the P2P code keep track of WPS vendor extensions received from
peers so they can be exposed via DBus later.

Signed-off-by: Jean-Michel Bachot <jean-michelx.bachot@linux.intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 years agoP2P: Allow adding of WPS vendor extension attributes
Jean-Michel Bachot [Sat, 19 Mar 2011 09:57:10 +0000 (11:57 +0200)]
P2P: Allow adding of WPS vendor extension attributes

This adds the ability to add WPS vendor extension attributes in P2P
frames, like GO Negotiation and Probe Response frames.

Signed-off-by: Jean-Michel Bachot <jean-michelx.bachot@linux.intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 years agoWPS: Add support for adding WPS Vendor Extensions
Jean-Michel Bachot [Sat, 19 Mar 2011 09:44:42 +0000 (11:44 +0200)]
WPS: Add support for adding WPS Vendor Extensions

This adds the ability to add WPS vendor extensions to an AP (or GO).
They will be added to the WSC IE(s) in Beacon and Probe Response frames.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 years agoWPS: Move P2P extension generation for WSC IE in Beacon frames
Jouni Malinen [Sat, 19 Mar 2011 09:39:51 +0000 (11:39 +0200)]
WPS: Move P2P extension generation for WSC IE in Beacon frames

This cleans up debug log by keeping the WSC IE attributes for Beacon
frames before starting to build the Probe Response frame.

13 years agoIBSS RSN: Clear IBSS RSN peers based on peer lost events
Xi Chen [Fri, 18 Mar 2011 15:04:46 +0000 (17:04 +0200)]
IBSS RSN: Clear IBSS RSN peers based on peer lost events

13 years agoWPS: Store (secondary) device type as binary
Johannes Berg [Thu, 17 Mar 2011 16:50:22 +0000 (18:50 +0200)]
WPS: Store (secondary) device type as binary

Instead of converting back and forth from the string representation,
always use the binary representation internally.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 years agoWPS: Fix copying of UUID from the first interface
Jouni Malinen [Thu, 17 Mar 2011 16:07:00 +0000 (18:07 +0200)]
WPS: Fix copying of UUID from the first interface

Use the first interface (last in the list), not the last added
interface. In addition, use the same routine to set the UUID
after reconfiguration.

13 years agoWPS: Add more debug information to PBC session overlap check
Jouni Malinen [Thu, 17 Mar 2011 16:04:56 +0000 (18:04 +0200)]
WPS: Add more debug information to PBC session overlap check

13 years agoWPS: Fix active PBC session removal to ignore MAC address
Jouni Malinen [Thu, 17 Mar 2011 16:03:20 +0000 (18:03 +0200)]
WPS: Fix active PBC session removal to ignore MAC address

Use only the UUID-E to remove active PBC session(s) at the completion of
successful PBC protocol run. This fixes potential issues with Enrollees
that use multiple MAC addresses and as such, can get multiple entries in
the PBC session list.

13 years agoMake the link process quieter unless V=1 is specified
Jouni Malinen [Thu, 17 Mar 2011 10:31:38 +0000 (12:31 +0200)]
Make the link process quieter unless V=1 is specified

Hide the long command lines used for linking the binaries in the
default build. "make V=1" can be used to show the actual commands
if needed.

13 years agoP2P: Keep track of secondary device types for peers
Jean-Michel Bachot [Thu, 17 Mar 2011 09:45:46 +0000 (11:45 +0200)]
P2P: Keep track of secondary device types for peers

Signed-off-by: Jean-Michel Bachot <jean-michelx.bachot@linux.intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 years agoP2P: Add Secondary Device Type list in Probe Response frames
Jean-Michel Bachot [Thu, 17 Mar 2011 09:16:23 +0000 (11:16 +0200)]
P2P: Add Secondary Device Type list in Probe Response frames

Add Secondary Device Type List attribute in WSC IE for P2P
Probe Response frames if one or more secondary device types
are configured.

Signed-off-by: Jean-Michel Bachot <jean-michelx.bachot@linux.intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 years agoWPS: Add secondary device types into Probe Request frames
Jean-Michel Bachot [Thu, 17 Mar 2011 09:09:49 +0000 (11:09 +0200)]
WPS: Add secondary device types into Probe Request frames

The secondary device type list is an optional attribute in the WSC IE.

Signed-off-by: Jean-Michel Bachot <jean-michelx.bachot@linux.intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 years agoIBSS RSN: Enable group rekeying every 10 minutes
Xi Chen [Wed, 16 Mar 2011 14:28:56 +0000 (16:28 +0200)]
IBSS RSN: Enable group rekeying every 10 minutes

13 years agoIBSS RSN: Add for_each_sta handler for authenticator
Xi Chen [Wed, 16 Mar 2011 14:28:32 +0000 (16:28 +0200)]
IBSS RSN: Add for_each_sta handler for authenticator

13 years agoIBSS RSN: Add supp_get_state handler
Xi Chen [Wed, 16 Mar 2011 14:27:08 +0000 (16:27 +0200)]
IBSS RSN: Add supp_get_state handler

13 years agoIBSS RSN: Do not start if not yet connected to IBSS
Xi Chen [Wed, 16 Mar 2011 14:26:26 +0000 (16:26 +0200)]
IBSS RSN: Do not start if not yet connected to IBSS

This is used to avoid starting IBSS RSN processing with a peer before
the IBSS connection itself has been completed.

13 years agonl80211: Implement deauth/disassoc for non-HOSTAPD case
Johannes Berg [Wed, 16 Mar 2011 14:11:05 +0000 (16:11 +0200)]
nl80211: Implement deauth/disassoc for non-HOSTAPD case

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 years agowpa_s AP mode: Add notification functions for STA authorized
Johannes Berg [Wed, 16 Mar 2011 13:58:41 +0000 (15:58 +0200)]
wpa_s AP mode: Add notification functions for STA authorized

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 years agodbus: Fix interface list getter with multiple interfaces
Catalin Drula [Wed, 16 Mar 2011 10:30:09 +0000 (12:30 +0200)]
dbus: Fix interface list getter with multiple interfaces

There's a bug in the getter for the 'Interfaces' property
of /fi/w1/wpa_supplicant1 (new D-Bus interface) which causes a
'Segmentation Fault' when there are multiple interfaces.

13 years agohostapd: Don't force HT Mixed Mode for non-GF STAs
Helmut Schaa [Wed, 16 Mar 2011 09:56:39 +0000 (11:56 +0200)]
hostapd: Don't force HT Mixed Mode for non-GF STAs

Currently hostapd will force HT Mixed Mode if at least one non-GF STA is
associated. This will force _all_ HT transmissions to be protected.

802.11n-2009 doesn't require HT Mixed Mode to be used in case of non-GF
STAs but instead the HT information element contains a flag if non-GF
STAs are present. All STAs are required to protect GF transmissions in
that case. Hence, setting HT Mixed mode if non-GF STAs are present is
superfluous.

Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
13 years agoHT: Skip ht_capab validation if ieee80211n=0
Sujith Manoharan [Wed, 16 Mar 2011 09:22:40 +0000 (11:22 +0200)]
HT: Skip ht_capab validation if ieee80211n=0

There is no point in running through the 40 MHz scan if HT is
actually disabled regardless of whether the ht_capab parameter
is set.

13 years agoMove .config to the toplevel .gitignore
Jouni Malinen [Tue, 15 Mar 2011 15:52:13 +0000 (17:52 +0200)]
Move .config to the toplevel .gitignore

13 years agoCheck select() return value in wpa_ctrl_request()
Dmitry Shmidt [Tue, 15 Mar 2011 13:54:21 +0000 (15:54 +0200)]
Check select() return value in wpa_ctrl_request()

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
13 years agoAndroid: Use /data/system/wpa_supplicant path as default in wpa_cli
Jouni Malinen [Tue, 15 Mar 2011 13:27:17 +0000 (15:27 +0200)]
Android: Use /data/system/wpa_supplicant path as default in wpa_cli

13 years agowpa_cli: Allow wpa_supplicant control interface default to be changed
Jouni Malinen [Tue, 15 Mar 2011 13:26:27 +0000 (15:26 +0200)]
wpa_cli: Allow wpa_supplicant control interface default to be changed

CONFIG_CTRL_IFACE_DIR can now be defined to modify the default directory
wpa_cli uses for the wpa_supplicant control interface.

13 years agowpa_cli: Add Android socket support
Dmitry Shmidt [Tue, 15 Mar 2011 13:18:07 +0000 (15:18 +0200)]
wpa_cli: Add Android socket support

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
13 years agoAdd DBus state change notification for AuthMode property
Paul Stewart [Tue, 15 Mar 2011 11:54:59 +0000 (13:54 +0200)]
Add DBus state change notification for AuthMode property

Signed-off-by: Paul Stewart <pstew@google.com>
13 years agodbus: Add D-Bus method for current authentication mode
Paul Stewart [Tue, 15 Mar 2011 11:53:56 +0000 (13:53 +0200)]
dbus: Add D-Bus method for current authentication mode

Chooses between EAP and non-EAP authentication modes and
uses the appropriate method to retrieve the name.

Signed-off-by: Paul Stewart <pstew@google.com>