Commit graph

1514 commits

Author SHA1 Message Date
Sylvestre Gallon 3d0a843823 dbus: Fix endianness bug in Frequency and Signal properties
These properties did not work on big endian PowerPC (always 100% for
Signal and 0 for Frequency) due to endianness problem (u32 to u16 data
loss).

Signed-off-by: Sylvestre Gallon <ccna.syl@gmail.com>
2012-01-28 17:57:48 +02:00
Jouni Malinen 6897ce14a4 Rename systemd template files to avoid @ in the file name
Perforce does not like @ in the file name and since these template files
do not really need to have that in the name, make the files in
repository friendlier to Perforce. The generated *.service file will
maintain their old names.

Signed-hostap: Jouni Malinen <j@w1.fi>
2012-01-28 17:12:30 +02:00
Nicolas Cavallari 9e2af29f9b Support fixing the BSSID in IBSS mode
When the "bssid=" option is set for an IBSS network and ap_scan = 2,
ask the driver to fix this BSSID, if possible.

Previously, any "bssid=" option were ignored in IBSS mode when ap_scan=2.

Signed-hostap: Nicolas Cavallari <cavallar@lri.fr>
2012-01-28 11:33:47 +02:00
Paul Stewart a4bbb6066d dbus: Create DBus getter/setter for FastReauth
Provide a means over DBus to set the conf->fast_reauth
property, which controls whether TLS session resumption
should be attempted for EAP-TLS 802.1X networks.

Signed-off-by: Paul Stewart <pstew@chromium.org>
2012-01-28 11:21:37 +02:00
Jouni Malinen b21ff9cb20 P2P: Fix WSC IE inclusion for P2P disabled case
wpas_wps_in_use() was forcing WPS to be enabled unconditionally if P2P
support was included in the build. This is not really the correct
behavior for the case when P2P has been disabled at runtime. Change the
code here to verify runtime configuration of P2P before forcing WPS to
be enabled. This allows WSC IE to be left out from Probe Request frames
when scanning for APs without P2P or WPS being in use.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
2012-01-27 21:09:34 +02:00
Jouni Malinen b1aebbc427 P2P: Do not expire peer entry if we are connected to the peer
Even though we may not update P2P peer entry while connected to the
peer as a P2P client, we should not be expiring a P2P peer entry while
that peer is the GO in a group where we are connected as a P2P client.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
2012-01-25 17:27:47 +02:00
Jouni Malinen 433cd2ce65 Stop sched_scan in number of cases where it should not be running
When a P2P group is removed, we better not leave possibly started
sched_scan running. This could happen when a separate group interface
was not used.

In addition, it looks safer to explicitly stop sched_scan before
starting P2P Listen or Find operations to make sure the offloaded
scanning is not running when doing similar P2P operations.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
2012-01-23 18:26:09 +02:00
Sujith Manoharan cd2f4ddfb9 Update WPA/RSN IE properly for driver based BSS selection
This patch fixes an issue with roaming for drivers that set
WPA_DRIVER_FLAGS_BSS_SELECTION (currently ath6kl). On moving to an AP
with a different BSSID, an EVENT_ASSOC is received and the subsequent
4-way handshake may fail because of a mismatch between the RSN IE in
message 3/4 and in Beacon/Probe Response. This happens only when the APs
use different RSN IE contents and ap_scan is set to 1, since
wpa_supplicant fails to update its cached IEs.

Initial association may fail, too, in case of multiple APs with
the same SSID, since BSSID selection is done by the driver and again
a mismatch could be seen.

Fix these two issues by clearing and updating the cached IEs on
receiving an Association event from the driver. Also, retrieve the
scan results when the new BSS information is not present locally.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
2012-01-23 17:34:39 +02:00
Jouni Malinen beec9c3a1f eapol_test: Show MNC length in debug output
Signed-hostap: Jouni Malinen <j@w1.fi>
2012-01-22 20:59:00 +02:00
Sam Leffler f9121813d7 dbus: Validate SSID length in new D-Bus scan request
Validate the length of each SSID passed in a new D-Bus protocol
Scan request.
2012-01-22 12:02:09 +02:00
Jouni Malinen 6d92fa6e92 P2P: Allow Device ID to be specified for p2p_find command
dev_id=<P2P Device Addr> can now be specified as an argument to
p2p_find to request P2P find for a specific P2P device.

Signed-hostap: Jouni Malinen <j@w1.fi>
2012-01-08 09:25:29 -08:00
Jouni Malinen 57d38ddf6b Update copyright notices to include year 2012
Signed-hostap: Jouni Malinen <j@w1.fi>
2012-01-01 18:59:16 +02:00
Jouni Malinen 3d9975d5b0 Do not trigger fast reconnection on locally generated deauth/disassoc
The deauthentication and disassociation events from nl80211 were being
processed identically regardless of whether the frame was generated by
the local STA or the AP. This resulted in fast reconnection mechanism
getting triggered even in the case where the disconnection was detected
locally (e.g., due to beacon loss) while this was supposed to happen
only in the case where the AP is sending an explicit Deauthentication
or Disassociation frame with a specific reason code.

Fix this by adding a new deauth/disassoc event variable to indicate
whether the event was generated locally.

Signed-hostap: Jouni Malinen <j@w1.fi>
2012-01-01 18:55:58 +02:00
Jouni Malinen 0be3542338 Fix BSS property names in the example D-Bus script
Signed-hostap: Jouni Malinen <j@w1.fi>
2012-01-01 18:55:55 +02:00
Syam Sidhardhan 60d5a5a5fd dbus: Fix extra semicolon
Signed-off-by: Syam Sidhardhan <syamsidhardh@gmail.com>
2012-01-01 14:39:24 +02:00
Jouni Malinen 6fc74e5181 dbus: Increase buffer size to fix Introspect XML
Commit e9c3c1afed added a new D-Bus
method and that was enough to push the Introspect XML buffer over
the previously allocated 8000 bytes. Increase the buffer size to
make enough room for P2P interface. In addition, add a debug
message to indicate if an XML segment does not fit into the buffer
to make this types of failures somewhat easier to catch.

Signed-hostap: Jouni Malinen <j@w1.fi>
2011-12-31 17:40:49 +02:00
Jouni Malinen 5fd9fb2772 Remove possible authentication timeout on connection failure
The authentication timeout could be triggered after the connection has
already been known to have failed. The event at that point can be
confusing, so better cancel the timeout when processing connection
failure.

Signed-hostap: Jouni Malinen <j@w1.fi>
2011-12-31 13:25:37 +02:00
Jouni Malinen 1e7fb4f1b7 WPS: Use single channel scan if AP channel already known
If the BSSID of the AP is specified in the WPS command, the target
AP is likely already in the BSS table and its operating channel is
known. Use this information to speed up connection by only scanning
the known channel.

Signed-hostap: Jouni Malinen <j@w1.fi>
2011-12-31 13:17:20 +02:00
Michał Górny 399ec170e8 Use correct (multi-user) target when installing systemd units
The 'network.target' is special (per systemd.special(7)), and is to be
brought up indirectly when network is actually configured (i.e. through
DHCP or static address settings).

Irrelevant of that, all services should be always installed in
multi-user.target.

[Bug 427]
2011-12-29 21:39:34 +02:00
Jouni Malinen e91829f9ac P2P: Stop remain-on-channel prior to starting join-a-group client
This fixes issues with drivers that do not handle concurrent
remain-on-channel and scan operations in a case where Provision
Discovery Response frame is not received to stop the Action frame
handshake.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
2011-12-29 13:28:17 +02:00
Neeraj Kumar Garg b8349523e4 P2P: Reject p2p_group_add if forced frequency is not acceptable
If the freq parameter is specified and we are already running legacy STA
on a different frequency with a driver that does not support
multi-channel concurrency, reject p2p_group_add. Same code already
exists in the path of P2P connection with go negotiation but is missing
for autonomous GO.

Signed-hostap: Neeraj Garg <neerajkg@broadcom.com>
2011-12-27 23:21:45 +02:00
Jouni Malinen d7e70476f2 P2P: Use global->p2p_dev_addr instead of parent->own_addr
Start using global->p2p_dev_addr more consistently as the P2P Device
Address.

Signed-hostap: Jouni Malinen <j@w1.fi>
2011-12-25 23:58:03 +02:00
Bartosz Markowski 8945cc451f Add BSSID into blacklist and do not clean blacklist during countermeasures
If scanning continues during TKIP countermeasures, try to avoid selecting
the BSS that triggered the counter measures.
2011-12-25 21:09:17 +02:00
Jouni Malinen fbdcfd577a P2P: Maintain a list of P2P Clients for persistent group on GO
Add a new persistent group network block field, p2p_client_list, to
maintain a list of P2P Clients that have connected to a persistent
group. This allows GO of a persistent group to figure out more easily
whether re-invocation of a persistent group can be used with a specific
peer device.

Signed-hostap: Jouni Malinen <j@w1.fi>
2011-12-22 22:47:41 +02:00
Jouni Malinen 87f841a140 P2P: Show persistent group info on P2P_PEER data
Add "persistent=<network id>" line to P2P_PEER ctrl_iface data
if a persistent group credentials are available for this peer.
This makes it easier for external programs to figure out when
a persistent group could be re-invoked with this peer.

For now, this information is only available on the P2P client,
but similar information can be added for GO once a list of P2P
clients is maintained with the persistent group data.

Signed-hostap: Jouni Malinen <j@w1.fi>
2011-12-22 21:45:20 +02:00
Jouni Malinen b3ffc80b8c P2P: Move public P2P_PEER info generation into ctrl_iface
The P2P module provides access to public peer data in struct
p2p_peer_info. Use this to build the P2P_PEER information in
ctrl_iface.c instead of providing such text format data from the P2P
module.

The internal data that was previously built in p2p_get_peer_info() as
part of the text format peer data is now available through a separate
p2p_get_peer_info_txt() function. This is still included in P2P_PEER
output to maintain backwards compatibility with external programs that
could have started to use this. However, it should be noted that this
data is not really supposed to be used for anything else apart from
debugging purposes and its format is subject to change.

Signed-hostap: Jouni Malinen <j@w1.fi>
2011-12-22 21:26:31 +02:00
Jouni Malinen b3bcc0f519 P2P: Replace p2p_get_peer_info with p2p_peer_known when applicable
p2p_get_peer_info() was used in multiple places just to check whether a
specific peer is known. This was not the designed use for the function,
so introduce a simpler function for that purpose to make it obvious that
the p2p_get_peer_info() function is actually used only in ctrl_iface.c.

Signed-hostap: Jouni Malinen <j@w1.fi>
2011-12-22 21:04:41 +02:00
윤민홍 3b655312d4 P2P: Send D-Bus ServiceDiscoveryRequest signal for external SD processing
wpas_notify_p2p_sd_request() needs to be called when
p2p_sd_over_ctrl_iface is set to provide SD events over D-Bus similarly
to the ctrl_iface events.
2011-12-22 00:34:29 +02:00
Jouni Malinen 9b6f44cb63 Process EVENT_SCHED_SCAN_STOPPED partially if interface is disabled
The internal sched_scanning state needs to be cleared on this event
even if the events happen to get ordered in a way that the interface
gets disabled just prior to EVENT_SCHED_SCAN_STOPPED event.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
2011-12-21 13:36:58 +02:00
Jouni Malinen 4551dd9060 Ignore disassociation event in wpa_supplicant AP mode
If the driver was associated in station mode just before the AP mode was
started, the station mode disassociation event may end up getting
delivered to wpa_supplicant only after the AP mode has been started.
This can result in unexpected attempt to reassociate back to the network
that was previously used in station mode. Avoid this by ignoring the
disassociation event.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
2011-12-21 13:36:13 +02:00
Jouni Malinen 72d48a80ec P2P: Fix GO start on interface that has active station connection
The active station connection triggered wpa_supplicant AP mode startup
to try to update Beacon IEs before the AP mode was properly initialized
and that resulted in NULL pointer dereference in driver_nl80211.c. Fix
this by skipping the IE update before the AP mode is initialized.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
2011-12-21 13:34:25 +02:00
Neeraj Kumar Garg 653c4893be Add AP-STA-CONNECTED and DISCONNECTED events to wpa_cli -a
Signed-hostap: Neeraj Kumar Garg <neerajkg@broadcom.com>
2011-12-20 01:07:42 +02:00
Jouni Malinen c81066153c P2P: Use hardcoded idle timeout of 10 seconds in P2P client role
The p2p_group_idle configuration parameter is much more useful for
GO role, so use a separate hardcoded value of 10 seconds in P2P
client role. In practice, this means that the P2P client role will
automatically tear down the group when the GO tears down the group.

The 10 second timeout is enough to recover from temporary disconnections
without unnecessary tearing down the group if the GO is still present
and allows the client to connect.

Signed-hostap: Jouni Malinen <j@w1.fi>
2011-12-18 22:21:22 +02:00
Jouni Malinen 4c2c675173 P2P: Fix disconnect event not to increase idle timeout
When P2P client is processing a disconnection event, make sure the P2P
idle timeout does not get increased, i.e., set a new timeout only if no
timeout is in use. wpa_state changes between DISCONNECTED and SCANNING
can generate multiple calls to wpas_p2p_notif_disconnect() and
previously this was enough to force the idle timeout never hit in
practice when in P2P client role.

Signed-hostap: Jouni Malinen <j@w1.fi>
2011-12-18 22:18:42 +02:00
Jouni Malinen 74781dfc7b Lower RX_MGMT driver event debug level for Beacon frames
This event can be very frequent in AP mode when Beacon frames from
neighboring BSSes are delivered to user space. Drop the debug
message priority from DEBUG to EXCESSIVE for Beacon frames.

Signed-hostap: Jouni Malinen <j@w1.fi>
2011-12-18 21:48:25 +02:00
Jouni Malinen 1ef2f7ffcf P2P: Fix Provision Discovery channel for some join-GO cases
The Provision Discovery Request needs to be sent on the operating
channel of the GO and as such, the frequency from the BSS table
(scan results) need to override the frequency in the P2P peer
table that could be based on the Listen channel of the GO.

Signed-hostap: Jouni Malinen <j@w1.fi>
2011-12-18 17:21:25 +02:00
Gustavo Sverzut Barbieri 19030351b9 wpa_supplicant/dbus AP: Add support for WPS Internal Registrar
When in AP mode, wpa_supplicant is now enabling WPS (only Internal
Registrar). WPS.Start() call can be used to initiate WPS negotiation
similarly to how this is done in station mode.

This was done to ctrl_iface by Jouni Malinen on April 21, 2009 (commit
3ec97afe57)

Signed-hostap: Gustavo Sverzut Barbieri <barbieri@profusion.mobi>
2011-12-18 17:06:31 +02:00
Reinette Chatre e5a359cf7e P2P: Make GO negotiation peer and group information available over D-Bus
The GO negotiation response is very cryptic at the moment. For a success
message we only know on which interface the negotiation succeeded, not
which peer. For a failure we know the interface also and a status code
(number).

It will be very useful for clients to know upon receipt of such a message
which peer the negotiation occurred with.

Now that the peer information is available and the API is changed
already, the function composing the D-Bus message might as well include
all GO negotiation information. This is done with a dict to make things
easier on clients if this result information changes down the line.

Signed-hostap: Reinette Chatre <reinette.chatre@intel.com>
Signed-hostap: Johannes Berg <johannes.berg@intel.com>
2011-12-18 16:52:33 +02:00
Jouni Malinen 90b8fc8f4e Fix CONFIG_NO_SCAN_PROCESSING=y build with ctrl_iface
Need to remove ROAM command processing since the needed functionality
for it gets removed with CONFIG_NO_SCAN_PROCESSING=y.

Signed-hostap: Jouni Malinen <j@w1.fi>
2011-12-17 18:07:58 +02:00
Antonio Quartulli b58bcbb2ef ctrl_iface: Check for IEEE8021X_EAPOL definition
The whole wpa_supplicant_ctrl_iface_ctrl_rsp_handle() function operates
on the ssid->eap field which exists only if IEEE8021X_EAPOL has been
defined. Therefore the whole function body needs to be enclosed within
an #ifdef/endif block.

Signed-hostap: Antonio Quartulli <ordex@autistici.org>
2011-12-17 18:04:50 +02:00
Johannes Berg 457a126e29 IBSS: fix RSN key initialisation
Antonio reported that RSN IBSS failed to work.
We traced it down to a GTK failure, and he then
bisected it to commit bdffdc5ddb:
"AP: Reorder WPA/Beacon initialization".

The reason this commit broke it is that the state
machine's GInit variable is never set to false as
wpa_init_keys() never gets called, and thus new
keys are generated every time the state machine
executes.

Fix this by calling wpa_init_keys() when the new
group has been initialised.

Reported-by: Antonio Quartulli <ordex@autistici.org>
Tested-by: Antonio Quartulli <ordex@autistici.org>
Signed-hostap: Johannes Berg <johannes.berg@intel.com>
2011-12-11 19:57:50 +02:00
Jouni Malinen d9d87c3357 Disassociate when starting WPS search
Previously, the WPS scans could have been done in associated state if we
happened to be associated when the request to use WPS was received. This
can slow down scanning and end up in unexpected state if no WPS
association is tried. Avoid these issues by disconnecting when WPS
search is started.

Signed-hostap: Jouni Malinen <j@w1.fi>
2011-12-11 18:30:47 +02:00
Jouni Malinen 5506d18418 Fix compiler warning with CONFIG_NO_STDOUT_DEBUG=y
Signed-hostap: Jouni Malinen <j@w1.fi>
2011-12-11 18:19:24 +02:00
Jouni Malinen 5928411e91 Fix compiler warning with CONFIG_NO_SCAN_PROCESSING=y
Signed-hostap: Jouni Malinen <j@w1.fi>
2011-12-11 18:14:09 +02:00
Jouni Malinen 76202aed23 Fix compiler warning with CONFIG_NO_STDOUT_DEBUG=y
Signed-hostap: Jouni Malinen <j@w1.fi>
2011-12-11 18:13:51 +02:00
Jouni Malinen 7165c5dc1f P2P: Fix 32-bit compiler warnings on service discovery reference
Convert core wpa_supplicant code to use u64 instead of void * for the
P2P service discovery reference. Use uintptr_t in type casts in
p2p_supplicant.c to handle the conversion without warnings.

Note: This needs to be revisited for 128-bit CPU where sizeof(void *)
could be larger than sizeof(u64).

Signed-hostap: Jouni Malinen <j@w1.fi>
2011-12-11 18:06:34 +02:00
Jouni Malinen e3a0706b47 P2P: Fix Provision Discovery name in debug messages
Some debug messages used incorrect name for Provision Discovery.
Replace "Provisioning Discovery" with "Provision Discovery".

Signed-hostap: Jouni Malinen <j@w1.fi>
2011-12-11 17:36:38 +02:00
Vitaly Wool c3daaf3325 Skip WPS PBC overlap detection if P2P address is the same
WPS overlap detection can detect false overlap if a P2P peer
changes UUID while authentication is ongoing. Changing UUID
is of course wrong but this is what some popular devices do
so we need to work around it in order to keep compatibility
with these devices. There already is a mechanism in WPS
registrar to skip overlap detection if P2P addresses of two
sessions match but it wasn't really triggered because the
address wasn't filled in in the caller function.

Let's fill in this address and also clean up WPS PBC sessions
on WSC process completion if UUID was changed.

Signed-hostap: Vitaly Wool<vitalywool@gmail.com>
2011-12-11 12:03:18 +02:00
Arik Nemtsov 4f73d88afa Maintain internal copy of Probe Response offload capabilities
Signed-hostap: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
2011-12-10 21:11:32 +02:00
Jouni Malinen 502618f7c1 P2P: Clean up group formation on network block removal
If a P2P group network block is removed for any reason (e.g., wps_cancel
command) while the interface is in group formation, remove the group
formation timeout and indicate failure immediately. Previously, this
type of operations could end up leaving the timeout running and result
in somewhat unexpected group formation failure events later.

Signed-hostap: Jouni Malinen <j@w1.fi>
2011-12-10 12:56:42 +02:00
Jouni Malinen c3f4278445 P2P: Add group ifname to P2P-PROV-DISC-* events
If Provision Discovery Request is sent for GO role (i.e., P2P Group ID
attribute is included), add the group interface name to the control
interface event on the GO. This makes it easier to figure out which
ctrl_iface needs to be used for wps_pbc/wps_pin command to authorize
the joining P2P client.

Signed-hostap: Jouni Malinen <j@w1.fi>
2011-12-06 21:57:17 +02:00
Jithu Jance ec437d9e74 P2P: Skip duplicated provision discovery on join
If p2p_prov_disc join command is used prior to p2p_connect join,
skip the duplicated provision discovery exchange.

Signed-hostap: Jithu Jance <jithu@broadcom.com>
2011-12-06 21:44:57 +02:00
Jithu Jance 8c5f730983 P2P: Add optional "join" argument for p2p_prov_disc command
This can be used to request Provision Discovery Request to be sent
for the purpose of joining a running group, e.g., to request the GO
to display a PIN that we can then use with p2p_connect join command.

Signed-hostap: Jithu Jance <jithu@broadcom.com>
2011-12-06 21:28:02 +02:00
Jouni Malinen 61ff2c8080 Remove documentation for label option in p2p_connect
P2P use cases do not allow use of Label config method and the earlier
code for this has already been removed, but this documentation was not
updated at the same time.

Signed-hostap: Jouni Malinen <j@w1.fi>
2011-12-06 21:13:54 +02:00
Jouni Malinen 14115a1089 SME: Fix processing of Authentication timeout
The wpa_state needs to be dropped back to DISCONNECTED to allow scan
results to trigger a new authentication attempt.

Signed-hostap: Jouni Malinen <j@w1.fi>
2011-12-04 22:27:48 +02:00
Jouni Malinen d00821e913 Try to reconnect to the same BSS on recoverable disconnection
If the AP disconnects us with a reason code that indicates that it has
dropped the association, but could allow us to connect again, try to
reconnect to the same BSS without going through the full scan. This can
save quite a bit of time in some common use cases, e.g., when inactivity
timeout is used on the AP (and especially, when waking up from suspend
which has likely triggered some timeout on the AP).

Signed-hostap: Jouni Malinen <j@w1.fi>
2011-12-04 21:57:14 +02:00
Jouni Malinen ed57c5907e SME: Fix processing of Authentication request failure
The wpa_state needs to be dropped back to DISCONNECTED to allow scan
results to trigger a new authentication attempt. In addition, we can use
wpas_connection_failed() instead of requesting a scan after a fixed time
to make this error case more consistent with other similar error paths
in sme.c.

Signed-hostap: Jouni Malinen <j@w1.fi>
2011-12-04 21:04:24 +02:00
Jouni Malinen bfba8deb8b Update internal MAC address on EVENT_INTERFACE_ENABLED events
This allows the MAC address of the interface to be changed when the
interface is set down even if the interface does not get completed
removed and re-added.

Signed-hostap: Jouni Malinen <j@w1.fi>
2011-12-03 13:20:40 +02:00
Johan Hedlund f98eb880eb Update RSN supplicant MAC address on driver reinitialization
I have a test case where I remove and insert another network adapter
between two connections to AP. The interface get the same interface name
but switches macadresses between the connections. When running WPA2 I
got a failure in EAPOL negotiation and found out that the reason for
this was that the supplicant did not update the MAC address in the
correct place.
2011-12-03 13:02:57 +02:00
Szymon Bigos 9337e876ab Fix generated WPS PIN values to use zero-padding
The dynamically generated PINs are supposed to have 8 digits, but
some PIN generatation cases were not zero-padding these properly.
2011-12-02 23:04:39 +02:00
Jouni Malinen 47662f4017 Add example WPS AP mode UI for wpa_supplicant
This script shows some minimal WPS user interface requirements for
mobile AP support with wpa_supplicant.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
2011-12-01 22:14:07 +02:00
Jouni Malinen 0bc134683e wpa_supplicant AP: Allows passphrase to be fetched
"wpa_cli status wps" can now be used to fetch the WPA2-Personal
passphrase from AP mode operation with wpa_supplicant to make it
easier to meet WPS requirements for legacy STA support.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
2011-12-01 22:12:03 +02:00
Jouni Malinen c0f83f3104 WPS: Disable WPS(v2) in WPA/TKIP-only configuration
When using wpa_supplicant AP mode, WPS support is enabled by default for
WPA/WPA2-Personal. Change this to enforce the WPS2 rules on not allowing
WPS to be used with WPA/TKIP-only configuration (i.e., at minimum, mixed
mode with WPA/TKIP and WPA2/CCMP has to be used for WPS to be enabled).

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
2011-12-01 21:46:19 +02:00
Jouni Malinen 56d24b4ee0 Call wpas_connection_failed() only if actually trying to connect
A disconnection event from the driver may end up getting delivered at a
time when wpa_supplicant is not even trying to connect (e.g., during a
scan that was already started after WPS provisioning step). In such a
case, there is not much point calling wpas_connection_failed() and
skipping this avoids confusing attempts of re-starting scanning while
the previous scan is still in progress.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
2011-12-01 18:22:56 +02:00
Jouni Malinen f7da5a9ef4 Make reconnect-on-disassoc debug prints somewhat more helpful
Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
2011-12-01 18:22:10 +02:00
Jouni Malinen a9e02d593d P2P: Clear show_group_started on GO start
The show_group_started variable could be left to 1 based on an earlier
failed attempt to start P2P client operation. This can result in
unexpected P2P-GROUP-STARTED event when a GO is started without group
formation (e.g., re-invoke a persistent group or start an autonomous
GO). Avoid this by explicitly clearing show_group_start when setting up
the GO.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
2011-12-01 10:49:26 +02:00
Arik Nemtsov 79b8c60f81 Set ht_capab from based on driver capabilities when in P2P GO mode
Set the HT capabilities of a P2P GO according to the wiphy supported
ones. Mask-in a white-list of HT capabilities that won't cause problems
for non-supporting stations.

Signed-hostap: Arik Nemtsov <arik@wizery.com>
2011-11-29 23:45:07 +02:00
Jouni Malinen ea5bae4731 Increase min sched_scan interval from 2 to 10 seconds
Trying to run sched_scan round every two seconds by defaults sounds way
too frequent since dualband cards are unlikely to be able to complete
the full scan cycle in two seconds. For now, set the hardcoded value to
10 seconds to make this somewhat more reasonable.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
2011-11-29 20:05:58 +02:00
Dmitry Shmidt d70b945d4d Fix pno_start() to initialize SSID list properly
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2011-11-29 12:56:32 +02:00
Jouni Malinen 0b7a25c00f Use normal scan before sched_scan if that can speed up connection
When normal scan can speed up operations, use that for the first three
scan runs before starting the sched_scan to allow user space sleep more.
We do this only if the normal scan has functionality that is suitable
for this or if the sched_scan does not have better support for multiple
SSIDs.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
2011-11-28 18:36:36 +02:00
Jouni Malinen 76a5249e52 Add broadcast SSID for sched_scan for scan_ssid=0 networks
Previously, only networks with scan_ssid=1 were included in sched_scan.
This needs to behave similarly to the normal scan where broadcast SSID
is used to find networks that are not scanned for with a specific SSID.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
2011-11-28 18:12:38 +02:00
Jouni Malinen 5edddf4175 Use common code for disabled network case in sched_scan
There is no need to implement two copies of the iteration code here.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
2011-11-28 18:09:37 +02:00
Jouni Malinen 86b47aaf36 Drop sched_scan filter if not enough match sets supported
Instead of including only a single SSID in the sched_scan request if
the driver does not support match sets, just drop the SSID filter and
configure more SSIDs up to the sched_scan limit.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
2011-11-28 17:52:36 +02:00
Jouni Malinen a8cb5a8897 Make sched_scan debug clearer on timeout use
Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
2011-11-28 17:52:02 +02:00
Jouni Malinen 6ad9c91100 Stop sched_scan on DISCONNECT command
Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
2011-11-28 16:35:30 +02:00
Jouni Malinen b5c6831201 Add preferred network offload (PNO) functionality
"SET pno <1/0>" ctrl_iface command can now be used to start/stop PNO
with sched_scan driver commands. This will request offloading of
scanning to find any of the enabled networks in the configuration.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
2011-11-28 16:32:44 +02:00
Jouni Malinen 7c6a266ced Fix sched_scan filter_ssids setting for no filters case
The filter_ssids pointer needs to be set to NULL if no SSID filters
are set to avoid filtering out all scan results.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
2011-11-28 15:19:41 +02:00
Jouni Malinen dbfdb3927c Interworking: Verify that BSS information includes SSID
Better make sure that the SSID is available before dereferencing
the pointer to the SSID element.

Signed-hostap: Jouni Malinen <j@w1.fi>
2011-11-27 23:00:37 +02:00
Jouni Malinen 48f24f93a5 wpa_passphrase: Include SHA256 objects to fix some build combinations
Signed-hostap: Jouni Malinen <j@w1.fi>
2011-11-27 22:17:41 +02:00
Jouni Malinen ca84eed7ad TLS: Add build configuration for TLS v1.2 support
This allows the internal TLS implementation to be built for TLS v1.2
support. In addition to the build option, this changes the TLS PRF
based on the negotiated version number. Though, this commit does not
yet complete support for TLS v1.2.

Signed-hostap: Jouni Malinen <j@w1.fi>
2011-11-27 21:45:07 +02:00
Jouni Malinen 8307489840 Add implementation of TLS v1.2 PRF (P_SHA256)
Signed-hostap: Jouni Malinen <j@w1.fi>
2011-11-27 21:10:06 +02:00
Dmitry Shmidt e670738ae0 wpa_cli: Add action script call on P2P-GO-NEG-FAILURE events
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2011-11-25 23:56:18 +02:00
Dmitry Shmidt 8a5e75f60f P2P: Send STA connected/disconnected events to parent ctrl_iface
Send the connection events from P2P group to both the group interface
and parent interface ctrl_ifaces to make it easier for external monitor
programs to see these events without having to listen to all group
interfaces when virtual group interfaces are used.

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2011-11-25 23:56:13 +02:00
Jouni Malinen fcd1684787 Fix sched_scan filter setting for max_match_sets == 0
The previous implementation was trying to add the first SSID
to a zero-length array. Avoid this with an explicit validation
of the array length.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
2011-11-25 18:12:04 +02:00
Jouni Malinen 0bf927a03e Use wpa_key_mgmt_*() helpers
This cleans up the source code and makes it less likely that new AKM
addition misses some needed changes in the future.

Signed-hostap: Jouni Malinen <j@w1.fi>
2011-11-24 22:47:46 +02:00
Jouni Malinen 8e8280bd5e Do not save an invalid network block in wpa_supplicant.conf
wpa_supplicant is going to reject a configuration file that uses
WPA/WPA2-Personal (the default key_mgmt), but does not define
passphrase/PSK. Refuse to save such a configuration to avoid getting
stuck with a configuration that wpa_supplicant will reject.

Signed-hostap: Jouni Malinen <j@w1.fi>
2011-11-24 22:47:32 +02:00
Jouni Malinen a769b094d7 Do not write all zeros device_type
This is the default value if device_type is not set, so do not
write it to the wpa_supplicant configuration file when saving
updated configuration.

Signed-hostap: Jouni Malinen <j@w1.fi>
2011-11-24 22:22:16 +02:00
Dmitry Shmidt 6ce937b8cf Add 'get country' command
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2011-11-24 21:33:24 +02:00
David Spinadel 9a6ade33d4 wpa_cli: Correct return value of wpa_cli_cmd_p2p_peers
Signed-off-by: David Spinadel <david.spinadel@intel.com>
2011-11-24 21:19:52 +02:00
Dmitry Shmidt 20b2161d5b Android: Move WPA_BUILD check in Android.mk
This is part of commit e61a2d6db6113da5fad91660764afdb0596dbc46 from
Android wpa_supplicant_8.git.

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2011-11-23 17:58:44 +02:00
Jeff Brown 4482f1fbc4 Android: Remove the simulator target from all makefiles
This is commit bbda627478b0e9a312fea4662cd7cd8d6bdf82bf from
Android wpa_supplicant_8.git.
2011-11-23 17:56:41 +02:00
Kel Modderman ef992bbd3b wpa_gui-qt4: Improve scan results signal display
Display signal strength in dBm with visual indicator in the form of a
bar for scan results displayed by wpa_gui-qt4. Any signal > -35dBm is
treated as full signal bar, signals between range of -95<->-35dBm are
displayed linearly. Convert WEXT signal level value to scale that
nl80211 typically reports in dBm. The condition which differentiates
8-bit WEXT dBm and regular dBm is probably fragile, but there is
currently no way to know what the driver is going to report for signal
strength.

Signed-off-by: Kel Modderman <kel@otaku42.de>
2011-11-19 20:10:37 +02:00
Jouni Malinen 9dbf53fe35 P2P: Send Listen state Probe Response frames without retries
Use the no-ACK send_mlme request to transmit Probe Response frames
in P2P Listen state. This reduces number of unnecessary transmissions
if the peer device has already moved away from the channel. It will most
likely go through Search state multiple times anyway, so even if the
response were to be lost, a new retry will happen at higher layer.

Signed-hostap: Jouni Malinen <j@w1.fi>
2011-11-19 19:15:10 +02:00
Helmut Schaa 8cfa3527e1 Allow MLME frames to be sent without expecting an ACK (no retries)
In some situations it might be benefical to send a unicast frame without
the need for getting it ACKed (probe responses for example). In order to
achieve this add a new noack parameter to the drivers send_mlme callback
that can be used to advise the driver to not wait for an ACK for this
frame.

Signed-hostap: Helmut Schaa <helmut.schaa@googlemail.com>
2011-11-19 19:02:05 +02:00
Jouni Malinen 3f56f3a496 Do not try to add wildcard SSID into active sched_scan
Even though scan_ssid should not really be set for wildcard SSID,
better verify that here explicitly insead of assuming that the
SSID is set.

Signed-hostap: Jouni Malinen <j@w1.fi>
2011-11-19 17:01:53 +02:00
Johannes Berg dd840f793c AP: Add explicit EAPOL TX status event
The new event can be used when EAPOL TX status can't be reported as a
complete 802.11 frame but is instead reported as just the EAPOL data as
originally passed to hapd_send_eapol().

Signed-hostap: Johannes Berg <johannes.berg@intel.com>
2011-11-19 13:00:30 +02:00
Alan T. DeKok 8205c82a48 wpa_supplicant: Make objects depend on the .config file
The source code compiles into different objects depending on
the contents of .config. Therefore, the objects should depend
on .config.

Previously, only the executables depended on .config. This meant
that they were re-linked when .config changed. But that relink
process used the old (and now wrong) objects.
2011-11-19 11:46:39 +02:00
Johannes Berg 6cad95db72 P2P: Simplify code in wpas_p2p_connect()
There's some duplicated code there that can be simplified
with just a single new variable.

Signed-hostap: Johannes Berg <johannes.berg@intel.com>
2011-11-18 23:32:03 +02:00
Eyal Shapira 1966e3d1b7 sched scan: Fix passive scanning
Scan wasn't initiated in case the config contained only networks without
scan_ssid. In such a case we want scan to be initiated without any SSIDs
to actively scan but include all the SSIDs in the filter list. Also
added some debug logs to easily see which SSIDs were included in which
list.

Cc: Luciano Coelho <coelho@ti.com>
Signed-off-by: Eyal Shapira <eyal@wizery.com>
2011-11-18 23:05:57 +02:00
Jouni Malinen 19df9b0761 Mark local functions static
These functions are not used outside the file in which they are defined.

Signed-hostap: Jouni Malinen <j@w1.fi>
2011-11-18 21:53:36 +02:00