Commit Graph

1339 Commits

Author SHA1 Message Date
Jouni Malinen ccb7e5ee59 WPS: Send WSC_NACK if message without Message Type is received 2010-11-04 18:17:00 +02:00
Jouni Malinen 4a64a51b63 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.
2010-11-04 18:16:14 +02:00
Jouni Malinen 7b23f0f3c8 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.
2010-11-04 17:37:20 +02:00
Jouni Malinen c7c0ddfd91 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.
2010-11-04 17:29:48 +02:00
Jouni Malinen 6e1468839c nl80211: Allow libnl to be replaced with libnl-tiny
CONFIG_LIBNL_TINY=y can be used to select libnl-tiny instead of
libnl.
2010-11-04 17:14:58 +02:00
Jouni Malinen 8dcb61ce5d WPS: Comment out WEP configuration lines on reconfig 2010-11-04 17:02:16 +02:00
Jouni Malinen 07fef399a1 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.
2010-11-02 11:20:54 +02:00
Helmut Schaa 65ae1afd44 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>
2010-10-31 21:36:43 +02:00
Jouni Malinen d96e79f1e7 Make wpa_hexdump_buf{,-key} handle NULL buffer
This matches with behavior of other wpa_hexdump* functions.
2010-10-31 12:09:18 +02:00
Dmitry Shmidt 7a6a6374f2 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>
2010-10-31 11:59:31 +02:00
Jouni Malinen 5245483f80 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.
2010-10-31 11:57:13 +02:00
Jouni Malinen ea78c315a2 Add ctrl_interface event for association rejected 2010-10-27 20:28:16 +03:00
Jouni Malinen 59ddf221c8 Add BSSID to association rejected events 2010-10-27 20:27:39 +03:00
Jouni Malinen 10c4edde6e 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.
2010-10-27 19:36:10 +03:00
Jouni Malinen c926593119 Allow EAPOL frames from pre-authenticating station to be processed 2010-10-27 11:34:29 +03:00
Shan Palanisamy d143bdc862 atheros: Remove debug for ioctls that are not used anymore
This is needed to fix build with a newer driver version.
2010-10-27 11:33:40 +03:00
Jouni Malinen e11f5a2cbc 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.
2010-10-26 16:30:28 +03:00
Jouni Malinen 4e0c025d13 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.
2010-10-26 10:40:35 +03:00
Jouni Malinen be88391dee 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.
2010-10-25 22:22:07 +03:00
Jouni Malinen ed159ad41b WPS ER: Add more details to wps_er_pbc failure returns
Indicate the reason for the failure when wps_er_pbc is rejected.
2010-10-25 21:59:25 +03:00
Jouni Malinen 669f322d0e 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.
2010-10-25 21:45:29 +03:00
Jouni Malinen 20ebd9c4b9 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.
2010-10-25 21:41:10 +03:00
Jouni Malinen 3e7533b399 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.
2010-10-25 21:29:22 +03:00
Jouni Malinen c973f3868a 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
2010-10-25 19:16:11 +03:00
Jouni Malinen 3071e18109 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
2010-10-25 18:24:15 +03:00
Jouni Malinen 1f4c7b6b2a hostapd: Fix compiler warning
Commit 83e843e830 copied a workaround
without updating the return value to match with the void function.
2010-10-25 13:38:06 +03:00
Jouni Malinen 83e843e830 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.
2010-10-22 17:43:23 +03:00
Jouni Malinen 450eddcfae 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.
2010-10-21 16:49:41 +03:00
Jouni Malinen 7374b68ee9 P2P: Fix p2p_send_action conversions
Couple of these missed the change in the first argument and resulted
in various crashes.
2010-10-20 21:32:18 +03:00
Jouni Malinen 3f9285ff19 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.
2010-10-20 19:44:21 +03:00
Jouni Malinen 0b8889d8e5 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.
2010-10-20 19:44:16 +03:00
Jouni Malinen ef10f4733f 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.
2010-10-20 13:37:01 +03:00
Jouni Malinen cbbf4a1cc3 WPS: Fix a compiler warning in hostapd_wps_update_ie() 2010-10-20 13:35:55 +03:00
Jouni Malinen 2c8a4eef41 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.
2010-10-19 19:57:01 +03:00
Jouni Malinen 3f4ce13fde 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.
2010-10-19 18:10:28 +03:00
Jouni Malinen 93b7ddd032 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.
2010-10-19 12:47:33 +03:00
Jouni Malinen 2b67a67144 WPS UPnP: Add more debug for event subscription 2010-10-19 12:43:48 +03:00
Jouni Malinen 99ba7f889b 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.
2010-10-17 21:36:04 +03:00
Jouni Malinen f30e698c08 WPS UPnP: Add more priority for queuing EAP events 2010-10-17 21:30:25 +03:00
Jouni Malinen 08a98b6544 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.
2010-10-17 21:24:12 +03:00
Jouni Malinen 3904567d0b 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.
2010-10-17 20:58:58 +03:00
Jouni Malinen d1e17fbc9c 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.
2010-10-17 20:57:11 +03:00
Jouni Malinen 8c3a2f11ab 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.
2010-10-17 20:29:28 +03:00
Jouni Malinen dd50c2d425 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.
2010-10-17 20:26:03 +03:00
Jouni Malinen 10fb1a984f WPS: Convert assert() to error return 2010-10-17 20:23:51 +03:00
Jouni Malinen 1f1d4df09a WPS UPnP: Fix memory leak on retry case
The event entry needs to be freed when giving up on retries.
2010-10-17 20:22:03 +03:00
Jouni Malinen 3953627b35 WPS: Add more debug info for UPnP operations 2010-10-17 20:20:28 +03:00
Jouni Malinen ed31b5ebcf WPS: Remove unused define
This timeout value was moved to now separate HTTP client implementation.
2010-10-17 20:15:08 +03:00
Jouni Malinen 75c3fc2e8a 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.
2010-10-17 20:12:54 +03:00
Jouni Malinen 75779589e8 WPS: Drop subscription if it does not have any valid callback address 2010-10-17 20:11:03 +03:00