Commit graph

1291 commits

Author SHA1 Message Date
Jayant Sane 2855070673 P2P: More complete persistent group management over D-Bus
Extend commit c2762e410f to allow
applications to manage (add/remove) persistent groups and accepted
network object paths while invoking a persistent group.
2011-06-24 11:20:19 +03:00
Jayant Sane 5d5fe8ed08 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>
2011-06-23 21:35:20 +03:00
Jayant Sane 2a10959e7c 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>
2011-06-23 21:31:22 +03:00
Jayant Sane 6402fc438b 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>
2011-06-23 21:29:10 +03:00
Jayant Sane c2762e410f 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>
2011-06-23 21:25:13 +03:00
Jayant Sane c988980d95 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>
2011-06-23 20:51:27 +03:00
Jouni Malinen 62b98282ba 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.
2011-06-23 19:53:45 +03:00
Jouni Malinen 4aced422d3 Add notes for CONFIG_WPS_ER build configuration option
[Bug 407]
2011-06-23 19:30:13 +03:00
Jouni Malinen ee8ad5d849 Use nl80211 as an example instead of WEXT 2011-06-23 19:28:14 +03:00
Jouni Malinen 29fbc52251 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.
2011-06-23 15:39:00 +03:00
Jouni Malinen 7dcdcfd68d 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.
2011-06-21 11:47:03 +03:00
Jouni Malinen 692cb2266f Fix non-P2P D-Bus build 2011-06-20 09:02:41 +03:00
Jouni Malinen 634ce80246 Fix CONFIG_AP=y build without CONFIG_P2P=y 2011-06-20 08:58:32 +03:00
Jouni Malinen 83fa07226d DBus: Fix some typos on comments 2011-06-12 15:09:32 -07:00
Johannes Berg 9abafccc0d DBus: Add support for P2P primitives
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2011-06-12 15:08:19 -07:00
Johannes Berg 911e97e400 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>
2011-06-12 14:47:49 -07:00
Fabien Marotte 58f80e2aeb 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>
2011-06-12 14:41:41 -07:00
Jean-Michel Bachot 4b6baa2f5e P2P: Add group started notification
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2011-06-12 14:35:37 -07:00
Johannes Berg dd8a7e0547 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>
2011-06-12 14:31:56 -07:00
Jouni Malinen 38e24575c1 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.
2011-05-31 20:07:11 +03:00
Jouni Malinen ceb34f250a Remove compiler warning for non-P2P builds 2011-05-27 19:06:05 +03:00
Jouni Malinen 6d28fb9627 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.
2011-05-19 17:52:46 +03:00
Dmitry Shmidt bcb90f750d Add TDLS support to Android.mk 2011-05-16 22:29:43 +03:00
Jouni Malinen 64f992652d 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.
2011-05-16 21:07:05 +03:00
Jouni Malinen eec92ec597 WPS: Remove obsolete note about lack for WPS ER support 2011-05-16 21:06:08 +03:00
Jouni Malinen 117e812d06 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.
2011-05-16 19:19:30 +03:00
Jouni Malinen 0725cc7b7e Enable CONFIG_DRIVER_NL80211=y in the default configuration
nl80211 should be preferred over WEXT with any recent Linux kernel
version.
2011-04-21 20:41:01 +03:00
Dmitry Shmidt 60b24b0de4 Add 'signal_poll' command interface
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2011-04-15 18:52:01 +03:00
Dmitry Shmidt 746bba1a5e Prevent explicit scan command during scan or association
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2011-04-15 18:40:29 +03:00
Jouni Malinen 849b5dc78b Update driver country info on 'SET country <value>' 2011-04-15 17:00:01 +03:00
Jouni Malinen 4a26df7107 IBSS RSN: peer->addr is an array so it cannot be NULL 2011-04-14 20:18:12 +03:00
Jouni Malinen 95cb2d88e9 TDLS: Verify that scan results for BSS are available before using them 2011-04-14 19:50:26 +03:00
Jouni Malinen 5dac11e027 WPS: Use strict validation of (Re)AssocResp only if IEs are known 2011-04-14 02:57:24 +03:00
Jouni Malinen b211f3eb71 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.
2011-04-14 02:39:25 +03:00
Jouni Malinen f4fbba8cf9 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.
2011-04-14 02:25:43 +03:00
Jouni Malinen 714b8b5378 P2P: Fix memory leak in UPnP service discovery request processing 2011-04-14 01:33:26 +03:00
Jouni Malinen 62c0d27ed3 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).
2011-04-13 22:03:52 +03:00
Jouni Malinen be5b1e86a3 Make the example action script less likely to result in failures
Use "=" instead of "==" and add an example statement between "then"
and "fi".
2011-04-13 19:55:34 +03:00
Dmitry Shmidt 67b9bd089b 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>
2011-04-11 23:14:38 +03:00
Jouni Malinen c2197bc9bc Return NULL instead of 0 as the pointer on error case 2011-04-08 19:16:20 +03:00
Jouni Malinen c2f1fe41c2 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.
2011-04-08 19:13:58 +03:00
Sam Leffler 9768da202b 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>
2011-04-05 01:24:26 +03:00
Jouni Malinen e73edcaa6a wpa_s AP mode: Fix regression in P2P AP mode setup
Commit c76e5d7f9b 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().
2011-04-04 12:50:26 +03:00
Felix Fietkau 4378fc14eb 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.
2011-04-02 22:03:05 +03:00
Paul Stewart 439efd1eac 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>
2011-03-31 18:06:09 +03:00
Paul Stewart 6d21d41125 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>
2011-03-31 18:04:48 +03:00
Paul Stewart db03ddacff 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
2011-03-31 18:02:37 +03:00
Paul Stewart 1c5c7273f5 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>
2011-03-31 17:56:48 +03:00
Paul Stewart 14dc00115e 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>
2011-03-31 17:38:08 +03:00
Jouni Malinen b6e0180035 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.
2011-03-28 15:24:12 +03:00
Jouni Malinen b8f64582e3 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.
2011-03-24 20:44:17 +02:00
Jouni Malinen 78177a000e 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.
2011-03-23 21:15:46 +02:00
Jouni Malinen d47fa330b8 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.
2011-03-22 23:15:00 +02:00
Sam Leffler 78633c3709 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.
2011-03-20 12:40:59 +02:00
Paul Stewart cfe53c9aa5 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.
2011-03-20 12:27:03 +02:00
Jouni Malinen 87880919ad Fix a typo in a comment 2011-03-20 12:15:02 +02:00
Sam Leffler 7c49fdd0bd 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.
2011-03-20 12:12:12 +02:00
Nathan Williams bc8397822b 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">.
2011-03-20 12:06:36 +02:00
Sam Leffler 2b65b30da8 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).
2011-03-20 12:02:33 +02:00
Sam Leffler d4c1ec56f1 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.
2011-03-20 11:52:57 +02:00
Jouni Malinen fe885594ac Document CONFIG_DEBUG_SYSLOG and CONFIG_DEBUG_SYSLOG_FACILITY 2011-03-20 11:49:41 +02:00
Sam Leffler 3e1996216e Add support for setting the syslog facility from the config file
This enables setting the syslog facility at build time.
2011-03-20 11:48:42 +02:00
Johannes Berg c76e5d7f9b 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>
2011-03-19 13:11:15 +02:00
Johannes Berg c202f19c68 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>
2011-03-19 13:08:08 +02:00
Jean-Michel Bachot 046ef4aa67 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>
2011-03-19 12:57:46 +02:00
Jean-Michel Bachot f95cac271b 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>
2011-03-19 12:22:18 +02:00
Xi Chen ea244d2156 IBSS RSN: Clear IBSS RSN peers based on peer lost events 2011-03-18 17:04:46 +02:00
Johannes Berg 2f646b6e83 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>
2011-03-17 18:50:22 +02:00
Jouni Malinen 85a821d611 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.
2011-03-17 18:07:00 +02:00
Jouni Malinen 586bad514b 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.
2011-03-17 12:31:38 +02:00
Jean-Michel Bachot a9e86bfb74 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>
2011-03-17 11:09:49 +02:00
Xi Chen 13579b987b IBSS RSN: Enable group rekeying every 10 minutes 2011-03-16 16:28:56 +02:00
Xi Chen 92ac6376c4 IBSS RSN: Add for_each_sta handler for authenticator 2011-03-16 16:28:32 +02:00
Xi Chen f385833bda IBSS RSN: Add supp_get_state handler 2011-03-16 16:27:08 +02:00
Xi Chen df41824501 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.
2011-03-16 16:26:26 +02:00
Johannes Berg d8a43924ec wpa_s AP mode: Add notification functions for STA authorized
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2011-03-16 15:58:41 +02:00
Catalin Drula 5b49c9d5ed 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.
2011-03-16 12:30:09 +02:00
Jouni Malinen 4db9f805c7 Move .config to the toplevel .gitignore 2011-03-15 17:52:13 +02:00
Jouni Malinen 8e8f849f9d Android: Use /data/system/wpa_supplicant path as default in wpa_cli 2011-03-15 15:27:17 +02:00
Jouni Malinen c5c5817c33 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.
2011-03-15 15:26:27 +02:00
Dmitry Shmidt b1001e4c45 wpa_cli: Add Android socket support
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2011-03-15 15:18:07 +02:00
Paul Stewart 5bbf9f1086 Add DBus state change notification for AuthMode property
Signed-off-by: Paul Stewart <pstew@google.com>
2011-03-15 13:54:59 +02:00
Paul Stewart ba6f267f64 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>
2011-03-15 13:53:56 +02:00
Paul Stewart cf83fb0b5b wpa_supplicant: Add wpa_supplicant_get_eap_mode method
Signed-off-by: Paul Stewart <pstew@google.com>
2011-03-15 13:53:08 +02:00
Jouni Malinen e17a2477db nl80211: Extend bridge add/del operations for secondary BSSes
Previously, only the main interface was added to a bridge. Extend this
to apply to all configured BSSes.
2011-03-15 13:02:49 +02:00
Chao-Wen Yang 3152ff421e WPS: Indicate PBC session overlap in wps_pbc return value
Use a specific return value, WPS-PBC-OVERLAP, to indicate a reason
for rejecting a wps_pbc command in wpa_supplicant AP mode if the
PBC mode cannot be started due to PBC session overlap having been
detected during monitor time.
2011-03-10 18:59:51 +02:00
Jouni Malinen ab45223b1a wpa_supplicant AP: Copy generated UUID for AP configuration
If the wpa_supplicant configuration file does not specify an UUID,
we need to copy the generated UUID, not the all zeros buffer
reserved for the configured UUID.
2011-03-10 18:40:16 +02:00
Jouni Malinen ca29141c83 WPS: Copy UUID from the first interface
Instead of generating a different UUID for each interface, use the
same UUID that was either configured of generated for the first
interface. This avoids potential issues with PBC session overlap
detection should multiple interfaces end up running a PBC scan
at the same time which may happen at least in some P2P use cases.
2011-03-10 18:36:07 +02:00
Jouni Malinen 52c9e6f3f5 TDLS: Do not allow setup to be started if AP prohibits TDLS 2011-03-06 14:54:49 +02:00
Jouni Malinen 94377fbc52 TDLS: Allow wpa_cli tdls_setup to start renegotiation
If there is already a link the requested peer, request start of
renegotiation instead of completely new link. This seems to be needed
to allow some driver to accept the trigger for a new negotiation.
2011-03-06 14:54:44 +02:00
Jouni Malinen 5b0e6ece54 TDLS: Add a special testing feature for changing TDLS behavior
These special test cases can be configured at run time with "wpa_cli
tdls_testing <value>" where <value> is an integer (either as a decimal
or as a hex value with 0x prefix) bitmap of special features with
following bits available at this point:
bit 0 = long frame (add dummy subelement to make FTIE very long)
bit 1 = use alternative RSN IE (different RSN capab value and no extra
replay counters)
bit 2 = send incorrect BSSID in Link Identifier of TDLS Setup Request
(e.g., 1 = long FTIE, 2 = different RSN IE, 3 = both of those)

This is disabled by default and can be enabled for the build by
adding the following line to .config:
CFLAGS += -DCONFIG_TDLS_TESTING
2011-03-06 14:53:54 +02:00
Ganesh Prasadh 281ff0aa76 TDLS: Add initial support for TDLS (IEEE Std 802.11z-2010) 2011-03-06 14:53:49 +02:00
Shan Palanisamy 39b08b5fc0 Indicate assoc vs. reassoc in association event
This allows driver wrappers to indicate whether the association was
done using Association Request/Response or with Reassociation
Request/Response frames.
2011-03-06 14:31:46 +02:00
Dmitry Shmidt 9fc6aa9f95 Add Android make files for hostapd and wpa_supplicant 2011-02-27 19:19:43 +02:00
Dmitry Shmidt b3f3865e0e Use Android reserved namespace for control interface
On Android, use a special reserved namespace for the UNIX domain
socket.
2011-02-27 18:19:17 +02:00
Jouni Malinen 9e0749737c Update copyright notices to include the new year 2011-02-27 12:50:00 +02:00
Dmitry Shmidt 4e2ead7a72 Add wpa_supplicant state change event for Android network manager
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2011-02-26 13:20:16 +02:00
Dmitry Shmidt fb0e5bd7df ctrl_iface: Return only finished line for scan results
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2011-02-26 13:16:04 +02:00
Konguraj(Raj) Kulanthaivel 43a26f606c P2P: Add wpas_notify_p2p_sd_response
Signed-off-by: Konguraj(Raj) Kulanthaivel <konguraj.kulanthaivel@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2011-02-24 22:47:34 +02:00
Konguraj(Raj) Kulanthaivel e1653cac23 P2P: Add wpas_notify_p2p_sd_request
Signed-off-by: Konguraj(Raj) Kulanthaivel <konguraj.kulanthaivel@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2011-02-24 22:45:39 +02:00
Jean-Michel Bachot 5ccdf84f0d P2P: Add invitation result notification
Add a notification function for the result of an invitation.

Signed-off-by: Jean-Michel Bachot <jean-michelx.bachot@linux.intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2011-02-24 22:40:21 +02:00
Jayant Sane c2641bf7cf P2P: Add GO negotiation status notification
Signed-off-by: Jayant Sane <jayant.sane@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2011-02-24 22:34:52 +02:00
Konguraj(Raj) Kulanthaivel 32d1bce0c0 P2P: Add wpas_notify_p2p_go_neg_req
Add a notification for received GO negotiation requests.

Signed-off-by: Konguraj(Raj) Kulanthaivel <konguraj.kulanthaivel@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2011-02-24 22:30:19 +02:00
Johannes Berg 408af93ed4 P2P: Add group removed notification
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2011-02-24 22:27:23 +02:00
Johannes Berg 56eeb8f299 P2P: Add method to signal lost device
This signal is used to notify users of the P2P
state machine or wpa_supplicant of lost devices.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2011-02-24 22:22:16 +02:00
Johannes Berg d642d2d267 P2P: Add notification for P2P device found
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2011-02-24 22:08:18 +02:00
Johannes Berg 8fd7dc1b1c P2P: Add new_device flag to dev_found callback
The DBus code will want to have perfect matching of dev_found and the
dev_lost it adds so it doesn't need to keep track internally. Enable
that with a new flag in the core that tracks whether we have already
notified about this -- the existing users can ignore it.

The part where this is always set to 1 if the new device is discovered
by a driver that has P2P in the driver is buggy -- the driver should
feed the P2P peer database and then that should feed the notification
here instead.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2011-02-24 21:59:58 +02:00
Konguraj(Raj) Kulanthaivel c5db8e5170 P2P: Embed publically visible struct in peer info
This embeds some information about each P2P peer that will be publically
visible in a struct that is shared.

The dev_found notification function is also passed the new struct, which
requires some work for the driver-based P2P management.

Signed-off-by: Konguraj(Raj) Kulanthaivel <konguraj.kulanthaivel@intel.com>
Signed-off-by: Fabien Marotte <fabienx.marotte@linux.intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2011-02-24 21:51:17 +02:00
Jouni Malinen 9526fd293f P2P: Handle P2P-not-supported without segfaults
Previous code was assuming that the P2P module is always initialized.
However, that is not the case anymore with drivers that do not support
P2P. Add verification of whether P2P is enabled before trying to execute
P2P commands.
2011-02-24 21:13:30 +02:00
Ben Greear 48b84f18a3 Wait 1 second before (re)scanning on authentication timeout
If we timed out, the AP or the local radio may be busy.
So, wait a second until scanning again.

Signed-off-by: Ben Greear <greearb@candelatech.com>
2011-02-24 17:16:16 +02:00
Ben Greear e29853bbff SME: Add timers for authentication and asscoiation
mac80211 authentication or association operation may get stuck for some
reasons, so wpa_supplicant better use an internal timer to recover from
this.

Signed-off-by: Ben Greear <greearb@candelatech.com>
2011-02-24 16:59:46 +02:00
Jouni Malinen b89883a444 P2P: Notify WPS-M2D event on parent interface and handle PBC overlap
GO may use M2D to notify that PBC overlap was detected if the GO was
configured to allow only a specific P2P Device to connect using PBC.
We need to report the M2D message on the parent interface if a
separate group interface is used. In addition, we can stop the P2P
operation if PBC overlap was indicated similarly to what we are
already doing in th case the overlap is detected locally.
2011-02-22 12:20:16 +02:00
Jouni Malinen a432bafbca wpa_cli: Add newline to end of responses in interactive mode
Some of the wpa_supplicant control interface commands, like WPS_PIN,
may not include a newline in the end of the response. This can result
in the response being lost when wpa_cli redraws the screen after an
event message. Add a newline after such responses in interactive mode
to avoid the problem.
2011-02-21 22:50:11 +02:00
Ben Greear 4c9695be8f WPS ER: Stop eloop only on the last terminate_cb
This allows all WPS ER instances to be cleaned up properly if more
than one interface has an active WPS ER when wpa_supplicant is being
killed.
2011-02-21 21:47:46 +02:00
Jouni Malinen 16a83d2965 FT: Set EAPOL state machined to authenticated state with FT-EAP
When FT protocol run is completed with FT-EAP, the EAPOL state machine
needs to be notified of the completed authentication to make sure it
does not try to start new authentication.
2011-02-20 21:57:53 +02:00
Ben Greear e1504976f1 Do not propagate bad scan results to siblings sharing the radio
This decreases useless work and re-scans by siblings when a
device gets a scan failure.

Signed-off-by: Ben Greear <greearb@candelatech.com>
2011-02-16 18:55:37 +02:00
Jouni Malinen 50b16da13f Fix CONFIG_NO_STDOUT_DEBUG=y build 2011-02-10 20:24:06 +02:00
Ben Greear f049052b9e Use wpa_msg() instead of wpa_printf()
This converts number of debugging messages to use wpa_msg() in order
to allow the interface name to be shown with the messages.

A new function, wpa_dbg(), is introduced to allow
CONFIG_NO_STDOUT_DEBUG=y builds to remove the debug strings. This is
otherwise identical with wpa_msg(), but it gets compiled out if stdout
debugging is disabled.
2011-02-10 20:14:46 +02:00
Jouni Malinen e67b55fb11 wpa_s AP: Deliver EVENT_RX_PROBE_REQ events to AP processing
This is needed to allows WPS PBC session overlap detection to work
with drivers that process Probe Request frames internally. This
code is is run in hostapd, but the wpa_supplicant AP mode did not
have call to the hostapd_probe_req_rx() function even though it
registered handlers for hostapd Probe Request RX callbacks.
2011-02-08 14:32:35 +02:00
Jouni Malinen d601247ca9 P2P: Allow WPS_PBC command on GO to select on P2P Device Address
An optional parameter, p2p_dev_addr, can now be given to WPS_PBC
command on P2P GO to indicate that only the P2P device with the
specified P2P Device Address is allowed to connect using PBC. If
any other device tries to use PBC, a session overlap is indicated
and the negotiation is rejected with M2D. The command format for
specifying the address is "WPS_PBC p2p_dev_addr=<address>", e.g.,
WPS_PBC p2p_dev_addr=02:03:04:05:06:07

In addition, show the PBC session overlap indication as a WPS failure
event on an AP/GO interface. This particular new case shows up as
"WPS-FAIL msg=4 config_error=12".
2011-02-07 18:28:36 +02:00
Ben Greear 4f1495aefa Add interface name to wpa_msg() output
This makes log files much more readable if multiple interfaces
are being controlled by the same process. The interface name is
added to stdout/file/syslog entries, but not to the messages
sent to control interface monitors to avoid issues with parsing
in external programs.

Signed-off-by: Ben Greear <greearb@candelatech.com>
2011-02-06 20:39:34 +02:00
Ben Greear ac6912b5d1 wpa_supplicant: Support 'relog' command to re-open log files
This allows rolling log files:

mv log.txt log.txt.1
wpa_cli relog

Signed-off-by: Ben Greear <greearb@candelatech.com>
2011-02-06 20:15:19 +02:00
Johannes Berg 3103f34576 P2P: Add wpas_p2p_disconnect()
Add a new API function wpas_p2p_disconnect()
to disconnect from or dissolve a group.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2011-02-02 17:30:15 +02:00
Johannes Berg bbeee9b0db P2P: Use a variable for generated PIN to allow multiple uses
In order to pass the same PIN to multiple notifications in the future,
generate it centrally.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2011-02-02 17:12:37 +02:00
Johannes Berg d750b7e699 DBus: Improve error reporting
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2011-02-02 17:03:32 +02:00
Johannes Berg 6d7111418d DBus: Increase introspection buffer sizes
The P2P additions will add more data so
that the current buffers aren't big enough.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2011-02-02 17:01:29 +02:00
Johannes Berg d1c8ac88b9 DBus: Publish provisioned keys in network properties
When the network was provisioned, we need to get the keys to be able to
reconnect without new provisioning. To be able to publish those keys but
not normally configured ones, add a new attribute to struct wpa_ssid
indicating whether or not keys may be exported.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2011-02-02 17:00:12 +02:00
Johannes Berg 839b33ad90 P2P: Clear driver Probe Response IE on stop_listen
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2011-02-01 18:30:33 +02:00
Johannes Berg 11fb02be67 P2P: Fix p2p_long_listen
There are two issues with p2p_long_listen:
 1) max_remain_on_channel is assumed to be 5 seconds,
 2) if max_remain_on_channel is not a full multiple of
    seconds, accounting breaks.

Fix these by converting p2p_long_listen to ms and
tracking it according to max_remain_on_channel.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2011-02-01 18:09:38 +02:00
Jouni Malinen 09c395b4bb FT: Configure FT XXKey as PMK for driver-based 4-way handshake
When using FT-EAP, the second half of MSK is used as the starting
point for PMK key hierarchy. Configure that instead of the first
half of MSK when using FT with driver-based 4-way handshake and
FT protocol.
2011-02-01 00:06:13 +02:00
Jouni Malinen 98ea943177 Set portValid=TRUE on association for driver-based 4-way handshake
This was previously done for WPA/WPA2-Personal as part of association
processing when the driver is implementing 4-way handshake. The
portValid needs to be done for WPA/WPA2-Enterprise to get the proper
EAPOL authentication completed callback to configure PMK to the driver.
2011-02-01 00:04:02 +02:00
Masashi Honma 6c714cd7d4 P2P: Show "FAIL" for failed p2p_find operation
I tried these commands:

./wpa_cli -i wlan0 p2p_group_add
./wpa_cli -i wlan0 p2p_find

The second one results in following messages because it is invalid
operation.

-------
nl80211: Scan trigger failed: ret=-95 (Operation not supported)
P2P: Failed to start p2p_scan
-------

But the second one shows "OK" on control console.

This patch makes it to show "FAIL".
2011-01-31 17:29:31 +02:00
Jouni Malinen df077c6262 Remove obsolete drivers wrappers: atmel, ndiswrapper, ipw, hermes
There is no real reason to maintain these in the current development
branch anymore. If someone really needs support for the obsolete
driver interfaces, these can be found in older wpa_supplicant
branches.

driver_atmel.c
- vendor-specific interface for ATMEL AT76C5XXx cards
- for some old out-of-tree driver; not for the upstream atmel*
  drivers

driver_ndiswrapper.c
- vendor-specific interface for an out-of-tree driver
- ndiswrapper should work with driver_wext.c, too

driver_ipw.c
- vendor-specific interface for old ipw2100/2200 driver
- the upstream driver works with driver_wext.c (and does not work
  with the old interface)

driver_hermes.c
- vendor driver that was not even included in the main wpa_supplicant
  releases
2011-01-30 21:29:25 +02:00
Jouni Malinen 6c9a98a20d IBSS RSN: Do not start multiple Auth/Supp for same peer
This avoids an issue when a received EAPOL-Key frame from a peer
is initiating IBSS RSN Authenticator and Supplicant for the peer
and the following new-STA-in-IBSS event from the driver is adding
yet another instance of Authenticator/Supplicant. The EAPOL-Key
RX case was already checking whether an instance had been started;
the driver new-STA event needs to do same.
2011-01-15 16:55:15 +02:00
Jouni Malinen 50b05780c2 IBSS RSN: Delay setting of the initial TX GTK
The driver may get confused if we set the initial TX GTK before having
fully configured and connected to an IBSS, so better delay this
operation until the connection (join/start IBSS) has been completed.
2011-01-15 14:07:02 +02:00
Chao-Wen Yang 449adbaca9 WPS: Indicate WPS-FAIL event on EAPOL timeout-based failure callback
If the EAPOL processing times out (e.g., if the AP stops replying
to messages for some reason) during WPS negotiation, we need to
indicate WPS-FAIL event from eapol_cb since no other WPS failure is
reported for this particular case.
2011-01-13 18:04:33 +02:00
Chao-Wen Yang c5cf0a18f1 WPS: Add mechanism for indicating non-standard WPS errors
Previously, only the Configuration Error values were indicated in
WPS-FAIL events. Since those values are defined in the specification
it is not feasible to extend them for indicating other errors. Add
a new error indication value that is internal to wpa_supplicant and
hostapd to allow other errors to be indicated.

Use the new mechanism to indicate if negotiation fails because of
WEP or TKIP-only configurations being disallows by WPS 2.0.
2011-01-13 17:50:59 +02:00
Jouni Malinen 0382097ef3 Use set_key addr to distinguish default and multicast keys
Previously, both NULL and ff:ff:ff:ff:ff:ff addr were used in various
places to indicate default/broadcast keys. Make this more consistent
and useful by defining NULL to mean default key (i.e., used both for
unicast and broadcast) and ff:ff:ff:ff:ff:ff to indicate broadcast
key (i.e., used only with broadcast).
2011-01-09 19:44:28 +02:00
Jouni Malinen da64c266e7 Use more consistent set_key seq value when nothing is being set
Use NULL instead of (u8 *) "" as the seq value and make sure the
driver wrapper implementations can handle NULL value. This was
previously already done in number of places, but not everywhere.
2011-01-09 12:09:04 +02:00
Jouni Malinen 6c6ad81f9c WPS: Make WPS-AP-AVAILABLE* events a bit more consistent
The BSS table entries may be in more or less random order and it is
better to show the most likely WPS configuration method in a way that is
somewhat more consistent instead of just showing the method of the first
BSS entry found in the table.
2011-01-05 11:49:03 +02:00
Jouni Malinen df83fb7d00 Fix wpa_supplicant_ssid_bss_match() handler for non-WPA
The proto configuration may be left to non-zero when moving from one
configuration to another. To avoid misidentifying a network
configuration as enabling WPA, check key_mgmt field, too.
2010-12-30 18:27:33 +02:00
Jouni Malinen 3ac17eba31 P2P: Add initial support for driver-based P2P management
This adds partial callbacks and events to allow P2P management to be
implemented in a driver/firmware. This is not yet complete and is
very much subject to change in the future.
2010-12-30 12:48:55 +02:00
Jouni Malinen f981eabcf0 WPS: Add option to disable open networks by default
CONFIG_WPS_REG_DISABLE_OPEN=y can be used to configure wpa_supplicant
to disable open networks by default when wps_reg command is used to
learn the current AP settings. When this is enabled, there will be a
WPS-OPEN-NETWORK ctrl_iface event and the user will need to explicitly
enable the network (e.g., with "select_network <id>") to connect to
the open network.
2010-12-30 12:28:13 +02:00
Johannes Berg 190b9062b2 P2P: Add option for offloading off-channel TX to the driver
With the new kernel functionality coming to Linux to allow off-channel
TX, we can take advantage of that in the P2P code that currently uses
remain-on-channel. If a driver advertises support for it, it will be
asked to handle off-channel TX by itself.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2010-12-29 13:59:17 +02:00
Johannes Berg 0d7e5a3a29 Allow AP mode to disconnect STAs based on low ACK condition
The nl80211 driver can report low ACK condition (in fact it reports
complete loss right now only). Use that, along with a config option, to
disconnect stations when the data connection is not working properly,
e.g., due to the STA having went outside the range of the AP. This is
disabled by default and can be enabled with disassoc_low_ack=1 in
hostapd or wpa_supplicant configuration file.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2010-12-28 17:15:01 +02:00
Jouni Malinen cc5e390d28 WPS: Require PBC match with wps_pbc that specifies BSSID
The WPS mode was already verified when the AP was configured for
WPA/WPA2, but this was not done with AP that was in open mode.
Fix this by allowing wpa_supplicant_ssid_bss_match() to be called
in non-WPA configuration, too. With this change, wps_pbc BSSID
command will wait until the specified target AP is in active PBC
mode before trying to connect to it.
2010-12-28 08:56:23 +02:00
Jouni Malinen 5e8b237864 Fix CONFIG_SME build without CONFIG_IEEE80211W 2010-12-19 12:44:58 +02:00
Jouni Malinen 7d878ca769 Use SA Query procedure to recovery from AP/STA state mismatch
If a station received unprotected Deauthentication or Disassociation
frame with reason code 6 or 7 from the current AP, there may be a
mismatch in association state between the AP and STA. Verify whether
this is the case by using SA Query procedure. If not response is
received from the AP, deauthenticate.

This implementation is only for user space SME with
driver_nl80211.c.
2010-12-19 11:58:00 +02:00
Johannes Berg 0423d090ce P2P: Fix some int size warnings
When u64 != unsigned long, the compiler will give
some warnings. Fix these.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2010-12-17 17:09:50 +02:00
Dan Williams 1e6288df6b dbus: Emit property changed events when adding/removing BSSes
The supplicant was not emitting property changed events when the BSSs
property changed.

Signed-off-by: Dan Williams <dcbw@redhat.com>
2010-12-17 15:56:01 +02:00