]> git.ipfire.org Git - thirdparty/hostap.git/log
thirdparty/hostap.git
12 years agoWork around interop issue with WPA type EAPOL-Key 4/4 in WPA2 mode
Jouni Malinen [Sun, 22 Jan 2012 10:23:28 +0000 (12:23 +0200)] 
Work around interop issue with WPA type EAPOL-Key 4/4 in WPA2 mode

Some deployed station implementations seem to send msg 4/4 with
incorrect type value in WPA2 mode. Add a workaround to ignore that issue
so that such stations can interoperate with hostapd authenticator. The
validation checks were added in commit
f8e96eb6fd960a017793942cff0eb43b09f444c6.

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

12 years agodbus: Validate SSID length in new D-Bus scan request
Sam Leffler [Sun, 22 Jan 2012 10:00:44 +0000 (12:00 +0200)] 
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.

12 years agoP2P: Use Device ID attribute to filter Probe Request frames as GO
Jouni Malinen [Sun, 8 Jan 2012 17:35:33 +0000 (09:35 -0800)] 
P2P: Use Device ID attribute to filter Probe Request frames as GO

The Device ID attribute was already used in Listen state, but it was
ignored in GO role. Verify that there is a match with Device ID in
GO rule, too, before replying to the Probe Request frame.

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

12 years agoP2P: Allow Device ID to be specified for p2p_find command
Jouni Malinen [Sun, 8 Jan 2012 17:25:29 +0000 (09:25 -0800)] 
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>

12 years agoAllow SNonce update after sending EAPOL-Key 3/4 if 1/4 was retransmitted
Jouni Malinen [Mon, 2 Jan 2012 20:36:11 +0000 (22:36 +0200)] 
Allow SNonce update after sending EAPOL-Key 3/4 if 1/4 was retransmitted

Some supplicant implementations (e.g., Windows XP WZC) update SNonce for
each EAPOL-Key 2/4. This breaks the workaround on accepting any of the
pending requests, so allow the SNonce to be updated even if we have
already sent out EAPOL-Key 3/4.

While the issue was made less likely to occur when the retransmit
timeout for the initial EAPOL-Key msg 1/4 was increased to 1000 ms,
this fixes the problem even if that timeout is not long enough.

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

12 years agoDo not disconnect STA based on inactivity on driver failure
Jouni Malinen [Mon, 2 Jan 2012 19:27:06 +0000 (21:27 +0200)] 
Do not disconnect STA based on inactivity on driver failure

Now that we can use driver_nl80211.c with non-mac80211 drivers that
implement SME/MLME internally, we may not get inactivity time from the
driver. If that is the case, we need to skip disconnection based on
maximum inactivity timeout. This fixes some unexpected disconnection
cases with ath6kl in AP mode.

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

12 years agoRemove test-https on "make clean"
Jouni Malinen [Sun, 1 Jan 2012 17:09:18 +0000 (19:09 +0200)] 
Remove test-https on "make clean"

This is not included in the TESTS list, but should be removed anyway.

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

12 years agoUpdate copyright notices to include year 2012
Jouni Malinen [Sun, 1 Jan 2012 16:59:16 +0000 (18:59 +0200)] 
Update copyright notices to include year 2012

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

12 years agoDo not trigger fast reconnection on locally generated deauth/disassoc
Jouni Malinen [Sun, 1 Jan 2012 16:53:12 +0000 (18:53 +0200)] 
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>

12 years agoFix BSS property names in the example D-Bus script
Jouni Malinen [Sun, 1 Jan 2012 16:50:31 +0000 (18:50 +0200)] 
Fix BSS property names in the example D-Bus script

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

12 years agodbus: Fix extra semicolon
Syam Sidhardhan [Sun, 1 Jan 2012 12:39:24 +0000 (14:39 +0200)] 
dbus: Fix extra semicolon

Signed-off-by: Syam Sidhardhan <syamsidhardh@gmail.com>
12 years agodbus: Increase buffer size to fix Introspect XML
Jouni Malinen [Sat, 31 Dec 2011 15:40:49 +0000 (17:40 +0200)] 
dbus: Increase buffer size to fix Introspect XML

Commit e9c3c1afedd2d0c6a0939f40c40701af8c450e1f 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>

12 years agoClear EAPOL authWhile and heldWhile values when port is disabled
Jouni Malinen [Sat, 31 Dec 2011 11:42:23 +0000 (13:42 +0200)] 
Clear EAPOL authWhile and heldWhile values when port is disabled

IEEE Std 802.1X-2004 does not clear authWhile and heldWhile in this
case, but doing so allows the timer tick to be stopped more quickly when
the port is not enabled. Since these variables are used only within HELD
and RECEIVE states, clearing them on initialization does not change
actual state machine behavior. This reduces some unnecessary operations
in port disabled state and cleans up the wpa_supplicant debug log after
disconnection.

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

12 years agoRemove possible authentication timeout on connection failure
Jouni Malinen [Sat, 31 Dec 2011 11:25:37 +0000 (13:25 +0200)] 
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>

12 years agoWPS: Use single channel scan if AP channel already known
Jouni Malinen [Sat, 31 Dec 2011 11:17:20 +0000 (13:17 +0200)] 
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>

12 years agonl80211: Mark Beacon event debug excessive
Jouni Malinen [Fri, 30 Dec 2011 12:10:15 +0000 (14:10 +0200)] 
nl80211: Mark Beacon event debug excessive

This can show up way too frequently in AP mode to make debug logs
readable at debug level.

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

12 years agoUse correct (multi-user) target when installing systemd units
Michał Górny [Thu, 29 Dec 2011 19:39:34 +0000 (21:39 +0200)] 
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]

12 years agoWPS: Cancel previous registered wps_registrar_pbc_timeout
Spencer Chang [Thu, 29 Dec 2011 19:32:06 +0000 (21:32 +0200)] 
WPS: Cancel previous registered wps_registrar_pbc_timeout

Since wps_registrar_pbc_timeout is called to stop PBC, previously
registered wps_registrar_pbc_timeout must be canceled when canceling
the WPS operation.

Signed-off-by: Spencer Chang <jungwalk@gmail.com>
12 years agonl80211: Fix NL80211_CMD_FRAME to not try offchannel without driver support
Jouni Malinen [Thu, 29 Dec 2011 12:15:31 +0000 (14:15 +0200)] 
nl80211: Fix NL80211_CMD_FRAME to not try offchannel without driver support

The offchanok parameter is hardcoded to one in number of paths and that
added NL80211_ATTR_OFFCHANNEL_TX_OK attribute to NL80211_CMD_FRAME
unconditional. cfg80211 rejects this with EINVAL if the driver does not
indicate support for offchannel TX. Fix this by not requesting
offchannel TX depending on driver capabilities. Remain-on-channel
operation was used for those cases anyway, so the additional attribute
was not really needed for these in the first place.

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

12 years agoP2P: Stop remain-on-channel prior to starting join-a-group client
Jouni Malinen [Thu, 29 Dec 2011 11:28:17 +0000 (13:28 +0200)] 
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>

12 years agoP2P: Reject p2p_group_add if forced frequency is not acceptable
Neeraj Kumar Garg [Tue, 27 Dec 2011 21:21:45 +0000 (23:21 +0200)] 
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>

12 years agonl80211: Do not stop AP mode Probe Request reporting on Listen stop
Jouni Malinen [Tue, 27 Dec 2011 18:32:29 +0000 (20:32 +0200)] 
nl80211: Do not stop AP mode Probe Request reporting on Listen stop

When nl80211_setup_ap() has enabled Probe Request reporting, this must
not be disabled when P2P Listen state is stopped to avoid breaking AP
mode operations. This could happen, e.g., if a Probe Request frame was
received from a P2P device that the we are trying to invite to our group
(i.e., when operating in GO role). p2p_probe_req_rx() calls
p2p_invite_start() in this case and that ends up calling
p2p->cfg->stop_listen() which calls probe_req_report() driver op.

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

12 years agoP2P: Use global->p2p_dev_addr instead of parent->own_addr
Jouni Malinen [Sun, 25 Dec 2011 21:58:03 +0000 (23:58 +0200)] 
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>

12 years agoAdd BSSID into blacklist and do not clean blacklist during countermeasures
Bartosz Markowski [Sun, 25 Dec 2011 19:09:17 +0000 (21:09 +0200)] 
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.

12 years agohostapd: Make inactivity polling configurable
Yogesh Ashok Powar [Sun, 25 Dec 2011 18:57:01 +0000 (20:57 +0200)] 
hostapd: Make inactivity polling configurable

hostapd uses the poll method to check if the station is alive
after the station has been inactive for ap_max_inactivity seconds.
Make the poll mechanism configurable so that user can choose to
disconnect idle clients.

This can be especially useful when some devices/firmwares have
restrictions on the number of clients that can connect to the AP
and that limit is smaller than the total number of stations trying
to use the AP.

Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com>
Signed-off-by: Nishant Sarmukadam <nishants@marvell.com>
12 years agoRemove obsolete comment on removed PTK rekeying operation
Jouni Malinen [Sat, 24 Dec 2011 11:55:03 +0000 (13:55 +0200)] 
Remove obsolete comment on removed PTK rekeying operation

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

12 years agoIncrease initial group key handshake retransmit timeout to 500 ms
Jouni Malinen [Sat, 24 Dec 2011 11:50:59 +0000 (13:50 +0200)] 
Increase initial group key handshake retransmit timeout to 500 ms

The 100 ms timeout on retransmitting group key message can be too short
for stations that are in power save mode or if there is a large number
of association stations. While the retransmission of the EAPOL-Key frame
should allow this to be recovered from, it is useful to avoid
unnecessary frames to save soem CPU and power.

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

12 years agoDrop priority level of the logger message for unexpected replay counter
Jouni Malinen [Sat, 24 Dec 2011 11:39:40 +0000 (13:39 +0200)] 
Drop priority level of the logger message for unexpected replay counter

This can happen frequently during normal EAPOL-Key exchanges and there
is no need to log it at info level.

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

12 years agonl80211: Fix mgmt RX for device SME in AP mode without monitor
Jouni Malinen [Fri, 23 Dec 2011 16:15:07 +0000 (18:15 +0200)] 
nl80211: Fix mgmt RX for device SME in AP mode without monitor

Drivers that use device SME in AP mode may still need to be
subscribed for Action frame RX when monitor interface is not used.
This fixes number of P2P GO operations with ath6kl.

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

12 years agonl80211: Fix use_monitor driver capability for non-mac80211 drivers
Jouni Malinen [Fri, 23 Dec 2011 16:13:01 +0000 (18:13 +0200)] 
nl80211: Fix use_monitor driver capability for non-mac80211 drivers

Poll command may be enough for mac80211 to figure out whether monitor
interface is to be used, but this change did not take into account
non-mac80211 drivers that support AP mode without monitor interface.
For example, ath6kl needs to get use_monitor disabled.

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

12 years agonl80211: Show station flush failures in debug log
Jouni Malinen [Fri, 23 Dec 2011 16:12:07 +0000 (18:12 +0200)] 
nl80211: Show station flush failures in debug log

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

12 years agonl80211: Add debug prints for mgmt RX subscription
Jouni Malinen [Fri, 23 Dec 2011 16:10:59 +0000 (18:10 +0200)] 
nl80211: Add debug prints for mgmt RX subscription

This makes it easier to figure out which management frames has been
subscribed to for RX events.

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

12 years agoP2P: Maintain a list of P2P Clients for persistent group on GO
Jouni Malinen [Thu, 22 Dec 2011 20:47:41 +0000 (22:47 +0200)] 
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>

12 years agoP2P: Show persistent group info on P2P_PEER data
Jouni Malinen [Thu, 22 Dec 2011 19:45:20 +0000 (21:45 +0200)] 
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>

12 years agoP2P: Move public P2P_PEER info generation into ctrl_iface
Jouni Malinen [Thu, 22 Dec 2011 19:26:31 +0000 (21:26 +0200)] 
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>

12 years agoP2P: Replace p2p_get_peer_info with p2p_peer_known when applicable
Jouni Malinen [Thu, 22 Dec 2011 19:04:41 +0000 (21:04 +0200)] 
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>

12 years agoP2P: Fix a typo in a function documentation
Jouni Malinen [Thu, 22 Dec 2011 18:55:51 +0000 (20:55 +0200)] 
P2P: Fix a typo in a function documentation

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

12 years agowlantest: Store last received GTK for each STA
Jouni Malinen [Thu, 22 Dec 2011 14:59:25 +0000 (16:59 +0200)] 
wlantest: Store last received GTK for each STA

This allows info_sta command to be used to fetch the last received GTK
separately for each STA.

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

12 years agowlantest: Fix EAPOL-Key Key Data decryption for rekey case
Jouni Malinen [Thu, 22 Dec 2011 14:39:17 +0000 (16:39 +0200)] 
wlantest: Fix EAPOL-Key Key Data decryption for rekey case

KEK from TPTK needs to be used instead of from PTK when processing
rekeying case similarly to what was already done with KCK.

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

12 years agoP2P: Send D-Bus ServiceDiscoveryRequest signal for external SD processing
윤민홍 [Wed, 21 Dec 2011 22:34:29 +0000 (00:34 +0200)] 
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.

12 years agoProcess EVENT_SCHED_SCAN_STOPPED partially if interface is disabled
Jouni Malinen [Wed, 21 Dec 2011 11:36:58 +0000 (13:36 +0200)] 
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>

12 years agoIgnore disassociation event in wpa_supplicant AP mode
Jouni Malinen [Wed, 21 Dec 2011 11:36:13 +0000 (13:36 +0200)] 
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>

12 years agoP2P: Do not allow pending listen command override connect
Jouni Malinen [Wed, 21 Dec 2011 11:35:18 +0000 (13:35 +0200)] 
P2P: Do not allow pending listen command override connect

If p2p_listen is issued during a p2p_scan, a pending after-scan operation
is scheduled. However, since there is support for only a single pending
operation, this was able to override a previously scheduled pending
connect command. This can break some command sequences, so give higher
priority to pending connect operation.

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

12 years agoP2P: Fix GO start on interface that has active station connection
Jouni Malinen [Wed, 21 Dec 2011 11:34:25 +0000 (13:34 +0200)] 
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>

12 years agoAndroid: nl80211: Work around limited genl_ctrl_resolve()
Jouni Malinen [Wed, 30 Nov 2011 11:41:55 +0000 (13:41 +0200)] 
Android: nl80211: Work around limited genl_ctrl_resolve()

Android ICS system/core/libnl_2 has very limited genl_ctrl_resolve()
implementation that cannot handle names other than nlctrl. Work
around that by implementing more complete genl_ctrl_resolve()
functionality within driver_nl80211.c for Android builds.

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

12 years agoAdd AP-STA-CONNECTED and DISCONNECTED events to wpa_cli -a
Neeraj Kumar Garg [Mon, 19 Dec 2011 23:07:42 +0000 (01:07 +0200)] 
Add AP-STA-CONNECTED and DISCONNECTED events to wpa_cli -a

Signed-hostap: Neeraj Kumar Garg <neerajkg@broadcom.com>

12 years agoP2P: Use hardcoded idle timeout of 10 seconds in P2P client role
Jouni Malinen [Sun, 18 Dec 2011 20:21:22 +0000 (22:21 +0200)] 
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>

12 years agoP2P: Fix disconnect event not to increase idle timeout
Jouni Malinen [Sun, 18 Dec 2011 20:18:42 +0000 (22:18 +0200)] 
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>

12 years agoLower RX_MGMT driver event debug level for Beacon frames
Jouni Malinen [Sun, 18 Dec 2011 19:48:25 +0000 (21:48 +0200)] 
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>

12 years agoAllow linking with libnl-3 (libnl 3.2 and newer)
Ben Greear [Sun, 18 Dec 2011 19:12:05 +0000 (21:12 +0200)] 
Allow linking with libnl-3 (libnl 3.2 and newer)

I needed this patch to compile against the latest
libnl code. I added this to my config file:

CONFIG_LIBNL32=y

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

12 years agoP2P: Reduce the idle time in Wait peer connect state
Neeraj Kumar Garg [Sun, 18 Dec 2011 16:01:11 +0000 (18:01 +0200)] 
P2P: Reduce the idle time in Wait peer connect state

When waiting for go_neg frame from the peer in WAIT_PEER_CONNECT state,
I have observed that sometimes it takes 20 to 30 secs for successful GO
negotiation. I also found out that it is because of 1 second idle time,
in WAIT_PEER_CONNECT state. While it is good to have 1 second idle time
[for doing power-save or doing some other legacy STA Scan or some other
useful stuff], this makes GO Negotiation process slow.

We wait for 1 second idle and then listen for a random time between
100(min)-300(max) ms. Assume P1 is in WAIT_PEER_CONNECT state and P2 is
the one which is now to send go_neg frame. If P2 sends GO Negotiation
frame just at the boundary of 300 ms of P1 and assume that P2 takes
close to 600-800 ms for one iteration of sending go_neg request (one
iteration is GO Negotiation Request frame time + dwell time +
listen_time), P2 needs to transmit at least 16-18 Action frames for
hitting the listen time of P1.

Following patch reduces the idle time to 500 ms. Alternatively we can
increase the listen time interval to 500 ms just for WAIT_PEER_CONNECT
state.

12 years agoP2P: Fix PROBE_REQ_ONLY flag use for Provision Discovery Request
Neeraj Kumar Garg [Sun, 18 Dec 2011 15:42:11 +0000 (17:42 +0200)] 
P2P: Fix PROBE_REQ_ONLY flag use for Provision Discovery Request

Provision discovery from a known peer should actually check for
dev->flags & P2P_DEV_PROBE_REQ_ONLY. This is creating an issue of
updating the listen frequency of peer with the PD request frame
frequency. PD request frame will be sent by the peer on our local listen
frequency. This patch fixes that error. Suggested check has already been
implemented in the invitation req receive path.

12 years agoP2P: Fix Provision Discovery channel for some join-GO cases
Jouni Malinen [Sun, 18 Dec 2011 15:21:25 +0000 (17:21 +0200)] 
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>

12 years agowpa_supplicant/dbus AP: Add support for WPS Internal Registrar
Gustavo Sverzut Barbieri [Sun, 18 Dec 2011 15:06:31 +0000 (17:06 +0200)] 
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
3ec97afe571f159ea95213262c1c6b89965827d4)

Signed-hostap: Gustavo Sverzut Barbieri <barbieri@profusion.mobi>

12 years agoP2P: Make GO negotiation peer and group information available over D-Bus
Reinette Chatre [Sun, 18 Dec 2011 14:52:33 +0000 (16:52 +0200)] 
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>

12 years agoP2P: Do not include own information in the peer table
Marek Kwaczynski [Sun, 18 Dec 2011 14:38:48 +0000 (16:38 +0200)] 
P2P: Do not include own information in the peer table

When the station is connected to P2P GO after calling p2p_find command
the device sees itself. It is related to lack of filtering itself from
clients connected to P2P GO.

Step by step:
1. dev1: p2p_group_add
2. dev2: p2p_connect <MAC1> pbc join
3. dev1: wps_pbc
4. dev2: p2p_find

Skip P2P client information for our own device from a GO with which
we are connected.

12 years agoPCSC: Accept 0x67 (Wrong length) as a response to READ RECORD
Jouni Malinen [Sun, 18 Dec 2011 12:44:03 +0000 (14:44 +0200)] 
PCSC: Accept 0x67 (Wrong length) as a response to READ RECORD

It looks like some USIM cards respond with 0x67 (Wrong length) instead
of 0x6c to 00 b2 01 04 ff. This was getting rejected in
scard_get_record_len(). ETSI TS 102 221 is not very clear on this
detail, but it looks fine to accept the 0x67 error value, too, to learn
the record length.

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

12 years agoFix CONFIG_NO_SCAN_PROCESSING=y build with ctrl_iface
Jouni Malinen [Sat, 17 Dec 2011 16:07:58 +0000 (18:07 +0200)] 
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>

12 years agoctrl_iface: Check for IEEE8021X_EAPOL definition
Antonio Quartulli [Sat, 17 Dec 2011 16:04:50 +0000 (18:04 +0200)] 
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>

12 years agoMake hostapd_eid_wmm_valid() return more logical return values
Jouni Malinen [Sat, 17 Dec 2011 10:41:00 +0000 (12:41 +0200)] 
Make hostapd_eid_wmm_valid() return more logical return values

Return 1/0 instead 0/-1 to indicate valid/invalid element so that
the if statement makes more sense with !wmm_valid().

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

12 years agoAP: Pass station's WMM configuration to driver wrappers
Jason Young [Sat, 17 Dec 2011 10:38:06 +0000 (12:38 +0200)] 
AP: Pass station's WMM configuration to driver wrappers

This updates a previous patch did more or less the same thing by
providing the qosinfo as a single variable to the driver wrappers.

Signed-hostap: Jason Young <jason.young@dspg.com>

12 years agonl80211: Fix memory leaks on nla_put_failure error paths
Jouni Malinen [Sat, 17 Dec 2011 10:27:11 +0000 (12:27 +0200)] 
nl80211: Fix memory leaks on nla_put_failure error paths

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

12 years agonl80211: Fix memory leak on nla_put_failure error paths
Jason Young [Sat, 17 Dec 2011 10:19:36 +0000 (12:19 +0200)] 
nl80211: Fix memory leak on nla_put_failure error paths

Signed-hostap: Jason Young <jason.young@dspg.com>

12 years agonl80211: Send uapsd_queues and max_sp values on STA addition
Eliad Peller [Sat, 17 Dec 2011 09:59:34 +0000 (11:59 +0200)] 
nl80211: Send uapsd_queues and max_sp values on STA addition

When a new station is added, send its configured WMM params.

Signed-off-by: Eliad Peller <eliad@wizery.com>
12 years agoAP: Add uapsd_queues and max_sp fields
Eliad Peller [Sat, 17 Dec 2011 09:55:14 +0000 (11:55 +0200)] 
AP: Add uapsd_queues and max_sp fields

Add uapsd_queues and max_sp fields to sta_info struct,
and pass them to the sta_add callback.

These values are determined by the WMM IE in the (Re)Association Request.

Signed-off-by: Eliad Peller <eliad@wizery.com>
12 years agoAP: Consider U-APSD driver support
Eliad Peller [Sat, 17 Dec 2011 09:45:53 +0000 (11:45 +0200)] 
AP: Consider U-APSD driver support

Check whether the driver advertises support for U-APSD
in AP mode, and evaluate wmm_uapsd only in this case.

Signed-off-by: Eliad Peller <eliad@wizery.com>
12 years agoAndroid: Fix PNO start function conversion
Jouni Malinen [Wed, 14 Dec 2011 23:06:02 +0000 (01:06 +0200)] 
Android: Fix PNO start function conversion

The wpa_hexdump_ascii() call did not get converted properly and this
was missed becaused of it getting defined out from the build. Anyway,
this better use the correct variable names should that debug print
ever be enabled for Android.

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

12 years agonl80211: Fix CONFIG_TDLS=y build
Jouni Malinen [Mon, 12 Dec 2011 14:32:07 +0000 (16:32 +0200)] 
nl80211: Fix CONFIG_TDLS=y build

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

12 years agoIBSS: fix RSN key initialisation
Johannes Berg [Sun, 11 Dec 2011 17:57:50 +0000 (19:57 +0200)] 
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 bdffdc5ddb0c838af4c90d11:
"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>

12 years agonl80211: Clean up info on netdev or nl80211 not found errors
Jouni Malinen [Sun, 11 Dec 2011 16:51:55 +0000 (18:51 +0200)] 
nl80211: Clean up info on netdev or nl80211 not found errors

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

12 years agoDisassociate when starting WPS search
Jouni Malinen [Sun, 11 Dec 2011 16:30:47 +0000 (18:30 +0200)] 
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>

12 years agoFix compiler warning with CONFIG_NO_STDOUT_DEBUG=y
Jouni Malinen [Sun, 11 Dec 2011 16:19:24 +0000 (18:19 +0200)] 
Fix compiler warning with CONFIG_NO_STDOUT_DEBUG=y

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

12 years agoFix compiler warning with CONFIG_NO_SCAN_PROCESSING=y
Jouni Malinen [Sun, 11 Dec 2011 16:14:09 +0000 (18:14 +0200)] 
Fix compiler warning with CONFIG_NO_SCAN_PROCESSING=y

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

12 years agoFix compiler warning with CONFIG_NO_STDOUT_DEBUG=y
Jouni Malinen [Sun, 11 Dec 2011 16:13:51 +0000 (18:13 +0200)] 
Fix compiler warning with CONFIG_NO_STDOUT_DEBUG=y

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

12 years agoP2P: Fix 32-bit compiler warnings on service discovery reference
Jouni Malinen [Sun, 11 Dec 2011 16:06:34 +0000 (18:06 +0200)] 
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>

12 years agoP2P: Remove unexpected pending Provision Discovery Request in Search
Jean-Michel.Bachot [Sun, 11 Dec 2011 15:43:17 +0000 (17:43 +0200)] 
P2P: Remove unexpected pending Provision Discovery Request in Search

A Pending Provision Discovery Request was sent in SEARCH phase after a
previous provision discovery timeout. Fix this by resetting the config
method of P2P device in the pending PD reset function. This avoids the
sending of a pending Provision Discovery Request during the next P2P
search.

Signed-off-by: Jean-Michel.Bachot <jean-michelx.bachot@intel.com>
12 years agoP2P: Fix Provision Discovery name in debug messages
Jouni Malinen [Sun, 11 Dec 2011 15:36:38 +0000 (17:36 +0200)] 
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>

12 years agoP2P: Reject Presence Request if current NoA cannot be fetched
Jouni Malinen [Sun, 11 Dec 2011 15:07:41 +0000 (17:07 +0200)] 
P2P: Reject Presence Request if current NoA cannot be fetched

It is safer to assume that the driver could be using NoA and reject
any Presence Request unless we are sure that noa NoA is in use.

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

12 years agoAllow WPA passphrase to be fetched with RADIUS Tunnel-Password attribute
Michael Braun [Sun, 11 Dec 2011 11:01:57 +0000 (13:01 +0200)] 
Allow WPA passphrase to be fetched with RADIUS Tunnel-Password attribute

This allows per-device PSK to be configured for WPA-Personal using a
RADIUS authentication server. This uses RADIUS-based MAC address ACL
(macaddr_acl=2), i.e., Access-Request uses the MAC address of the
station as the User-Name and User-Password. The WPA passphrase is
returned in Tunnel-Password attribute in Access-Accept. This
functionality can be enabled with the new hostapd.conf parameter,
wpa_psk_radius.

Signed-hostap: Michael Braun <michael-dev@fami-braun.de>

12 years agoSkip WPS PBC overlap detection if P2P address is the same
Vitaly Wool [Sun, 11 Dec 2011 10:03:18 +0000 (12:03 +0200)] 
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>

12 years agonl80211: Send Probe Response template to the driver
Arik Nemtsov [Sat, 10 Dec 2011 19:01:36 +0000 (21:01 +0200)] 
nl80211: Send Probe Response template to the driver

Pass the raw Probe Response template to kernel via netlink using the
set_ap() driver callback. The data is sent as one of the Beacon
attributes.

Signed-hostap: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
12 years agoSet driver Probe Response template for AP mode offload
Arik Nemtsov [Sat, 10 Dec 2011 18:58:59 +0000 (20:58 +0200)] 
Set driver Probe Response template for AP mode offload

Configure a Probe Response template for drivers that support it. The
template is updated when the Beacon template is updated.

The Probe Response template is propagated to the driver via the set_ap()
callback.

Signed-hostap: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
12 years agoSplit Probe Response generation into a separate function
Arik Nemtsov [Sat, 10 Dec 2011 18:52:16 +0000 (20:52 +0200)] 
Split Probe Response generation into a separate function

This is needed for Probe Response template, so move the code into a
separate function that can be shared.

Signed-hostap: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
12 years agoMaintain internal copy of Probe Response offload capabilities
Arik Nemtsov [Sat, 10 Dec 2011 15:17:43 +0000 (17:17 +0200)] 
Maintain internal copy of Probe Response offload capabilities

Signed-hostap: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
12 years agonl80211: Propagate Probe Response offload capabilities from kernel
Arik Nemtsov [Sat, 10 Dec 2011 14:50:00 +0000 (16:50 +0200)] 
nl80211: Propagate Probe Response offload capabilities from kernel

Translate nl80211 flags to wpa_supplicant flags for Probe Response
offload support. The existence of the nl80211 PROBE_RESP_OFFLOAD_SUPPORT
attribute means Probe Response offload is supported. The value of the
attribute is a bitmap of supported protocols.

Signed-hostap: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
12 years agoAP: Improve disconnect and timeout related logging
Ben Greear [Sat, 10 Dec 2011 14:34:52 +0000 (16:34 +0200)] 
AP: Improve disconnect and timeout related logging

This previously helped when debugging some auth issues when hitting the
AP with 128 association attempts all at once.

Signed-off-by: Ben Greear <greearb@candelatech.com>
12 years agoAP: Convert some wpa_printf to wpa_msg/dbg
Ben Greear [Sat, 10 Dec 2011 14:28:14 +0000 (16:28 +0200)] 
AP: Convert some wpa_printf to wpa_msg/dbg

This generates better log messages when running multiple
interfaces in one process.

Signed-off-by: Ben Greear <greearb@candelatech.com>
12 years agoTell user why a channel cannot be used in AP mode
Ben Greear [Sat, 10 Dec 2011 14:18:50 +0000 (16:18 +0200)] 
Tell user why a channel cannot be used in AP mode

Signed-off-by: Ben Greear <greearb@candelatech.com>
12 years agoP2P: Remove forgotten TODO comment
Jouni Malinen [Sat, 10 Dec 2011 12:28:23 +0000 (14:28 +0200)] 
P2P: Remove forgotten TODO comment

The P2P peers are already expired.

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

12 years agoP2P: Clean up group formation on network block removal
Jouni Malinen [Sat, 10 Dec 2011 10:56:42 +0000 (12:56 +0200)] 
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>

12 years agoP2P: Append P2P Device Address to AP-STA-DISCONNECTED event
Jithu Jance [Sat, 10 Dec 2011 10:26:00 +0000 (12:26 +0200)] 
P2P: Append P2P Device Address to AP-STA-DISCONNECTED event

Append "p2p_dev_addr" parameter to AP-STA-DISCONNECTED event for P2P
connections. In addition, for AP-STA-CONNECTED event during P2P
connection, the "dev_addr=" print is replaced with "p2p_dev_addr=" to
be more consistent with other events.

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

12 years agonl80211: Store own address in BSS
Johannes Berg [Sat, 10 Dec 2011 09:56:31 +0000 (11:56 +0200)] 
nl80211: Store own address in BSS

Storing the address in the BSS instead of the DRV struct makes it usable
for hostapd and thus gets rid of the linux_get_ifhwaddr() call when
receiving a spurious frame.

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

12 years agoAdd MSK dump mechanism into hostapd RADIUS server for testing
Jouni Malinen [Thu, 8 Dec 2011 22:15:04 +0000 (00:15 +0200)] 
Add MSK dump mechanism into hostapd RADIUS server for testing

Testing code can now be enabled in the hostapd RADIUS server to dump
each derived MSK into a text file (e.g., to be used as an input to
wlantest). This functionality is not included in the default build
and can be enabled by adding the following line to hostapd/.config:
CFLAGS += -DCONFIG_RADIUS_TEST

The MSK dump file is specified with dump_msk_file parameter in
hostapd.conf (path to the dump file). If this variable is not set,
MSK dump mechanism is not enabled at run time.

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

12 years agowlantest: Allow MSK/PMK list to be read from a text file
Jouni Malinen [Thu, 8 Dec 2011 22:12:27 +0000 (00:12 +0200)] 
wlantest: Allow MSK/PMK list to be read from a text file

A text file with MSK/PMK entries (one key per line in hexdump format)
can be read into wlantest (-f<path to file>) to initialize list of
known PMKs.

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

12 years agoP2P: Add group ifname to P2P-PROV-DISC-* events
Jouni Malinen [Tue, 6 Dec 2011 19:57:17 +0000 (21:57 +0200)] 
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>

12 years agoP2P: Skip duplicated provision discovery on join
Jithu Jance [Tue, 6 Dec 2011 19:44:57 +0000 (21:44 +0200)] 
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>

12 years agoP2P: Add optional "join" argument for p2p_prov_disc command
Jithu Jance [Tue, 6 Dec 2011 19:28:02 +0000 (21:28 +0200)] 
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>

12 years agoRemove documentation for label option in p2p_connect
Jouni Malinen [Tue, 6 Dec 2011 19:13:54 +0000 (21:13 +0200)] 
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>

12 years agonl80211: Remove unnecessary struct nl80211_handles wrapper
Jouni Malinen [Tue, 6 Dec 2011 17:47:59 +0000 (19:47 +0200)] 
nl80211: Remove unnecessary struct nl80211_handles wrapper

Since the nl_cache is not used anymore, there is no need for maintaining
the struct nl80211_handles wrapper for struct nl_handle. Clean this up
by using nl_handle directly.

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

12 years agonl80211: Listen to unexpected 4addr events
Johannes Berg [Tue, 6 Dec 2011 17:32:41 +0000 (19:32 +0200)] 
nl80211: Listen to unexpected 4addr events

Monitor-less AP mode had lost the ability to do
4addr WDS, this adds it back.

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