Commit graph

3039 commits

Author SHA1 Message Date
Jouni Malinen
4e22adb4d1 WPS: Move from WLAN_STA_MAYBE_WPS to WLAN_STA_WPS based on EAP messages
If the station does not include WSC IE in Association Request, it
is marked with WLAN_STA_MAYBE_WPS flag. We can update that to
WLAN_STA_WPS if the station uses either of the WPS identity strings.
This enables some workarounds for WPS stations.
2010-07-18 16:10:08 -07:00
Jouni Malinen
9301f6515e WPS: Reduce client timeout with EAP-WSC to avoid long wait
This works around issues with EAP-Failure getting lost for some reason.
Instead of waiting up to 60 seconds on a timeout, 30 second timeout is
now used and whenever the provisioning step has been completed (either
successfully or unsuccessfully), this timeout is reduced to 2 seconds.
2010-07-18 16:09:30 -07:00
Jouni Malinen
3239706303 WPS: Force disconnection after provisioning step
This works around some problems where the station is unable to disconnect
for some reason (e.g., if EAP-Failure gets dropped).
2010-07-18 16:08:52 -07:00
Jouni Malinen
9b7124b27f Add some more debug for driver events 2010-07-17 20:33:34 -07:00
Jouni Malinen
5bc0cdb721 Ignore scan results in wpa_supplicant AP mode
This is needed to avoid trying to reassociate based on new scan
results when using wpa_supplicant to control AP mode. This could
happen if something external triggered the driver to run a scan.
2010-07-17 20:32:25 -07:00
Jouni Malinen
979b988ed6 WPS: Do not allow Label and Display config methods to be enabled
It is unclear which PIN is used if both Label and Display config
methods are advertised. Avoid this by not allowing such configuration.
2010-07-17 20:30:49 -07:00
Jouni Malinen
4436274bef SME: Do not skip initial scan request
When SME is in wpa_supplicant (mac80211), we need to make sure that
the kernel code has valid BSS entry for the AP. In some cases it
seemed to be possible to end up not having current information in
cfg80211 or mac80211 which can result to association failures. Avoid
this by always running through the scan request before initial
connection attempt.
2010-07-17 20:28:22 -07:00
Jouni Malinen
6e3f7173f1 SME: Retry scan after authentication failure
This is needed to avoid getting stuck if driver fails authentication
request for some reason.
2010-07-17 20:27:19 -07:00
Jouni Malinen
3f967fe055 Verify that l2_packet is initialized before notification call
It is possible that l2_packet is not used with wpa_supplicant
in some cases, so better make sure we do not end up notifying
l2_packet code about authentications unless it was actually
initialized in the first place.
2010-07-17 20:26:47 -07:00
Jouni Malinen
69a6b47aa0 Fix wpa_supplicant AP mode to ignore EAPOL Supplicant port callback
This is needed to avoid setting EAPOL PAE port status incorrectly
when using wpa_supplicant to control AP mode operations.
2010-07-17 20:25:41 -07:00
Jouni Malinen
c01106f3e8 WPS: Add more debug info for DH keys 2010-07-17 20:23:55 -07:00
Jouni Malinen
a33c5f96b8 Fix a typo in Disassociation frame building
This did not really change any behavior since Deauthentication frame
uses the same format.
2010-07-17 20:23:20 -07:00
Jouni Malinen
b3b2da770e Define Public Action and Vendor-specific Public Action frames 2010-07-17 20:22:40 -07:00
Jouni Malinen
950388f745 IEEE 802.11u GAS defines 2010-07-17 20:21:39 -07:00
Jouni Malinen
4796272f5f nl80211: show TX status (ack) in debug log 2010-07-17 20:17:43 -07:00
Jouni Malinen
e9501a07c6 FT: Fix RRB messages to use correct endianness
The pairwise cipher field is supposed to be little endian, but the
message building functions did not swap the bytes on big endian
hosts while the message processing functions did. Fix this by using
little endian byte order in both places.
2010-07-17 17:48:32 -07:00
Jouni Malinen
79614ec55b bgscan learn: Remove forgotten debug printf 2010-07-10 19:59:31 -07:00
Jouni Malinen
3b7442e5fe bgscan learn: Mark BSSes that show up in the same scan as neighbors 2010-07-10 18:33:22 -07:00
Jouni Malinen
2e2a8d073d bgscan learn: Probe one new channel at a time to find APs
This allows APs to be found from channels that have not previously
been observed to contain APs for this ESS.
2010-07-10 18:09:41 -07:00
Jouni Malinen
fc480e88bf bgscan learn: Learn BSS information based on previous scans
Store list of all discovered BSSes in the ESS and on which frequencies
they have been seen. Use this information to dynamically generated the
list of channels for background scans.
2010-07-10 17:41:16 -07:00
Jouni Malinen
2e8d6ae32e bgscan learn: Add data file for storing learned network information 2010-07-10 16:05:31 -07:00
Jouni Malinen
c4d71c2505 bgscan: Add starting point for more advanced bgscan module: learn
This is based on the bgscan "simple" module and this initial commit
does not add any new functionality.
2010-07-10 15:55:48 -07:00
Jouni Malinen
c2594c3677 bgscan: Provide scan results to the notify_scan handler 2010-07-10 15:43:44 -07:00
Sam Leffler
3b038d7968 Fix bgscan stopping after dissassociation
Clear bgscan_ssid on disassoc event so bgscan is initialized the next
time we reach COMPLETED state.
2010-07-10 14:43:48 -07:00
Jouni Malinen
2f1ce78bf7 WPS: Add a workaround for OS X 10.6.3 and .4 (use PSK, not passphrase)
It looks like 10.6.3 and 10.6.4 do not like to receive Network Key
with WPA passphrase while PSK format still works. Use peer information
from M1 to figure out whether the Enrollee is likely to be OS X and
if so, force PSK format to be used for Network Key.
2010-07-05 15:37:47 -07:00
Jouni Malinen
612e9160e2 WPS: Add a workaround for parsing M1 from OS X 10.6
It looks like Mac OS X adds unexpected 0x00 padding to the end of M1.
Skip that padding to avoid interop issues.
2010-07-05 13:04:54 -07:00
Jouni Malinen
2d8bf73298 Add new debug message level for excessive information
Some frequent debug prints are of limited use and make debug output
difficult to read. Make them use a new debug level so that -dd
provides more readable output (-ddd can now be used to enable
the excessive debug prints).
2010-07-05 12:21:48 -07:00
Jouni Malinen
cc91e07e57 OpenSSL: Fix public key length in DH group 5 operations
The length of the prime was used incorrectly and this resulted
in WPS DH operation failing whenever the public key ended up having
leading zeros (i.e., about every 1/256th time).
2010-06-26 21:03:25 -07:00
Jouni Malinen
41e650ae5c WPS: Use different scan result sorting rules when doing WPS provisioning
The AP configuration may change after provisioning, so it is better
not to use the current security policy to prioritize results. Instead,
use WPS Selected Registrar attribute as the main sorting key and use
signal strength next without considering security policy or rate sets.
The non-WPS provisioning case remains as-is, i.e., this change applies
only when trying to find an AP for WPS provisioning.
2010-06-11 13:50:13 -07:00
Jouni Malinen
f62c2315f7 Show signal level and WPS support in scan results debug dump
This makes it easier to debug AP selection for WPS provisioning.
2010-06-11 13:47:33 -07:00
Jouni Malinen
9abe9b2c35 WPS: Add workaround for missing Network Key attribute
Some deployed implementations do not include the mandatory Network
Key attribute when a WPS Credential is for an open network. Allow
this to improve interoperability since the actual key value is not
really needed for open networks.
2010-06-11 11:29:10 -07:00
Jouni Malinen
d902a9c1bc Fix scan_runs counting
Addition of the background scanning mechanism in commit
60b94c9819 moved the scan trigger
into a new function that was also incrementing the scan_runs
counter, but the removal of the previous scan_runs incrementation
was forgotten from that patch. This counter should only be updated
into a single location, so remove the old one. This improves AP
selection for WPS provisioning by not skipping some of the initial
scans.
2010-06-11 11:15:16 -07:00
Jouni Malinen
9776475fb9 WPS: Do not proxy Probe Request frames to foreign SSIDs to Registrars
We must only indicate stations that are either probing the wildcard SSID
or our own SSID.
2010-06-10 22:36:34 -07:00
Jouni Malinen
a63063b4f6 rfkill: Use rtnetlink ifup/ifdown events
Replace use of rfkill block event with rtnetlink ifdown. This makes
the design more robust since the rfkill event could have been for
another interface while the rtnetlink events are already filtered
based of ifindex. In addition, the new design handles other than
rfkill-triggered ifdown/ifup events, too. rfkill unblocked event
is still needed to try to set the interface back up. If the unblock
was for another interface, ifup will fail and the driver state is
not changed.
2010-05-31 18:52:17 +03:00
Jouni Malinen
84b2f9909f Fix driver operation order in configuration reloading
Some of the driver wrappers need to get set_ieee8021x() call before
they can configure keys. Reorder the operations in the reloading
of configuration case to match with that expectation.
2010-05-29 22:27:27 +03:00
Jouni Malinen
7f5957abcf eloop: Fix crash on signal handler cancelling next timeout
It is possible that the timeout pointer becomes invalid in one of the
signal handlers, so we need to reload the pointer after those.
2010-05-28 22:18:28 +03:00
Jouni Malinen
8b0ea5a07e atheros: Fix WPA/802.1X disabling to clear Privacy flag
Setting IEEE80211_PARAM_AUTHMODE to IEEE80211_AUTH_AUTO ends up enabling
Privacy mode in the driver. We need to clear that to allow hostapd to be
reconfigured into open mode.
2010-05-28 21:51:31 +03:00
Jouni Malinen
7d6640a62c WPS ER: Add command for configuring an AP
wps_er_config can now be used to configure an AP. It is similar to
wps_er_learn, but instead of only learning the current AP settings,
it continues to send M8 with the new settings for the AP.
2010-05-28 00:01:48 +03:00
Jouni Malinen
3085b8052e WPS ER: Add initial documentation for External Registrar functionality 2010-05-27 15:25:18 +03:00
Jouni Malinen
15dbf1291a WPS ER: Add ctrl_iface event for learned AP settings 2010-05-27 15:24:45 +03:00
Jouni Malinen
0848668513 WPS ER: Allow AP filtering based on IP address
wps_er_start command now takes an optional parameter that can be used
to configure a filter to only allow UPnP SSDP messages from the
specified IP address. In practice, this limits the WPS ER operations
to a single AP and filters out all other devices in the network.
2010-05-27 15:23:55 +03:00
Jouni Malinen
826fe5fec3 WPS ER: Fix Credential to use correct Enrollee MAC Address
When starting the protocol run with an Enrollee, clone the AP Settings
and replace the AP MAC Address with the Enrollee MAC Address so that the
correct value is then used in the Credential attribute in M8.
2010-05-27 15:22:44 +03:00
Jouni Malinen
ed7a09f914 Add WPS IE into (Re)Association Response frame if WPS is used
If the associating station indicates that it is intents to use WPS
by including WPS IE in (Re)Association Request frame, include WPS IE
in (Re)Association Response frame.
2010-05-26 18:46:08 +03:00
Jouni Malinen
16e46ec043 Reassemble WPS IE(s) in (Re)Association Request if needed
Use a function that will take care of possible (though, very unlikely)
fragmentation of WPS TLVs in (Re)Association Request frames.
2010-05-26 18:17:13 +03:00
Jouni Malinen
99e437ad52 Fix WPS attribute parser to use correct pointer for Response Type 2010-05-26 17:12:30 +03:00
Jouni Malinen
32b752ef8f Internal TLS: Fix X.509 name handling to use sequency of attributes
There may be more than one attribute of same type (e.g., multiple DC
attributes), so the code needs to be able to handle that. Replace the
fixed structure with an array of attributes.
2010-05-25 20:55:29 +03:00
Jouni Malinen
969b403fa7 Internal TLS: Add domainComponent parser for X.509 names 2010-05-25 19:43:21 +03:00
Jouni Malinen
5216938960 Fix memory leak on rfkill init error path 2010-05-25 12:06:25 +03:00
Jouni Malinen
8c0ef18199 Fix a typo in unused attribute name 2010-05-25 09:57:22 +03:00
Jouni Malinen
7cc5995845 Skip D-Bus signals if the dbus_path is not yet set
This avoids an invalid D-Bus call during interface initialization.
The wpa_state change can happen before the D-Bus interface is set up,
so we must be preparted to handle this early event signal. In theory,
it should be possible to reorder initialization code to make sure
D-Bus signals are ready, but that would likely require quite a bit of
code restructuring, so it looks like a safer option for now is to just
skip the early event.
2010-05-23 20:23:11 +03:00