mech_eap.git
11 years agoP2P: Check memory allocation result in a Service Discovery Response
Masashi Honma [Mon, 2 Jul 2012 17:53:46 +0000 (20:53 +0300)]
P2P: Check memory allocation result in a Service Discovery Response

This patch adds a check of the return value of wpabuf_dup() in a large
Service Discovery Response.

Signed-hostap: Masashi Honma <masashi.honma@gmail.com>

11 years agoUpdate license notification in driver_wired.c
Jouni Malinen [Mon, 2 Jul 2012 17:50:03 +0000 (20:50 +0300)]
Update license notification in driver_wired.c

This updates the license notification to use only the BSD license. The
changes were acknowledged by email (Gunter Burchardt, tmisu@gmx.de,
Mon, 02 Jul 2012 17:54:28 +0200).

Signed-hostap: Jouni Malinen <j@w1.fi>

11 years agoUpdate license notification in signalbar implementation
Jouni Malinen [Mon, 2 Jul 2012 17:48:24 +0000 (20:48 +0300)]
Update license notification in signalbar implementation

This updates the license notification to use only the BSD license. The
changes were acknowledged by email (Kel Modderman <kel@otaku42.de>,
Mon, 2 Jul 2012 20:02:37 +1000).

Signed-hostap: Jouni Malinen <j@w1.fi>

11 years agoUpdate license notification in roboswitch interface file
Jouni Malinen [Mon, 2 Jul 2012 09:43:16 +0000 (12:43 +0300)]
Update license notification in roboswitch interface file

This updates the license notification to use only the BSD license. The
changes were acknowledged by email (Jouke Witteveen
<j.witteveen@gmail.com>, Mon, 2 Jul 2012 11:38:34 +0200).

Signed-hostap: Jouni Malinen <j@w1.fi>

11 years agowpa_gui: Update licence notification text in wpa_gui
Jouni Malinen [Mon, 2 Jul 2012 09:11:01 +0000 (12:11 +0300)]
wpa_gui: Update licence notification text in wpa_gui

The Help|About message box was still referring to the old license
alternatives.

Signed-hostap: Jouni Malinen <j@w1.fi>

11 years agoUpdate license notification in D-Bus interface files
Jouni Malinen [Mon, 2 Jul 2012 09:04:38 +0000 (12:04 +0300)]
Update license notification in D-Bus interface files

This updates these files to use the license notification that uses only
the BSD license. The changes were acknowledged by email (Dan Williams
<dcbw@redhat.com>, Sun, 01 Jul 2012 15:53:36 -0500).

Signed-hostap: Jouni Malinen <j@w1.fi>

11 years agoMove p2p_connect PIN format validation into a separate function
Jouni Malinen [Sat, 30 Jun 2012 18:27:32 +0000 (21:27 +0300)]
Move p2p_connect PIN format validation into a separate function

This functionality could be shared for other commands, too, so move
it to a common function. In addition, implement the validation in a
bit more strict way to avoid accepting values like '-123' as a valid
PIN.

Signed-hostap: Jouni Malinen <j@w1.fi>

11 years agoP2P: Add error message for invalid PIN
Masashi Honma [Sat, 30 Jun 2012 18:19:12 +0000 (21:19 +0300)]
P2P: Add error message for invalid PIN

Reject invalid PIN value in p2p_connect command. Before this, typos
like "pbd" as the third parameter could have resulted in OK return
value since this parameter was interpreted as the PIN.

Signed-hostap: Masashi Honma <masashi.honma@gmail.com>

11 years agoDo not share special scan results with virtual interfaces
Jouni Malinen [Sat, 30 Jun 2012 17:30:40 +0000 (20:30 +0300)]
Do not share special scan results with virtual interfaces

When a special scan_res_handler is used the scan parameters may not have
been suitable for other purposes (e.g., during a p2p_find operation). As
such, do not indicate such scan results to other virtual interfaces
using the same radio.

Signed-hostap: Jouni Malinen <j@w1.fi>

11 years agoP2P: Remove unused P2P_SCAN_SPECIFIC
Jouni Malinen [Sat, 30 Jun 2012 17:20:29 +0000 (20:20 +0300)]
P2P: Remove unused P2P_SCAN_SPECIFIC

This is not used anymore after the commit
e6ecfc4fd3856309b2e1b9e0d23a8635752666e2.

Signed-hostap: Jouni Malinen <j@w1.fi>

11 years agoP2P: Remove GO neg/invite special cases from search
Johannes Berg [Sat, 30 Jun 2012 17:18:07 +0000 (20:18 +0300)]
P2P: Remove GO neg/invite special cases from search

There are separate states for these, so we can't really get into this
situation unless somebody tries to do multiple things at the same
time. p2p_connect stops find and CONNECT state is used to probe the peer
on its Listen channel with GO Negotiation Request frames. Similarly,
p2p_invite() stops find and INVITE state is used to probe the peer on
its Listen channel with Invitation Request frames. The older mechanism
of using Search state functionality to find the peer can be removed.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agoUpdate license notification in files initially contributed by Sam
Jouni Malinen [Sat, 30 Jun 2012 16:36:04 +0000 (19:36 +0300)]
Update license notification in files initially contributed by Sam

This updates these files to use the license notification that uses only
the BSD license. The changes were acknowledged by email (Sam Leffler
<sam@errno.com>, Sat, 30 Jun 2012 07:57:53 -0700).

Signed-hostap: Jouni Malinen <j@w1.fi>

11 years agoExport disconnect reason code to dbus
Gary Morain [Sat, 30 Jun 2012 13:43:50 +0000 (16:43 +0300)]
Export disconnect reason code to dbus

In the properties changed signal, added a new property
"DisconnectReason", which carries the IEEE 802.11 reason code of the
most recent disassociation or deauthentication event. The reason code is
negative if it is locally generated. The property is sent to the DBUS
immediately so as to prevent it from being coalesced with other
disconnect events.

Signed-off-by: Gary Morain <gmorain@chromium.org>
11 years agoEAP-pwd: Avoid double-frees on some error paths
Jouni Malinen [Sat, 30 Jun 2012 13:16:32 +0000 (16:16 +0300)]
EAP-pwd: Avoid double-frees on some error paths

At least some error paths (e.g., hitting the limit on hunt-and-peck
iterations) could have resulted in double-freeing of some memory
allocations. Avoid this by setting the pointers to NULL after they have
been freed instead of trying to free the data structure in a location
where some external references cannot be cleared. [Bug 453]

Signed-hostap: Jouni Malinen <j@w1.fi>

11 years agoEAP-pwd: Increase maximum number of hunting-and-pecking iterations
Jouni Malinen [Sat, 30 Jun 2012 13:12:41 +0000 (16:12 +0300)]
EAP-pwd: Increase maximum number of hunting-and-pecking iterations

The previously used limit (10) is too small for practical purposes since
it can result in about 1 out of 1000 authentication attempts failing.
Increase the limit to 30 to avoid such issues. [Bug 453]

Signed-hostap: Jouni Malinen <j@w1.fi>
intended-for: hostap-1

11 years agohostapd: Add IEEE 802.11ac VHT IEs into Beacon/Probe Response
Mahesh Palivela [Sat, 30 Jun 2012 10:57:52 +0000 (13:57 +0300)]
hostapd: Add IEEE 802.11ac VHT IEs into Beacon/Probe Response

IEEE 802.11ac VHT changes to include VHT IEs in Beacon and Probe
Response frames.

Signed-hostap: Mahesh Palivela <maheshp@posedge.com>

11 years agohostapd: Initial IEEE 802.11ac (VHT) definitions
Mahesh Palivela [Sat, 30 Jun 2012 10:52:13 +0000 (13:52 +0300)]
hostapd: Initial IEEE 802.11ac (VHT) definitions

Add IEEE 802.11ac definitions for config, IEEE structures, constants.

Signed-hostap: Mahesh Palivela <maheshp@posedge.com>

11 years agoP2P: Add dbus python scripts to perform p2p_find and p2p_connect
Michael Naumov [Sat, 30 Jun 2012 10:11:26 +0000 (13:11 +0300)]
P2P: Add dbus python scripts to perform p2p_find and p2p_connect

Two DBUS scripts using python glib are added to perform p2p_find and
p2p_connect operations respectively. p2p_connect script just performs
the traditional connect to create a new p2p group. Additional updates
will be required to perform join, auth etc. al.

Signed-hostap: Michael Naumov <michael.naumov@intel.com>
Signed-hostap: Nirav Shah <nirav.j2.shah@intel.com>

11 years agoWPS: Document NFC use cases with password/config token
Jouni Malinen [Thu, 28 Jun 2012 18:28:49 +0000 (21:28 +0300)]
WPS: Document NFC use cases with password/config token

Signed-hostap: Jouni Malinen <j@w1.fi>

11 years agoWPS: Share a single function for generating NFS password tokens
Jouni Malinen [Thu, 28 Jun 2012 17:54:53 +0000 (20:54 +0300)]
WPS: Share a single function for generating NFS password tokens

There is no need for both hostapd and wpa_supplicant to have their
own functions for this.

Signed-hostap: Jouni Malinen <j@w1.fi>

11 years agoWPS: Add a standalone tool for building NFC password tokens
Jouni Malinen [Thu, 28 Jun 2012 17:42:50 +0000 (20:42 +0300)]
WPS: Add a standalone tool for building NFC password tokens

nfc_pw_token can be used to build random NFC password token for WPS.
This tool prints out the wpa_supplicant.conf (or hostapd.conf)
parameters and the hexdump of the WPS password token (with and without
NDEF encapsulation) so that it can be written to a NFC tag with an
external program.

Signed-hostap: Jouni Malinen <j@w1.fi>

11 years agoWPS: Use random_get_bytes() for NFC password id
Jouni Malinen [Thu, 28 Jun 2012 17:40:16 +0000 (20:40 +0300)]
WPS: Use random_get_bytes() for NFC password id

os_random() may not be seeded properly, so use stronger mechanism for
generating the password id for NFC password tokens.

Signed-hostap: Jouni Malinen <j@w1.fi>

11 years agoWPS: Add support for NCF password token from AP
Jouni Malinen [Thu, 28 Jun 2012 16:43:29 +0000 (19:43 +0300)]
WPS: Add support for NCF password token from AP

The new hostapd ctrl_iface command WPS_NFC_TOKEN can now be used to
manage AP-as-Enrollee operations with NFC password token. WPS/NDEF
parameters to this command can be used to generate a new NFC password
token. enable/disable parameters can be used to enable/disable use of
NFC password token (instead of AP PIN) for external Registrars.

A preconfigured NFS password token can be used by providing its
parameters with new hostapd.conf fields wps_nfc_dev_pw_id,
wps_nfc_dh_pubkey, wps_nfc_dh_privkey, and wps_nfc_dev_pw. This use
will also depend on WPS_NFC_TOKEN enable/disable commands, i.e., the
configured NFS password token is disabled by default.

Signed-hostap: Jouni Malinen <j@w1.fi>

11 years agoWPS: Allow NFC password token from AP to be used with wps_reg
Jouni Malinen [Thu, 28 Jun 2012 16:41:26 +0000 (19:41 +0300)]
WPS: Allow NFC password token from AP to be used with wps_reg

The AP PIN on wps_reg command can now be replaced with special value
"nfc-pw" to use device password from a NFC password token from the AP.

Signed-hostap: Jouni Malinen <j@w1.fi>

11 years agoWPS ER: Add support for using NFC password token from an Enrollee
Jouni Malinen [Thu, 28 Jun 2012 14:34:46 +0000 (17:34 +0300)]
WPS ER: Add support for using NFC password token from an Enrollee

WPS_NFC_TAG_READ ctrl_iface command can now be used to add NFC password
tokens to ER.

Signed-hostap: Jouni Malinen <j@w1.fi>

11 years agoWPS ER: Add support for building NFC configuration token
Jouni Malinen [Thu, 28 Jun 2012 13:35:51 +0000 (16:35 +0300)]
WPS ER: Add support for building NFC configuration token

WPS_ER_NFC_CONFIG_TOKEN command can now be used to build a NFC
configuration token based on AP Settings learnt with WPS_ER_LEARN
or set with WPS_ER_CONFIG.

Signed-hostap: Jouni Malinen <j@w1.fi>

11 years agoWPS: Fix ifdef use for the new NFC mechanism in wpa_supplicant
Jouni Malinen [Thu, 28 Jun 2012 11:05:13 +0000 (14:05 +0300)]
WPS: Fix ifdef use for the new NFC mechanism in wpa_supplicant

Use CONFIG_WPS_NFC instead of CONFIG_WPS_OOB for the NFC specific
new ctrl_iface commands.

Signed-hostap: Jouni Malinen <j@w1.fi>

11 years agoWPS: Add support for NFC configuration token from external program
Jouni Malinen [Thu, 28 Jun 2012 10:59:29 +0000 (13:59 +0300)]
WPS: Add support for NFC configuration token from external program

The new wpa_supplicant ctrl_iface command WPS_NFC_TAG_READ can now be
used to process NFC tags read by external programs to initiate
wpa_supplicant to use NFC Configuration Token to create a new network.

Signed-hostap: Jouni Malinen <j@w1.fi>

11 years agoWPS: Add new mechanism for generation NFC configuration token
Jouni Malinen [Thu, 28 Jun 2012 10:25:48 +0000 (13:25 +0300)]
WPS: Add new mechanism for generation NFC configuration token

The new hostapd ctrl_iface command WPS_NFC_CONFIG_TOKEN can now be used
to fetch payload for an NFC configuration token so that an external
program can be used to write this on an NFC tag.

Signed-hostap: Jouni Malinen <j@w1.fi>

11 years agoWPS: Fix error case in NFC password token generation
Jouni Malinen [Thu, 28 Jun 2012 10:23:58 +0000 (13:23 +0300)]
WPS: Fix error case in NFC password token generation

Need to verify that wps_build_nfc_pw_token() returned a valid buffer
before trying to encapsulate it for NDEF.

Signed-hostap: Jouni Malinen <j@w1.fi>

11 years agoWPS: Use separate list of NFC Password Tokens in the Registrar
Jouni Malinen [Wed, 27 Jun 2012 19:15:55 +0000 (22:15 +0300)]
WPS: Use separate list of NFC Password Tokens in the Registrar

This adds a cleaner mechanism for handling NFC Password Tokens in the
WPS Registrar. There could be more than one active NFC Password Token in
use and as such, a list of tokens needs to be maintained. The old
WPS_OOB interface is still using the old mechanism that supports only a
single active NFC Password Token.

Signed-hostap: Jouni Malinen <j@w1.fi>

11 years agoWPS: Add new mechanism for communicating NFC tag read events
Jouni Malinen [Wed, 27 Jun 2012 17:54:56 +0000 (20:54 +0300)]
WPS: Add new mechanism for communicating NFC tag read events

hostapd ctrl_iface can now be used to deliver payload from read
operation of an NFC tag. This allows operations without having to have
low-level NFC code within hostapd. For now, the new wps_nfc_tag_read
command can be used with NFC password tokens for the case where the AP
has an NFC device that is used to read an NFC tag from the station
Enrollee.

Signed-hostap: Jouni Malinen <j@w1.fi>

11 years agoWPS: Add new mechanism for NFC config method using password token
Jouni Malinen [Wed, 27 Jun 2012 15:56:41 +0000 (18:56 +0300)]
WPS: Add new mechanism for NFC config method using password token

Instead of requiring low-level access to an NFC device and synchronous
operations, the new WPS_NFC_TOKEN and WPS_NFC ctrl_iface commands can be
used to build a NFC password token and initiate WPS protocol run using
that token (or pre-configured values) as separate commands. The
WPS_NFC_TOKEN output can be written to a NFC tag using an external
program, i.e., wpa_supplicant does not need to have low-level code for
NFC operations for this.

Signed-hostap: Jouni Malinen <j@w1.fi>

11 years agoWPS: Move attribute parser definitions into a new header file
Jouni Malinen [Wed, 27 Jun 2012 17:18:47 +0000 (20:18 +0300)]
WPS: Move attribute parser definitions into a new header file

This allows wps/wps_attr_parse.h to be included into files outside
src/wps.

Signed-hostap: Jouni Malinen <j@w1.fi>

11 years agoWPS: Split wps_build_oob_dev_password() into parts
Jouni Malinen [Wed, 27 Jun 2012 15:25:16 +0000 (18:25 +0300)]
WPS: Split wps_build_oob_dev_password() into parts

This allows sharing of a function to build the attribute without
changing the OOB parameters.

Signed-hostap: Jouni Malinen <j@w1.fi>

11 years agoNDEF: Mark input data const when it is not modified
Jouni Malinen [Wed, 27 Jun 2012 16:51:11 +0000 (19:51 +0300)]
NDEF: Mark input data const when it is not modified

Signed-hostap: Jouni Malinen <j@w1.fi>

11 years agoWPS: Allow NDEF functions to be used from outside src/wps
Jouni Malinen [Wed, 27 Jun 2012 15:16:47 +0000 (18:16 +0300)]
WPS: Allow NDEF functions to be used from outside src/wps

Signed-hostap: Jouni Malinen <j@w1.fi>

11 years agoNDEF: Skip unnecessary wpabuf to ptr/len conversion
Jouni Malinen [Wed, 27 Jun 2012 15:11:46 +0000 (18:11 +0300)]
NDEF: Skip unnecessary wpabuf to ptr/len conversion

Signed-hostap: Jouni Malinen <j@w1.fi>

11 years agoAdd dh5_init_fixed() to allow fixed DH parameters to be used
Jouni Malinen [Wed, 27 Jun 2012 18:17:49 +0000 (21:17 +0300)]
Add dh5_init_fixed() to allow fixed DH parameters to be used

This allows pre-configured private and public key to be used when
initializing DH for group 5.

Signed-hostap: Jouni Malinen <j@w1.fi>

11 years agoWPS: Fix OOB Device Password use for EAP-WSC peer
Jouni Malinen [Wed, 27 Jun 2012 18:15:29 +0000 (21:15 +0300)]
WPS: Fix OOB Device Password use for EAP-WSC peer

The OOB Device Password is passed in as a hexdump of the real Device
Password (16..32 octets of arbitrary binary data). The hexdump needs to
be converted to binary form before passing it for WPS processing.

Signed-hostap: Jouni Malinen <j@w1.fi>

11 years agoWPS: Add support for OOB dev password lengths 16..31
Jouni Malinen [Wed, 27 Jun 2012 15:28:13 +0000 (18:28 +0300)]
WPS: Add support for OOB dev password lengths 16..31

Previously, only the maximum length 32 octets for OOB device password
was accepted. Since the specification allows a shorter password to be
used with limited OOB mechanism (e.g., small NFC tag), we should accept
lengths 16..32.

Signed-hostap: Jouni Malinen <j@w1.fi>

11 years agoWPS: Fix potential memory leak with NFC password token
Jouni Malinen [Wed, 27 Jun 2012 17:53:29 +0000 (20:53 +0300)]
WPS: Fix potential memory leak with NFC password token

The old stored public key hash needs to be freed before replacing
the pointer with the new value.

Signed-hostap: Jouni Malinen <j@w1.fi>

11 years agoWPS: Fix NFC password token building with WPS 2.0
Jouni Malinen [Wed, 27 Jun 2012 15:19:29 +0000 (18:19 +0300)]
WPS: Fix NFC password token building with WPS 2.0

The earlier WPS 2.0 changes did not increase the wpabuf size when
adding a new attribute to the NFC password token. This could result
in aborting the application on wpabuf overflow if NFC out-of-band
mechanism is used with WPS 2.0 enabled.

Signed-hostap: Jouni Malinen <j@w1.fi>
intended-for: hostap-1

11 years agoAllow autoscan parameters to be changed in SCANNING state
Jouni Malinen [Tue, 26 Jun 2012 17:11:25 +0000 (20:11 +0300)]
Allow autoscan parameters to be changed in SCANNING state

Signed-hostap: Jouni Malinen <j@w1.fi>

11 years agoReinitialize autoscan on explicit reassocciate/reconnect command
Jouni Malinen [Tue, 26 Jun 2012 17:05:51 +0000 (20:05 +0300)]
Reinitialize autoscan on explicit reassocciate/reconnect command

This clears the exponential scan interval back to the base value
when a reconnection is requested explicitly.

Signed-hostap: Jouni Malinen <j@w1.fi>

11 years agoCancel pending scan request on DISCONNECT command
Jouni Malinen [Tue, 26 Jun 2012 16:57:03 +0000 (19:57 +0300)]
Cancel pending scan request on DISCONNECT command

Previously, a pending scan request could be left running when processing
DISCONNECT command from control interface. This can result in unexpected
scan, so cancel the request to avoid this.

Signed-hostap: Jouni Malinen <j@w1.fi>

11 years agoStart autoscan for first connection attempt
Jouni Malinen [Tue, 26 Jun 2012 16:52:46 +0000 (19:52 +0300)]
Start autoscan for first connection attempt

Use wpa_supplicant_set_state() to initialize state to DISCONNECT so that
autoscan gets initialized properly. This needs a change in
autoscan_init() to avoid extra scan request that would postpone the
first scan request when an interface is added.

Signed-hostap: Jouni Malinen <j@w1.fi>

11 years agoFix autoscan exponential to limit interval in all cases
Jouni Malinen [Tue, 26 Jun 2012 16:51:06 +0000 (19:51 +0300)]
Fix autoscan exponential to limit interval in all cases

The first time the limit is exceeded could result in using larger
value - avoid that by limiting the interval also in that case.

Signed-hostap: Jouni Malinen <j@w1.fi>

11 years agoFix autoscan exponential to start with the base value
Jouni Malinen [Tue, 26 Jun 2012 16:47:25 +0000 (19:47 +0300)]
Fix autoscan exponential to start with the base value

Initial implementation used base^2 as the starting value.

Signed-hostap: Jouni Malinen <j@w1.fi>

11 years agoWrite autoscan parameter to config file on updates
Jouni Malinen [Tue, 26 Jun 2012 16:43:05 +0000 (19:43 +0300)]
Write autoscan parameter to config file on updates

Signed-hostap: Jouni Malinen <j@w1.fi>

11 years agoAdd a simple periodic autoscan module
Tomasz Bursztyka [Tue, 26 Jun 2012 16:28:21 +0000 (19:28 +0300)]
Add a simple periodic autoscan module

This module will sets a fixed scanning interval. Thus, the parameter to
this module is following this format: <fixed interval>

Signed-hostap: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>

11 years agoAdd autoscan module named exponential
Tomasz Bursztyka [Tue, 26 Jun 2012 16:22:56 +0000 (19:22 +0300)]
Add autoscan module named exponential

This module will compute the interval on a base exponential. Thus,
params to this module are following this format: <base>:<limit>

Signed-hostap: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>

11 years agoAdd autoscan command into wpa_cli
Tomasz Bursztyka [Tue, 26 Jun 2012 16:11:17 +0000 (19:11 +0300)]
Add autoscan command into wpa_cli

Signed-hostap: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>

11 years agoAdd ctrl iface command for autoscan
Tomasz Bursztyka [Tue, 26 Jun 2012 16:09:47 +0000 (19:09 +0300)]
Add ctrl iface command for autoscan

Signed-hostap: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>

11 years agoD-Bus: Add AutoScan interface method to set/unset autoscan parameters
Tomasz Bursztyka [Tue, 26 Jun 2012 16:05:09 +0000 (19:05 +0300)]
D-Bus: Add AutoScan interface method to set/unset autoscan parameters

Signed-hostap: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>

11 years agoAdd automatic scanning support
Tomasz Bursztyka [Tue, 26 Jun 2012 15:55:41 +0000 (18:55 +0300)]
Add automatic scanning support

Like bgscan, autoscan is an optional module based feature to automate
scanning but while disconnected or inactive.

Instead of requesting directly a scan, it only sets the scan_interval
and the sched_scan_interval. So, if the driver supports sched_scan,
autoscan will be able to tweak its interval. Otherwise, the tweaked
scan_interval will be used. If scan parameters needs to be tweaked, an
autoscan_params pointer in wpa_s will provide those. So req_scan /
req_sched_scan will not set the scan parameters as they usually do, but
instead will use this pointer.

Modules will not have to request a scan directly, like bgscan does.
Instead, it will need to return the interval it wants after each
notification.

Signed-hostap: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>

11 years agoAdd autoscan parameters support in config file
Tomasz Bursztyka [Tue, 26 Jun 2012 15:09:57 +0000 (18:09 +0300)]
Add autoscan parameters support in config file

Signed-hostap: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>

11 years agonl80211: Handle CH_SWITCH event
Thomas Pedersen [Mon, 25 Jun 2012 11:45:14 +0000 (14:45 +0300)]
nl80211: Handle CH_SWITCH event

Some drivers may independently decide to switch channels. Handle this by
updating the hostapd and wpa_supplicant AP and GO configuration.

Signed-hostap: Thomas Pedersen <c_tpeder@qca.qualcomm.com>

11 years agoSync with include/linux/nl80211.h from wireless-testing.git
Jouni Malinen [Mon, 25 Jun 2012 11:34:22 +0000 (14:34 +0300)]
Sync with include/linux/nl80211.h from wireless-testing.git

Signed-hostap: Jouni Malinen <j@w1.fi>

11 years agoSet state to DISCONNECTED on auth/assoc failures
Jouni Malinen [Mon, 25 Jun 2012 11:23:25 +0000 (14:23 +0300)]
Set state to DISCONNECTED on auth/assoc failures

Some of the authentication/association failure paths left wpa_state to
its previous value. This can result in unexpected behavior when
wpa_supplicant tries to find an AP to connect to since the uncleared
state can result the in the selected BSS being ignored if it is same as
the previously used BSS. This could happen, e.g., when wpa_supplicant
SME was used and the AP rejected authentication. Fix this by explicitly
setting state to DISCONNECTED on auth/assoc failures that did not yet do
this.

Signed-hostap: Jouni Malinen <j@w1.fi>
intended-for: hostap-1

11 years agoP2P: Reject p2p_find when in provisioning
Sunil Dutt Undekari [Mon, 25 Jun 2012 11:05:49 +0000 (14:05 +0300)]
P2P: Reject p2p_find when in provisioning

A p2p_find during provisioning shall not allow the enrollee to
pick the network, hence disable p2p_find during provisioning.

Signed-hostap: Sunil Dutt Undekari <duttus@codeaurora.org>

11 years agoRemove STA entry from AP when starting TKIP countermeasures
Jouni Malinen [Mon, 25 Jun 2012 10:53:24 +0000 (13:53 +0300)]
Remove STA entry from AP when starting TKIP countermeasures

Previously, the STA entry was removed only from the driver and the STA
entry within hostapd was just marked disassociated. However, this left
the WPA authenticator state machine with an entry and the session was
not terminated properly. In addition, the STA entry could have remaining
indefinitely if the STA did not reconnect after TKIP countermeasures.
Fix this by removing the STA entry from hostapd instead of just leaving
it disassociated.

Signed-hostap: Jouni Malinen <j@w1.fi>

11 years agohostapd: Fix PBC config method of WSC IE in Beacon/Probe Response
Yoni Divinsky [Mon, 25 Jun 2012 09:20:37 +0000 (12:20 +0300)]
hostapd: Fix PBC config method of WSC IE in Beacon/Probe Response

In AP which supports WPSv2 with only virtual push button, when PBC is
called, the WSC IE should include Selected Registrar Configuration
Methods attribute with the bit of the physical push button not set.

Signed-hostap: Yoni Divinsky <yoni.divinsky@ti.com>

11 years agoeloop/poll: Handle POLLER | POLLHUP in read logic
Ben Greear [Sun, 24 Jun 2012 10:19:34 +0000 (13:19 +0300)]
eloop/poll: Handle POLLER | POLLHUP in read logic

Without this, we can get into a tight loop because the
code in general doesn't add eloop exception handlers,
so socket reporting the POLLERR would never be read.

With this change, any socket with POLLERR or POLLHUP
asserted will be handled by the read logic.

Signed-hostap: Ben Greear <greearb@candelatech.com>

11 years agoDescribe CONFIG_AP=y and CONFIG_P2P=y in defconfig
Jouni Malinen [Sat, 23 Jun 2012 22:07:15 +0000 (01:07 +0300)]
Describe CONFIG_AP=y and CONFIG_P2P=y in defconfig

Signed-hostap: Jouni Malinen <j@w1.fi>

11 years agoFix a typo
Jouni Malinen [Sat, 23 Jun 2012 21:59:06 +0000 (00:59 +0300)]
Fix a typo

Signed-hostap: Jouni Malinen <j@w1.fi>

11 years agonl80211: Simplify cbmsg buffer
Johannes Berg [Sat, 23 Jun 2012 17:37:09 +0000 (20:37 +0300)]
nl80211: Simplify cbmsg buffer

The control message received from the kernel needs some space, but
there's no need for the strange typing that breaks clang compilation.

Signed-hostap: Johannes Berg <johannes.berg@intel.com>

11 years agoatheros: Remove unused variables
Jouni Malinen [Sat, 23 Jun 2012 17:34:29 +0000 (20:34 +0300)]
atheros: Remove unused variables

Signed-hostap: Jouni Malinen <j@w1.fi>

11 years agoatheros: Fix build when WPS and IEEE80211R are both disabled
Baruch Siach [Sat, 23 Jun 2012 17:33:50 +0000 (20:33 +0300)]
atheros: Fix build when WPS and IEEE80211R are both disabled

Signed-hostap: Baruch Siach <baruch@tkos.co.il>

11 years agoP2P: Fix fallback to GO Negotiation to avoid PD-before-join timeout
Aarthi Thiruvengadam [Wed, 20 Jun 2012 18:38:31 +0000 (21:38 +0300)]
P2P: Fix fallback to GO Negotiation to avoid PD-before-join timeout

The wpas_p2p_pd_before_join_timeout could be left behind if the PD
Request in p2p_connect-auto case does not succeed. This timeout can
result in unexpected operations since it could trigger join operation
while going through GO Negotiation. Fix this by canceling the timeout
when falling back to GO Negotiation.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>

11 years agoCopy Chargeable-User-Identity in PMKSA caching case
Jouni Malinen [Sun, 17 Jun 2012 16:51:57 +0000 (19:51 +0300)]
Copy Chargeable-User-Identity in PMKSA caching case

Maintain a copy of Chargeable-User-Identity in the PMKSA cache to allow
it to be included in accounting messages even if full authentication was
not completed.

Signed-hostap: Jouni Malinen <j@w1.fi>

11 years agoRADIUS DAS: Support Chargeable-User-Identity with Disconnect-Request
Jouni Malinen [Sun, 17 Jun 2012 16:44:46 +0000 (19:44 +0300)]
RADIUS DAS: Support Chargeable-User-Identity with Disconnect-Request

Chargeable-User-Identity can now be used in Disconnect-Request to
identify the station to be disconnected.

Signed-hostap: Jouni Malinen <j@w1.fi>

11 years agoRADIUS: Fix a typo in attribute name in debug messages
Jouni Malinen [Sun, 17 Jun 2012 16:39:29 +0000 (19:39 +0300)]
RADIUS: Fix a typo in attribute name in debug messages

Signed-hostap: Jouni Malinen <j@w1.fi>

11 years agoRADIUS DAS: Add Event-Timestamp attribute into ACK/NAK messages
Jouni Malinen [Sun, 17 Jun 2012 16:35:03 +0000 (19:35 +0300)]
RADIUS DAS: Add Event-Timestamp attribute into ACK/NAK messages

Signed-hostap: Jouni Malinen <j@w1.fi>

11 years agoRADIUS DAS: Add support for Disconnect-Request
Jouni Malinen [Sun, 17 Jun 2012 16:30:01 +0000 (19:30 +0300)]
RADIUS DAS: Add support for Disconnect-Request

Calling-Station-Id, Acct-Session-Id, and User-Name attributes in a
Disconnect-Request message can now be used to indicate which station is
to be disconnected.

Signed-hostap: Jouni Malinen <j@w1.fi>

11 years agoRADIUS DAS: Check Disconnect-Request attributes
Jouni Malinen [Sun, 17 Jun 2012 15:14:43 +0000 (18:14 +0300)]
RADIUS DAS: Check Disconnect-Request attributes

Reject Disconnect-Request if it includes unsupported attributes.

Signed-hostap: Jouni Malinen <j@w1.fi>

11 years agoRADIUS DAS: Validate Event-Timestamp
Jouni Malinen [Sun, 17 Jun 2012 14:43:36 +0000 (17:43 +0300)]
RADIUS DAS: Validate Event-Timestamp

DAS will now validate Event-Timestamp value to be within an acceptable
time window (300 seconds by default; can be set using
radius_das_time_window parameter). In addition, Event-Timestamp can be
required in Disconnect-Request and CoA-Request messages with
radius_das_require_event_timestamp=1.

Signed-hostap: Jouni Malinen <j@w1.fi>

11 years agoP2P: Add p2p_client_list support for FullMAC Persistent GO
Masashi Honma [Sun, 17 Jun 2012 08:58:46 +0000 (11:58 +0300)]
P2P: Add p2p_client_list support for FullMAC Persistent GO

Currently, FullMAC Persistent GO can't use p2p_client_list because its
own hapd->p2p_group is NULL at ap_sta_set_authorized(). This patch
changes the processing to use sta->p2p_ie instead of
p2p_group_get_dev_addr() on FullMAC GO.

Signed-hostap: Masashi Honma <masashi.honma@gmail.com>

11 years agohostapd: Return error value on configuration check failure
Baruch Siach [Sat, 16 Jun 2012 17:30:28 +0000 (20:30 +0300)]
hostapd: Return error value on configuration check failure

Don't count errors since the number isn't used anyway.

Signed-hostap: Baruch Siach <baruch@tkos.co.il>

11 years agohostapd: Remove redundant variable initialization
Baruch Siach [Sat, 16 Jun 2012 17:26:51 +0000 (20:26 +0300)]
hostapd: Remove redundant variable initialization

The 'errors' variable is initialized later anyway.

Signed-hostap: Baruch Siach <baruch@tkos.co.il>

11 years agoP2P: Fix P2P Client Discoverability bit updates
Jouni Malinen [Sat, 16 Jun 2012 17:17:39 +0000 (20:17 +0300)]
P2P: Fix P2P Client Discoverability bit updates

The P2P Client Discoverability bit is reserved in most frames and its
value in the local P2P peer table should only be updated based on P2P
Group Info attribute from a GO. Fix this by avoiding changes to this
dev_capab bit based on other P2P frames. It would be more correct to
track this separately for each group in which the peer is a member, but
since we do not do that for the other group specific information either,
this can do for now.

It should be noted that prior to commit
18485b5469c5eeea6a552264fbfaabb089a0a557 wpa_supplicant set this bit in
all P2P frames. However, that commit changed this to match the
specification, i.e., the bit is not set in frames which are received
from P2P Device role. As such, this fix is needed to be able to figure
out that a peer supports client discoverability capability after that
commit.

Signed-hostap: Jouni Malinen <j@w1.fi>
intended-for: hostap-1

11 years agoP2P: Fix setting of P2P Client Discoverability bit
Masashi Honma [Sat, 16 Jun 2012 16:54:47 +0000 (19:54 +0300)]
P2P: Fix setting of P2P Client Discoverability bit

In the P2P specification v1.1, the P2P Client Discoverability bit is
described in Table 12 "Device Capability Bitmap definition". The table
says "Within a P2P Group Info attribute and a (Re)association request
frame the P2P Client Discoverability field shall be set to 1 when the
P2P Device supports P2P Client Discoverability, and is set to 0
otherwise. This field shall be reserved and set to 0 in all other frames
or uses.". To match with this, filter out P2P Client Discoverability bit
from frames where its use is reserved.

Signed-hostap: Masashi Honma <masashi.honma@gmail.com>

11 years agoEAP-SIM/AKA server: Allow pseudonym to be used after unknown reauth id
Jouni Malinen [Fri, 15 Jun 2012 15:49:54 +0000 (18:49 +0300)]
EAP-SIM/AKA server: Allow pseudonym to be used after unknown reauth id

If the peer uses an unknown reauth id, it would still be possible to use
pseudonym instead of permanent id. Allow this by changing the
AT_PERMANENT_ID_REQ to AT_FULLAUTH_ID_REQ in case unknown reauth id is
used in EAP-Response/Identity.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>

11 years agoP2P: Add driver op for requesting GO/AP channel switch
Jithu Jance [Sun, 10 Jun 2012 17:54:31 +0000 (20:54 +0300)]
P2P: Add driver op for requesting GO/AP channel switch

Signed-hostap: Jithu Jance <jithu@broadcom.com>

11 years agoP2P: Add preference setting for concurrent use cases
Jithu Jance [Sun, 10 Jun 2012 17:53:09 +0000 (20:53 +0300)]
P2P: Add preference setting for concurrent use cases

Add an additional parameter to prioritize either sta or p2p connection
to resolve conflicts arising during single channel concurrency.

Signed-hostap: Jithu Jance <jithu@broadcom.com>

11 years agoP2P: Do not use reassociation after getting disassociated
Jouni Malinen [Sun, 10 Jun 2012 16:51:36 +0000 (19:51 +0300)]
P2P: Do not use reassociation after getting disassociated

This avoids issues with some APs rejecting a reassociation if the
station is not currently associated as reported by Yossi Wortzel.
The change is based on a patch from Arik Nemtsov.

Signed-hostap: Jouni Malinen <j@w1.fi>

11 years agoP2P: Ignore unexpected GO Neg Resp is we have sent Resp
Jouni Malinen [Sat, 9 Jun 2012 15:31:24 +0000 (18:31 +0300)]
P2P: Ignore unexpected GO Neg Resp is we have sent Resp

There is a race condition in GO Negotiation Request frame sending and
processing that may end up with both devices sending GO Negotiation
Response. This response frame was previously accepted even if a response
had already been sent. This could result in two GO Negotiation Confirm
frames being exchanged and consequently, with two separate GO
Negotiations completing concurrently. These negotiations could result in
getting mismatching parameters (e.g., both device could believe it was
the GO).

Fix this by ignoring GO Negotiation Response from the peer if twe have
already sent a GO Negotiation Response frame and we have the higher P2P
Device Address. This is similar to the rule used to determine whether to
reply to GO Negotiation Request frame when Request was already sent,
i.e., the same direction of GO Negotiation is maintained here to enforce
that only the negotiation initiated by the device with smaller P2P
Device Address is completed.

Signed-hostap: Jouni Malinen <j@w1.fi>
intended-for: hostap-1

11 years agoP2P: Address race condition with GO Negotiation Request TX status
Neeraj Kumar Garg [Sat, 9 Jun 2012 15:03:47 +0000 (18:03 +0300)]
P2P: Address race condition with GO Negotiation Request TX status

If both peers initiate GO Negotiation at about the same time, it is
possible for the GO Negotiation Request frame from the peer to be
received between the local attempt to send the GO Negotiation Request
and TX status event for that. This could result in both devices sending
GO Negotiation Response frames even though one of them should have
skipped this based which device uses a higher MAC address.

Resolve this race by incrementing go_neg_req_sent when p2p_send_action()
returns success instead of doing this from the TX status callback. If
the frame is not acknowledged, go_neg_req_sent is cleared in TX status
handler.

Signed-off-by: Neeraj Garg <neerajkg@broadcom.com>
11 years agosta_info: Remove duplicated function declaration
Antonio Quartulli [Sat, 9 Jun 2012 09:54:00 +0000 (12:54 +0300)]
sta_info: Remove duplicated function declaration

In sta_info.h, ap_free_sta() was declared twice.

Signed-off-by: Antonio Quartulli <ordex@autistici.org>
11 years agoLibTomMath: Use 64-bit mode for mp_digit
Jouni Malinen [Sat, 9 Jun 2012 08:53:30 +0000 (11:53 +0300)]
LibTomMath: Use 64-bit mode for mp_digit

For 64-bit x86 builds, enable 64-bit mode to optimize bignum operations
with the internal LibTomMath version.

Signed-hostap: Jouni Malinen <j@w1.fi>

11 years agoatheros: Set essid length field only once
Baruch Siach [Fri, 8 Jun 2012 17:28:23 +0000 (20:28 +0300)]
atheros: Set essid length field only once

Signed-hostap: Baruch Siach <baruch@tkos.co.il>

11 years agoatheros: Fix build when CONFIG_WPS is disabled
Baruch Siach [Fri, 8 Jun 2012 17:27:45 +0000 (20:27 +0300)]
atheros: Fix build when CONFIG_WPS is disabled

The use of ETH_P_80211_RAW does not depend on CONFIG_WPS, so make its
definition independent as well.

Signed-hostap: Baruch Siach <baruch@tkos.co.il>

11 years agoP2P: Assume GO Negotiation failed if GO Neg Conf wait times out
Jouni Malinen [Fri, 8 Jun 2012 15:24:08 +0000 (18:24 +0300)]
P2P: Assume GO Negotiation failed if GO Neg Conf wait times out

Stop the connection attempt if GO Negotiation Confirm is not received
within 100 ms of the GO Negotiation Response getting acknowledged.
Previously, we would have continued trying to connect to the peer even
in this case which could result in confusing second GO Negotiation
Request frame and unnecessarily long wait before indicating failure.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>

11 years agoP2P: Fix group formation timeout on GO during WPS step
Jouni Malinen [Fri, 8 Jun 2012 15:22:03 +0000 (18:22 +0300)]
P2P: Fix group formation timeout on GO during WPS step

Commit 361cdf34009c7407ddf22dee6f5e6ce82e81bcae changed the way the
group formation timeout is used on P2P client. However, it resulted in
clearing the timeout on the GO when the GO started beaconing. This is
not correct since the timeout is supposed to be maintained until at
least the completion of the WPS provisioning step. Fix this regression
by clearing the timeout here only in the case we are not GO in group
formation phase.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>

11 years agoWPS: Cancel WPS operation also in DISCONNECTED state
Jouni Malinen [Wed, 6 Jun 2012 19:07:11 +0000 (22:07 +0300)]
WPS: Cancel WPS operation also in DISCONNECTED state

It is possible for wpa_state to be WPA_DISCONNECTED when a new scan is
scheduled to be started in the future. If wpas_wps_cancel() gets called
(e.g., through control interface wps_cancel or a P2P group removal)
while in that state, the WPS operation (scan request and special network
block) were not removed. Fix this by clearing the WPS operations both in
WPA_SCANNING and WPA_DISCONNECTED states.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
intended-for: hostap-1

11 years agoP2P: Fix scan_res_handler setting for p2p_scan
Jouni Malinen [Wed, 6 Jun 2012 14:07:46 +0000 (17:07 +0300)]
P2P: Fix scan_res_handler setting for p2p_scan

The previous version set scan_res_handler unconditionally and then
cleared it if scan request failed. This can result in incorrect clearing
of the handler to NULL for a previously started scan that has not yet
completed. This can make p2p_find command fail to use the
start-after-scan-completion mechanism in some cases. Fix this by setting
scan_res_handler properly after having verified that the driver command
for starting the scan was successful.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
intended-for: hostap-1

11 years agoP2P: Send GO Negotiation Confirm without wait
Johannes Berg [Wed, 6 Jun 2012 13:37:54 +0000 (16:37 +0300)]
P2P: Send GO Negotiation Confirm without wait

The GO Negotiation Confirm frame doesn't need to be sent with a wait
since we don't expect a response to it.

Signed-hostap: Johannes Berg <johannes.berg@intel.com>

11 years agoP2P: Improve p2p_prov_disc-auto robustness
Sunil Dutt Undekari [Wed, 6 Jun 2012 12:46:05 +0000 (15:46 +0300)]
P2P: Improve p2p_prov_disc-auto robustness

Perform addition additional scan runs on the operating channel of the GO
(if known from previous scan results) and fall back to initiate the PD
for GO Negotiation if these additional scans do not detect the peer as
GO.

Signed-hostap: Sunil Dutt Undekari <duttus@codeaurora.org>

11 years agoP2P: Use consistent Device Capability in Beacon/Probe Response
Masashi Honma [Wed, 6 Jun 2012 09:55:44 +0000 (12:55 +0300)]
P2P: Use consistent Device Capability in Beacon/Probe Response

Concurrent Operation bit was not set for GO even if the device
supports concurrent operations. Make sure the Device Capability
value is consistent with other P2P use cases by using the value
determined in p2p_init().

Signed-hostap: Masashi Honma <masashi.honma@gmail.com>

11 years agoP2P: Fix P2P Group Formation timeout registration (use parent iface)
Nirav Shah [Mon, 4 Jun 2012 18:58:34 +0000 (21:58 +0300)]
P2P: Fix P2P Group Formation timeout registration (use parent iface)

Commit 361cdf34009c7407ddf22dee6f5e6ce82e81bcae extended the use of
group formation timeout for the way handshake, but the registration was
done on the group_interface while the cancellation was done on the
parent interface. Fix the registration to set the eloop timeout on
parent to address potential issues when using a separate group
interface.

Signed-hostap: Nirav Shah <nirav.j2.shah@intel.com>