mech_eap.git
12 years agoP2P: Remove unused variable
Masashi Honma [Sat, 21 Apr 2012 15:21:30 +0000 (18:21 +0300)]
P2P: Remove unused variable

The "type" variable is not used in wpas_p2p_deinit_global().
So this patch removes it.

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

12 years agoSync with include/linux/nl80211.h from wireless-testing.git
Jouni Malinen [Thu, 19 Apr 2012 17:41:42 +0000 (20:41 +0300)]
Sync with include/linux/nl80211.h from wireless-testing.git

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

12 years agoP2P: Add provision discovery failure event
Deepthi Gowri [Tue, 17 Apr 2012 16:44:13 +0000 (19:44 +0300)]
P2P: Add provision discovery failure event

Add provisional discovery failure ctrl_iface event
(P2P-PROV-DISC-FAILURE) to indicate to the application layer in case of
PD failure.

Signed-off-by: Deepthi Gowri <deepthi@codeaurora.org>
12 years agoFix sched_scan for max-num-of-scan_ssid=1 networks
Jouni Malinen [Tue, 17 Apr 2012 13:51:09 +0000 (16:51 +0300)]
Fix sched_scan for max-num-of-scan_ssid=1 networks

When the network configuration includes exactly the number of
scan_ssid=1 networks as the driver supports for scan_sched and no
networks need wildcard SSID scan, there is no need to use sched_scan
timeout. Check this condition and optimize this case to avoid the extra
sched_scan start/stop operations.

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

12 years agoFix sched_scan debug print regarding timeout
Jouni Malinen [Tue, 17 Apr 2012 13:32:40 +0000 (16:32 +0300)]
Fix sched_scan debug print regarding timeout

The debug messages were showing the opposite of what the actual
implementation was doing for sched_scan timeout.

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

12 years agoAdd disable_scan_offload parameter to disable automatic scan offloading
Jouni Malinen [Tue, 17 Apr 2012 13:30:15 +0000 (16:30 +0300)]
Add disable_scan_offload parameter to disable automatic scan offloading

This new configuration parameter can be used to disable automatic
offloading of scan requests to the driver which was previously used
by default if the driver supported sched_scan.

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

12 years agoP2P: Fix disallowing of pending listen command to override connect
Jouni Malinen [Mon, 16 Apr 2012 15:51:33 +0000 (18:51 +0300)]
P2P: Fix disallowing of pending listen command to override connect

Commit d9bdba9f867577ed9da6df9c5c933033c71bcdf2 was supposed to allow
p2p_listen to schedule new after scan operation only if a p2p_connect
operation was not pending. However, it used incorrect P2P_AFTER_SCAN_
value for this and did not actually prevent overriding of p2p_connect
and could have caused some p2p_listen operations to be skipped
unnecessarily.

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

12 years agoP2P: Allow wildcard service discovery from DBus API
Adrien Bustany [Sat, 14 Apr 2012 18:06:16 +0000 (21:06 +0300)]
P2P: Allow wildcard service discovery from DBus API

Using the socket command interface, it is possible to pass a NULL dst to
wpas_p2p_sd_request, however you could not do so using the D-Bus API,
since it required a valid Peer object path. This patch changes the
behavior, so that if the "peer_object" is missing from the parameters,
a NULL dst is passed to wpas_p2p_sd_request.

Signed-hostap: Adrien Bustany <adrien.bustany@nokia.com>
intended-for: hostap-1

12 years agoP2P: Cleanup P2PDevice D-Bus interface for hostap-1 release
Nirav Shah [Sat, 14 Apr 2012 17:52:59 +0000 (20:52 +0300)]
P2P: Cleanup P2PDevice D-Bus interface for hostap-1 release

This patch cleans up the P2PDevice D-Bus interface for the hostap-1
release. A spelling error is corrected and P2PDeviceProperties is
renamed to clarify that this data is configuration data and not the
total collection of Properties for the P2PDevice interface.

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

12 years agoP2P: Fix D-Bus property getters to default to "/" for Group, PeerGO
Nirav Shah [Sat, 14 Apr 2012 17:48:26 +0000 (20:48 +0300)]
P2P: Fix D-Bus property getters to default to "/" for Group, PeerGO

The D-Bus property getters should not return an error when the
properties are not valid/relevant. Returning an error breaks the
GetAll method in the dbus interface. Change Group and PeerGO
property getters to make GetAll work on P2PDevice.

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

12 years agowpa_supplicant: Use bss_id list for 'bss FIRST' command
Dmitry Shmidt [Sat, 14 Apr 2012 17:39:10 +0000 (20:39 +0300)]
wpa_supplicant: Use bss_id list for 'bss FIRST' command

Command 'bss FISRT' should use bss_id list, because 'bss NEXT-N' is using
bss_id list as well.

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
12 years agoP2P: Allow immediate group idle timeout configuration
Jouni Malinen [Fri, 13 Apr 2012 14:03:27 +0000 (17:03 +0300)]
P2P: Allow immediate group idle timeout configuration

A special value p2p_group_idle=-1 can now be used to configure the P2P
group idle mechanism to terminate a P2P client group immediately on any
disconnection after the completion of the initial 4-way handshake.

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

12 years agoP2P: Extend use of group formation timeout until end of 4-way handshake
Jouni Malinen [Fri, 13 Apr 2012 14:01:15 +0000 (17:01 +0300)]
P2P: Extend use of group formation timeout until end of 4-way handshake

Instead of relying on the P2P group idle timeout before the group
connection has been fully established, re-start the group formation
timeout in the end of the WPS provisioning step and clear it at the
successful completion of the initial 4-way handshake. This allows the
P2P group idle timeout to be set to a small value without triggering it
during the initial scan and connection attempt.

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

12 years agoP2P: Fix p2p_connect join scan handler in error cases
Jouni Malinen [Fri, 13 Apr 2012 13:13:14 +0000 (16:13 +0300)]
P2P: Fix p2p_connect join scan handler in error cases

wpa_drv_scan() may fail for the initial p2p_connect join scan request,
e.g., if the driver happened to be scanning at the time the new
operation was initialized. Previously, a special scan result handler was
registered regardless of whether the new scan was started. This could
result in partial scan results (e.g., from p2p_find social scan) from
being used as full results for join (or now more importantly for
p2p_connect auto) purposes. Fix this by registering the new scan result
handler only if wpa_drv_scan() returns success.

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

12 years agoP2P: Add automatic GO Negotiation vs. join-a-group selection
Jouni Malinen [Fri, 13 Apr 2012 13:04:36 +0000 (16:04 +0300)]
P2P: Add automatic GO Negotiation vs. join-a-group selection

p2p_connect command can now be used with an optional "auto" parameter
to request wpa_supplicant to determine automatically whether to use
join-a-group operation (if the peer is operating as a GO) or group
formation. This makes it easier for external programs to handle
connection type selection by offloading this to wpa_supplicant. The
previously used p2p_connect join commands can be replaced with
p2p_connect auto to use this new mechanism.

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

12 years agoP2P: Clear P2P_DEV_SD_INFO when new wildcard SD query is added
Jouni Malinen [Wed, 11 Apr 2012 14:51:19 +0000 (17:51 +0300)]
P2P: Clear P2P_DEV_SD_INFO when new wildcard SD query is added

Unlike the unicast SD queries, the queries directed to all peers depend
on P2P_DEV_SD_INFO flag being cleared to allow the query to be sent to
a peer that has previously replied to any SD query.

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

12 years agoAllow disable_ht to override 11n configuration in AP mode
Vasanthakumar Thiagarajan [Wed, 11 Apr 2012 13:24:03 +0000 (16:24 +0300)]
Allow disable_ht to override 11n configuration in AP mode

This is being done only for station mode, extend it to AP mode as well.

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

12 years agoAP: Reschedule ap_handle_timer event on (re)association
Jouni Malinen [Wed, 11 Apr 2012 11:21:35 +0000 (14:21 +0300)]
AP: Reschedule ap_handle_timer event on (re)association

Previously, the timeout scheduled during the previous association was
used after reassociation if the STA entry had not yet been removed. The
next timeout does not need to happen that quickly, so reschedule it
during reassociation.

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

12 years agoAP: Add debug information for ap_handle_timer operations
Jouni Malinen [Wed, 11 Apr 2012 11:09:40 +0000 (14:09 +0300)]
AP: Add debug information for ap_handle_timer operations

This makes it easier to figure out what exactly was done with the
ap_handle_timer registration/cancellation based on a debug log.

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

12 years agoAP: Reset STA timeout_next on driver-based-SME association
Jouni Malinen [Wed, 11 Apr 2012 11:06:50 +0000 (14:06 +0300)]
AP: Reset STA timeout_next on driver-based-SME association

The next ap_handle_timer action was already cleared when association
is handled with user space -based SME. However, this step was missing
from the driver callback for indicating new association. This could
result in the first ap_handle_timer timeout on the new association
removing the station unexpectedly. Fix this by resetting the timeout_next
in hostapd_notif_assoc().

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

12 years agoFix EAP/WPS to PSK transition on reassociation in authenticator
Jouni Malinen [Tue, 10 Apr 2012 18:30:46 +0000 (21:30 +0300)]
Fix EAP/WPS to PSK transition on reassociation in authenticator

A station may move from EAP/WPS key_mgmt to PSK using re-association. In
practice, this can happen most likely with WPS when the station runs
through the provisioning step (EAP/WPS) followed by PSK authentication.
If a deauthentication event is missed from the station for whatever
reason, the EAPOL authenticator state machine could have been left
running.

This can result in various issues, including unexpected disconnection of
the station while both the 4-way handshake and EAPOL authenticator state
machines (EAP) are running at the same time when the supplicant is
trying to use PSK. Fix this by explicitly clearing EAPOL authenticator
state machine on (re)association if the new association does not use it.

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

12 years agonl80211: Extend shared_freq to handle AP/GO mode interfaces
Jithu Jance [Sun, 8 Apr 2012 17:44:05 +0000 (20:44 +0300)]
nl80211: Extend shared_freq to handle AP/GO mode interfaces

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

12 years agoP2P: Fix shared freq check and support AP mode validation
Jouni Malinen [Sun, 8 Apr 2012 17:42:45 +0000 (20:42 +0300)]
P2P: Fix shared freq check and support AP mode validation

The previous commit did not use the correct pointer in all operations
and was specific to station mode interfaces. Fix and extend it to work
with AP/GO interfaces, too.

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

12 years agoP2P: Abort join-group operation if concurrent group cannot be supported
Jouni Malinen [Sun, 8 Apr 2012 17:12:05 +0000 (20:12 +0300)]
P2P: Abort join-group operation if concurrent group cannot be supported

If the driver does not indicate support for multi-channel concurrency,
abort join-group operation if the end result would result in use of
multiple operating frequencies with the same radio.

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

12 years agoScan only affected frequencies for 20/40 MHz co-ex check for
Jouni Malinen [Sun, 8 Apr 2012 09:12:32 +0000 (12:12 +0300)]
Scan only affected frequencies for 20/40 MHz co-ex check for

When starting an AP with HT40 on 2.4 GHz, limit the set of channels
to scan for based on the affected frequency range to speed up the
AP setup.

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

12 years agoMake random_add_randomness() debug print less verbose
Jouni Malinen [Sun, 8 Apr 2012 08:34:54 +0000 (11:34 +0300)]
Make random_add_randomness() debug print less verbose

Mark the debug print excessive and print it only in case the entropy
collection is used since this function can get called pretty frequently.

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

12 years agoTLS: Use separate TLS library context for tunneled TLS
Jouni Malinen [Sat, 7 Apr 2012 17:57:02 +0000 (20:57 +0300)]
TLS: Use separate TLS library context for tunneled TLS

OpenSSL wrapper was using the same certificate store for both Phase 1
and Phase 2 TLS exchange in case of EAP-PEAP/TLS, EAP-TTLS/TLS, and
EAP-FAST/TLS. This would be fine if the same CA certificates were used
in both phases, but does not work properly if different CA certificates
are used. Enforce full separation of TLS state between the phases by
using a separate TLS library context in EAP peer implementation.

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

12 years agoRemove forgotten GPL language from man pages and README files
Jouni Malinen [Sat, 7 Apr 2012 10:17:20 +0000 (13:17 +0300)]
Remove forgotten GPL language from man pages and README files

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

12 years agoAndroid: Sync build configuration with defconfig changes
Jouni Malinen [Sat, 7 Apr 2012 10:09:20 +0000 (13:09 +0300)]
Android: Sync build configuration with defconfig changes

This brings up the changes from defconfig into the Android configuration
file, but does not change any of the actual build parameters.

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

12 years agoRemove experimental Symbian build
Jouni Malinen [Sat, 7 Apr 2012 10:00:30 +0000 (13:00 +0300)]
Remove experimental Symbian build

This was never really completed and is of not much use at this point,
so clean up the repository by removing the Symbian-specific changes.

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

12 years agoAdd RANGE=ALL|N1-N2 selection for ctrl_iface BSS command
Dmitry Shmidt [Sat, 7 Apr 2012 09:49:31 +0000 (12:49 +0300)]
Add RANGE=ALL|N1-N2 selection for ctrl_iface BSS command

Add ability to get information about several BSS's in one call.

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
12 years agoAdd MASK=0xH option for the ctrl_iface BSS command
Dmitry Shmidt [Sat, 7 Apr 2012 09:23:21 +0000 (12:23 +0300)]
Add MASK=0xH option for the ctrl_iface BSS command

This optional parameter to the BSS command can be used to select which
fields are included in the output to avoid having to parse through
unneeded information and to reduce the buffer size.

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
12 years agoMove ctrl_iface BSS command response generation into a separate function
Dmitry Shmidt [Sat, 7 Apr 2012 09:06:35 +0000 (12:06 +0300)]
Move ctrl_iface BSS command response generation into a separate function

This is in preparation for allowing multiple BSS entries to be fetched
with a single command.

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
12 years agonl80211: Skip set_mode event subscription during deinit
Jouni Malinen [Fri, 6 Apr 2012 15:58:44 +0000 (18:58 +0300)]
nl80211: Skip set_mode event subscription during deinit

There is no need to subscribe to event messages during deinit process,
so skip this to avoid unnecessary operations and to keep the debug logs
a bit cleaner.

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

12 years agoP2P: Disconnect P2P group on supplicant deinit
Nirav Shah [Fri, 6 Apr 2012 15:41:06 +0000 (18:41 +0300)]
P2P: Disconnect P2P group on supplicant deinit

When a supplicant is deinited and shutting, disconnect from P2P groups.
This fixes a memory leak on variable dbus_groupobj_path on exiting
supplicant.

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

12 years agoP2P: Fix crash for failure case when WSC PIN is entered incorrectly
Angie Chinchilla [Fri, 6 Apr 2012 15:22:03 +0000 (18:22 +0300)]
P2P: Fix crash for failure case when WSC PIN is entered incorrectly

When forming a P2P group using WSC PIN method, if the PIN is entered
incorrectly the P2P client supplicant instance will crash as a result
of cleanup happening on data that is still in use in a case where a
separate P2P group interface is used.

For example, here is the path for the first crash:
eap_wsc_process():
- creates struct wpabuf tmpbuf; on the stack
- sets data->in_buf = &tmpbuf;
- calls wps_process_msg()
- which calls wps_process_wsc_msg()
- which, in case WPS_M4: calls wps_fail_event()
- which calls wps->event_cb()
- wps->event_cb = wpa_supplicant_wps_event()
- wpa_supplicant_wps_event()
- wpa_supplicant_wps_event_fail()
- which calls wpas_clear_wps()
- which calls wpas_notify_network_removed()
- which calls wpas_p2p_network_removed()
- which calls wpas_p2p_group_formation_timeout()
- which calls wpas_group_formation_completed()
- which calls wpas_p2p_group_delete()
- which calls wpa_supplicant_remove_iface()
- which calls wpa_supplicant_deinit_iface()
- which calls wpa_supplicant_cleanup()
- which calls eapol_sm_deinit()
- ... which eventually uses the ptr data->in_buf to free tmpbuf, our
stack variable and then the supplicant crashes

If you fix this crash, you'll hit another. Fix it and then a segfault.
The way we're cleaning up and deleting data from under ourselves here
just isn't safe, so make the teardown portion of this async.

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

12 years agoDo not write bg_scan_period value if default (-1) has not been changed
Jouni Malinen [Fri, 6 Apr 2012 15:11:47 +0000 (18:11 +0300)]
Do not write bg_scan_period value if default (-1) has not been changed

There is no need to force this configuration parameter to be written
into the configuration file for each network block that has not modified
the default value.

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

12 years agoClarify comment in wpa_supplicant/defconfig
Angie Chinchilla [Fri, 6 Apr 2012 15:06:56 +0000 (18:06 +0300)]
Clarify comment in wpa_supplicant/defconfig

I think this comment, as originally stated, says the opposite of
what is meant. Reword to help the next guy.

Signed-hostap: Angie Chinchilla <angie.v.chinchilla@intel.com>

12 years agoSave bgscan parameter into configuration file
Ed Wildgoose [Fri, 6 Apr 2012 14:59:34 +0000 (17:59 +0300)]
Save bgscan parameter into configuration file

Signed-off-by: Ed Wildgoose <lists@wildgooses.com>
intended-for: hostap-1

12 years agoP2P: Update BSS entries in P2P group interface only if P2P IE is present
Neeraj Kumar Garg [Fri, 6 Apr 2012 11:58:22 +0000 (14:58 +0300)]
P2P: Update BSS entries in P2P group interface only if P2P IE is present

For concurrency scenarios we should not update the scan results without
P2P IE to P2P group interfaces. This patch is to take care if a scan has
been requested on STA interface and scan results are getting updated
from sibling to P2P group interface. A P2P GO Probe Response for a
legacy STA scan would be without P2P IE. So it will wrongly update the
BSS list of P2P group interface too when results are updated from
sibling.

Since P2P group interfaces are used only for connecting to a P2P group,
it is fine to filter out all non-P2P entries from their BSS table.

Signed-off-by: Neeraj Garg <neerajkg@broadcom.com>
12 years agoBetter wpa_cli error messages when connect fails
Ben Greear [Fri, 6 Apr 2012 09:15:30 +0000 (12:15 +0300)]
Better wpa_cli error messages when connect fails

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

12 years agoMake bind failure messages unique
Ben Greear [Fri, 6 Apr 2012 09:10:36 +0000 (12:10 +0300)]
Make bind failure messages unique

This helps someone know which part of the code is complaining.

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

12 years agowpa_supplicant: Print initialization information on startup
Ben Greear [Fri, 6 Apr 2012 08:52:17 +0000 (11:52 +0300)]
wpa_supplicant: Print initialization information on startup

This lets someone know if they have a log file that properly
starts at the beginning.

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

12 years agoAP: Add fuzz to idle-timer calculations
Ben Greear [Fri, 6 Apr 2012 08:47:29 +0000 (11:47 +0300)]
AP: Add fuzz to idle-timer calculations

This should keep us from getting into a state where we bounce large
numbers of stations all at once. Spreading out the bounce should cause
less stress on the network as the idle stations won't all be trying to
reconnect at once.

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

12 years agoAdd script to convert wpa_supplicant debug output to pcap
Johannes Berg [Thu, 5 Apr 2012 16:47:45 +0000 (19:47 +0300)]
Add script to convert wpa_supplicant debug output to pcap

For debugging I needed to look at the frames in a wpa_supplicant debug
log. Looking at the hexdump is a bit tedious, so I wrote a quick script
to convert the nl80211 debugging output to a PCAP file that can be
opened in wireshark.

I've polished the initial raw script a bit to add error messages and to
also record the timestamps to the pcap file.

Hopefully it's useful to somebody else as well.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
12 years agoWPS: Allow vendor specific attribute to be added into M1
Anirban Sirkhell [Tue, 3 Apr 2012 21:08:57 +0000 (00:08 +0300)]
WPS: Allow vendor specific attribute to be added into M1

wps_vendor_ext_m1 configuration parameter can now be used to add a
vendor specific attribute into the WPS M1 message, e.g., for
Windows Vertical Pairing.

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

12 years agonl80211: Indicate disconnect event as deauthentication
Jouni Malinen [Tue, 3 Apr 2012 14:11:22 +0000 (17:11 +0300)]
nl80211: Indicate disconnect event as deauthentication

This was previously indicated as disassociation, but the P2P group
session ending case expect a deauthentication notification. Since the
cfg80211 disconnection event does not really indicate which frame was
used, the easiest approach for now seems to be to just indicate these
as deauthentication events.

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

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