mech_eap.git
12 years agoP2P: Remove client group on Deauthentication reason code 3
Jouni Malinen [Tue, 3 Apr 2012 13:43:06 +0000 (16:43 +0300)]
P2P: Remove client group on Deauthentication reason code 3

The GO can indicate that the P2P Group session is ending by sending a
Deauthentication frame with reason code 3 (Deauthenticated because
sending STA is leaving) based on P2P specification section 3.2.9. Use
this reason code to remove the P2P client group without waiting for the
group idle timeout.

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

12 years agoChange reason code for AP mode BSS termination to 3
Jouni Malinen [Tue, 3 Apr 2012 13:17:38 +0000 (16:17 +0300)]
Change reason code for AP mode BSS termination to 3

Use reason code 3 (Deauthenticated because sending STA is leaving)
instead of reason code 2 (Previous authentication ot valid) in the
Deauthentication frame sent at the time a BSS is terminated. This is
more accurate reason for the message and allows the stations to get
better understand on why they were disconnected. This can be useful
especially for P2P clients that can use this as a signal that the
P2P group session was ended per P2P specification section 3.2.9.

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

12 years agohostapd: Do not allow HT in 11b mode
Sujith Manoharan [Mon, 2 Apr 2012 05:33:14 +0000 (11:03 +0530)]
hostapd: Do not allow HT in 11b mode

When the HW mode has been configured as 11b, disable HT
operations.

Signed-hostap: Sujith Manoharan <c_manoha@qca.qualcomm.com>

12 years agoP2P: Notify about disconnection only when needed
Eliad Peller [Sun, 1 Apr 2012 18:49:03 +0000 (21:49 +0300)]
P2P: Notify about disconnection only when needed

wpas_notify_state_changed() notified about disconnection when
new_state < WPA_ASSOCIATED, without checking the old state. This
results in extra processing which can be avoided by checking that
old_state was connected.

Signed-hostap: Eliad Peller <eliad@wizery.com>
intended-for: hostap-1

12 years agoP2P: Add deinit_p2p_cli op to clear P2P client driver state
Eliad Peller [Sun, 1 Apr 2012 18:41:23 +0000 (21:41 +0300)]
P2P: Add deinit_p2p_cli op to clear P2P client driver state

On P2P group removal, the GO is deinitialized correctly (and the vif
mode is set back to sta in case of nl80211), but the P2P client mode
wasn't deinitialized, and the nl80211 vif stays in P2P client mode.

Add a new deinit_p2p_cli op (similar to deinit_ap), which currently only
sets the interface back to station mode.

Signed-hostap: Eliad Peller <eliad@wizery.com>
intended-for: hostap-1

12 years agoFix Probe Request processing in wpa_supplicant AP mode
Jouni Malinen [Sun, 1 Apr 2012 18:27:12 +0000 (21:27 +0300)]
Fix Probe Request processing in wpa_supplicant AP mode

Commit 2d43d37ff2c3115da812bec8ea4c72048e1194d8 broke EVENT_RX_MGMT
processing in wpa_supplicant AP mode. ap_mgmt_rx() needs to be called
for Probe Request frames even if they get notified through the new
D-Bus signal mechanism.

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

12 years agoDBus: Add ability to report probe requests
Johannes Berg [Sun, 1 Apr 2012 18:13:38 +0000 (21:13 +0300)]
DBus: Add ability to report probe requests

Some applications require knowing about probe requests to identify
devices. This can be the case in AP mode to see the devices before they
connect, or even in P2P mode when operating as a P2P device to identify
non-P2P peers (P2P peers are identified via PeerFound signals).

As there are typically a lot of probe requests, require that an
interested application subscribes to this signal so the bus isn't always
flooded with these notifications. The notifications in DBus are then
unicast only to that application.

A small test script is also included.

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

12 years agoPass signal strength through, fix units
Johannes Berg [Sun, 1 Apr 2012 15:48:12 +0000 (18:48 +0300)]
Pass signal strength through, fix units

The signal strength is currently never used as the only driver reporting
it is nl80211 which uses IEEE80211_RADIOTAP_DB_ANTSIGNAL which is never
populated by the kernel. The kernel will (soon) populate
IEEE80211_RADIOTAP_DBM_ANTSIGNAL instead though, so use that.

Also, since it was never really populated, we can redefine the signal
field to be in dBm units only.

My next patch will also require knowing the signal strength of probe
requests throughout the code (where available), so add it to the
necessary APIs.

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

12 years agohostapd: Only update already-set beacons when processing OLBC
Luciano Coelho [Sun, 1 Apr 2012 15:12:04 +0000 (18:12 +0300)]
hostapd: Only update already-set beacons when processing OLBC

When hostapd is about to start an AP using HT40, it starts a scan to
check whether it is allowed or not. If OLBC is detected before the
scan has completed, it sets the beacons prematurely.

To fix this, instead of setting all beacons when OLBC is detected,
only update the ones that have already been started.

Signed-off-by: Luciano Coelho <coelho@ti.com>
12 years agoCreate DBus getter/setter for ScanInterval
Mukesh Agrawal [Sun, 1 Apr 2012 15:05:22 +0000 (18:05 +0300)]
Create DBus getter/setter for ScanInterval

Enable control of wpa_s->scan_interval via D-Bus. This parameter
controls the delay between successive scans for a suitable AP.

Also, update dbus.doxygen with ScanInterval, and some other
parameters that were undocumented.

Signed-hostap: Mukesh Agrawal <quiche@chromium.org>

12 years agoFix memory leaks on radius_client_send error paths
Jouni Malinen [Sun, 1 Apr 2012 14:55:20 +0000 (17:55 +0300)]
Fix memory leaks on radius_client_send error paths

In case this function returns an error, the RADIUS message needs to
freed in the caller.

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

12 years agoRemove extra linefeed from hostapd_logger message
Jouni Malinen [Sun, 1 Apr 2012 10:41:03 +0000 (13:41 +0300)]
Remove extra linefeed from hostapd_logger message

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

12 years agoFix potential double free and use of freed memory in RADIUS client
Alexander Couzens [Sun, 1 Apr 2012 10:36:52 +0000 (13:36 +0300)]
Fix potential double free and use of freed memory in RADIUS client

ieee802_1x_encapsulate_radius() frees the RADIUS message if
radius_client_send() returns error. This could have resulted in use of
freed memory and double freeing of the RADIUS message if send() fails
since the message is also left in the retransmit list. Avoid this by not
returning error to the caller in such a case.

Signed-off-by: Alexander Couzens <lynxis@c-base.org>
12 years agonl80211: Report signal strength from nl80211
Johannes Berg [Sun, 1 Apr 2012 09:39:33 +0000 (12:39 +0300)]
nl80211: Report signal strength from nl80211

Report signal strength from nl80211 events to the higher layers.

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

12 years agoClean up: Replace standard lib methods with os.h ones
Nirav Shah [Sat, 31 Mar 2012 18:13:53 +0000 (21:13 +0300)]
Clean up: Replace standard lib methods with os.h ones

Some of the standard lib functions being used directly are redefined in
src/utils/os.h thus providing an abstraction. Change code to use os_*
functions instead of directly using the lib functions.

Signed-hostap: Nirav Shah <nirav.j2.shah@intel.com>
Signed-hostap: Angie Chinchilla <angie.v.chinchilla@intel.com>

12 years agodebug: Add option to log to Linux tracing
Johannes Berg [Sat, 31 Mar 2012 10:55:33 +0000 (13:55 +0300)]
debug: Add option to log to Linux tracing

Add the option (-T) to wpa_supplicant to log all debug messages into the
kernel tracing, allowing to aggregate kernel debugging with
wpa_supplicant debugging and recording all with trace-cmd.

Since tracing has relatively low overhead and can be filtered
afterwards, record all messages regardless of log level. However, it
will honor the -K option and not record key material by default.

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

12 years agoP2P: Use P2P Device ID attribute if Device Info not available
Jouni Malinen [Fri, 30 Mar 2012 12:50:33 +0000 (15:50 +0300)]
P2P: Use P2P Device ID attribute if Device Info not available

The "BSS p2p_dev_addr=address" command uses p2p_parse_dev_addr() to
figure out the P2P Device Address of the GO from scan results. This used
to work only if the P2P IE was received from Probe Response frames since
only those include the P2P Device Info attribute. Make this work with
Beacon frames, too, by using P2P Device ID attribute if the P2P Device
Info attribute is not present.

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

12 years agoAllow background scan period to be configured
Bala Shanmugam [Fri, 30 Mar 2012 12:20:35 +0000 (15:20 +0300)]
Allow background scan period to be configured

A network block specific background scan period can now be configured
for drivers that implement internal background scan mechanism for
roaming and BSS selection.

Signed-hostap: Bala Shanmugam <bkamatch@qca.qualcomm.com>

12 years agoInterworking: Add realm to the anonymous identity from realm
Jouni Malinen [Fri, 23 Mar 2012 23:16:25 +0000 (16:16 -0700)]
Interworking: Add realm to the anonymous identity from realm

If the username part in the credential does not include a realm,
generate one automatically based on the configured realm information.

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

12 years agoInterworking: Disconnect before trying interworking reconnection
Jouni Malinen [Fri, 23 Mar 2012 23:15:18 +0000 (16:15 -0700)]
Interworking: Disconnect before trying interworking reconnection

Make the connection change on Interworking network selection cases
clearer by forcing the previous association to be dropped before trying
to start a new one.

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

12 years agoClear previous BSSID on explicit disconnection request
Jouni Malinen [Fri, 23 Mar 2012 23:12:07 +0000 (16:12 -0700)]
Clear previous BSSID on explicit disconnection request

There is no need to use reassociation instead of association in a case
the previous connection was explicitly disconnected.

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

12 years agoTDLS: Add support for TDLS frame RX with bridge interfaces
Subrat Dash [Mon, 19 Mar 2012 06:52:10 +0000 (20:52 -1000)]
TDLS: Add support for TDLS frame RX with bridge interfaces

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

12 years agoAdd wps_cancel for hostapd_cli
Anirban Sirkhell [Mon, 19 Mar 2012 06:23:31 +0000 (20:23 -1000)]
Add wps_cancel for hostapd_cli

Implement wps_cancel for hostapd similarly to how it was already
supported in wpa_supplicant AP mode.

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

12 years agoP2P: Add support for preferred channel list
Jouni Malinen [Thu, 29 Mar 2012 18:28:34 +0000 (21:28 +0300)]
P2P: Add support for preferred channel list

p2p_pref_chan configuration parameter can now be used to set the
list of preferred channel for P2P GO Negotiation. This will be used
in the priority order if the peer does not support the channel we
are trying to use as the GO (configured operating channel or the
best 2.4 GHz/5 GHz channel) for the case where a forced channel is
not used.

p2p_pref_chan=<op class:channel>,...

For example:
p2p_pref_chan=81:1,81:2,81:3,81:4,81:5,81:6

This would configure 2.4 GHz channels 1-6 as the preferred ones with
channel 1 the most preferred option.

These configuration parameters can be set in wpa_supplicant.conf and
dynamically updated with "wpa_cli set <param> <value>".

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

12 years agoStop sched_scan if requested to run full scan
Jouni Malinen [Thu, 29 Mar 2012 18:05:56 +0000 (21:05 +0300)]
Stop sched_scan if requested to run full scan

This allows the ctrl_iface SCAN command to be used to run through a scan
to collect full scan results when sched_scan is in progress. sched_scan
will be re-started automatically after the full scan.

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

12 years agoFix eapol_test build without CONFIG_PCSC=y
Jouni Malinen [Thu, 29 Mar 2012 17:44:36 +0000 (20:44 +0300)]
Fix eapol_test build without CONFIG_PCSC=y

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

12 years agonl80211: Make use of driver's capability to detect inactive stations
Vasanthakumar Thiagarajan [Tue, 27 Mar 2012 17:45:23 +0000 (20:45 +0300)]
nl80211: Make use of driver's capability to detect inactive stations

When drivers advertise their capability to free up inactive
stations based on ap_max_inactivity, send the inactivity period
timeout to driver in NL80211_ATTR_INACTIVITY_TIMEOUT. This
introduces a WPA_DRIVER_FLAGS (WPA_DRIVER_FLAGS_INACTIVITY_TIMER)
so that the inactivity period will be sent only when this capability
bit is set.

Signed-hostap: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>

12 years agowpa_supplicant: Add provision to configure inactivity period in AP mode
Vasanthakumar Thiagarajan [Tue, 27 Mar 2012 17:41:27 +0000 (20:41 +0300)]
wpa_supplicant: Add provision to configure inactivity period in AP mode

This patch adds a configuration in network block, ap_max_inactivity, for
station's inactivity period when in AP mode. The time period is
configured in seconds, by default 300 seconds.

Signed-hostap: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>

12 years agoSync with include/linux/nl80211.h from wireless-testing.git
Jouni Malinen [Tue, 27 Mar 2012 17:38:33 +0000 (20:38 +0300)]
Sync with include/linux/nl80211.h from wireless-testing.git

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

12 years agoP2P: Do not use group idle timeout during provisioning
Jouni Malinen [Tue, 27 Mar 2012 15:04:06 +0000 (18:04 +0300)]
P2P: Do not use group idle timeout during provisioning

Use the normal group formation timeout during the provisioning phase to
avoid terminating this process too early due to group idle timeout.

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

12 years agoP2P: Validate p2p_oper_channel in p2p_group_add
Jouni Malinen [Mon, 26 Mar 2012 19:06:48 +0000 (22:06 +0300)]
P2P: Validate p2p_oper_channel in p2p_group_add

If the p2p_group_add command does not specify the operating channel,
make sure the operating channel set in the configuration file meets
the P2P requirements in the same way as is done with the frequency
specified as the command parameter.

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

12 years agowlantest: Update STA info based on WPA/RSN IE in EAPOL-Key 2/4
Jouni Malinen [Wed, 21 Mar 2012 23:19:00 +0000 (16:19 -0700)]
wlantest: Update STA info based on WPA/RSN IE in EAPOL-Key 2/4

The WPA/RSN IE in EAPOL-Key 2/4 is more reliable than the one in
(Re)Association Request frame. Update the STA info base don the
EAPOL-Key frame so that the correct cipher information is used
even if the (Re)Association Request frame is missing or corrupted
in the capture.

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

12 years agonl80211: Fix deauth/disassoc for AP mode SME-in-driver case
Aarthi Thiruvengadam [Thu, 15 Mar 2012 00:06:06 +0000 (14:06 -1000)]
nl80211: Fix deauth/disassoc for AP mode SME-in-driver case

When the driver (or firmware) implements AP mode SME, the use of raw
management frame TX functions is not working properly at the moment. As
an initial step, convert these AP mode operations to use
NL80211_CMD_DEL_STATION and do not claim that driver provides TX status
for deauth/disassoc frames. While this does not address all use cases
(e.g., reason code is not specified in the command), this fixes number
of issues where the station does not get disconnected properly.

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

12 years agodbus: Make P2P group properties accessible individually
Todd Previte [Mon, 5 Mar 2012 15:25:08 +0000 (17:25 +0200)]
dbus: Make P2P group properties accessible individually

Group properties are now accessible individually. The function to retrieve
the dictionary containing the group properties is removed in favor of the
individual functions. The group member properties are removed as well as
they erroneously retrieved the group properties via the old function.

Signed-hostap: Todd Previte <toddx.a.previte@intel.com>
Signed-hostap: Angie Chinchilla <angie.v.chinchilla@intel.com>
intended-for: hostap-1

12 years agoWPS: Select the BSD license terms as the only license alternative
Masashi Honma [Mon, 5 Mar 2012 15:15:47 +0000 (17:15 +0200)]
WPS: Select the BSD license terms as the only license alternative

I changed license terms which I can change.
(email of Mon, 5 Mar 2012 22:59:02 +0900 to hostap@lists.shmoo.com)

12 years agoBSS: Fix use-after-realloc
Eliad Peller [Mon, 5 Mar 2012 15:09:55 +0000 (17:09 +0200)]
BSS: Fix use-after-realloc

After reallocation of the bss struct, current_bss wasn't updated and
could hold an invalid pointer (which might get dereferenced later).

Update current_bss if the pointer was changed.

Signed-hostap: Eliad Peller <eliad@wizery.com>
intended-for: hostap-1

12 years agoTTLS: Fix peer challenge generation for TTLS/MSCHAPv2
Jouni Malinen [Mon, 5 Mar 2012 14:59:03 +0000 (16:59 +0200)]
TTLS: Fix peer challenge generation for TTLS/MSCHAPv2

Commit 30680e9332c96803533b9dae6105fd7b15b5bb52 changed the length
of the implicit challenge result to match with the exact length used
in TTLS. However, it failed to update the peer_challenge generation
to use a separate random value. Previously, this was generated as
part of the implicit challenge, but more correct way would have been
to generate a random value for it separately. Do this now to fix the
read after the allocated buffer (16 bytes after the implicit
challenge).

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

12 years agoAP: remove ssi_signal from ap_info
Johannes Berg [Mon, 5 Mar 2012 14:38:26 +0000 (16:38 +0200)]
AP: remove ssi_signal from ap_info

It is never used.

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

12 years agoP2P: Filter input parameters in p2p_serv_disc_external
Grzegorz Bajorski [Mon, 5 Mar 2012 14:26:19 +0000 (16:26 +0200)]
P2P: Filter input parameters in p2p_serv_disc_external

p2p_ctrl_serv_disc_external() can take only one parameters "0" or "1".

Signed-hostap: Grzegorz Bajorski <grzegorz.bajorski@tieto.com>

12 years agoFilter station mode EAPOL RX on bridge interface based on destination
Jouni Malinen [Mon, 5 Mar 2012 13:22:42 +0000 (15:22 +0200)]
Filter station mode EAPOL RX on bridge interface based on destination

If multiple station mode radios are bridged together on the same device,
it is possible for wpa_supplicant to receive EAPOL frames from the
bridge interface and then process them separately for each interface.
This can results in problems since multiple instances of supplicant side
could end up trying to process a single 4-way handshake. Avoid this
problem by filtering bridge interface EAPOL RX based on the desctination
MAC address. It should be noted that this works only when unicast
addresses are used (e.g., with WLAN) and not with the IEEE 802.1X EAPOL
group address (e.g., most wired networks).

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

12 years agoFix memory leak on parsing multiple network block eap entries
Jouni Malinen [Sun, 4 Mar 2012 14:13:00 +0000 (16:13 +0200)]
Fix memory leak on parsing multiple network block eap entries

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

12 years agoInterworking: Use EAP-AKA if USIM is used
Jouni Malinen [Sun, 4 Mar 2012 14:11:02 +0000 (16:11 +0200)]
Interworking: Use EAP-AKA if USIM is used

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

12 years agoInterworking: Support real SIM/USIM card for network selection
Jouni Malinen [Sun, 4 Mar 2012 14:02:56 +0000 (16:02 +0200)]
Interworking: Support real SIM/USIM card for network selection

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

12 years agoInterworking: Make plmn_id_match() for generic
Jouni Malinen [Sun, 4 Mar 2012 09:27:38 +0000 (11:27 +0200)]
Interworking: Make plmn_id_match() for generic

Use separate mnc_len parameter instead of expecting the imsi parameter
to be in special MCC|MNC|-|<MSIN> format to make this function more
generic.

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

12 years agoInterworking: Fix credential block example
Jouni Malinen [Sun, 4 Mar 2012 09:24:24 +0000 (11:24 +0200)]
Interworking: Fix credential block example

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

12 years agoSCARD: Increase application template DO buffer size
Jouni Malinen [Sat, 3 Mar 2012 16:15:23 +0000 (18:15 +0200)]
SCARD: Increase application template DO buffer size

This DO has a maximum length of 127 bytes (TS 102 221), so better use
large enough buffer when reading the record.

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

12 years agoSCARD: Move SIM file definitions into the C file
Jouni Malinen [Sat, 3 Mar 2012 16:10:37 +0000 (18:10 +0200)]
SCARD: Move SIM file definitions into the C file

These are used only within pcsc_funcs.c so no need to define the
file identifiers in the header file.

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

12 years agoSCARD: Add function for fetching PIN retry counter
Jouni Malinen [Sat, 3 Mar 2012 11:51:34 +0000 (13:51 +0200)]
SCARD: Add function for fetching PIN retry counter

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

12 years agoSCARD: Add debug dumps of FCP template TLVs in SELECT response
Jouni Malinen [Sat, 3 Mar 2012 11:28:46 +0000 (13:28 +0200)]
SCARD: Add debug dumps of FCP template TLVs in SELECT response

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

12 years agoSCARD: Reindent scard_parse_fsp_templ()
Jouni Malinen [Sat, 3 Mar 2012 10:35:14 +0000 (12:35 +0200)]
SCARD: Reindent scard_parse_fsp_templ()

This was left at incorrect indentation level when moved to a separate
function.

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

12 years agoInterworking: Update configuration file documentation for credentials
Jouni Malinen [Sat, 3 Mar 2012 08:49:02 +0000 (10:49 +0200)]
Interworking: Update configuration file documentation for credentials

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

12 years agoInterworking: Add support for certificate credentials (EAP-TLS)
Jouni Malinen [Wed, 29 Feb 2012 14:40:17 +0000 (16:40 +0200)]
Interworking: Add support for certificate credentials (EAP-TLS)

This allows Interworking network selection to be used with EAP-TLS
(client certificate/private key based credential).

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

12 years agoP2P: Fix provisioning info clearing after successful WPS step
Jouni Malinen [Thu, 1 Mar 2012 20:06:03 +0000 (22:06 +0200)]
P2P: Fix provisioning info clearing after successful WPS step

Previously, this provisioning info was cleared using the P2P Interface
Address of the GO as the key. That did not always work in the case the
where we joined an already running group. This could result in the next
connection to that same GO skipping provision discovery. Fix this by
finding the peer entry based on its P2P Device Address instead of the
P2P Interface Address which may not always be set.

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

12 years agoFix P2P-SERV-DISC-{REQ,RESP} documentation
Jouni Malinen [Thu, 1 Mar 2012 17:55:46 +0000 (19:55 +0200)]
Fix P2P-SERV-DISC-{REQ,RESP} documentation

The Service Update Indicator parameter was missing from documentation.

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

12 years agoFix processing of channel list update events
Jouni Malinen [Thu, 1 Mar 2012 15:53:53 +0000 (17:53 +0200)]
Fix processing of channel list update events

Commit 6bf731e8cea4d9d41665d271b331e096c7c569e9 broke handling of
EVENT_CHANNEL_LIST_CHANGED by introducing a cached copy of the driver
channel list that does not get updated even if driver changes its list.
Fix this by synchronizing the cacched wpa_s->hw.modes information
whenever EVENT_CHANNEL_LIST_CHANGED is processed. This fixes P2P channel
list updates based on regulatory domain hints that may trigger driver to
change its supported channel list.

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

12 years agoFix CTRL-EVENT-DISCONNECTED event for locally generated disconnection
Jouni Malinen [Thu, 1 Mar 2012 13:42:35 +0000 (15:42 +0200)]
Fix CTRL-EVENT-DISCONNECTED event for locally generated disconnection

When wpa_supplicant disconnects, e.g., due to authentication timeout,
we need to go through the EVENT_DISASSOC/DEAUTH processing similarly
to the driver triggered cases to get correct events delivered to the
ctrl_iface. Fix this by calling wpa_supplicant_event() in these cases
and by filtering out the confusing CTRL-EVENT-DISCONNECTED event with
all zeros BSSID.

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

12 years agoP2P: Fix p2p_cancel to return success if GO Negotiation is stopped
Jouni Malinen [Wed, 29 Feb 2012 23:16:06 +0000 (01:16 +0200)]
P2P: Fix p2p_cancel to return success if GO Negotiation is stopped

If a GO Negotiation peer is found, wpas_p2p_stop_find() stops the
negotiation and p2p_cancel can return success.

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

12 years agoWPS: Invalidate wildcard PIN on other radios after successful use
Jouni Malinen [Wed, 29 Feb 2012 18:42:48 +0000 (20:42 +0200)]
WPS: Invalidate wildcard PIN on other radios after successful use

If a wildcard PIN is used on any of the radios that hostapd is
controlling, invalidate the matching PIN on all the other radios
to avoid multiple uses of the same PIN.

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

12 years agoP2P: Use scan optimization for post-provisioning connection
Jouni Malinen [Tue, 28 Feb 2012 22:34:53 +0000 (00:34 +0200)]
P2P: Use scan optimization for post-provisioning connection

Since P2P GO cannot change the SSID after WPS provisioning step, we
can use the specific SSID for the scan for data connection. In addition,
mark this as p2p_probe to avoid unnecessary use of 802.11b rates.

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

12 years agoP2P: Optimize provisioning step scan for join-a-group sequence
Jouni Malinen [Tue, 28 Feb 2012 22:22:58 +0000 (00:22 +0200)]
P2P: Optimize provisioning step scan for join-a-group sequence

Copy the SSID and frequency of the selected group into go_params in
join-a-running-group case so that the scan optimization can be used for
the provisioning step similarly to the case of group formation. This
uses a specific SSID and a single channel scan to avoid unnecessary
frames during the step.

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

12 years agoP2P: Use specific SSID in scan for provisioning step
Jouni Malinen [Tue, 28 Feb 2012 22:02:34 +0000 (00:02 +0200)]
P2P: Use specific SSID in scan for provisioning step

Since the P2P client learns the SSID of the group during GO Negotiation,
use the specific SSID in the Probe Request frames during the
provisioning step. This helps in avoiding unnecessary Probe Response
frames from other P2P GOs or APs.

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

12 years agoP2P: Advertise immediate availability of WPS credential
Jouni Malinen [Mon, 27 Feb 2012 21:14:35 +0000 (23:14 +0200)]
P2P: Advertise immediate availability of WPS credential

Use Device Password ID in WSC IE of Probe Request and Probe Response
frames to advertise immediate availability of WPS credentials per P2P
specification sections 3.1.2.1.1 (Listen State), 3.1.2.1.2 (Scan Phase),
and 3.1.2.1.3 (Find Phase).

For now, the Device Password ID is set only for the case where we are
active GO Negotiation with a specific peer. In practice, this means that
the Probe Response frames during pending GO Negotiation (whenever in
Listen state) indicate availability of the credential.

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

12 years agoP2P: Make p2p_flush stop P2P operations consistently
Jouni Malinen [Mon, 27 Feb 2012 17:10:04 +0000 (19:10 +0200)]
P2P: Make p2p_flush stop P2P operations consistently

p2p_flush did not explicit stop all P2P operations, i.e., the exact
behavior depended on the P2P module state at the time the p2p_flush
command was issued. Make this more consistent by explicitly calling
p2p_stop_find() from p2p_flush().

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

12 years agoP2P: Fix remain-on-channel use with PD/Invitation Request while in Listen
Jouni Malinen [Mon, 27 Feb 2012 15:23:41 +0000 (17:23 +0200)]
P2P: Fix remain-on-channel use with PD/Invitation Request while in Listen

If Listen state was in progress on another channel when a request to
send an Action frame (e.g., Provision Discovery Request or Invitation
Request to a peer on the peer's Listen channel that is different from
our Listenc hannel) is issued, wpa_supplicant tried to use concurrent
remain-on-channel operations. While some drivers can handle this
cleanly, there are drivers that don't and wpa_supplicant is not expected
to request concurrent remain-on-channel operations.

Fix this by cancelling the ongoing remain-on-channel with stop_listen
prior to sending the Action frame on another channel. If a P2P search
was in progress, it will be continued after the timeout on the new
operation.

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

12 years agoAdd support for hidden SSID in wpa_supplicant AP mode
Vivek Natarajan [Mon, 27 Feb 2012 14:28:45 +0000 (16:28 +0200)]
Add support for hidden SSID in wpa_supplicant AP mode

This also disables WPS support if hidden SSID is enabled in AP mode.

Signed-off-by: Vivek Natarajan <nataraja@qca.qualcomm.com>
Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>

12 years agoFix CONFIG_AP + CONFIG_INTERWORKING build
Jouni Malinen [Mon, 27 Feb 2012 14:21:50 +0000 (16:21 +0200)]
Fix CONFIG_AP + CONFIG_INTERWORKING build

Need to include gas_serv.o in the build to get all the needed symbols.

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

12 years agoGAS server: Add support for ANQP Venue Name element
Jouni Malinen [Sun, 26 Feb 2012 20:34:21 +0000 (22:34 +0200)]
GAS server: Add support for ANQP Venue Name element

The new venue_name configuration parameter can now be used to configure
the ANQP Venue Name values that stations can request through GAS.

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

12 years agoGAS server: Add support for ANQP Roaming Consortium list
Jouni Malinen [Sun, 26 Feb 2012 20:34:19 +0000 (22:34 +0200)]
GAS server: Add support for ANQP Roaming Consortium list

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

12 years agoInterworking: Add GAS server support for AP mode
Jay Katabathuni [Sun, 26 Feb 2012 20:34:19 +0000 (22:34 +0200)]
Interworking: Add GAS server support for AP mode

This adds GAS/ANQP implementation into hostapd. This commit brings in
the basic GAS/ANQP functionality, but only the ANQP Capability List
element is supported.

For testing purposes, hostapd control interface SET command can be used
to set the gas_frag_limit parameter dynamically.

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

12 years agoAdd hostapd_drv_send_action()
Jay Katabathuni [Sun, 26 Feb 2012 18:52:31 +0000 (20:52 +0200)]
Add hostapd_drv_send_action()

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

12 years agopcsc: Allow T1 protocol to be enabled
Jouni Malinen [Sun, 26 Feb 2012 11:14:46 +0000 (13:14 +0200)]
pcsc: Allow T1 protocol to be enabled

The previous implementation was hardcoding only T0 protocol to be
acceptable. Allow T1 to be selected, too.

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

12 years agoAllow PC/SC reader to be selected and initialized at start
Jouni Malinen [Sun, 26 Feb 2012 11:07:05 +0000 (13:07 +0200)]
Allow PC/SC reader to be selected and initialized at start

New global configuration parameters pcsc_reader and pcsc_pin can now be
used to initialize PC/SC reader context at start of wpa_supplicant.

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

12 years agoGenerate random ANonce instead of one based on Counter
Jouni Malinen [Sun, 26 Feb 2012 10:06:36 +0000 (12:06 +0200)]
Generate random ANonce instead of one based on Counter

Definition of ANonce selection in IEEE Std 802.11i-2004 is somewhat
ambiguous. The Authenticator state machine uses a counter that is
incremented by one for each 4-way handshake. However, the security
analysis of 4-way handshake points out that unpredictable nonces help in
preventing precomputation attacks. Instead of the state machine
definition, use an unpredictable nonce value here to provide stronger
protection against potential precomputation attacks.

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

12 years agoAndroid: Build wpa_supplicant.conf from a template
Dmitry Shmidt [Wed, 1 Jun 2011 21:59:18 +0000 (14:59 -0700)]
Android: Build wpa_supplicant.conf from a template

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
12 years agoAndroid: Add PLATFORM_VERSION to VERSION_STR_POSTFIX definition
Dmitry Shmidt [Sat, 25 Feb 2012 15:35:44 +0000 (17:35 +0200)]
Android: Add PLATFORM_VERSION to VERSION_STR_POSTFIX definition

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
12 years agoAndroid: Add build configuration files
Dmitry Shmidt [Tue, 15 Nov 2011 14:02:30 +0000 (16:02 +0200)]
Android: Add build configuration files

These are from Android wpa_supplicant_8.git initial 0.8.X commit
8d520ff1dc2da35cdca849e982051b86468016d8 with some additional edits and
renaming of .config files to android.config.

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
12 years agoAdd CONFIG_NO_ROAMING option
Dmitry Shmidt [Tue, 16 Aug 2011 18:55:46 +0000 (11:55 -0700)]
Add CONFIG_NO_ROAMING option

This can be used to disable wpa_supplicant controlled roaming. It should
be noted that the WPA_DRIVER_FLAGS_BSS_SELECTION capability is the
preferred way for this and CONFIG_NO_ROAMING should be obsoleted once
drivers support the new NL80211_ATTR_ROAM_SUPPORT capability
advertisement.

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
12 years agoAdd wpa_supplicant AP mode STA deauthenticate/disassociate commands
Jithu Jance [Sat, 25 Feb 2012 15:22:48 +0000 (17:22 +0200)]
Add wpa_supplicant AP mode STA deauthenticate/disassociate commands

Move disassociate and deauthenticate commands to ctrl_iface_ap.c, so
that they ares accessible for wpa_supplicant AP mode and wpa_cli (with
CONFIG_AP option enabled).

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

12 years agodbus: return NULL data for peer IEs
Reinette Chatre [Sat, 25 Feb 2012 08:54:11 +0000 (10:54 +0200)]
dbus: return NULL data for peer IEs

The org.freedesktop.DBus.Properties interface is now supported for peer
properties. Ensure that GetAll will work by having the IEs property
function return NULL data instead of a failure until it is implemented.

Signed-hostap: Reinette Chatre <reinette.chatre@intel.com>
intended-for: hostap-1

12 years agodbus: revert changes to some peer properties
Reinette Chatre [Sat, 25 Feb 2012 08:50:13 +0000 (10:50 +0200)]
dbus: revert changes to some peer properties

Commit 3f6e50ac282bbcb4be137023316543bd232ba350 made it possible to access
P2P peer properties using the org.freedesktop.DBus.Properties interface.

While maintaining the original intent of that patch we make two changes
to it here:

First, 3f6e50ac282bbcb4be137023316543bd232ba350 changed the type used to
represent the WPS vendor extension data from bytes to a string. In
addition to the type change the way in which the vendor extension data
was provided to the function creating the string was incorrect and would
not present the correct vendor extension data even in string format.

Revert the type change made in 3f6e50ac282bbcb4be137023316543bd232ba350
and present the WPS vendor extension data as an array of an array of
bytes as it was before.

Second, 3f6e50ac282bbcb4be137023316543bd232ba350 changes the secondary
device types representation from an array of an array of bytes to an
array of bytes. Revert that change to make secondary device types
accessible via an array of an array of bytes again.

Signed-hostap: Reinette Chatre <reinette.chatre@intel.com>
intended-for: hostap-1

12 years agodbus: utility to create dbus message from wpabuf array
Jayant Sane [Sat, 25 Feb 2012 08:45:17 +0000 (10:45 +0200)]
dbus: utility to create dbus message from wpabuf array

If a wpabuf array is used to store basic typed data that we would like
to send over D-Bus then this utility will be of help when it places the
data in a variant with format aa? (array of an array of type ?, with ?
indicating any basic type).

Signed-hostap: Jayant Sane <jayant.sane@intel.com>
Signed-hostap: Angie Chinchilla <angie.v.chinchilla@intel.com>
intended-for: hostap-1

12 years agoP2P: Add more debug on group idle timeout
Jouni Malinen [Sun, 19 Feb 2012 16:16:34 +0000 (18:16 +0200)]
P2P: Add more debug on group idle timeout

This makes it easier to debug issues with P2P group idle timeout.

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

12 years agoP2P: Fix group idle timer cancellation on group removal
Jouni Malinen [Sun, 19 Feb 2012 16:10:20 +0000 (18:10 +0200)]
P2P: Fix group idle timer cancellation on group removal

The wpas_p2p_group_idle_timeout was getting cancelled in the beginning
of wpas_p2p_group_delete(). However, in the case of P2P client role,
this function called wpa_supplicant_deauthenticate() next and that ended
up changing state to WPA_DISCONNECTED which resulted in
wpas_p2p_notif_disconnected() rescheduling the timeout. This left the
unexpected timeout behind after the group was removed. If another group
operation was started within P2P_MAX_CLIENT_IDLE (10) seconds, that
timeout could end up terminating the group while it was still being set
up.

Fix this by reordering wpas_p2p_group_delete() to cancel the group idle
timeout only after having called wpa_supplicant_deauthenticate(). The
group idle timeout is still rescheduled, but it gets removed immediately
afterwards when the actual group information is being cleared.

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

12 years agoClean up array insertion to skip unnecessary memmove
Jouni Malinen [Sun, 19 Feb 2012 14:44:30 +0000 (16:44 +0200)]
Clean up array insertion to skip unnecessary memmove

The previous elements need to be moved only if we are inserting the new
network in the middle of the list. While the memmove of zero bytes at
the end of the array does not cause real problems, some static analyzers
complain about this, so in addition to slightly optimized
implementation, this removes some analyzer warnings, too.

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

12 years agoFix memory leak on set_cred error path
Jouni Malinen [Sun, 19 Feb 2012 12:29:38 +0000 (14:29 +0200)]
Fix memory leak on set_cred error path

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

12 years agoFix memory leak on error path in bssid_filter setting
Jouni Malinen [Sun, 19 Feb 2012 12:28:02 +0000 (14:28 +0200)]
Fix memory leak on error path in bssid_filter setting

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

12 years agoInterworking: Fix SIM/USIM NAI construction
Jouni Malinen [Sun, 19 Feb 2012 12:24:45 +0000 (14:24 +0200)]
Interworking: Fix SIM/USIM NAI construction

Commit 9914c96febff964374a863bbd6986ade13a2215a moved sizeof(nai) to a
helper function and broke the determination of maximum buffer length.
Fix this by moving the sizeof() to the functions that define the buffer.

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

12 years agoWPS UPnP: Clean up URL parser
Jouni Malinen [Sun, 19 Feb 2012 11:19:34 +0000 (13:19 +0200)]
WPS UPnP: Clean up URL parser

Remove unnecessary second copy of the URL and too long memory
allocation. In addition, avoid use of strcpy() to keep static analyzers
happier.

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

12 years agoAndroid: Extend debug logging to include wpa_dbg and hexdump
Jouni Malinen [Sat, 18 Feb 2012 18:57:22 +0000 (20:57 +0200)]
Android: Extend debug logging to include wpa_dbg and hexdump

This makes the Android debug logs from logcat quite a bit more helpful
in debugging wpa_supplicant.

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

12 years agowext: Filter unexpected interface added/up events
Jouni Malinen [Sat, 18 Feb 2012 11:28:21 +0000 (13:28 +0200)]
wext: Filter unexpected interface added/up events

It looks like a RTM_NEWLINK event claiming the interface to be UP is
delivered just before removing an interface after having first indicated
that the interface was going down/removed. Ignore this event if the
interface is not present anymore at the moment the event is processed.
This fixes issues where an interface that was re-added after being
removed did not get reconfigured properly.

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

12 years agoUse WPA_INTERFACE_DISABLED with interface removed events
Jouni Malinen [Sat, 18 Feb 2012 11:16:17 +0000 (13:16 +0200)]
Use WPA_INTERFACE_DISABLED with interface removed events

This makes WPA_INTERFACE_DISABLED more consistent in indicating that
wpa_supplicant cannot currently control the interface regardless of
whether the interface is disabled or completely removed.

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

12 years agonl80211: Filter unexpected interface added/up events
Jouni Malinen [Sat, 18 Feb 2012 11:13:23 +0000 (13:13 +0200)]
nl80211: Filter unexpected interface added/up events

It looks like a RTM_NEWLINK event claiming the interface to be UP is
delivered just before removing an interface after having first indicated
that the interface was going down/removed. Ignore this event if the
interface is not present anymore at the moment the event is processed.
This fixes issues where an interface that was re-added after being
removed did not get reconfigured properly.

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

12 years agonl80211: Indicate p2p_probe in debug log as scan parameter
Jouni Malinen [Sat, 18 Feb 2012 10:39:01 +0000 (12:39 +0200)]
nl80211: Indicate p2p_probe in debug log as scan parameter

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

12 years agoP2P: Allow channels to be removed from P2P use
Jouni Malinen [Fri, 17 Feb 2012 20:57:13 +0000 (22:57 +0200)]
P2P: Allow channels to be removed from P2P use

A list of disallowed frequencies for P2P channel list can now be
configured with P2P_SET disallow_freq. The frequencies (or frequency
pairs) are comma separated. For example:
wpa_cli p2p_set disallow_freq 2462,5000-6000

The allowed P2P channel list is constructed by removing explicitly
disallowed channels from the channel list received from the driver.

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

12 years agoP2P: Do not include P2P IE in association request to non-P2P AP
Jouni Malinen [Fri, 17 Feb 2012 09:34:56 +0000 (11:34 +0200)]
P2P: Do not include P2P IE in association request to non-P2P AP

This was previously fixed for most cases in commit
ffad8858370e297b22ff5d9e6e36372755364ec0, but the check here for
drivers that implement SME/MLME was missed in that commit.

This removes the P2P IE from (Re)Association Request frame with
drivers that do not use wpa_supplicant SME implementation and are
P2P cabable when associating with a non-P2P AP (i.e., not a GO or
P2P WLAN manager AP).

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

12 years agoEAP-SIM/AKA server: Fix re-authentication not to update pseudonym
Jouni Malinen [Thu, 16 Feb 2012 21:27:01 +0000 (23:27 +0200)]
EAP-SIM/AKA server: Fix re-authentication not to update pseudonym

AT_NEXT_PSEUDONYM is supposed to be included only in the Challenge
messages, not in the Re-authentication messages. This attribute was
incorrectly included in the Re-authentication messages and could have
been used to update the pseudonym state on the server without the peer
updating its state.

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

12 years agoEAP-AKA peer: Clean up forgetting-id debug prints
Jouni Malinen [Thu, 16 Feb 2012 21:25:53 +0000 (23:25 +0200)]
EAP-AKA peer: Clean up forgetting-id debug prints

Do not show forgetting of old id values if no value was stored.

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

12 years agohostapd: Allow 'none' driver to be started without ifname
Jouni Malinen [Thu, 16 Feb 2012 21:11:29 +0000 (23:11 +0200)]
hostapd: Allow 'none' driver to be started without ifname

Commit 0dcc4dc4b31d48ed32940b9adb0b9fcdcab32dc3 made driver
initialization conditional on interface name being configured. This can
break hostapd-as-RADIUS-server use case where this parameter does not
really make any sense. Fix this with a special case for the none driver.

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

12 years agoatheros: Add new IEEE 802.11r driver_ops
Shan Palanisamy [Thu, 16 Feb 2012 17:57:33 +0000 (19:57 +0200)]
atheros: Add new IEEE 802.11r driver_ops

Add support to send Action frames to the driver.
Add support for TSPEC req and adding STA node to the driver.

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

12 years agoClear WEP configuration on interface deinit
Shan Palanisamy [Thu, 16 Feb 2012 17:48:48 +0000 (19:48 +0200)]
Clear WEP configuration on interface deinit

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