Commit graph

940 commits

Author SHA1 Message Date
Jouni Malinen
3b29972c09 P2P: Limit p2p_connect .. pbc join based on BSSID
Allow only the expected P2P Interface Address as the BSSID for
the AP to avoid selecting incorrect BSS should there be another
device that is advertising active PBC mode before the target
P2P GO does.
2010-10-12 16:56:17 +03:00
Johannes Berg
6cb22d2fd1 P2P: Fix remain-on-channel abort race
When the P2P state machine requests a remain- on-channel, there's a
potential race where it can then request a stop before the r-o-c has
actually started, in which case the stop will not be processed. Fix
that.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2010-10-10 17:52:13 +03:00
Paul Stewart
8ee69e0633 dbus_new_handlers: Don't send NULL to dbus_message_new_error
The new DBus API helper function wpas_dbus_error_unknown_error
function can be called as a result of a failure within internal
getter calls, which will call this function with a NULL message
parameter.  However, dbus_message_new_error looks very unkindly
(i.e, abort()) on a NULL message, so in this case, we should not
call it.

I've observed this course of events during a call to
wpas_dbus_getter_bss_wpa with a faileld parse of the IE parameter.
We got here through a call to fill_dict_with_properties which
explicitly calls getters with a NULL message parameter.  Judging
from the way it is called, this could easily occur if an AP sends
out a malformed (or mis-received) probe response.  I usually run
into this problem while driving through San Francisco, so I'm
exposed to any number of base stations along this path.
2010-10-09 17:29:51 +03:00
Daniel Kurtz
556522ee09 dbus: Treat '' in SSIDs of Interface.Scan as a request for broadcast scan
This patch changes wpa_supplicant policy for handling '' in SSIDs field of
Interface.SSID DBus message. It treats '' (zero-length) SSID as a request
for a broadcast scan, instead of ignoring it.

This patch updates DBus API .Scan() logic per the test cases listed below:

1) Interface.Scan({'Type':'active', 'Channel':(2412, 20)})
   Request:     Active scan with only '' SSID (1 channel)
   Should be:   1 broadcast ProbeRequest on specified channel
   Previous:    1 broadcast ProbeRequest on specified channel
   This Patch:  1 broadcast ProbeRequest on specified channel

2) Interface.Scan({'Type':'active', 'Channel':(2412, 20), 'SSIDs':['']})
   Request:     Active scan with only '' SSID (1 channel)
   Should be:   1 broadcast ProbeRequest on specified channel
   Previous:    No ProbeRequests; passive scan results for specified channel
   This Patch:  FIXED: 1 broadcast ProbeRequest on specified channel

3) Interface.Scan({'Type':'active', 'Channel':(2412, 20), 'SSIDs':['MySSID']})
   Request:     Active scan with only non-'' SSIDs (1 channel)
   Should be:   1 directed ProbeRequest for each SSID on specified channel,
	no broadcast ProbeRequest
   Previous:    1 directed ProbeRequest for each SSID on specified channel,
	no broadcast ProbeRequest
   This Patch:  1 directed ProbeRequest for each SSID on specified channel,
	no broadcast ProbeRequest

4) Interface.Scan({'Type':'active', 'Channel':(2412, 20), 'SSIDs':['',
	'MySSID']})
   Request:     Active scan with SSIDs, including 1 '' SSID (1 channel)
   Should be:   1 broadcast ProbeRequest, 1 directed ProbeRequest for each
	non-'' SSID on specified channel
   Previous:    1 directed ProbeRequest for each non-'' SSID on specified
	channel
   This Patch:  FIXED: 1 broadcast ProbeRequest, 1 directed ProbeRequest for
	each non-'' SSID on specified channel
2010-10-09 16:27:53 +03:00
Daniel Kurtz
a7af023b84 dbus: Fix passive/active scans in some cases
Currently the DBus Interface.Scan API is counter-intuitive. It issues
ProbeRequests when doing passive scans when channels are specified, and
does not issue ProbeRequests for broadcast active scans.

This patch updates DBus API .Scan() logic per the test cases listed below:

 1) Interface.Scan({'Type':'passive'})
    Request:     Passive scan (all channels)
    Should be:   No ProbeRequests; Passive Scan results for all channels
    Previous:    1 ProbeRequest on all channels for both broadcast SSID and
	selected network (scan_ssid=1)
    This Patch:  --No change--: 1 ProbeRequest on all channels for both
	broadcast SSID and selected network (scan_ssid=1)

 2) Interface.Scan({'Type':'passive', 'Channel':(2412, 20)})
    Request:     Passive scan (1 channel)
    Should be:   No ProbeRequests; Passive Scan results for 1 channel
	(plus overlapping channels)
    Previous:    1 broadcast ProbeRequest on specified channel
    This Patch:  --Fixed--: No ProbeRequests; Passive Scan results for 1
	channel (plus overlapping channels)

 3) Interface.Scan({'Type':'active'})
    Request:     Active scan with no SSIDs (all channels)
    Should be:   1 broadcast ProbeRequest on all channels
    Previous:    No ProbeRequests;  passive scan results for all channels
    This Patch:  --Fixed--: 1 broadcast ProbeRequest on all channels

 4) Interface.Scan({'Type':'active', 'Channel':(2412, 20)})
    Request:     Active scan with no SSIDs (1 channel)
    Should be:   1 broadcast ProbeRequest on specified channel
    Previous:    No ProbeRequests; Passive scan results for specified
	channel (plus overlapping channels)
    This Patch:  --Fixed--: 1 broadcast ProbeRequest on specified channel
2010-10-09 16:22:39 +03:00
Jouni Malinen
01cf713e51 Fix .gitignore files to not ignore subdirectory matches
The previous used .gitignore files were mathing some files that
were actually already in the repository (e.g.,
hostapd/logwatch/hostapd). Avoid this by listing the conflicting
entries in the root directory .gitignore with full path.
2010-10-07 11:04:16 +03:00
Ben Greear
199716adb3 Fix wpa_supplicant build without CONFIG_WPS and CONFIG_AP 2010-10-07 10:41:58 +03:00
Johannes Berg
9919f7a22b Fix AP mode in wpa_supplicant with interface events
Needs to not trigger a scan here when the AP mode setup sets
interface down/up.
2010-10-06 17:10:07 +03:00
Jouni Malinen
d9c8a7c44c Fix build with CONFIG_WPS_OOB 2010-10-06 16:40:20 +03:00
Jouni Malinen
235f69fcd6 Mark ctrl_iface RX debug for PING commands excessive
This cleans up debug log from unnecessary entries when using
wpa_cli/hostapd_cli or other ctrl_iface monitors that PING
periodically to check connectivity.
2010-09-24 15:50:13 -07:00
Jouni Malinen
95ee81e4e7 WPS: Documented wps_er_pin MAC address option 2010-09-24 15:44:26 -07:00
Jouni Malinen
3981cb3cb8 WPS: Add wps_check_pin command for processing PIN from user input
UIs can use this command to process a PIN entered by a user and to
validate the checksum digit (if present).
2010-09-23 10:30:52 -07:00
Jouni Malinen
f648bc7d0d WPS: Use blacklist more aggressively during WPS provisioning
This allows more APs to be tried during the WPS timeout.
2010-09-22 11:50:15 -07:00
Jouni Malinen
0e2e565a44 WPS 2.0: Provide (Re)Association Response WPS IE to driver
WPS 2.0 mandates the AP to include WPS IE in (Re)Association Response
if the matching (Re)Association Request included WPS IE. Provide the
needed WPS IE information to the driver_ops API for drivers that
process association frames internally.

Note: This modifies the driver_ops API by adding a new argument to
set_ap_wps_ie().
2010-09-22 10:46:44 -07:00
Jouni Malinen
b4e34f2fdf WPS: Make testing operations configurable at runtime
Instead of build time options (CONFIG_WPS_TESTING_EXTRA_CRED and
CONFIG_WPS_EXTENSIBILITY_TESTING), use a single build option
(CONFIG_WPS_TESTING) and runtime configuration of which testing
operations are enabled. This allows a single binary to be used
for various tests.

The runtime configuration can be done through control interface
with wpa_cli/hostapd_cli commands:
Enable extensibility tests:
set wps_version_number 0x57
Disable extensibility tests (WPS2 build):
set wps_version_number 0x20
Enable extra credential tests:
set wps_testing_dummy_cred 1
Disable extra credential tests:
set wps_testing_dummy_cred 0
2010-09-21 19:51:23 -07:00
Jouni Malinen
9647120b07 WPS: Add more verbose debug info on PBC session overlap detection 2010-09-20 15:08:52 -07:00
Jouni Malinen
ff28ccafd5 WPS: Add BSSID to strict validation error messages
This makes it easier to figure out which AP is sending invalid
Beacon or Probe Response frames.
2010-09-20 14:54:22 -07:00
Jouni Malinen
7736f18bef WPS: Cancel WPS operation on PBC session overlap detection
Previously, wpa_supplicant remaining in scanning state without
trying to connect, but there is no particular need to do that.
Instead, cancel WPS operation completely whenever PBC session
overlap is detected.
2010-09-19 17:04:04 -07:00
Dan Harkins
df684d82ff EAP-pwd: Add support for EAP-pwd server and peer functionality
This adds an initial EAP-pwd (RFC 5931) implementation. For now,
this requires OpenSSL.
2010-09-14 21:51:40 -10:00
Jouni Malinen
ea184114ca Allow auto-connect to request scan in associating state
Disconnection event may be received while in associating state.
Previously, wpa_supplicant could get stuck not trying to reconnect
in that case at least with nl80211. Allow scan request in this
state to avoid the issue. This helps especially with APs that do
load balancing by sending Deauthentication frame as a response to
Reassociation Request frame after successful Authentication frame
exchange.
2010-09-14 00:07:54 -07:00
Sudhakar Swaminathan
0f66abd25b P2P: Add option for disabling intra BSS distribution
p2p_intra_bss configuration parameter can now be used to
disable/enable intra BSS distribution (bridging of frames between
the clients in a group).
2010-09-10 10:30:26 -07:00
Ardong Chen
0d0a8ca1cc Add option for disabling automatic reconnection on disconnection
ctrl_interface STA_AUTOCONNECT command can now be used to disable
automatic reconnection on receiving disconnection event. The default
behavior is for wpa_supplicant to try to reconnect automatically, i.e.,
to maintain previous behavior.
2010-09-10 10:30:26 -07:00
Ardong Chen
2049af2bd5 P2P: Fix invitation_received callback to use NULL bssid (if not known)
Previously, the storage buffer for the Group BSSID was returned
regardless of whether it was included in the invitation or not.
2010-09-10 10:30:26 -07:00
Kuko Li
4c01083400 P2P: Do not process configuration changes on non-P2P interfaces 2010-09-10 10:30:26 -07:00
Jouni Malinen
b73bf0a74b P2P: Stop connection attempt on PBC session overlap
The overlap condition cannot disappear before group formation timeout
hits, so there is no point in continuing in this case and failure can
be indicated immediately.
2010-09-10 10:30:25 -07:00
Jouni Malinen
3094d4837a P2P: Use group formation timeout (but longer one) with join-a-group
This allows the pending group interface to be removed if we fail
to join a running group. A longer than 15 second timeout is needed
here since the GO may not have authorized our connection yet.
2010-09-10 10:30:25 -07:00
Jouni Malinen
ae3e342108 P2P: Add peer timeout into group formation 15 second timeout
This adds some more time for WPS provisioning step in case the peer
takes long time to start group interface operations.
2010-09-10 10:30:25 -07:00
Ardong Chen
2f9929ffcc WPS: Allow pending WPS operation to be cancelled
A new ctrl_interface command, WPS_CANCEL, can now be used to cancel
a pending or ongoing WPS operation. For now, this is only available
with wpa_supplicant (either in station or AP mode). Similar
functionality should be added for hostapd, too.
2010-09-10 10:30:25 -07:00
Ardong Chen
014732ea81 WPS: Fix timeout event to be sent over ctrl_interface
This was supposed to be sent to external event monitors, i.e., to
use wpa_msg instead of wpa_printf.
2010-09-10 10:30:25 -07:00
Wei-Jen Lin
c0a321c519 Allow bssid parameter to be cleared through ctrl_interface
Setting bssid to an empty string, "", or any can now be used to
clear the bssid_set flag in a network block, i.e., to remove bssid
filtering.
2010-09-10 10:30:25 -07:00
Ardong Chen
876103dc6c wpa_cli action: Add WPS_EVENT_SUCCESS and WPS_EVENT_FAIL handlers 2010-09-10 10:30:25 -07:00
Ardong Chen
c481048f7c P2P: Add frequency into group started ctrl_interface events 2010-09-10 10:30:25 -07:00
Jouni Malinen
812bf56ab1 Fix build without CONFIG_P2P=y 2010-09-09 07:20:28 -07:00
Jouni Malinen
e9a7ae41fa P2P: Use SSID from GO Negotiation to limit WPS provisioning step
In order to avoid picking incorrect SSID from old scan results, use
SSID from GO Negotiation to select the AP.
2010-09-09 07:17:23 -07:00
Jouni Malinen
743ef79914 P2P: Deinit GO group data before global P2P deinit
This avoids issues with using freed memory in p2p_group_deinit().
2010-09-09 07:17:23 -07:00
Jouni Malinen
f8d0131a11 P2P: Use operating frequency from peer table as backup for join
The scan operation before Provision Discovery Request may not include
the GO. However, we are likely to have the GO in our P2P peer table,
so use that information to figure out the operating channel if BSS
table entry is not available.
2010-09-09 07:17:23 -07:00
Jouni Malinen
a482883f63 P2P: Fix connect-to-running-group if Action TX status is delayed
The following operations (scan and associate) were not run if the
Provisioning Discovery Response is received before the TX Action
status.
2010-09-09 07:17:23 -07:00
Jouni Malinen
ab218b7c72 P2P: Add some more debug information for Action frame TX 2010-09-09 07:17:22 -07:00
Jouni Malinen
1cc3a29d49 P2P: Clear pending Action TX frame on p2p_stop_find and p2p_listen
This is needed to avoid issues with the previous TX command from
stopping long Listen state.
2010-09-09 07:17:22 -07:00
Jouni Malinen
b6c79a998f Add test command for disabling/enabling A-MPDU aggregation
ctrl_iface command "SET ampdu <0/1>" can now be used to
disable/enable A-MPDU aggregation.
2010-09-09 07:17:21 -07:00
Jouni Malinen
10b9ac17cf P2P: For now, do not use channels 12-14 in P2P groups
This is needed to make sure we do not try to accidentally enable GO
in channels that may not be allowed. In addition, this may help with
some driver that do not like channel 14 even as a passive scan
channel.
2010-09-09 07:17:21 -07:00
Jouni Malinen
7fbf99aa6b P2P: Add an example p2p-action script for udhcpc/udhcpd 2010-09-09 07:17:21 -07:00
Jouni Malinen
56815b2b7d Copy WPS strings into AP configuration when using wpa_supplicant AP 2010-09-09 07:17:21 -07:00
Jouni Malinen
1c9cb49fe9 Trigger WPS configuration update on string changes
Previously, only Device Name string was handled, but similar trigger
is needed on Manufacturer, Model Name, Model Number, and Serial Number
changes.
2010-09-09 07:17:21 -07:00
Jouni Malinen
0e14267a31 P2P: Avoid segfault on AP deinit after failed AP start 2010-09-09 07:17:21 -07:00
Jouni Malinen
e1f1509bb0 P2P: Fix P2P IE generation for AssocReq when BSS info is not available
This code could segfault on NULL pointer dereference at least when
ap_scan=2 is used.
2010-09-09 07:17:21 -07:00
Jouni Malinen
c4ea4c5c90 P2P: Allow driver wrapper to indicate how many stations are supported
This can be used to limit the number of clients allowed to connect
to the group on the GO.
2010-09-09 07:17:21 -07:00
Jouni Malinen
f80a2237ca Fix AP mode wps_pin command to return the entered PIN
This command is supposed to return the PIN value that was generated
or passed in as an argument. In the AP case, the entered PIN was not
being returned.
2010-09-09 07:17:21 -07:00
Jouni Malinen
eea2fd9eff P2P: Add mechanism for configuring UAPSD parameters for group
This is needed to be able to change parameters for dynamically
created interfaces between the creation of the interface and
association/start AP commands.

Following ctrl_interface commands can now be used:

P2P_SET client_apsd disable
- disable configuration (i.e., use driver default) in client mode

P2P_SET client_apsd <BE>,<BK>,<VI>,<VO>;<max SP Length>
- enable UASPD with specific trigger configuration (0/1) per AC
  (max SP Length is currently ignored)

P2P_SET go_apsd disable
- disable configuration (i.e., use driver default) in AP mode

P2P_SET go_apsd <0/1>
- disable/enable APSD in AP mode
2010-09-09 07:17:21 -07:00
Jouni Malinen
3dfda83d9c P2P: Add Device Password ID to GO Neg Request RX event
This event indicates the Device Password ID that the peer tried
to use in GO Negotiation. For example:
P2P-GO-NEG-REQUEST 02:40:61:c2:f3:b7 dev_passwd_id=4
2010-09-09 07:17:20 -07:00