mech_eap.git
12 years agodoc: Use correct path for kerneldoc2doxygen.pl
Pavel Roskin [Wed, 21 Sep 2011 14:59:19 +0000 (10:59 -0400)]
doc: Use correct path for kerneldoc2doxygen.pl

Refer to kerneldoc2doxygen.pl as doc/kerneldoc2doxygen.pl since doxygen
is run in the top-level source directory.

Signed-off-by: Pavel Roskin <proski@gnu.org>
12 years agowext: Remove write-only variable ap_num
Pavel Roskin [Wed, 21 Sep 2011 14:59:07 +0000 (10:59 -0400)]
wext: Remove write-only variable ap_num

Signed-off-by: Pavel Roskin <proski@gnu.org>
12 years agonl80211: Support PMKSA candidate events
Jouni Malinen [Wed, 21 Sep 2011 13:14:41 +0000 (16:14 +0300)]
nl80211: Support PMKSA candidate events

This adds support for RSN pre-authentication with nl80211 interface and
drivers that handle roaming internally (i.e., wpa_supplicant is not
responsible for requesting scan results that provide the needed
information without these events).

12 years agoSync with wireless-testing.git linux/nl80211.h
Jouni Malinen [Wed, 21 Sep 2011 13:14:00 +0000 (16:14 +0300)]
Sync with wireless-testing.git linux/nl80211.h

12 years agowlantest: Verify that comeback assoc resp includes correct type
Jouni Malinen [Tue, 20 Sep 2011 17:13:18 +0000 (20:13 +0300)]
wlantest: Verify that comeback assoc resp includes correct type

The Timeout Interval element needs to use Association Comeback time
for the case when (Re)Association Response frame uses Status Code 30.
Verify this before incrementing the (re)assocresp_comeback counters.

12 years agonl80211: Work around EALREADY from connect command
Jouni Malinen [Sun, 18 Sep 2011 18:26:55 +0000 (21:26 +0300)]
nl80211: Work around EALREADY from connect command

cfg80211 does not currently allow NL80211_CMD_CONNECT when there
is already an association. This can result in wpa_supplicant being
unable to request a connection if the interface is already in
connected state. Work around this by requesting disconnection if
the connect command fails with EALREADY error. This allows
wpa_supplicant to recover from the unexpected state and complete
the connect request on next attempt.

12 years agoeapol_test: Add option for writing server certificate chain to a file
Jouni Malinen [Sat, 17 Sep 2011 19:42:54 +0000 (22:42 +0300)]
eapol_test: Add option for writing server certificate chain to a file

eapol_test command line argument -o<file> can now be used to request
the received server certificate chain to be written to the specified
file. The certificates will be written in PEM format. [Bug 391]

12 years agoRSN: Add a debug message when considing addition of OKC entry
Jouni Malinen [Fri, 16 Sep 2011 15:45:15 +0000 (18:45 +0300)]
RSN: Add a debug message when considing addition of OKC entry

12 years agoFix proactive_key_caching configuration to WPA code
Jouni Malinen [Fri, 16 Sep 2011 15:44:06 +0000 (18:44 +0300)]
Fix proactive_key_caching configuration to WPA code

The proactive_key_caching parameter was missed in mapping the
config_ssid data into the WPA state machine configuration. This
prevented addition of PMKSA cache entries based on PMKSA caching
candidate events.

12 years agoSync with wireless-testing.git linux/nl80211.h
Jouni Malinen [Fri, 16 Sep 2011 14:13:08 +0000 (17:13 +0300)]
Sync with wireless-testing.git linux/nl80211.h

12 years agowpa_supplicant AP: Set static WEP keys if configured
Jouni Malinen [Thu, 15 Sep 2011 12:04:46 +0000 (15:04 +0300)]
wpa_supplicant AP: Set static WEP keys if configured

This is needed to configure static WEP keys to the driver through the
hostapd configuration structures.

12 years agoAP: Set pairwise/group cipher for non-WPA modes
Jouni Malinen [Thu, 15 Sep 2011 12:02:59 +0000 (15:02 +0300)]
AP: Set pairwise/group cipher for non-WPA modes

This is needed to avoid confusing configuration in some nl80211
drivers that the new AP mode configuration alternatives for
setting security policy.

12 years agoFix AP build without CONFIG_WPS=y
Jouni Malinen [Mon, 12 Sep 2011 19:23:45 +0000 (22:23 +0300)]
Fix AP build without CONFIG_WPS=y

Make the WPS processing of (Re)Association Request frame IEs conditional
on WPS support. This fixes a build issue with wps_is_20() not being
defined and makes the non-WPS build a bit smaller.

12 years agoRemove time.h include from utils/includes.h
Jouni Malinen [Mon, 12 Sep 2011 19:15:13 +0000 (22:15 +0300)]
Remove time.h include from utils/includes.h

os_*() wrappers should be used instead of functions from time.h.
Removing the header from includes.h enforces this. os_unix.c can
include this its uses are valid wrapper calls. wps_upnp.c uses
gmtime() for which there is no os_*() wrapper available yet, so
allow it to use time.h, too. Similarly, allow dump_state.c to
use time.h for ctime().

12 years agoRemove references to time_t/time()
Per Ekman [Mon, 12 Sep 2011 19:14:30 +0000 (22:14 +0300)]
Remove references to time_t/time()

Use os_time() in AP mode instead of direct time() calls.

12 years agonl80211: Cancel not yet started r-o-c
Johannes Berg [Sat, 10 Sep 2011 19:57:41 +0000 (22:57 +0300)]
nl80211: Cancel not yet started r-o-c

Currently, the following can happen:

1) P2P state machine requests R-O-C
2) user changes their mind and aborts
3) P2P state machine aborts R-O-C
4) driver_nl80211 rejects abort since there
   was no notification about the start yet
5) R-O-C period start notification from kernel
6) P2P state machine requests new R-O-C
7) this overlaps with old R-O-C -- iwlwifi driver
   can't handle that and returns -EBUSY
8) state machine stops dead in its tracks

The reason is that the abort isn't going through properly. Instead of
tracking whether a R-O-C is active in driver_nl80211, track whether one
was requested to avoid this scenario.

Reported-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
12 years agoP2P: Remove CCK supported rates when running P2P scan
Rajkumar Manoharan [Sat, 10 Sep 2011 19:40:30 +0000 (22:40 +0300)]
P2P: Remove CCK supported rates when running P2P scan

This allows drivers to disable CCK rates from Probe Request frames.
For nl80211, this is currently applying only to the supported rates
element(s), but this mechanism could be extended to address TX rate
control masking, too, to lessen need for global rate disabling.

Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
12 years agonl80211: Automatically use concurrent P2P if possible
Johannes Berg [Sat, 10 Sep 2011 18:52:21 +0000 (21:52 +0300)]
nl80211: Automatically use concurrent P2P if possible

Since the kernel can now advertise P2P concurrent support by advertising
interface combinations, we can take advantage of that and automatically
use P2P_CONCURRENT / P2P_MGMT_AND_NON_P2P for drivers that advertise
support.

Keep driver_param=use_p2p_group_interface=1 for anyone not advertising
interface combinations in their drivers yet.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
12 years agoMake sure wpa_proto gets cleared for WPS and non-WPA connections
Edward Lu [Thu, 8 Sep 2011 14:51:08 +0000 (17:51 +0300)]
Make sure wpa_proto gets cleared for WPS and non-WPA connections

This is needed to fix the wpa_proto association parameter for drivers
that select AP based on security parameters internally.

12 years agoP2P: Allow advertisement config methods to be limited
Jouni Malinen [Thu, 8 Sep 2011 13:48:06 +0000 (16:48 +0300)]
P2P: Allow advertisement config methods to be limited

The default config methods was hardcoded to claim support for
PushButton, Display, and Keypad. While these are supported by
most P2P devices, there may be some cases where it is convenient
to be able to disable a specific config method. Use config_methods
configuration parameter to set the default values for Config Methods
in the P2P Device Info attribute.

12 years agoP2P: Remove Label config method
Jouni Malinen [Thu, 8 Sep 2011 13:40:03 +0000 (16:40 +0300)]
P2P: Remove Label config method

The P2P specification (3.1.4.3) disallows use of the Label configuration
method between two P2P devices. This was previously enforced at upper
level, but the obsolete code can be removed from wpa_supplicant. This
adds a bit more strict enforcement of the policy, but should not result
in practical differences since no known P2P implementation uses Label
config method.

12 years agoFlush PMKSA cache entries and invalidate EAP state on network changes
Jouni Malinen [Wed, 7 Sep 2011 14:46:00 +0000 (17:46 +0300)]
Flush PMKSA cache entries and invalidate EAP state on network changes

If a network configuration block is removed or modified, flush
all PMKSA cache entries that were created using that network
configuration. Similarly, invalidate EAP state (fast re-auth).

The special case for OKC on wpa_supplicant reconfiguration
(network_ctx pointer change) is now addressed as part of the
PMKSA cache flushing, so it does not need a separate mechanism
for clearing the network_ctx values in the PMKSA cache.

12 years agoCall wpas_notify_network_removed() on REMOVE_NETWORK
Jouni Malinen [Wed, 7 Sep 2011 14:44:00 +0000 (17:44 +0300)]
Call wpas_notify_network_removed() on REMOVE_NETWORK

This was done for the case where all networks are being removed,
but the case where a single network is removed was forgotten.

12 years agoClear driver PMKSA cache entry on PMKSA cache expiration
Jouni Malinen [Wed, 7 Sep 2011 13:31:09 +0000 (16:31 +0300)]
Clear driver PMKSA cache entry on PMKSA cache expiration

If the driver maintains its own copy of the PMKSA cache, we need to
clear an entry from the driver whenever wpa_supplicant is dropping
an old PMKSA cache entry.

12 years agoFix SIM/USIM simulator build to include AES encryption function
Jouni Malinen [Wed, 7 Sep 2011 13:17:08 +0000 (16:17 +0300)]
Fix SIM/USIM simulator build to include AES encryption function

12 years agoFix Deauth/Disassoc callback handling with test frames
Jouni Malinen [Tue, 6 Sep 2011 18:03:02 +0000 (21:03 +0300)]
Fix Deauth/Disassoc callback handling with test frames

The Deauth/Disassoc TX status callbacks were ending up kicking the
station entry from kernel driver when test functionality was used to
inject Deauth/Disassoc frames from the AP with the purpose of leaving
the local association in place. Fix this by using STA flags to figure
out whether there was a pending callback for the frame that we need
to act on.

In addition, add forgotten functionality for the Disassoc TX status
callback to match the behavior with Deauth.

12 years agoWPS: Add 'wpa_cli wps_pin get' for generating random PINs
Jouni Malinen [Fri, 2 Sep 2011 18:29:06 +0000 (21:29 +0300)]
WPS: Add 'wpa_cli wps_pin get' for generating random PINs

This can be used, e.g., in a UI to generate a PIN without
starting WPS (or P2P) operation.

12 years agonl80211: Fix WPA_VERSIONS attribute for Connect command
Jouni Malinen [Fri, 2 Sep 2011 17:40:23 +0000 (20:40 +0300)]
nl80211: Fix WPA_VERSIONS attribute for Connect command

The previous code was trying to figure out which WPA version is
used based on the extra IEs requested for Association Request. That
did not work properly in cases where non-WPA networks are used with
some extra IEs. Fix this by using more robust mechanism for passing
the WPA versions from core wpa_supplicant to the driver_ops
associate().

12 years agoAndroid: Include libcrypto and libssl only if CONFIG_TLS=openssl
Jouni Malinen [Fri, 2 Sep 2011 13:16:22 +0000 (16:16 +0300)]
Android: Include libcrypto and libssl only if CONFIG_TLS=openssl

12 years agoAndroid: Modify wireless_copy.h to fix Android build
Jouni Malinen [Thu, 1 Sep 2011 15:51:09 +0000 (18:51 +0300)]
Android: Modify wireless_copy.h to fix Android build

12 years agoReduce debug verbosity on global ctrl_iface PING command
Jouni Malinen [Thu, 1 Sep 2011 15:16:37 +0000 (18:16 +0300)]
Reduce debug verbosity on global ctrl_iface PING command

This matches with the earlier change that did the same for the
per-interface ctrl_iface commands.

12 years agoWPS: Set Probe Request config methods based on configuration
Bharat Chakravarty [Thu, 1 Sep 2011 12:24:45 +0000 (15:24 +0300)]
WPS: Set Probe Request config methods based on configuration

Instead of hardcoding the Config Methods attribute value in Probe
Request frames, set this based on the configured parameter
config_methods to allow correct set of methods to be advertised.

12 years agoWPS: Set RF bands based on driver capabilities
Bharat Chakravarty [Wed, 31 Aug 2011 14:53:55 +0000 (17:53 +0300)]
WPS: Set RF bands based on driver capabilities

Instead of hardcoding support for both 2.4 GHz and 5 GHz bands,
use driver capabilities to figure out which bands are supported.

12 years agoWPS ER: Fix UPnP XML Device Description parser to find correct device
Jouni Malinen [Wed, 31 Aug 2011 10:56:03 +0000 (13:56 +0300)]
WPS ER: Fix UPnP XML Device Description parser to find correct device

The device description file may include multiple devices. Improve the
simplistic parser by first trying to find the WFADevice:1 device before
fetching the device parameters. While this is still far from complete
XML parsing, this should address the most common root device
specifications.

12 years agonl80211: Support AP mode probe/action frame TX/RX without monitor iface
Jouni Malinen [Mon, 29 Aug 2011 11:26:55 +0000 (14:26 +0300)]
nl80211: Support AP mode probe/action frame TX/RX without monitor iface

This allows non-mac80211 drivers to report received Probe Request
frames to user space and Probe Response and Action frames to be sent
from user space when using AP/P2P GO mode.

12 years agoDelay STA entry removal until Deauth/Disassoc TX status in AP mode
Jouni Malinen [Sun, 28 Aug 2011 20:07:02 +0000 (23:07 +0300)]
Delay STA entry removal until Deauth/Disassoc TX status in AP mode

This allows the driver to use PS buffering of Deauthentication and
Disassociation frames when the STA is in power save sleep. The STA
entry (and PTK) will be removed from the kernel only after the
Deauth/Disassoc has been transmitted (e.g., when the STA wakes up).
A hardcoded two second timeout is used to limit the length of this
window should the driver fail to deliver the frame (e.g., the STA
is out of range and does not wake up). The kernel STA entry is
marked unauthorized during the wait to avoid accepting Data
frames from the STA that we have decided to disconnect.

This behavior is available only with drivers that provide TX status
events for Deauth/Disassoc frames (nl80211 at this point). Other
drivers continue to use the previous behavior where the STA entry
is removed immediately.

12 years agoEAP: Add "expanded" EAP type to get_name functions
Jouni Malinen [Sun, 28 Aug 2011 16:23:16 +0000 (19:23 +0300)]
EAP: Add "expanded" EAP type to get_name functions

12 years agowlantest: Allow injection of unprotected frames to unknown BSS
Jouni Malinen [Sun, 28 Aug 2011 16:19:38 +0000 (19:19 +0300)]
wlantest: Allow injection of unprotected frames to unknown BSS

12 years agoWPS: Wait for EAPOL-Start unless WPS 2.0 station as workaround
Jouni Malinen [Sun, 28 Aug 2011 16:16:59 +0000 (19:16 +0300)]
WPS: Wait for EAPOL-Start unless WPS 2.0 station as workaround

Extend the code that waits for the station to send EAPOL-Start before
initiating EAPOL authenticator operations to cover the case where the
station includes WPS IE in (Re)Association Request frame if that IE
does not include support for WPS 2.0. While this should not really
be needed, this may help with some deployed WPS 1.0 stations that do
not support EAPOL operations correctly and may get confused of the
EAP-Request/Identity packets that would show up twice if EAPOL-Start
is transmitted.

12 years agoProvide extra IEs for AP mode management frames with set_ap
Jouni Malinen [Fri, 26 Aug 2011 18:14:25 +0000 (21:14 +0300)]
Provide extra IEs for AP mode management frames with set_ap

Drivers that build Beacon, Probe Response, and (Re)Association
Response frames can use this information to and WPS and P2P IE
when needed.

12 years agoAdd support for setting SSID hiding mode through set_ap()
Jouni Malinen [Fri, 26 Aug 2011 18:12:47 +0000 (21:12 +0300)]
Add support for setting SSID hiding mode through set_ap()

12 years agoAdd crypto parameters to set_ap() command separately
Jouni Malinen [Fri, 26 Aug 2011 18:11:42 +0000 (21:11 +0300)]
Add crypto parameters to set_ap() command separately

This helps drivers that build the Beacon and Probe Response frames
internally.

12 years agoSync with include/linux/nl80211.h in wireless-testing.git
Jouni Malinen [Fri, 26 Aug 2011 18:09:08 +0000 (21:09 +0300)]
Sync with include/linux/nl80211.h in wireless-testing.git

12 years agoWPS: Drop responses from ER to a STA that is not in WPS protocol
Jouni Malinen [Fri, 12 Aug 2011 08:58:32 +0000 (11:58 +0300)]
WPS: Drop responses from ER to a STA that is not in WPS protocol

If an ER tries to send a message to a STA that is not in the middle
of WPS protocol, do not try to deliver that. This can help with issues
where an ER takes long time to reply to M1 and another Registrar has
already completed negotiation.

12 years agoMake sure that EAP callbacks are not done if state machine has been removed
Jouni Malinen [Fri, 12 Aug 2011 08:56:44 +0000 (11:56 +0300)]
Make sure that EAP callbacks are not done if state machine has been removed

It is possible to get a response for a pending EAP callback after the
EAP state machine has already completed its work or has timed out. For
those cases, make sure that the callback function is not delivered since
it could result in NULL pointer dereferences.

12 years agoWPS: Fix M2/M2D Config Methods to include PushButton even if PBC not in use
Jouni Malinen [Thu, 11 Aug 2011 14:03:57 +0000 (17:03 +0300)]
WPS: Fix M2/M2D Config Methods to include PushButton even if PBC not in use

The Config Methods attribute in M2 and M2D messages is supposed to
indicate which configuration methods are supported by the Registrar. As
such, it should not depend on whether PBC mode is currently active or
not. That will only affect the Selected Registrar Config Methods and
Device Password ID attributes.

12 years agoWPS: Fix default virt/phy pushbutton config method setting
Jouni Malinen [Thu, 11 Aug 2011 13:51:40 +0000 (16:51 +0300)]
WPS: Fix default virt/phy pushbutton config method setting

Instead of always adding PHY PushButton config method, only add this
if neither virtual nor physical push button is advertised.

12 years agoAdd SSID as a separate item in AP mode Beacon setup
Jouni Malinen [Wed, 10 Aug 2011 10:29:32 +0000 (13:29 +0300)]
Add SSID as a separate item in AP mode Beacon setup

This makes it easier for drivers that need the SSID to get it from the
Beacon setup operation without having to parse the Beacon IEs.

12 years agoReplace set_beacon() driver op with set_ap()
Jouni Malinen [Wed, 10 Aug 2011 10:22:37 +0000 (13:22 +0300)]
Replace set_beacon() driver op with set_ap()

This change is a first step in better supporting different driver
architectures for AP mode operations with nl80211. This commit in
itself does not add new functionality, but it makes it easier to add
new AP mode parameters to address needs of drivers that have more of
the MLME/SME in firmware or kernel.

12 years agonl80211: Fix hostapd build
Jouni Malinen [Tue, 9 Aug 2011 20:32:26 +0000 (23:32 +0300)]
nl80211: Fix hostapd build

12 years agoAP: Reorder WPA/Beacon initialization
Jouni Malinen [Tue, 9 Aug 2011 11:56:16 +0000 (14:56 +0300)]
AP: Reorder WPA/Beacon initialization

Split WPA initialization into two parts so that the Beacon frames can be
configured fully before the initial keys (GTK/IGTK) are configured. This
makes it easier for drivers that depend on the AP security mode being
fully set before the keys are configured.

12 years agoWPS: Do not update Beacon IEs before initial IE set
Jouni Malinen [Tue, 9 Aug 2011 11:40:06 +0000 (14:40 +0300)]
WPS: Do not update Beacon IEs before initial IE set

This avoids a request to the driver to first start beaconing before
the WPA/RSN IE has been generated and then immediately changing the
beacon IEs once the WPA/RSN IE is ready.

12 years agonl80211: Add l2_packet for AP mode EAPOL TX without monitor iface
Jouni Malinen [Tue, 9 Aug 2011 11:04:53 +0000 (14:04 +0300)]
nl80211: Add l2_packet for AP mode EAPOL TX without monitor iface

This can be used with drivers that do not support monitor interface
when transmitting EAPOL frames in AP mode.

12 years agonl80211: Do not include NL80211_ATTR_DURATION in TX frame if zero
Jouni Malinen [Tue, 9 Aug 2011 11:01:31 +0000 (14:01 +0300)]
nl80211: Do not include NL80211_ATTR_DURATION in TX frame if zero

When offloading of the offchannel TX wait is not used, it is better to
not include NL80211_ATTR_DURATION to avoid confusing nl80211/cfg80211.

12 years agonl80211: Fix connect command to not claim WPA if WPS is used
Jouni Malinen [Tue, 9 Aug 2011 10:59:43 +0000 (13:59 +0300)]
nl80211: Fix connect command to not claim WPA if WPS is used

Such using params->wpa_ie to figure out whether the connection is for
WPA/WPA2 is not correct since that buffer is used also to add WPS IE. In
case of WPS, do not add NL80211_ATTR_WPA_VERSIONS to avoid confusing
drivers.

12 years agonl80211: Add more debug information on frame TX command failures
Jouni Malinen [Tue, 9 Aug 2011 10:59:12 +0000 (13:59 +0300)]
nl80211: Add more debug information on frame TX command failures

12 years agodbus: Do not segfault if P2P is disabled
Dan Williams [Fri, 29 Jul 2011 19:59:54 +0000 (14:59 -0500)]
dbus: Do not segfault if P2P is disabled

Various pieces of the P2P code assume that P2P is enabled, so make
the D-Bus code not call the P2P stuff if P2P is disabled. Also
ensures that if P2P is disabled a suitable error is returned to
the D-Bus caller.

Signed-off-by: Dan Williams <dcbw@redhat.com>
12 years agodbus: Remove separate access variable from properties
Jouni Malinen [Sun, 7 Aug 2011 08:16:05 +0000 (11:16 +0300)]
dbus: Remove separate access variable from properties

The read, write, read-write permissions can be figured out from
getter/setter function pointers, so there is no need for maintaining
that information separately.

12 years agowpa_supplicant AP: Enable uapsd in P2P GO mode if go_apsd was set
Eliad Peller [Sun, 31 Jul 2011 18:45:05 +0000 (21:45 +0300)]
wpa_supplicant AP: Enable uapsd in P2P GO mode if go_apsd was set

If uapsd is explicitly enabled, set conf->bss->wmm_enabled and
conf->bss->wmm_uapsd to enable (and advertise) uapsd.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
12 years agoDBus/P2P: Return Primary and Secondary device types as bytes
Jayant Sane [Sat, 6 Aug 2011 18:34:11 +0000 (21:34 +0300)]
DBus/P2P: Return Primary and Secondary device types as bytes

These properties are already correctly treated as bytes for the local
device, we need to do same for peers.

Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
12 years agorandom: Check fwrite return value to avoid warnings
Jouni Malinen [Sat, 6 Aug 2011 18:16:31 +0000 (21:16 +0300)]
random: Check fwrite return value to avoid warnings

Some compilers complain about fwrite calls if the return value is
not checked, so check the value even if it does not really make
much of a difference in this particular case.

12 years agoTLS: Reorder certificates if needed when reading them
Jouni Malinen [Thu, 4 Aug 2011 19:39:03 +0000 (22:39 +0300)]
TLS: Reorder certificates if needed when reading them

The internal TLS implementation assumes that the certificate chain
is ordered by issuer certificate following the certificate that it
signed. Add the certificates to the chain in suitable order when
loading multiple certificates.

12 years agoDispatch more WPS events through hostapd ctrl_iface
Anish Nataraj [Thu, 4 Aug 2011 13:56:41 +0000 (16:56 +0300)]
Dispatch more WPS events through hostapd ctrl_iface

12 years agoP2P: Fix 802.11b-only rate validation for Probe Request frames
Jouni Malinen [Tue, 2 Aug 2011 08:18:03 +0000 (11:18 +0300)]
P2P: Fix 802.11b-only rate validation for Probe Request frames

Commit e1d526293b27f5123777e695750a0d38bdfe936a added code for verifying
whether the receive Probe Request frame was indicating support for only
802.11b rates, but it missed the for loop for the extended supported
rates element. Add that to fix the validation code for cases where
non-802.11b rates are in the extended supported rates element.

12 years agoClarify hostapd error message on unsupported hw_mode value
Jouni Malinen [Sat, 30 Jul 2011 21:51:34 +0000 (00:51 +0300)]
Clarify hostapd error message on unsupported hw_mode value

12 years agoChange example hostapd.conf to use 2.4 GHz channel
Jouni Malinen [Sat, 30 Jul 2011 21:47:49 +0000 (00:47 +0300)]
Change example hostapd.conf to use 2.4 GHz channel

This is more likely to work if someone tests the example file with
no or minimal changes.

12 years agodbus: clean up new D-Bus interface getters and setters
Dan Williams [Fri, 29 Jul 2011 18:25:39 +0000 (21:25 +0300)]
dbus: clean up new D-Bus interface getters and setters

A number of fixes/improvements here:

1) Remove casting of getter/setter function types which allows
us to change the prototypes in the future and not have hard-to-find
runtime segfaults

2) Instead of having the getters create a fake reply message which
then gets its arguments copied into the real reply message, and is
then disposed, just pass message iters around and have them add
their arguments to the message itself

3) For setters, just pass in the message iter positioned at the
start of the argument list, instead of each setter having to skip
over the standard interface+property name

4) Convert error handling to use DBusError and return the error
back down through the call stacks to the function that will
actually send the error back to the caller, instead of having a
fake DBusMessage of type DBUS_MESSAGE_TYPE_ERROR that then
needs to have the error extracted from it.

But most of all, this fixes various segfaults (like rh #725517
and #678625) which were caused by some functions deep down in the
getter callpaths wanting a source DBusMessage* when the getters were
used for two things: signals (which don't have a source DBusMessage)
and methods (which will have a source DBusMessage that's being
replied to).  This duality made the code fragile when handling
errors like invalid IEs over the air.

Signed-off-by: Dan Williams <dcbw@redhat.com>
12 years agomadwifi: Implement set_freq for hostapd, adjust hostapd.conf
Pavel Roskin [Fri, 29 Jul 2011 17:49:45 +0000 (20:49 +0300)]
madwifi: Implement set_freq for hostapd, adjust hostapd.conf

Signed-off-by: Pavel Roskin <proski@gnu.org>
12 years agohostap: Remove unused variable in handle_frame()
Pavel Roskin [Fri, 29 Jul 2011 17:43:10 +0000 (20:43 +0300)]
hostap: Remove unused variable in handle_frame()

Signed-off-by: Pavel Roskin <proski@gnu.org>
12 years agohostap: Add channel selection support in hostapd
Pavel Roskin [Fri, 29 Jul 2011 17:39:32 +0000 (20:39 +0300)]
hostap: Add channel selection support in hostapd

Signed-off-by: Pavel Roskin <proski@gnu.org>
12 years agoIncrease maximum number of SSIDs per scan with ProbeReq to 10
Dmitry Shmidt [Tue, 19 Jul 2011 05:55:46 +0000 (08:55 +0300)]
Increase maximum number of SSIDs per scan with ProbeReq to 10

12 years agoFix hostapd_cli linking without CONFIG_WPA_TRACE=y
Vladimir [Tue, 19 Jul 2011 05:45:33 +0000 (08:45 +0300)]
Fix hostapd_cli linking without CONFIG_WPA_TRACE=y

12 years agoAdd CONFIG_IEEE80211N to wpa_supplicant defconfig
Jouni Malinen [Mon, 18 Jul 2011 18:34:25 +0000 (21:34 +0300)]
Add CONFIG_IEEE80211N to wpa_supplicant defconfig

This is needed for AP mode functionality with some drivers.

12 years agoP2P: Set p2p auth/assoc parameter based on connection type
Jouni Malinen [Sun, 17 Jul 2011 17:52:49 +0000 (20:52 +0300)]
P2P: Set p2p auth/assoc parameter based on connection type

Fix the previous code that was hardcoding the p2p parameter based
on the driver P2P capability regardless of whether the connection
was really used for P2P or not.

12 years agonl80211: Change vif type to P2P_CLI upon P2P authentication
Eliad Peller [Sun, 17 Jul 2011 17:25:58 +0000 (20:25 +0300)]
nl80211: Change vif type to P2P_CLI upon P2P authentication

Currently, wpa_driver_nl80211_authenticate() changes the interface type
to station. However, in case of P2P, we need to change the interface
type to P2P_CLI.

Add p2p field to the authentication params, and consider it for choosing
the correct interface type.

Signed-off-by: Eliad Peller <eliad@wizery.com>
12 years agonl80211: Consider P2P when changing vif type
Eliad Peller [Sun, 17 Jul 2011 17:22:11 +0000 (20:22 +0300)]
nl80211: Consider P2P when changing vif type

Commit 9f51b11395646efeb5d6a75d2cabc0bf7626496f added support for P2P
interfaces when adding a new interface. However, it didn't handle the
case in which the same interface is being used and its type is being
changed. Add support for this case.

Consequently, when doing "ap_scan_as_station" we now need to save the
actual AP interface type (AP/P2P GO) in order to restore it properly.
For that, change ap_scan_as_station type from int to nl80211_iftype, and
set it to NL80211_IFTYPE_UNSPECIFED when not used.

Signed-off-by: Eliad Peller <eliad@wizery.com>
12 years agonl80211: Do not re-set iftype when initializing added interface
Jouni Malinen [Sun, 17 Jul 2011 17:03:25 +0000 (20:03 +0300)]
nl80211: Do not re-set iftype when initializing added interface

There is no need to force the interface into station mode when
wpa_supplicant adds a new interface (e.g., P2P group) with the correct
iftype.

12 years agonl80211: Add more debug info for iftype changes
Jouni Malinen [Sun, 17 Jul 2011 16:47:41 +0000 (19:47 +0300)]
nl80211: Add more debug info for iftype changes

12 years agonl80211: Ignore ifdown event if mode change triggered it
Jouni Malinen [Sun, 17 Jul 2011 10:56:34 +0000 (13:56 +0300)]
nl80211: Ignore ifdown event if mode change triggered it

When driver_nl80211.c has to set the netdev down to change iftype, an
RTM_NEWLINK event is generated. Do not generate
EVENT_INTERFACE_DISABLED event based on that.

12 years agohostapd_cli: Start using src/utils/edit*.c
Jouni Malinen [Sat, 16 Jul 2011 14:37:18 +0000 (17:37 +0300)]
hostapd_cli: Start using src/utils/edit*.c

This brings hostapd_cli closer to the design used in wpa_cli
and allows command history and editing mechanisms to be added.

12 years agoDeauthenticate on reconfiguration
Jouni Malinen [Sat, 16 Jul 2011 13:57:11 +0000 (16:57 +0300)]
Deauthenticate on reconfiguration

This makes sure that the old connection is not maintained if the new
configuration does not allow it anymore. In addition, it is better to
use wpa_supplicant_clear_connection() instead of just clearing
wpa_s->current_ssid here to keep things in sync.

12 years agoDrop oldest unknown BSS table entries first
Jouni Malinen [Sat, 16 Jul 2011 10:22:58 +0000 (13:22 +0300)]
Drop oldest unknown BSS table entries first

When the BSS table size limit has been reached, drop first the oldest
BSS entries for which there is not a matching network in the
configuration based on SSID (wildcards are ignored). This makes it
less likely to hit connection issues in environments with huge number
of visible APs.

12 years agoFT: Share IE parser implementation for Authenticator and Supplicant
Jouni Malinen [Sat, 16 Jul 2011 08:13:39 +0000 (11:13 +0300)]
FT: Share IE parser implementation for Authenticator and Supplicant

These are almost identical, so there is no point in using separate
implementations.

12 years agoFT: Fix FT IE parser to not count TIE as protected IE
Jouni Malinen [Sat, 16 Jul 2011 08:05:28 +0000 (11:05 +0300)]
FT: Fix FT IE parser to not count TIE as protected IE

12 years agoFT: Fix the calculation of MIC Control field in FTIE
Hong Wu [Sat, 16 Jul 2011 07:57:17 +0000 (10:57 +0300)]
FT: Fix the calculation of MIC Control field in FTIE

Reassociation Request/Response frame validation need to count all IEs in
the RIC. In addition, TIE is not protected, so it should not be included
in the count.

Signed-off-by: Hong Wu <hong.wu@dspg.com>
12 years agoP2P: Do not reply to Probe Request frame indicating only 802.11b rates
Jouni Malinen [Fri, 15 Jul 2011 18:49:50 +0000 (21:49 +0300)]
P2P: Do not reply to Probe Request frame indicating only 802.11b rates

Per P2P specification 2.4.1, P2P Device shall shall not respond to
Probe Request frames that indicate support for only 802.11b rates.

12 years agoP2P: Check Device ID match in Probe Request frames in Listen state
Jouni Malinen [Fri, 15 Jul 2011 17:48:06 +0000 (20:48 +0300)]
P2P: Check Device ID match in Probe Request frames in Listen state

Do not reply to Probe Request frames that include a Device ID that
does not match with our own P2P Device Address.

12 years agoP2P: Filter Probe Request frames based on DA and BSSID in Listen state
Jouni Malinen [Fri, 15 Jul 2011 17:25:53 +0000 (20:25 +0300)]
P2P: Filter Probe Request frames based on DA and BSSID in Listen state

Only accept Probe Request frames that have a Wildcard BSSID and a
destination address that matches with our P2P Device Address or is the
broadcast address per P2P specification 3.1.2.1.1.

12 years agoCheck random_get_bytes() result before writing entropy file
Jouni Malinen [Fri, 15 Jul 2011 14:17:48 +0000 (17:17 +0300)]
Check random_get_bytes() result before writing entropy file

12 years agoP2P: Fix p2p_intra_bss with nl80211
Johannes Berg [Fri, 15 Jul 2011 14:13:44 +0000 (17:13 +0300)]
P2P: Fix p2p_intra_bss with nl80211

The current implementation of p2p_intra_bss doesn't work since the flag
isn't propagated into the corresponding hostapd config, so AP code will
never enable AP isolation and will in fact disable it again after it had
been enabled by the P2P code.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
12 years agoP2P: Remove unused SearchOnly parameter from D-Bus p2p_find
Jouni Malinen [Fri, 15 Jul 2011 13:59:05 +0000 (16:59 +0300)]
P2P: Remove unused SearchOnly parameter from D-Bus p2p_find

12 years agoP2P: Fix memory leak in D-Bus p2p_find handler
Jouni Malinen [Fri, 15 Jul 2011 13:33:21 +0000 (16:33 +0300)]
P2P: Fix memory leak in D-Bus p2p_find handler

12 years agoP2P: Coding style cleanup
Jouni Malinen [Fri, 15 Jul 2011 11:41:01 +0000 (14:41 +0300)]
P2P: Coding style cleanup

12 years agoP2P: Fix error path not to build error message twice
Jouni Malinen [Fri, 15 Jul 2011 11:40:04 +0000 (14:40 +0300)]
P2P: Fix error path not to build error message twice

12 years agoP2P: Clear entry.key to avoid use of uninitialized value on error path
Jouni Malinen [Fri, 15 Jul 2011 11:39:07 +0000 (14:39 +0300)]
P2P: Clear entry.key to avoid use of uninitialized value on error path

12 years agoWPS: Check malloc success on workaround path
Jouni Malinen [Fri, 15 Jul 2011 11:21:50 +0000 (14:21 +0300)]
WPS: Check malloc success on workaround path

ssid->ssid could be NULL here if malloc failed, so better check that
consistently.

12 years agoP2P: Use consistent checking of ssid != NULL
Jouni Malinen [Fri, 15 Jul 2011 11:20:31 +0000 (14:20 +0300)]
P2P: Use consistent checking of ssid != NULL

12 years agoP2P: Coding style cleanup for D-Bus handlers
Jouni Malinen [Fri, 15 Jul 2011 11:18:29 +0000 (14:18 +0300)]
P2P: Coding style cleanup for D-Bus handlers

12 years agoP2P: Fix D-Bus error path (potential NULL pointer deref)
Jouni Malinen [Fri, 15 Jul 2011 11:03:41 +0000 (14:03 +0300)]
P2P: Fix D-Bus error path (potential NULL pointer deref)

The paths pointer could have been NULL when going through the shared
freeing path in error case. Avoid the NULL pointer dereference by
checking whether that is the case. In addition, remove unnecessary
gotos to make the function more readable.

12 years agoP2P: Remove dead code from wpas_p2p_connect()
Jouni Malinen [Fri, 15 Jul 2011 10:57:31 +0000 (13:57 +0300)]
P2P: Remove dead code from wpas_p2p_connect()

The case of joining a running group is handled before this location
and the P2P client iftype is assigned at a callback function for that
case.