]> git.ipfire.org Git - thirdparty/hostap.git/log
thirdparty/hostap.git
13 years agoWPS: Share common function for building WSC ACK/NACK
Jouni Malinen [Thu, 4 Nov 2010 16:16:14 +0000 (18:16 +0200)] 
WPS: Share common function for building WSC ACK/NACK

These are identical functions in Enrollee and Registrar and there
is no need to maintain two copies of the same functionality.

13 years agoWPS: Do not advertise support for WEP in WPS 2.0 build
Jouni Malinen [Thu, 4 Nov 2010 15:37:20 +0000 (17:37 +0200)] 
WPS: Do not advertise support for WEP in WPS 2.0 build

There is no point in advertising support for WEP or Shared Key
authentication if we are going to reject those anyway based on
WPS 2.0 rules.

13 years agoWPS: Remove PushButton from M1 ConfigMethods on AP
Jouni Malinen [Thu, 4 Nov 2010 15:29:48 +0000 (17:29 +0200)] 
WPS: Remove PushButton from M1 ConfigMethods on AP

These config methods are for the Enrollee role, i.e., for adding
external Registrars, and as such, PushButton should not be claimed
to be supported.

13 years agonl80211: Allow libnl to be replaced with libnl-tiny
Jouni Malinen [Thu, 4 Nov 2010 15:14:58 +0000 (17:14 +0200)] 
nl80211: Allow libnl to be replaced with libnl-tiny

CONFIG_LIBNL_TINY=y can be used to select libnl-tiny instead of
libnl.

13 years agoWPS: Comment out WEP configuration lines on reconfig
Jouni Malinen [Thu, 4 Nov 2010 15:02:16 +0000 (17:02 +0200)] 
WPS: Comment out WEP configuration lines on reconfig

13 years agoP2P: Copy p2p_intra_bss setting to the group interface
Jouni Malinen [Thu, 4 Nov 2010 14:53:09 +0000 (16:53 +0200)] 
P2P: Copy p2p_intra_bss setting to the group interface

This is needed to allow p2p_intra_bss take effect when using
separate group interfaces.

13 years agoP2P: Allow p2p_cancel to cancel P2P client that has not yet connected
Jouni Malinen [Thu, 4 Nov 2010 09:59:44 +0000 (11:59 +0200)] 
P2P: Allow p2p_cancel to cancel P2P client that has not yet connected

This can now be used to cancel a P2P client interface that has not
yet completed the first 4-way handshake with a GO.

13 years agoP2P: Skip extra remain-on-channel if oper channel matches
Jouni Malinen [Tue, 2 Nov 2010 17:35:40 +0000 (19:35 +0200)] 
P2P: Skip extra remain-on-channel if oper channel matches

There is no need to separately move to the correct channel
for transmitting an Action frame that is using the group
interface (i.e., source address is P2P Interface Address).
This removes extra latency from P2P Action frame operations
within a P2P group.

13 years agoWPS ER: Clear WPS state if PutMessage does not include NewOutMessage
Jouni Malinen [Tue, 2 Nov 2010 09:20:54 +0000 (11:20 +0200)] 
WPS ER: Clear WPS state if PutMessage does not include NewOutMessage

This is needed to avoid getting stuck with pending WPS operation, e.g.,
when an AP replies to WSC_NACK with HTTP OK, but without following
message.

13 years agonl80211: Pass data frames from unknown STAs to hostapd
Helmut Schaa [Sun, 31 Oct 2010 19:36:43 +0000 (21:36 +0200)] 
nl80211: Pass data frames from unknown STAs to hostapd

Pass data frames from unknown STAs to hostapd in order to reply with
a Deauthentication or Disassociation frame. This fixes compliance
with IEEE Std 802.11-2007, 11.3.

Furthermore, this does not cause a lot of overhead (at least with
mac80211 drivers) since mac80211 does not pass all data frames (but
at least from unauthenticated and unassociated STAs) to cooked monitor
interfaces.

Tested with rt2800pci on a MIPS board.

Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
13 years agoAdd ctrl_iface command 'GET version'
Jouni Malinen [Sun, 31 Oct 2010 15:07:31 +0000 (17:07 +0200)] 
Add ctrl_iface command 'GET version'

This can be used to fetch the wpa_supplicant/hostapd version
string.

13 years agoAdd WPA_IGNORE_CONFIG_ERRORS option to continue in case of bad config
Dmitry Shmidt [Sun, 31 Oct 2010 10:38:49 +0000 (12:38 +0200)] 
Add WPA_IGNORE_CONFIG_ERRORS option to continue in case of bad config

This is an option to continue with wpa_supplicant and hostapd even if
config file has errors. The problem is that these daemons are the best
"candidates" for the config change, so if they can not start because
config file was let's say corrupted, you can not fix it easily.

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
13 years agoP2P: Fix random channel selection to use os_get_random
Jouni Malinen [Sun, 31 Oct 2010 10:27:37 +0000 (12:27 +0200)] 
P2P: Fix random channel selection to use os_get_random

This could have been using an uninitialized variable instead of
purposefully random value in picking up the channel. There is not
much of a difference for the use case here, but anyway, we may
as well do what was initially planned here and.

13 years agoP2P: Reorder code to avoid memory leak on error path
Jouni Malinen [Sun, 31 Oct 2010 10:24:21 +0000 (12:24 +0200)] 
P2P: Reorder code to avoid memory leak on error path

13 years agoFix copy-paste bug in p2p_serv_disc_resp handling
Jouni Malinen [Sun, 31 Oct 2010 10:17:30 +0000 (12:17 +0200)] 
Fix copy-paste bug in p2p_serv_disc_resp handling

The destination address for p2p_serv_disc_resp must always be set
to an individual MAC address unlike p2p_serv_disc_req which may use
00:00:00:00:00:00 to indicate wildcard query. As such, we should not
try to check for this special case here.

13 years agoP2P: Add NULL pointer validation for ssid for group started event
Jouni Malinen [Sun, 31 Oct 2010 10:12:07 +0000 (12:12 +0200)] 
P2P: Add NULL pointer validation for ssid for group started event

It looks likely that ssid is not NULL here, but better keep this
consistent with other uses of ssid pointer in this function.

13 years agoMake wpa_hexdump_buf{,-key} handle NULL buffer
Jouni Malinen [Sun, 31 Oct 2010 10:09:18 +0000 (12:09 +0200)] 
Make wpa_hexdump_buf{,-key} handle NULL buffer

This matches with behavior of other wpa_hexdump* functions.

13 years agoClear vars in drivers makefile
Dmitry Shmidt [Sun, 31 Oct 2010 09:59:31 +0000 (11:59 +0200)] 
Clear vars in drivers makefile

drivers.mak is shared between hostapd and wpa_supplicant and
compiling them together may create "wrong" flags.

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
13 years agoWPS ER: Add validation of WPS attributes in proxied Probe Request
Jouni Malinen [Sun, 31 Oct 2010 09:57:13 +0000 (11:57 +0200)] 
WPS ER: Add validation of WPS attributes in proxied Probe Request

When strict validation is enabled in the build, check the WPS
attributes in proxied Probe Request frames.

13 years agoAdd ctrl_interface event for association rejected
Jouni Malinen [Wed, 27 Oct 2010 17:28:16 +0000 (20:28 +0300)] 
Add ctrl_interface event for association rejected

13 years agoAdd BSSID to association rejected events
Jouni Malinen [Wed, 27 Oct 2010 17:27:39 +0000 (20:27 +0300)] 
Add BSSID to association rejected events

13 years agoP2P: Do not re-send PD Request for join-a-group after acked frame
Jouni Malinen [Wed, 27 Oct 2010 16:36:10 +0000 (19:36 +0300)] 
P2P: Do not re-send PD Request for join-a-group after acked frame

We are not actually interested in the PD Response in join-a-group
case, so there is no point in trying to send PD Request until the
response is received. This avoids an extra PD getting started after
a join-a-group operation in some cases.

13 years agoP2P: Fix removal_reason setting to use correct pointer
Jouni Malinen [Wed, 27 Oct 2010 08:47:41 +0000 (11:47 +0300)] 
P2P: Fix removal_reason setting to use correct pointer

The previous version triggered a NULL pointer dereference on
P2P_GROUP_REMOVE * command.

13 years agoAllow EAPOL frames from pre-authenticating station to be processed
Jouni Malinen [Fri, 8 Oct 2010 12:49:12 +0000 (15:49 +0300)] 
Allow EAPOL frames from pre-authenticating station to be processed

13 years agoatheros: Remove debug for ioctls that are not used anymore
Shan Palanisamy [Tue, 26 Oct 2010 19:02:45 +0000 (22:02 +0300)] 
atheros: Remove debug for ioctls that are not used anymore

This is needed to fix build with a newer driver version.

13 years agoFix compiler warning from previous commit
Jouni Malinen [Wed, 27 Oct 2010 08:31:32 +0000 (11:31 +0300)] 
Fix compiler warning from previous commit

13 years agoFix memory leak in P2P build without MLME
Jouni Malinen [Wed, 27 Oct 2010 08:26:46 +0000 (11:26 +0300)] 
Fix memory leak in P2P build without MLME

The ieee80211_sta_free_hw_features() function is now used outside
the MLME code, so better make sure it gets included in the build
to avoid leaking memory.

13 years agohostapd: Set operstate UP when initializing AP mode
Jouni Malinen [Tue, 26 Oct 2010 13:30:28 +0000 (16:30 +0300)] 
hostapd: Set operstate UP when initializing AP mode

This is needed to avoid problems with other applications setting and
leaving the interface to IF_OPER_DORMANT state. In AP mode, the interface
is ready immediately after the keys are set, so we better make sure the
DORMANT state does not prevent normal operations after that.

13 years agoP2P: Fix parsing of UTF-8 device names
Jouni Malinen [Tue, 26 Oct 2010 07:40:35 +0000 (10:40 +0300)] 
P2P: Fix parsing of UTF-8 device names

The control character verification was supposed to only replace
bytes 0..31, not 0..31 and 128..255 as happened on systems where
char is signed.

13 years agoWPS ER: Cache AP settings for APs that restart UPnP
Jouni Malinen [Mon, 25 Oct 2010 19:22:07 +0000 (22:22 +0300)] 
WPS ER: Cache AP settings for APs that restart UPnP

This is needed to avoid issues with APs that restart their UPnP,
e.g., when ER reconfigures them. The previously known settings are
now cached and taken into use if an AP is detected to leave
(ssdp:byebye) and then return.

13 years agoWPS ER: Add more details to wps_er_pbc failure returns
Jouni Malinen [Mon, 25 Oct 2010 18:59:25 +0000 (21:59 +0300)] 
WPS ER: Add more details to wps_er_pbc failure returns

Indicate the reason for the failure when wps_er_pbc is rejected.

13 years agoWPS ER: Fix SetSelectedRegistrar to include wildcard AuthorizedMACs
Jouni Malinen [Mon, 25 Oct 2010 18:45:29 +0000 (21:45 +0300)] 
WPS ER: Fix SetSelectedRegistrar to include wildcard AuthorizedMACs

This is required by WPS 2.0, so add the wildcard address to
AuthorizedMACs if no addresses are in the list.

13 years agoWPS ER: Only activate PBC mode on single AP
Jouni Malinen [Mon, 25 Oct 2010 18:41:10 +0000 (21:41 +0300)] 
WPS ER: Only activate PBC mode on single AP

Verify that the UUID given to wps_er_pbc command is known and only
activate PBC mode on the matching AP. The UUID can be that of the
AP or the station/Enrollee.

13 years agoWPS ER: Show SetSelectedRegistrar events as ctrl_iface events
Jouni Malinen [Mon, 25 Oct 2010 18:29:22 +0000 (21:29 +0300)] 
WPS ER: Show SetSelectedRegistrar events as ctrl_iface events

This makes it easier to figure out if something goes wrong in
preparing the AP for enrolling a station.

13 years agoP2P: Remove P2P group on driver resource becoming unavailable
Jouni Malinen [Mon, 25 Oct 2010 16:16:11 +0000 (19:16 +0300)] 
P2P: Remove P2P group on driver resource becoming unavailable

Add a new driver event, EVENT_INTERFACE_UNAVAILABLE, for indicating
that the driver is not able to continue operating the virtual
interface in its current mode anymore, e.g., due to operating
channel for GO interface forced to a DFS channel by another virtual
interface.

When this happens for a P2P group interface, the P2P group will
be terminated and P2P-GROUP-REMOVED event shows the reason for
this as follows:
P2P-GROUP-REMOVED wlan0 GO reason=UNAVAILABLE

13 years agoWPS: Fix wps_reg command documentation to require BSSID
Jouni Malinen [Mon, 25 Oct 2010 15:56:49 +0000 (18:56 +0300)] 
WPS: Fix wps_reg command documentation to require BSSID

Replacing the BSSID with 'any' has never worked with wps_reg
command, so better not claim it could work. In addition, reject
this is wpa_supplicant to make it clearer that the operation
fails.

13 years agoP2P: Add mechanism for timing out idle groups
Jouni Malinen [Mon, 25 Oct 2010 15:24:15 +0000 (18:24 +0300)] 
P2P: Add mechanism for timing out idle groups

A new configuration parameter, p2p_group_idle, can now be used to set
idle timeout value for P2P groups in seconds (0 = no timeout). If set,
this values is used to remove P2P group (both GO and P2P client)
interfaces after the group has been idle (no clients/GO seen) for the
configuration duration.

The P2P-GROUP-REMOVED event is now indicating the reason for group
removal when known. For example:
P2P-GROUP-REMOVED wlan0 GO reason=REQUESTED
P2P-GROUP-REMOVED wlan1 client reason=IDLE

13 years agohostapd: Fix compiler warning
Jouni Malinen [Mon, 25 Oct 2010 10:38:06 +0000 (13:38 +0300)] 
hostapd: Fix compiler warning

Commit 83e843e830112a810ef6a1f6c08dbe8200e47f0f copied a workaround
without updating the return value to match with the void function.

13 years agohostapd: Avoid crashing on station mode disassoc event
Jouni Malinen [Fri, 22 Oct 2010 14:43:23 +0000 (17:43 +0300)] 
hostapd: Avoid crashing on station mode disassoc event

Some driver wrappers may end up indicating a disassociation or
deauthentication event without the address of the station, e.g.,
based on a previous non-AP mode event. Avoid crashing hostapd
by verifying that the require address parameter is available in
the event before processing it.

13 years agoShow wpa_supplicant version number in the debug log
Jouni Malinen [Fri, 22 Oct 2010 08:50:34 +0000 (11:50 +0300)] 
Show wpa_supplicant version number in the debug log

13 years agohostapd: Add wps_config ctrl_interface command for configuring AP
Jouni Malinen [Thu, 21 Oct 2010 13:49:41 +0000 (16:49 +0300)] 
hostapd: Add wps_config ctrl_interface command for configuring AP

This command can be used to configure the AP using the internal
WPS registrar. It works in the same way as new AP settings received
from an ER.

13 years agoP2P: Fix p2p_send_action conversions
Jouni Malinen [Wed, 20 Oct 2010 18:32:18 +0000 (21:32 +0300)] 
P2P: Fix p2p_send_action conversions

Couple of these missed the change in the first argument and resulted
in various crashes.

13 years agoP2P: Delay send_action call if p2p_scan is in progress
Jouni Malinen [Wed, 20 Oct 2010 16:41:20 +0000 (19:41 +0300)] 
P2P: Delay send_action call if p2p_scan is in progress

In order to avoid confusing the driver with a new remain-on-channel
request, delay sending of a new Action frame if the driver indicates
Action frame RX diromg a scan.

13 years agoP2P: Do not stop Listen state if it is on correct channel
Jouni Malinen [Wed, 20 Oct 2010 16:37:47 +0000 (19:37 +0300)] 
P2P: Do not stop Listen state if it is on correct channel

This is needed to optimize response to GO Negotiation Request frames.
The extra remain-on-channel cancel followed by new remain-on-channel for
the same channel takes too much time with some driver/firmware
designs for the response to go out quickly enough to avoid peer
timing out while waiting for our response.

13 years agoFix crash on channel list changed event during driver init
Jouni Malinen [Wed, 20 Oct 2010 16:30:55 +0000 (19:30 +0300)] 
Fix crash on channel list changed event during driver init

The driver wrapper may indicate EVENT_CHANNEL_LIST_CHANGED before
completing init(). This would likely result in segfault when driver
channel list is being read as part of processing this event when
P2P is enabled.

13 years agoWPS ER: Add wps_er_set_config to use local configuration
Jouni Malinen [Wed, 20 Oct 2010 10:37:01 +0000 (13:37 +0300)] 
WPS ER: Add wps_er_set_config to use local configuration

This command can be used to enroll a network based on a local
network configuration block instead of having to (re-)learn the
current AP settings with wps_er_learn.

13 years agoWPS: Fix a compiler warning in hostapd_wps_update_ie()
Jouni Malinen [Wed, 20 Oct 2010 10:35:55 +0000 (13:35 +0300)] 
WPS: Fix a compiler warning in hostapd_wps_update_ie()

13 years agoWPS: Update Beacon/ProbeResp IE on wps_version_number changes
Jouni Malinen [Tue, 19 Oct 2010 16:57:01 +0000 (19:57 +0300)] 
WPS: Update Beacon/ProbeResp IE on wps_version_number changes

This test command is supposed to change the WPS version number in all
places immediately, so make sure that the IEs used in management
frames get updated immediately.

13 years agoP2P: Scan all channels if GO is not found from common channels
Jouni Malinen [Tue, 19 Oct 2010 15:38:49 +0000 (18:38 +0300)] 
P2P: Scan all channels if GO is not found from common channels

This is not supposed to happen, but in theory, the GO may end up
changing its channels at some point. While it would be reasonable
to use one of the common channels, GO may be forced to use another
channel. The most likely reason for this would be if the P2P client
is enforcing only a single channel to be used (e.g., to avoid
multi-channel concurrent operations).

13 years agoP2P: Track non-P2P members in the group and set Group Limit bit
Jouni Malinen [Tue, 19 Oct 2010 15:10:28 +0000 (18:10 +0300)] 
P2P: Track non-P2P members in the group and set Group Limit bit

The P2P group component is now tracking of associated stations
in the group and the Group Limit bit in the Group Capabilities
is updated based on whether there is room for new clients in
the group.

13 years agoFix max_stations to apply to associated STAs, not P2P peers
Jouni Malinen [Tue, 19 Oct 2010 14:17:04 +0000 (17:17 +0300)] 
Fix max_stations to apply to associated STAs, not P2P peers

This driver capability limit was supposed to indicate limit on
how many stations can associate with us in the AP mode, not how
many P2P peers are stored in the peer table.

13 years agoAdd max_num_sta config option for wpa_supplicant AP mode
Jouni Malinen [Tue, 19 Oct 2010 14:08:20 +0000 (17:08 +0300)] 
Add max_num_sta config option for wpa_supplicant AP mode

This can be used to limit the number of stations allowed to be
connected to the AP.

13 years agoP2P: Add p2p_cancel command for cancelling ongoing group formation
Jouni Malinen [Tue, 19 Oct 2010 12:53:28 +0000 (15:53 +0300)] 
P2P: Add p2p_cancel command for cancelling ongoing group formation

13 years agoP2P: Skip GO Neg Conf ack failure workaround of send failures
Jouni Malinen [Tue, 19 Oct 2010 09:47:33 +0000 (12:47 +0300)] 
P2P: Skip GO Neg Conf ack failure workaround of send failures

The workaround to ignore no ctrl::ack received for GO Negotiation
Confirmation frame was only supposed to be used when the frame was
actually transmitted and just the ack was not received. However, due
to the way the driver failure on transmitting the frame were reported,
this ended up getting applied for all failures in sending the GO
Negotiation Confirmation frame.

Improve this by providing a mechanism to indicate whether send_action
operations fail locally before the frame was actually transmitted or
because of not receiving ack frame after having transmitted the frame.

13 years agoWPS UPnP: Add more debug for event subscription
Jouni Malinen [Tue, 19 Oct 2010 09:43:48 +0000 (12:43 +0300)] 
WPS UPnP: Add more debug for event subscription

13 years agoP2P: Try to re-create group interface if pending one is not available
Jouni Malinen [Mon, 18 Oct 2010 14:00:50 +0000 (17:00 +0300)] 
P2P: Try to re-create group interface if pending one is not available

This is needed to work around cases where the pending interface gets
removed, e.g., due to failed GO Negotiation. In such case, we may still
accept new GO Negotiation to be completed, but the interface did not
get created without a separate p2p_connect command.

The current implementation is not ideal since the re-created interface
may, at least in theory, get incorrect interface addrees. Though, this
would likely require that the driver supported more than one P2P group
interface and that the previous one was already taken into use for
another group.

13 years agoWPS: Do not drop subscriptions based on max queue length
Jouni Malinen [Sun, 17 Oct 2010 18:36:04 +0000 (21:36 +0300)] 
WPS: Do not drop subscriptions based on max queue length

UPnP event subscriptions are not supposed to be dropped based on
whether events can be delivered quickly enough. Leave dropping to
happen only based on failed deliveries to avoid issues with a burst
of events kicking out still active subscribers.

13 years agoWPS UPnP: Add more priority for queuing EAP events
Jouni Malinen [Sun, 17 Oct 2010 18:30:25 +0000 (21:30 +0300)] 
WPS UPnP: Add more priority for queuing EAP events

13 years agoWPS UPnP: Throttle WLANEvent notifications to 5 per second
Jouni Malinen [Sun, 17 Oct 2010 18:24:12 +0000 (21:24 +0300)] 
WPS UPnP: Throttle WLANEvent notifications to 5 per second

Do not send more than five Probe Request WLANEvent notifications
per second. Even though the limit should in theory apply to all
WLANEvents, it is better not to drop EAP notifications because
of Probe Request frames and really, the only real reason for
event bursts is Probe Request frames.

13 years agoWPS: Limit Probe Request event queuing if subscriber may have left
Jouni Malinen [Sun, 17 Oct 2010 17:58:58 +0000 (20:58 +0300)] 
WPS: Limit Probe Request event queuing if subscriber may have left

Instead of queuing all events for a subscriber, only queue more
important events if delivery of event notifications starts failing.
This allows more time for the subscriber to recover since the maximum
queue length if not reached because of Probe Request frames only.

13 years agoWPS: Schedule sending of pending events after failure
Jouni Malinen [Sun, 17 Oct 2010 17:57:11 +0000 (20:57 +0300)] 
WPS: Schedule sending of pending events after failure

There is no point leaving these pending events waiting for something
new to trigger us to continue.

13 years agoWPS: Separate local error from max queue length reached
Jouni Malinen [Sun, 17 Oct 2010 17:29:28 +0000 (20:29 +0300)] 
WPS: Separate local error from max queue length reached

Drop subscription only if the max queue length has been reached;
not based on any error.

13 years agoWPS UPnP: Improved event notification failure processing
Jouni Malinen [Sun, 17 Oct 2010 17:26:03 +0000 (20:26 +0300)] 
WPS UPnP: Improved event notification failure processing

Instead of dropping the subscription on first failure, allow up to
10 failures before dropping. In addition, drop the callback URLs
one by one instead of full subscription if only one URL is failing.

13 years agoWPS: Convert assert() to error return
Jouni Malinen [Sun, 17 Oct 2010 17:23:51 +0000 (20:23 +0300)] 
WPS: Convert assert() to error return

13 years agoWPS UPnP: Fix memory leak on retry case
Jouni Malinen [Sun, 17 Oct 2010 17:22:03 +0000 (20:22 +0300)] 
WPS UPnP: Fix memory leak on retry case

The event entry needs to be freed when giving up on retries.

13 years agoWPS: Add more debug info for UPnP operations
Jouni Malinen [Sun, 17 Oct 2010 17:20:28 +0000 (20:20 +0300)] 
WPS: Add more debug info for UPnP operations

13 years agoWPS: Remove unused define
Jouni Malinen [Sun, 17 Oct 2010 17:15:08 +0000 (20:15 +0300)] 
WPS: Remove unused define

This timeout value was moved to now separate HTTP client implementation.

13 years agoWPS: Cleaned up URL parser not to modify const buffer
Jouni Malinen [Sun, 17 Oct 2010 17:12:54 +0000 (20:12 +0300)] 
WPS: Cleaned up URL parser not to modify const buffer

There is no need to use '\0' termination here in string parsing,
so we may as well clean this up to follow the const declaration.

13 years agoWPS: Drop subscription if it does not have any valid callback address
Jouni Malinen [Sun, 17 Oct 2010 17:11:03 +0000 (20:11 +0300)] 
WPS: Drop subscription if it does not have any valid callback address

13 years agoWPS: Remove unused error path code
Jouni Malinen [Sun, 17 Oct 2010 17:10:09 +0000 (20:10 +0300)] 
WPS: Remove unused error path code

13 years agoWPS UPnP: Fix HTTP client timeout event code
Jouni Malinen [Sun, 17 Oct 2010 17:07:33 +0000 (20:07 +0300)] 
WPS UPnP: Fix HTTP client timeout event code

The define here was overriding the event code enum value and that
resulted in incorrect code being used and WPS UPnP code ignoring the
timeout events.

13 years agoWPS: Add virtual flags in Config Methods for WPS 2.0 if needed
Jouni Malinen [Sat, 16 Oct 2010 09:57:47 +0000 (12:57 +0300)] 
WPS: Add virtual flags in Config Methods for WPS 2.0 if needed

This is a workaround for incorrect configuration (missing
virtual/physical identifier for config methods) for WPS 2.0 to
allow unmodified configuration from WPS 1.0 to be used while
enforcing compliant WPS 2.0 values.

13 years agoFix build with drivers that use driver_wext.c
Jouni Malinen [Fri, 15 Oct 2010 19:11:33 +0000 (22:11 +0300)] 
Fix build with drivers that use driver_wext.c

If CONFIG_DRIVER_WEXT=y is not used in .config, but driver_wext.c
gets pull in to help another driver wrapper, rfkill code needs to
included to fix the build.

13 years agonl80211: Indicate channel list change events
Jouni Malinen [Fri, 15 Oct 2010 15:56:36 +0000 (18:56 +0300)] 
nl80211: Indicate channel list change events

Listen to regulatory event messages from kernel and convert them to
internal driver event notifications indicated that the channel list
may have changed.

13 years agoP2P: Add mechanism for updating P2P channel list based on driver events
Jouni Malinen [Fri, 15 Oct 2010 15:55:22 +0000 (18:55 +0300)] 
P2P: Add mechanism for updating P2P channel list based on driver events

This allows P2P channel list to be updated whenever the driver changes
its list of allowed channels, e.g., based on country code from scan
results.

13 years agoP2P: Set channel list per channel instead of per band
Jouni Malinen [Fri, 15 Oct 2010 15:51:37 +0000 (18:51 +0300)] 
P2P: Set channel list per channel instead of per band

This makes the channel list match with driver capabilities without
having to do workaround like disabling channels 12-14.

13 years agoP2P: Verify that forced channel is suitable for autonomous GO
Jouni Malinen [Fri, 15 Oct 2010 15:46:02 +0000 (18:46 +0300)] 
P2P: Verify that forced channel is suitable for autonomous GO

13 years agoP2P: Send AP mode WPS-FAIL event to parent interface
Anil Gathala Sudha [Thu, 14 Oct 2010 17:57:00 +0000 (20:57 +0300)] 
P2P: Send AP mode WPS-FAIL event to parent interface

The AP operation with wpa_supplicant requires an additional callback
to get the needed event information from hostapd side so that
wpa_msg() can be called for wpa_s->parent if needed.

13 years agoP2P: Send WPS-FAIL event to parent interface, too
Jouni Malinen [Thu, 14 Oct 2010 17:52:31 +0000 (20:52 +0300)] 
P2P: Send WPS-FAIL event to parent interface, too

This makes it easier to figure out what went wrong during group
formation when per-group interfaces are used.

13 years agoWPS: Add WPS-FAIL ctrl_interface event for hostapd
Jouni Malinen [Thu, 14 Oct 2010 17:50:46 +0000 (20:50 +0300)] 
WPS: Add WPS-FAIL ctrl_interface event for hostapd

13 years agoWPS: Add Config Error into WPS-FAIL events
Jouni Malinen [Thu, 14 Oct 2010 17:49:54 +0000 (20:49 +0300)] 
WPS: Add Config Error into WPS-FAIL events

This makes it easier to figure out what could have failed in the
WPS protocol and potentially provide more information for the
user on how to resolve the issue.

13 years agoP2P: Reject multi-channel concurrent operations depending on driver
Jouni Malinen [Thu, 14 Oct 2010 11:24:56 +0000 (14:24 +0300)] 
P2P: Reject multi-channel concurrent operations depending on driver

The driver wrapper can now indicate whether the driver supports
concurrent operations on multiple channels (e.g., infra STA connection
on 5 GHz channel 36 and P2P group on 2.4 GHz channel 1). If not,
P2P_CONNECT commands will be rejected if they would require
multi-channel concurrency.

The new failure codes for P2P_CONNECT:

FAIL-CHANNEL-UNAVAILABLE:
The requested/needed channel is not currently available (i.e., user has
an option of disconnecting another interface to make the channel
available).

FAIL-CHANNEL-UNSUPPORTED:
The request channel is not available for P2P.

13 years agoP2P: Share code for p2p_connect/authorize channel preparation
Jouni Malinen [Thu, 14 Oct 2010 09:45:15 +0000 (12:45 +0300)] 
P2P: Share code for p2p_connect/authorize channel preparation

13 years agoP2P: Verify that p2p_connect forced frequency is allowed for P2P
Jouni Malinen [Thu, 14 Oct 2010 09:39:40 +0000 (12:39 +0300)] 
P2P: Verify that p2p_connect forced frequency is allowed for P2P

Do not accept forced frequency unless the specified channel is
allowed for P2P, i.e., is included in the local list of
advertised channels.

13 years agobgscan: Add new channel condition parameters to signal change events
Paul Stewart [Tue, 12 Oct 2010 17:03:36 +0000 (20:03 +0300)] 
bgscan: Add new channel condition parameters to signal change events

bgscan modules can potentially get a richer feel for the channel
condition and make better choices about scan/no-scan and roam/no-roam.

13 years agonl80211: Add more details into signal change events
Paul Stewart [Tue, 12 Oct 2010 17:01:50 +0000 (20:01 +0300)] 
nl80211: Add more details into signal change events

Add new survey retrieval function and add txrate to station into the
EVENT_SIGNAL_CHANGE events.

13 years agoP2P: Limit p2p_connect .. pbc join based on BSSID
Jouni Malinen [Tue, 12 Oct 2010 13:56:17 +0000 (16:56 +0300)] 
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.

13 years agoWPS: Workaround broken Credential encoding from some D-Link APs
Jouni Malinen [Mon, 11 Oct 2010 13:07:49 +0000 (16:07 +0300)] 
WPS: Workaround broken Credential encoding from some D-Link APs

At least D-Link DIR-600 and DIR-825 have been reported to include
an extra octet after the Network Key attribute within a Credential
attribute. This can happen at least when they are provisioning an
open network.

Add a workaround to detect this incorrectly encoded attribute and
to skip the extra octet when parsing such a Credential.

13 years agonl80211: Use nl80211 for Probe Request/Response frames
Johannes Berg [Sun, 10 Oct 2010 15:10:37 +0000 (18:10 +0300)] 
nl80211: Use nl80211 for Probe Request/Response frames

The new nl80211 API means we don't need to use monitor interfaces. This
means that the P2P implementation now requires a kernel that has support
for generic management frame (not just Action frame) transmission.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 years agonl80211: Refactor Action frame TX
Johannes Berg [Sun, 10 Oct 2010 15:00:25 +0000 (18:00 +0300)] 
nl80211: Refactor Action frame TX

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 years agonl80211: Use new frame registration API
Johannes Berg [Sun, 10 Oct 2010 14:55:18 +0000 (17:55 +0300)] 
nl80211: Use new frame registration API

This is backward compatible since older kernels will ignore the extra
attribute and only allow registration for Action frames.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 years agoP2P: Fix remain-on-channel abort race
Johannes Berg [Sun, 10 Oct 2010 14:52:13 +0000 (17:52 +0300)] 
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>
13 years agonl80211: support intra-BSS configuration
Johannes Berg [Sun, 10 Oct 2010 14:48:54 +0000 (17:48 +0300)] 
nl80211: support intra-BSS configuration

Using the AP_ISOLATE nl80211 option, we can support intra-BSS
distribution configuration.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 years agonl80211: work around libnl bug
Johannes Berg [Sun, 10 Oct 2010 14:47:15 +0000 (17:47 +0300)] 
nl80211: work around libnl bug

libnl has a bug, when binding more than two sockets and releasing one,
it will release the wrong address and then try to reuse it, which fails.
Therefore, we need to reimplement the socket address assignment logic
locally for libnl 1.1.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 years agoWPS: Fix WPS commands in wpa_supplicant AP mode
Jouni Malinen [Sun, 10 Oct 2010 14:43:42 +0000 (17:43 +0300)] 
WPS: Fix WPS commands in wpa_supplicant AP mode

Commit 9290cc180040b77afbf3ccf088fb14d0121bc5b3 broke this by moving
to use for_each_interface() which is not available in wpa_supplicant
AP mode.

13 years agoP2P: Fix a typo to fix CONFIG_P2P=y build
Jouni Malinen [Sun, 10 Oct 2010 14:28:47 +0000 (17:28 +0300)] 
P2P: Fix a typo to fix CONFIG_P2P=y build

Previous typo fix was missed here.

13 years agodbus_new_handlers: Don't send NULL to dbus_message_new_error
Paul Stewart [Sat, 9 Oct 2010 14:29:51 +0000 (17:29 +0300)] 
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.

13 years agodbus: Treat '' in SSIDs of Interface.Scan as a request for broadcast scan
Daniel Kurtz [Sat, 9 Oct 2010 13:27:53 +0000 (16:27 +0300)] 
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

13 years agodbus: Fix passive/active scans in some cases
Daniel Kurtz [Sat, 9 Oct 2010 13:22:39 +0000 (16:22 +0300)] 
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

13 years agonl80211: Sync with wireless-testing.git
Jouni Malinen [Sat, 9 Oct 2010 08:57:05 +0000 (11:57 +0300)] 
nl80211: Sync with wireless-testing.git