]> git.ipfire.org Git - thirdparty/hostap.git/log
thirdparty/hostap.git
13 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>

13 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>

13 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>

13 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>

13 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>

13 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>

13 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>

13 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>

13 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.

13 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.

13 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>

13 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>

13 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>

13 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.

13 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>

13 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>

13 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>

13 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>

13 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>

13 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>

13 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>

13 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>
13 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>
13 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>
13 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>

13 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>

13 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>

13 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>

13 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>

13 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>

13 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>

13 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>

13 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>

13 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>
13 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>

13 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>

13 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>

13 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>

13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>

13 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>

13 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>

13 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>

13 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>

13 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>

13 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>

13 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>

13 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>

13 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>

13 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>

13 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>

13 years agonl80211: Use global event socket for multicast events
Johannes Berg [Tue, 6 Dec 2011 17:30:43 +0000 (19:30 +0200)] 
nl80211: Use global event socket for multicast events

This is a rewrite of Ben Greear's patch, making the
nl80211 code use just a single multicast event socket.

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

13 years agonl80211: Register for Beacon frames in AP mode
Johannes Berg [Tue, 6 Dec 2011 16:39:57 +0000 (18:39 +0200)] 
nl80211: Register for Beacon frames in AP mode

When running AP mode, we need to receive beacons over overlapping BSSes
to handle protection. Use the new nl80211 command for this. As the
command works per wiphy (and we don't want to receive the Beacon frames
multiple times) add an abstraction that keeps track of per-wiphy data.

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

13 years agonl80211: Subscribe to spurious class3 frame events
Johannes Berg [Tue, 6 Dec 2011 16:29:45 +0000 (18:29 +0200)] 
nl80211: Subscribe to spurious class3 frame events

These events are necessary to send deauth frames to
stations sending spurious data frames. Subscribe to
them on the per-BSS event socket.

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

13 years agonl80211: Use nl80211 for mgmt TX/RX in AP mode
Johannes Berg [Tue, 6 Dec 2011 16:24:00 +0000 (18:24 +0200)] 
nl80211: Use nl80211 for mgmt TX/RX in AP mode

To achieve this, multiple things are needed:
 1) since hostapd needs to handle *all* action frames,
    make the normal registration only when in a non-AP
    mode, to be able to do this use the new socket
 2) store the frequency in each BSS to be able to give
    the right frequency to nl80211's mgmt-tx operation
 3) make TX status processing reject non-matched cookie
    only in non-AP mode

The whole thing depends on having station-poll support
in the kernel. That's currently a good indicator since
the kernel patches are added together.

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

13 years agoEAP server: Force identity request after eapRestart for passthrough
Jouni Malinen [Tue, 6 Dec 2011 11:02:23 +0000 (13:02 +0200)] 
EAP server: Force identity request after eapRestart for passthrough

Fix start of reauthentication after failed authentication with
passthrough (external AAA server) to use internal EAP Identity method.

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

13 years agoRevert "EAP server: Force identity request after INITIALIZE for passthrough"
Jouni Malinen [Tue, 6 Dec 2011 10:47:17 +0000 (12:47 +0200)] 
Revert "EAP server: Force identity request after INITIALIZE for passthrough"

This reverts commit 204dd3f420bb1ddce02d13d7a366169e0bda914d.
start_reauth was not supposed to be used in this way and setting it
to TRUE in INITIALIZE breaks internal EAP server.

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

13 years agonl80211: Use driver event to indicate failure on authentication retry
Jouni Malinen [Sun, 4 Dec 2011 20:28:30 +0000 (22:28 +0200)] 
nl80211: Use driver event to indicate failure on authentication retry

When using authentication retry within driver_nl80211.c, a failure on the
second attempt has to be indicated with a driver event since the return
code from wpa_driver_nl80211_authenticate() is not actually delivered to
the core code in that case.

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

13 years agoSME: Fix processing of Authentication timeout
Jouni Malinen [Sun, 4 Dec 2011 20:27:48 +0000 (22:27 +0200)] 
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>

13 years agoTry to reconnect to the same BSS on recoverable disconnection
Jouni Malinen [Sun, 4 Dec 2011 19:57:14 +0000 (21:57 +0200)] 
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>

13 years agonl80211: Recover from auth req ENOENT with a scan
Jouni Malinen [Sun, 4 Dec 2011 19:53:56 +0000 (21:53 +0200)] 
nl80211: Recover from auth req ENOENT with a scan

cfg80211 rejects NL80211_CMD_AUTHENTICATE with ENOENT if the BSS entry
for the target BSS is not available. This can happen if the cfg80211
entry has expired before wpa_supplicant entry (e.g., during a suspend).
To recover from this quickly, run a single channel scan to get the
cfg80211 entry back and then retry authentication command again. This
is handled within driver_nl80211.c to keep the core wpa_supplicant
implementation cleaner.

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

13 years agoSME: Fix processing of Authentication request failure
Jouni Malinen [Sun, 4 Dec 2011 19:04:24 +0000 (21:04 +0200)] 
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>

13 years agoEAP-AKA peer: Keep pseudonym identity across EAP exchanges
Jouni Malinen [Sun, 4 Dec 2011 15:21:22 +0000 (17:21 +0200)] 
EAP-AKA peer: Keep pseudonym identity across EAP exchanges

This updates EAP-AKA peer implementation with the changes that previous
commits did for EAP-SIM.

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

13 years agoEAP-SIM peer: Only log the identities that we actually forget
Simon Baatz [Sun, 4 Dec 2011 15:17:21 +0000 (17:17 +0200)] 
EAP-SIM peer: Only log the identities that we actually forget

[Bug 425]

13 years agoEAP-SIM: Keep pseudonym identity
Simon Baatz [Sun, 4 Dec 2011 15:15:16 +0000 (17:15 +0200)] 
EAP-SIM: Keep pseudonym identity

The pseudonym is a temporary identity, but is no one-time identifier (like
the fast re-authentication identity). Thus, do not forget it if the server
does not include it in every challenge. There are servers that include the
pseudonym identity only at full-auth. [Bug 424]

13 years agoUse explicit type casting to avoid sign extensions
Jouni Malinen [Sun, 4 Dec 2011 15:06:35 +0000 (17:06 +0200)] 
Use explicit type casting to avoid sign extensions

Make sure sign extension does not end up getting used here by
explicitly type casting the variables to correct size.

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

13 years agoCheck nt_password_hash() return code
Jouni Malinen [Sun, 4 Dec 2011 14:59:16 +0000 (16:59 +0200)] 
Check nt_password_hash() return code

While this is unlikely to fail in practice, better be more consistent
in validating nt_password_hash() result.

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

13 years agoCheck wpa_supplicant_parse_ies() return value more consistently
Jouni Malinen [Sun, 4 Dec 2011 14:40:06 +0000 (16:40 +0200)] 
Check wpa_supplicant_parse_ies() return value more consistently

Reject messages that fail to be parsed instead of trying to use
partially parsed information.

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

13 years agoFix basic_rates copying
Jouni Malinen [Sun, 4 Dec 2011 11:12:30 +0000 (13:12 +0200)] 
Fix basic_rates copying

Commit e5693c4775bae65faa960f80889f98b0a6cb2e1c used incorrect
sizeof to copy the basic rates.

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

13 years agoFix no-NEED_AP_MLME build
Jouni Malinen [Sun, 4 Dec 2011 10:46:01 +0000 (12:46 +0200)] 
Fix no-NEED_AP_MLME build

Commit 34445d12eeb2eea53f50e5021e260dc0d07cbbbd forgot to convert
the hostapd_prepare_rates() inline wrapper for builds that do not
define NEED_AP_MLME.

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

13 years agoAllow Action frames with unknown BSSID in GO mode
Arik Nemtsov [Sun, 4 Dec 2011 10:10:11 +0000 (12:10 +0200)] 
Allow Action frames with unknown BSSID in GO mode

P2P invitation responses are transmitted with the BSSID set to the peer
address. Pass these action frames up to allow the GO to receive the
Invitation Response (and avoid sending the Invitation Request multiple
times).

Signed-off-by: Arik Nemtsov <arik@wizery.com>
13 years agonl80211: Do not encrypt IEEE 802.1X WEP EAPOL
Johannes Berg [Sat, 3 Dec 2011 18:46:12 +0000 (20:46 +0200)] 
nl80211: Do not encrypt IEEE 802.1X WEP EAPOL

Set the NL80211_ATTR_CONTROL_PORT_NO_ENCRYPT flag for nl80211 to tell
drivers (mac80211) to not encrypt the EAPOL frames for WEP IEEE 802.1X.

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

13 years agonl80211: Allocate nl CB for BSS RX
Johannes Berg [Sat, 3 Dec 2011 18:14:53 +0000 (20:14 +0200)] 
nl80211: Allocate nl CB for BSS RX

In preparation for things that receive on a BSS-specific handle,
allocate a CB for it and hook it up to receive functions.

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

13 years agonl80211: Rename process_event
Johannes Berg [Sat, 3 Dec 2011 18:10:44 +0000 (20:10 +0200)] 
nl80211: Rename process_event

The next patch will add process_bss_event, rename process_event to
process_drv_event to differentiate between them.

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

13 years agonl80211: Pass cb to eloop function
Johannes Berg [Sat, 3 Dec 2011 18:07:54 +0000 (20:07 +0200)] 
nl80211: Pass cb to eloop function

By passing the nl_cb as the context to the eloop function we can
(in the next patch) use the same eloop function for BSS events.

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

13 years agonl80211: Use one CB for driver event RX
Johannes Berg [Sat, 3 Dec 2011 18:00:11 +0000 (20:00 +0200)] 
nl80211: Use one CB for driver event RX

There's no need to clone the CB all the time
and then assign it, just use a constant one.

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

13 years agonl80211: Store frequency in bss struct
Johannes Berg [Sat, 3 Dec 2011 17:55:22 +0000 (19:55 +0200)] 
nl80211: Store frequency in bss struct

Storing the frequency in the bss struct allows using it for frame
commands in AP mode and not relying on the driver struct as much, which
is good for hostapd mode.

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

13 years agonl80211: Move AP SME setup to mode change
Johannes Berg [Sat, 3 Dec 2011 17:47:01 +0000 (19:47 +0200)] 
nl80211: Move AP SME setup to mode change

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

13 years agonl80211: Use socket error queue for EAPOL TX status
Johannes Berg [Sat, 3 Dec 2011 17:32:23 +0000 (19:32 +0200)] 
nl80211: Use socket error queue for EAPOL TX status

This will allow getting TX status for EAPOL frames
sent as data frames if the driver supports it.

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

13 years agoEAP server: Force identity request after INITIALIZE for passthrough
Jouni Malinen [Sat, 3 Dec 2011 15:37:48 +0000 (17:37 +0200)] 
EAP server: Force identity request after INITIALIZE for passthrough

Previously, sm->start_reauth was set to TRUE in SUCCESS2 state to force
reauthentication to start with EAP identity request. This works fine for
the case of EAP success through the AAA passthrough authentication, but
is not enough to handle passthrough authentication failure. sm->identity
is set in that case and getDecision would return PASSTHROUGH instead of
CONTINUE (to Identity method).

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

13 years agoUpdate internal MAC address on EVENT_INTERFACE_ENABLED events
Jouni Malinen [Sat, 3 Dec 2011 11:20:40 +0000 (13:20 +0200)] 
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>

13 years agonl80211: Ignore interface up event if interface is down
Jouni Malinen [Sat, 3 Dec 2011 11:18:57 +0000 (13:18 +0200)] 
nl80211: Ignore interface up event if interface is down

The RTM_NEWLINK even can have IFF_UP flag even if the interface is
down. Do not generate EVENT_INTERFACE_ENABLED event based on such a
message.

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

13 years agoUpdate RSN supplicant MAC address on driver reinitialization
Johan Hedlund [Sat, 3 Dec 2011 11:02:57 +0000 (13:02 +0200)] 
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.

13 years agonl80211: Use binary hexdump for scan IEs instead of text
Jouni Malinen [Sat, 3 Dec 2011 10:47:34 +0000 (12:47 +0200)] 
nl80211: Use binary hexdump for scan IEs instead of text

The IEs are binary data, so there is not much point in trying
to show them as ASCII data in debug prints.

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

13 years agoConvert hostapd_prepare_rates() to use struct hostapd_iface
Jouni Malinen [Sat, 3 Dec 2011 10:20:17 +0000 (12:20 +0200)] 
Convert hostapd_prepare_rates() to use struct hostapd_iface

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

13 years agoMerge set_rate_sets() driver_ops into set_ap()
Jouni Malinen [Sat, 3 Dec 2011 10:16:03 +0000 (12:16 +0200)] 
Merge set_rate_sets() driver_ops into set_ap()

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

13 years agoRemove unused parameters from set_rate_sets()
Jouni Malinen [Sat, 3 Dec 2011 09:57:13 +0000 (11:57 +0200)] 
Remove unused parameters from set_rate_sets()

Only setting of the basic rate set was supported, so remove the
unused parameters.

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

13 years agohostapd: Show driver event names in debug log
Jouni Malinen [Sat, 3 Dec 2011 09:46:47 +0000 (11:46 +0200)] 
hostapd: Show driver event names in debug log

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

13 years agonl80211: Merge ap_isolate configuration into nl80211_set_bss()
Jouni Malinen [Sat, 3 Dec 2011 09:43:18 +0000 (11:43 +0200)] 
nl80211: Merge ap_isolate configuration into nl80211_set_bss()

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

13 years agoFix a typo in a comment
Jouni Malinen [Sat, 3 Dec 2011 09:38:51 +0000 (11:38 +0200)] 
Fix a typo in a comment

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

13 years agoFix generated WPS PIN values to use zero-padding
Szymon Bigos [Fri, 2 Dec 2011 21:04:39 +0000 (23:04 +0200)] 
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.

13 years agoAdd example WPS AP mode UI for wpa_supplicant
Jouni Malinen [Thu, 1 Dec 2011 20:14:07 +0000 (22:14 +0200)] 
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>

13 years agowpa_supplicant AP: Allows passphrase to be fetched
Jouni Malinen [Thu, 1 Dec 2011 20:12:03 +0000 (22:12 +0200)] 
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>