libeap.git
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

13 years agoEAP server: Allow reauth to be started with passthrough
Jouni Malinen [Sat, 9 Oct 2010 05:53:45 +0000 (08:53 +0300)]
EAP server: Allow reauth to be started with passthrough

Some sequencies of EAPOL logoff/logon/start messages seem to be
able to get the previous implementation into state where hostapd
would not be able to start reauthentication when external
authentication server is used. The EAP server code would bypass
the initial Identity Request generation and EAPOL code would not
be able to send anything to the authentication server or supplicant
at that point. Work around this by forcing EAP server code to
start with Identity Request after INITIALIZE state even if the
Identity is known.

13 years agoP2P: Extend P2P manager functionality to work with driver MLME
Jouni Malinen [Fri, 8 Oct 2010 15:16:07 +0000 (18:16 +0300)]
P2P: Extend P2P manager functionality to work with driver MLME

Add P2P IE into Beacon, Probe Response, and (Re)Association Request
frames for drivers that generate this frames internally.

13 years agoP2P: Fix a typo in P2P manager definition
Jouni Malinen [Fri, 8 Oct 2010 15:15:38 +0000 (18:15 +0300)]
P2P: Fix a typo in P2P manager definition

13 years agoFix hostapd_cli get_config not to show key when WPA is disabled
Jouni Malinen [Fri, 8 Oct 2010 14:36:52 +0000 (17:36 +0300)]
Fix hostapd_cli get_config not to show key when WPA is disabled

Previously, incorrectly configured passphrase or group cipher type
could be shown even if WPA was disabled.

13 years agoApply WPS configuration changes to all interfaces that use WPS
Jouni Malinen [Fri, 8 Oct 2010 14:32:10 +0000 (17:32 +0300)]
Apply WPS configuration changes to all interfaces that use WPS

When a single hostapd process is controlling multiple interfaces,
apply the received or auto-generated configuration changes to all
interfaces that have enabled WPS.

13 years agoDisable AP PIN on all interfaces controlled by the same process
Jouni Malinen [Fri, 8 Oct 2010 14:24:58 +0000 (17:24 +0300)]
Disable AP PIN on all interfaces controlled by the same process

When a single hostapd process is used to manage multiple interfaces,
disable AP PIN on all interfaces if an attack is detected on any
interface.

13 years agoApply hostapd WPS commands to all interfaces on concurrent APs
Jouni Malinen [Fri, 8 Oct 2010 14:15:16 +0000 (17:15 +0300)]
Apply hostapd WPS commands to all interfaces on concurrent APs

When the same hostapd process is controlling multiple interfaces,
apply WPS commands (push button, add PIN, change AP PIN) to all
interfaces that are configured to use WPS.

13 years agoFix .gitignore files to not ignore subdirectory matches
Jouni Malinen [Thu, 7 Oct 2010 08:04:16 +0000 (11:04 +0300)]
Fix .gitignore files to not ignore subdirectory matches

The previous used .gitignore files were mathing some files that
were actually already in the repository (e.g.,
hostapd/logwatch/hostapd). Avoid this by listing the conflicting
entries in the root directory .gitignore with full path.

13 years agoAllow a postfix to be defined for the version number
Jouni Malinen [Thu, 7 Oct 2010 07:51:04 +0000 (10:51 +0300)]
Allow a postfix to be defined for the version number

A separate build number (etc.) version number postfix can now be
added to the build without having to modify source code files by
defining VERSION_STR_POSTFIX. This can be done, e.g., by adding
following line to .config:

CFLAGS += -DVERSION_STR_POSTFIX=\"-foo\"

13 years agoFix wpa_supplicant build without CONFIG_WPS and CONFIG_AP
Ben Greear [Thu, 7 Oct 2010 07:41:58 +0000 (10:41 +0300)]
Fix wpa_supplicant build without CONFIG_WPS and CONFIG_AP

13 years agoFix AP mode in wpa_supplicant with interface events
Johannes Berg [Wed, 6 Oct 2010 14:10:07 +0000 (17:10 +0300)]
Fix AP mode in wpa_supplicant with interface events

Needs to not trigger a scan here when the AP mode setup sets
interface down/up.

13 years agoFix wpa_supplicant AP mode with WPS not to crash
Jouni Malinen [Wed, 6 Oct 2010 13:46:43 +0000 (16:46 +0300)]
Fix wpa_supplicant AP mode with WPS not to crash

Commit 3379a3a795803335b3f464f34a15f06843369fb1 added a direct
iface->for_each_interface use without verification whether the
function is available. This works with hostapd, but not
wpa_supplicant (which crashes on segfault).

13 years agoFix build with CONFIG_WPS_OOB
Jouni Malinen [Wed, 6 Oct 2010 13:40:20 +0000 (16:40 +0300)]
Fix build with CONFIG_WPS_OOB

13 years agoFix AP mode 40 MHz pri/sec channel parsing in overlap determination
Jouni Malinen [Wed, 6 Oct 2010 11:09:44 +0000 (14:09 +0300)]
Fix AP mode 40 MHz pri/sec channel parsing in overlap determination

The previous implementation ended up incorrectly assuming that all
40 MHz use cases have secondary channel above the primary one. Fix this
by properly masking the secondary channel offset field and checking its
value.

13 years agoPreparations for 0.7.3 release
Jouni Malinen [Tue, 7 Sep 2010 16:48:50 +0000 (19:48 +0300)]
Preparations for 0.7.3 release

13 years agowext: Fix scan result signal levels when driver reports in dBm
David A Benjamin [Sun, 5 Sep 2010 16:04:10 +0000 (19:04 +0300)]
wext: Fix scan result signal levels when driver reports in dBm

wpa_supplicant showed signal levels incorrectly with some drivers:
Jun  6 16:29:36 rupert wpa_supplicant[18945]: Current BSS: 00:0d:97:11:40:d6
level=190
Jun  6 16:29:36 rupert wpa_supplicant[18945]: Selected BSS: 00:0d:97:11:50:09
level=192

Judging from output from other tools (iwlist) and the min_diff block
at the end of wpa_supplicant_need_to_roam, it seems these values
should actually be negative. Specifically, if one treats that number
as a signed char instead of unsigned, everything matches up.

To be honest, I've little to no understanding of wireless, but looking
at the source code for wireless-tools (iw_print_stats in iwlib.c), it
seems that the fields of the iw_quality struct need to be decoded
differently depending on various flags. I guess
src/drivers/driver_wext.c should have similar logic in
wext_get_scan_qual.

I wrote a patch that attempts to replicate some of that logic,
although it may be more complicated than is necessary; I think some of
the complexity is for backwards-compatibility, which might not be
necessary depending on wpa_supplicant's dependencies? In any case, it
is attached. Again, I don't know how any of this works, so it's likely
the patch is a bit off. But I think at least the logic to determine
min_diff in wpa_supplicant_need_to_roam would be more accurate if
level were determined correctly.

13 years agonl80211: Include linux/rtnetlink.h explicitly
Jouni Malinen [Thu, 30 Sep 2010 04:52:51 +0000 (21:52 -0700)]
nl80211: Include linux/rtnetlink.h explicitly

This is needed with libnl-tiny to get various definitions that
get included implicitly with libnl.

13 years agonl80211: Sync the header file with wireless-testing.git
Jouni Malinen [Thu, 30 Sep 2010 04:39:40 +0000 (21:39 -0700)]
nl80211: Sync the header file with wireless-testing.git

13 years agoatheros: Prefer WSC IE in (Re)Association Request frame
Jouni Malinen [Sat, 25 Sep 2010 00:01:03 +0000 (17:01 -0700)]
atheros: Prefer WSC IE in (Re)Association Request frame

This is needed to work properly with WPS stations that may include
both WPA/RSN IE and WSC IE when associating for WPS provisioning.

13 years agoWPS ER: Add more debug info on initialization errors
Jouni Malinen [Fri, 24 Sep 2010 23:05:58 +0000 (16:05 -0700)]
WPS ER: Add more debug info on initialization errors

13 years agoMark ctrl_iface RX debug for PING commands excessive
Jouni Malinen [Fri, 24 Sep 2010 22:50:13 +0000 (15:50 -0700)]
Mark ctrl_iface RX debug for PING commands excessive

This cleans up debug log from unnecessary entries when using
wpa_cli/hostapd_cli or other ctrl_iface monitors that PING
periodically to check connectivity.

13 years agoWPS: Documented wps_er_pin MAC address option
Jouni Malinen [Fri, 24 Sep 2010 22:44:26 +0000 (15:44 -0700)]
WPS: Documented wps_er_pin MAC address option

13 years agoWPS 2.0: Disable WPS if ignore_broadcast_ssid or WEP is used
Jouni Malinen [Fri, 24 Sep 2010 22:17:03 +0000 (15:17 -0700)]
WPS 2.0: Disable WPS if ignore_broadcast_ssid or WEP is used

These combinations are disallowed in WPS 2.0 (and do not work well
(or at all) with many deployed WPS 1.0 devices either).

13 years agoWPS ER: Make sure PIN timeout does not interrupt PBC operation
Jouni Malinen [Thu, 23 Sep 2010 21:45:55 +0000 (14:45 -0700)]
WPS ER: Make sure PIN timeout does not interrupt PBC operation

We need to clear the selected registrar timeout from wps_er_learn
when stopping the protocol run at M7 (previously, this was done only
when WSC_Done was being processed). In addition, we need to cancel
the timeout when a new PBC operation is started.

13 years agoWPS: Add hostapd_cli get_config command
Jouni Malinen [Thu, 23 Sep 2010 19:02:28 +0000 (12:02 -0700)]
WPS: Add hostapd_cli get_config command

This can be used by a WPS UI to display the current AP configuration.

13 years agoWPS: Add wps_check_pin command for processing PIN from user input
Jouni Malinen [Thu, 23 Sep 2010 17:30:52 +0000 (10:30 -0700)]
WPS: Add wps_check_pin command for processing PIN from user input

UIs can use this command to process a PIN entered by a user and to
validate the checksum digit (if present).

13 years agoWPS: Fix hostapd reconfig to update WPS UPnP string pointers
Jouni Malinen [Thu, 23 Sep 2010 02:34:32 +0000 (19:34 -0700)]
WPS: Fix hostapd reconfig to update WPS UPnP string pointers

This is needed to update the pointers maintained within WPS code
to use the new configuration data instead of maintaining pointers
to the old configuration which will be freed. This fixes strings in
UPnP discovery after reconfig (they used to be random freed memory..).

13 years agoWPS: Add more debug details for Credential building
Jouni Malinen [Thu, 23 Sep 2010 02:20:01 +0000 (19:20 -0700)]
WPS: Add more debug details for Credential building

13 years agoWPS ER: Fix debug message for protocol run done case
Jouni Malinen [Thu, 23 Sep 2010 02:19:33 +0000 (19:19 -0700)]
WPS ER: Fix debug message for protocol run done case

This is not a failure and should not be indicated as such in the
debug log.

13 years agoWPS: Fix strict validation of encrypted data for WSC 2.0-only case
Jouni Malinen [Thu, 23 Sep 2010 02:17:13 +0000 (19:17 -0700)]
WPS: Fix strict validation of encrypted data for WSC 2.0-only case

Need to figure out whether the message is from a WSC 2.0 -based
device based on the unencrypted attributes, not the contents of the
encrypted data since the Version2 subelement is only included in the
unencrypted area.

13 years agohostapd: Add virt/phy flag for Display/PushButton if needed (WPS 2.0)
Jouni Malinen [Thu, 23 Sep 2010 00:45:43 +0000 (17:45 -0700)]
hostapd: Add virt/phy flag for Display/PushButton if needed (WPS 2.0)

This seems to be the easiest way of making sure the Config Methods
value is compliant with the WSC 2.0 specification without having
to modify the configuration file. However, this will only add the
virtual flag, so the configuration files should really be updated
to specify values that match the AP design.

13 years agoWPS: Use blacklist more aggressively during WPS provisioning
Jouni Malinen [Wed, 22 Sep 2010 18:50:15 +0000 (11:50 -0700)]
WPS: Use blacklist more aggressively during WPS provisioning

This allows more APs to be tried during the WPS timeout.

13 years agoWPS: Making some parsing messages use excessive debug level
Jouni Malinen [Wed, 22 Sep 2010 18:39:58 +0000 (11:39 -0700)]
WPS: Making some parsing messages use excessive debug level

This makes it easier to read -dd debug logs in environments that
have multiple WPS or P2P devices.

13 years agoWPS: Fix strict validation of (Re)Association Response
Jouni Malinen [Wed, 22 Sep 2010 18:13:18 +0000 (11:13 -0700)]
WPS: Fix strict validation of (Re)Association Response

This frame is supposed to include Response Type, not Request Type
attribute.

13 years agoWPS 2.0: Provide (Re)Association Response WPS IE to driver
Jouni Malinen [Wed, 22 Sep 2010 17:46:44 +0000 (10:46 -0700)]
WPS 2.0: Provide (Re)Association Response WPS IE to driver

WPS 2.0 mandates the AP to include WPS IE in (Re)Association Response
if the matching (Re)Association Request included WPS IE. Provide the
needed WPS IE information to the driver_ops API for drivers that
process association frames internally.

Note: This modifies the driver_ops API by adding a new argument to
set_ap_wps_ie().

13 years agoWPS: Add MAC address to validation error message for Probe Request
Jouni Malinen [Wed, 22 Sep 2010 17:07:20 +0000 (10:07 -0700)]
WPS: Add MAC address to validation error message for Probe Request

This makes it easier to figure out which device is sending invalid
Probe Request frames.

13 years agoWPS: Make testing operations configurable at runtime
Jouni Malinen [Wed, 22 Sep 2010 02:51:23 +0000 (19:51 -0700)]
WPS: Make testing operations configurable at runtime

Instead of build time options (CONFIG_WPS_TESTING_EXTRA_CRED and
CONFIG_WPS_EXTENSIBILITY_TESTING), use a single build option
(CONFIG_WPS_TESTING) and runtime configuration of which testing
operations are enabled. This allows a single binary to be used
for various tests.

The runtime configuration can be done through control interface
with wpa_cli/hostapd_cli commands:
Enable extensibility tests:
set wps_version_number 0x57
Disable extensibility tests (WPS2 build):
set wps_version_number 0x20
Enable extra credential tests:
set wps_testing_dummy_cred 1
Disable extra credential tests:
set wps_testing_dummy_cred 0

13 years agoWPS 2.0: Fix AuthorizedMACs check to accept wildcard address
Jouni Malinen [Wed, 22 Sep 2010 02:36:44 +0000 (19:36 -0700)]
WPS 2.0: Fix AuthorizedMACs check to accept wildcard address

We need to accept both our own address and the ff:ff:ff:ff:ff:ff
as an indication of the AP having authorized us.

13 years agoP2P: Fill in default Config Methods in Invitation Request
Jouni Malinen [Wed, 22 Sep 2010 01:26:01 +0000 (18:26 -0700)]
P2P: Fill in default Config Methods in Invitation Request

If the peer is not authorized for GO Negotiation, wps_method is not
actually set. In that case, it is better to fill in our default
config methods rather than end up leaving the field to be zero.

13 years agoWPS: Fix Beacon WPS IE on concurrent dualband AP in PBC mode
Jouni Malinen [Mon, 20 Sep 2010 22:32:29 +0000 (15:32 -0700)]
WPS: Fix Beacon WPS IE on concurrent dualband AP in PBC mode

The Beacon frame must include UUID-E and RF Bands attributes when
in active PBC mode to allow stations to figure out that two BSSes in
PBC mode is not a PBC session overlap.

13 years agoWPS: Add more verbose debug info on PBC session overlap detection
Jouni Malinen [Mon, 20 Sep 2010 22:08:52 +0000 (15:08 -0700)]
WPS: Add more verbose debug info on PBC session overlap detection

13 years agoWPS: Add BSSID to strict validation error messages
Jouni Malinen [Mon, 20 Sep 2010 21:54:22 +0000 (14:54 -0700)]
WPS: Add BSSID to strict validation error messages

This makes it easier to figure out which AP is sending invalid
Beacon or Probe Response frames.

13 years agoWPS: Use same UUID in multi-interface case
Jouni Malinen [Mon, 20 Sep 2010 21:28:43 +0000 (14:28 -0700)]
WPS: Use same UUID in multi-interface case

When generating the UUID based on MAC address, share the same UUID
with all interfaces. This fixes a potential issue with concurrent
dualband APs where the UUID needs to be same for PBC to work properly.

13 years agoWPS: Fix CONFIG_WPS_OOB build
Jouni Malinen [Mon, 20 Sep 2010 00:18:43 +0000 (17:18 -0700)]
WPS: Fix CONFIG_WPS_OOB build

The Version2 attribute was previous changed to a subelement and
the OOB code was missed during the change.

13 years agoWPS: Cancel WPS operation on PBC session overlap detection
Jouni Malinen [Mon, 20 Sep 2010 00:04:04 +0000 (17:04 -0700)]
WPS: Cancel WPS operation on PBC session overlap detection

Previously, wpa_supplicant remaining in scanning state without
trying to connect, but there is no particular need to do that.
Instead, cancel WPS operation completely whenever PBC session
overlap is detected.

13 years agoEAP-pwd: Fix couple of memory leaks
Jouni Malinen [Wed, 15 Sep 2010 08:16:17 +0000 (22:16 -1000)]
EAP-pwd: Fix couple of memory leaks

13 years agoEAP-pwd: Move bnctx into per-protocol instance structure
Jouni Malinen [Wed, 15 Sep 2010 08:04:09 +0000 (22:04 -1000)]
EAP-pwd: Move bnctx into per-protocol instance structure

This avoids double frees of bnctx and related crashes.

13 years agoEAP-pwd: Add support for EAP-pwd server and peer functionality
Dan Harkins [Wed, 15 Sep 2010 07:51:40 +0000 (21:51 -1000)]
EAP-pwd: Add support for EAP-pwd server and peer functionality

This adds an initial EAP-pwd (RFC 5931) implementation. For now,
this requires OpenSSL.

13 years agoAllow auto-connect to request scan in associating state
Jouni Malinen [Tue, 14 Sep 2010 07:07:54 +0000 (00:07 -0700)]
Allow auto-connect to request scan in associating state

Disconnection event may be received while in associating state.
Previously, wpa_supplicant could get stuck not trying to reconnect
in that case at least with nl80211. Allow scan request in this
state to avoid the issue. This helps especially with APs that do
load balancing by sending Deauthentication frame as a response to
Reassociation Request frame after successful Authentication frame
exchange.

13 years agoP2P: Add option for disabling intra BSS distribution
Sudhakar Swaminathan [Wed, 8 Sep 2010 18:18:10 +0000 (21:18 +0300)]
P2P: Add option for disabling intra BSS distribution

p2p_intra_bss configuration parameter can now be used to
disable/enable intra BSS distribution (bridging of frames between
the clients in a group).

13 years agoAdd option for disabling automatic reconnection on disconnection
Ardong Chen [Mon, 6 Sep 2010 14:28:45 +0000 (17:28 +0300)]
Add option for disabling automatic reconnection on disconnection

ctrl_interface STA_AUTOCONNECT command can now be used to disable
automatic reconnection on receiving disconnection event. The default
behavior is for wpa_supplicant to try to reconnect automatically, i.e.,
to maintain previous behavior.

13 years agoP2P: Fix invitation_received callback to use NULL bssid (if not known)
Ardong Chen [Tue, 7 Sep 2010 14:35:42 +0000 (17:35 +0300)]
P2P: Fix invitation_received callback to use NULL bssid (if not known)

Previously, the storage buffer for the Group BSSID was returned
regardless of whether it was included in the invitation or not.

13 years agoP2P: Do not process configuration changes on non-P2P interfaces
Kuko Li [Tue, 7 Sep 2010 14:08:52 +0000 (17:08 +0300)]
P2P: Do not process configuration changes on non-P2P interfaces

13 years agoP2P: Make sure parsed Device Name gets null terminated
Jouni Malinen [Tue, 7 Sep 2010 14:07:57 +0000 (17:07 +0300)]
P2P: Make sure parsed Device Name gets null terminated

If the msg->device_name buffer is filled from two different sources,
the copy from the P2P Device Info attribute needs to make sure that
the values gets null terminated to match the length of the correct
string should the other place use another string (which is not really
allowed by the spec, but could happen).

13 years agoP2P: Stop connection attempt on PBC session overlap
Jouni Malinen [Tue, 7 Sep 2010 10:42:55 +0000 (13:42 +0300)]
P2P: Stop connection attempt on PBC session overlap

The overlap condition cannot disappear before group formation timeout
hits, so there is no point in continuing in this case and failure can
be indicated immediately.

13 years agoP2P: Use group formation timeout (but longer one) with join-a-group
Jouni Malinen [Tue, 7 Sep 2010 10:21:33 +0000 (13:21 +0300)]
P2P: Use group formation timeout (but longer one) with join-a-group

This allows the pending group interface to be removed if we fail
to join a running group. A longer than 15 second timeout is needed
here since the GO may not have authorized our connection yet.

13 years agoP2P: Add peer timeout into group formation 15 second timeout
Jouni Malinen [Mon, 6 Sep 2010 18:04:01 +0000 (21:04 +0300)]
P2P: Add peer timeout into group formation 15 second timeout

This adds some more time for WPS provisioning step in case the peer
takes long time to start group interface operations.

13 years agoWPS: Allow pending WPS operation to be cancelled
Ardong Chen [Mon, 6 Sep 2010 17:51:06 +0000 (20:51 +0300)]
WPS: Allow pending WPS operation to be cancelled

A new ctrl_interface command, WPS_CANCEL, can now be used to cancel
a pending or ongoing WPS operation. For now, this is only available
with wpa_supplicant (either in station or AP mode). Similar
functionality should be added for hostapd, too.

13 years agoP2P: Provide local event on GO Neg Req rejection
Jouni Malinen [Mon, 6 Sep 2010 16:00:43 +0000 (19:00 +0300)]
P2P: Provide local event on GO Neg Req rejection

If an authorized (p2p_connect used locally) GO Negotiation is
rejected when receiving GO Negotiation Request from the peer,
indicate the failure with a ctrl_interface P2P-GO-NEG-FAILURE
event. Previously, this event was only shown on the peer (i.e.,
the device receiving the GO Negotiation Response with non-zero
Status code).

13 years agoWPS: Fix timeout event to be sent over ctrl_interface
Ardong Chen [Mon, 6 Sep 2010 15:13:18 +0000 (18:13 +0300)]
WPS: Fix timeout event to be sent over ctrl_interface

This was supposed to be sent to external event monitors, i.e., to
use wpa_msg instead of wpa_printf.

13 years agoP2P: Process Invitation Request from previously unknown peer
Ardong Chen [Mon, 6 Sep 2010 15:10:55 +0000 (18:10 +0300)]
P2P: Process Invitation Request from previously unknown peer

Since this message now includes P2P Device Info attribute, it is
reasonable to learn the peer data and process the message instead of
rejecting the message.

13 years agoAllow bssid parameter to be cleared through ctrl_interface
Wei-Jen Lin [Mon, 6 Sep 2010 15:00:04 +0000 (18:00 +0300)]
Allow bssid parameter to be cleared through ctrl_interface

Setting bssid to an empty string, "", or any can now be used to
clear the bssid_set flag in a network block, i.e., to remove bssid
filtering.

13 years agowpa_cli action: Add WPS_EVENT_SUCCESS and WPS_EVENT_FAIL handlers
Ardong Chen [Mon, 6 Sep 2010 14:16:25 +0000 (17:16 +0300)]
wpa_cli action: Add WPS_EVENT_SUCCESS and WPS_EVENT_FAIL handlers

13 years agoP2P: Add frequency into group started ctrl_interface events
Ardong Chen [Mon, 6 Sep 2010 13:57:19 +0000 (16:57 +0300)]
P2P: Add frequency into group started ctrl_interface events

13 years agoP2P: Add peer entry based on Provision Discovery Request
Ardong Chen [Mon, 6 Sep 2010 13:51:46 +0000 (16:51 +0300)]
P2P: Add peer entry based on Provision Discovery Request

Add (or complete Probe Request only) P2P peer entry when receiving
Provision Discovery Request from a previously unknown peer. This is
especially of use for a GO when a P2P client is requesting to join
a running group.

13 years agoFix build without CONFIG_P2P=y
Jouni Malinen [Thu, 9 Sep 2010 14:20:28 +0000 (07:20 -0700)]
Fix build without CONFIG_P2P=y

13 years agoP2P: Use SSID from GO Negotiation to limit WPS provisioning step
Jouni Malinen [Thu, 5 Aug 2010 16:15:11 +0000 (09:15 -0700)]
P2P: Use SSID from GO Negotiation to limit WPS provisioning step

In order to avoid picking incorrect SSID from old scan results, use
SSID from GO Negotiation to select the AP.

13 years agoP2P: Deinit GO group data before global P2P deinit
Jouni Malinen [Thu, 5 Aug 2010 02:13:00 +0000 (19:13 -0700)]
P2P: Deinit GO group data before global P2P deinit

This avoids issues with using freed memory in p2p_group_deinit().

13 years agoP2P: Use operating frequency from peer table as backup for join
Jouni Malinen [Wed, 4 Aug 2010 23:00:21 +0000 (16:00 -0700)]
P2P: Use operating frequency from peer table as backup for join

The scan operation before Provision Discovery Request may not include
the GO. However, we are likely to have the GO in our P2P peer table,
so use that information to figure out the operating channel if BSS
table entry is not available.

13 years agoP2P: Fix connect-to-running-group if Action TX status is delayed
Jouni Malinen [Wed, 4 Aug 2010 21:34:56 +0000 (14:34 -0700)]
P2P: Fix connect-to-running-group if Action TX status is delayed

The following operations (scan and associate) were not run if the
Provisioning Discovery Response is received before the TX Action
status.

13 years agoP2P: Add a workaround for Extended Listen Timing getting stuck
Jouni Malinen [Wed, 4 Aug 2010 16:02:27 +0000 (09:02 -0700)]
P2P: Add a workaround for Extended Listen Timing getting stuck

This should not really happen, but it looks like the Listen command
may fail is something else (e.g., a scan) was running at an
inconvenient time. As a workaround, allow new Extended Listen
operation to be started if this state is detected.

13 years agoP2P: Add some more debug information for Action frame TX
Jouni Malinen [Tue, 3 Aug 2010 03:53:56 +0000 (20:53 -0700)]
P2P: Add some more debug information for Action frame TX

13 years agoP2P: Clear pending Action TX frame on p2p_stop_find and p2p_listen
Jouni Malinen [Tue, 3 Aug 2010 03:40:54 +0000 (20:40 -0700)]
P2P: Clear pending Action TX frame on p2p_stop_find and p2p_listen

This is needed to avoid issues with the previous TX command from
stopping long Listen state.

13 years agoP2P: Fix cross connection allowed parser to use correct field
Jouni Malinen [Mon, 2 Aug 2010 23:02:18 +0000 (16:02 -0700)]
P2P: Fix cross connection allowed parser to use correct field

The previous version had a bug that could result in NULL pointer
dereference if the P2P IE included Manageability attribute, but no
Capability attribute.

13 years agoP2P: Allow P2P IE without Device Info in (Re)Assoc Req
Jouni Malinen [Sun, 1 Aug 2010 23:47:38 +0000 (16:47 -0700)]
P2P: Allow P2P IE without Device Info in (Re)Assoc Req

This can happen, e.g., when a P2P client connects to a P2P group
using the infrastructure WLAN interface instead of P2P group
interface. In that case, the P2P client may behave as if the GO
would be a P2P Manager WLAN AP.

13 years agoAdd test command for disabling/enabling A-MPDU aggregation
Jouni Malinen [Sun, 1 Aug 2010 23:19:31 +0000 (16:19 -0700)]
Add test command for disabling/enabling A-MPDU aggregation

ctrl_iface command "SET ampdu <0/1>" can now be used to
disable/enable A-MPDU aggregation.

13 years agoP2P: For now, do not use channels 12-14 in P2P groups
Jouni Malinen [Fri, 30 Jul 2010 23:33:40 +0000 (16:33 -0700)]
P2P: For now, do not use channels 12-14 in P2P groups

This is needed to make sure we do not try to accidentally enable GO
in channels that may not be allowed. In addition, this may help with
some driver that do not like channel 14 even as a passive scan
channel.

13 years agoP2P: Add an example p2p-action script for udhcpc/udhcpd
Jouni Malinen [Fri, 30 Jul 2010 01:35:26 +0000 (18:35 -0700)]
P2P: Add an example p2p-action script for udhcpc/udhcpd

13 years agoCopy WPS strings into AP configuration when using wpa_supplicant AP
Jouni Malinen [Fri, 30 Jul 2010 00:25:54 +0000 (17:25 -0700)]
Copy WPS strings into AP configuration when using wpa_supplicant AP

13 years agoTrigger WPS configuration update on string changes
Jouni Malinen [Fri, 30 Jul 2010 00:13:11 +0000 (17:13 -0700)]
Trigger WPS configuration update on string changes

Previously, only Device Name string was handled, but similar trigger
is needed on Manufacturer, Model Name, Model Number, and Serial Number
changes.

13 years agoP2P: Avoid segfault on AP deinit after failed AP start
Jouni Malinen [Thu, 29 Jul 2010 23:41:14 +0000 (16:41 -0700)]
P2P: Avoid segfault on AP deinit after failed AP start

13 years agoP2P: Fix code order to avoid potential NULL pointer dereference
Jouni Malinen [Thu, 29 Jul 2010 23:20:02 +0000 (16:20 -0700)]
P2P: Fix code order to avoid potential NULL pointer dereference

13 years agoP2P: Fix P2P IE generation for AssocReq when BSS info is not available
Jouni Malinen [Thu, 29 Jul 2010 23:09:38 +0000 (16:09 -0700)]
P2P: Fix P2P IE generation for AssocReq when BSS info is not available

This code could segfault on NULL pointer dereference at least when
ap_scan=2 is used.

13 years agoP2P: Allow driver wrapper to indicate how many stations are supported
Jouni Malinen [Thu, 29 Jul 2010 22:32:33 +0000 (15:32 -0700)]
P2P: Allow driver wrapper to indicate how many stations are supported

This can be used to limit the number of clients allowed to connect
to the group on the GO.

13 years agoFix AP mode wps_pin command to return the entered PIN
Jouni Malinen [Thu, 29 Jul 2010 00:56:37 +0000 (17:56 -0700)]
Fix AP mode wps_pin command to return the entered PIN

This command is supposed to return the PIN value that was generated
or passed in as an argument. In the AP case, the entered PIN was not
being returned.

13 years agoP2P: Add mechanism for configuring UAPSD parameters for group
Jouni Malinen [Wed, 28 Jul 2010 17:18:52 +0000 (10:18 -0700)]
P2P: Add mechanism for configuring UAPSD parameters for group

This is needed to be able to change parameters for dynamically
created interfaces between the creation of the interface and
association/start AP commands.

Following ctrl_interface commands can now be used:

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

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

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

P2P_SET go_apsd <0/1>
- disable/enable APSD in AP mode