mech_eap.git
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>

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

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

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

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

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

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

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

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

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

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

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

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

12 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]

12 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]

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

12 years agoWPS: Disable WPS(v2) in WPA/TKIP-only configuration
Jouni Malinen [Thu, 1 Dec 2011 19:46:19 +0000 (21:46 +0200)]
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>

12 years agoCall wpas_connection_failed() only if actually trying to connect
Jouni Malinen [Thu, 1 Dec 2011 16:22:56 +0000 (18:22 +0200)]
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>

12 years agoMake reconnect-on-disassoc debug prints somewhat more helpful
Jouni Malinen [Thu, 1 Dec 2011 16:22:10 +0000 (18:22 +0200)]
Make reconnect-on-disassoc debug prints somewhat more helpful

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

12 years agoP2P: Clear show_group_started on GO start
Jouni Malinen [Thu, 1 Dec 2011 08:46:06 +0000 (10:46 +0200)]
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>

12 years agoWPS: Allow RF Bands value to be overridden
Bharat Chakravarty [Wed, 30 Nov 2011 15:44:43 +0000 (17:44 +0200)]
WPS: Allow RF Bands value to be overridden

A new hostapd.conf parameter, wps_rf_bands, can now be used to fix the
RF Bands value in cases where hw_mode is not set or when operating a
dual band dual concurrent AP.

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

12 years agoWPS: Fix stopping of active WPS operation on dual concurrent AP
Subrat Dash [Wed, 30 Nov 2011 14:48:14 +0000 (16:48 +0200)]
WPS: Fix stopping of active WPS operation on dual concurrent AP

When hostapd controls multiple radios, WPS operations are started on
all interfaces. However, when the provisioning run had been completed
successfully, actiove WPS mode was stopped only a single interface. Fix
this to iterate through all interfaces so that this is handled
consistently with the starting of WPS operation.

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

12 years agoWPS ER: Fix segfault in some selected registrar change cases
Jouni Malinen [Wed, 30 Nov 2011 12:44:23 +0000 (14:44 +0200)]
WPS ER: Fix segfault in some selected registrar change cases

Commit 628d54639a90f779fd5c98c31e049638de56b17e introduced number
of new WPS related ctrl_iface messages to hostapd. Some of these
were for ER events which do not make any sense to hostapd that
cannot operate as an ER. The WPS_EV_ER_SET_SELECTED_REGISTRAR one
from wps_registrar_sel_registrar_changed_event() was especially
problematic since it can cause wpa_supplicant ER code segfault due
to missing event data.

Revert all the ER specific changes from commit
628d54639a90f779fd5c98c31e049638de56b17e to get rid of the segfault
and undesired extra code in hostapd.

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

12 years agoSet ht_capab from based on driver capabilities when in P2P GO mode
Arik Nemtsov [Tue, 29 Nov 2011 21:45:07 +0000 (23:45 +0200)]
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>

12 years agoIncrease min sched_scan interval from 2 to 10 seconds
Jouni Malinen [Tue, 29 Nov 2011 18:05:58 +0000 (20:05 +0200)]
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>

12 years agoAndroid: nl80211: Add Android specific PNO configuration
Dmitry Shmidt [Wed, 23 Nov 2011 14:29:28 +0000 (16:29 +0200)]
Android: nl80211: Add Android specific PNO configuration

This is based on the Android driver_cmd changes that are converted to
use the sched_scan/stop_sched_scan driver_ops for the case where the
driver does not support the new nl80211 commands.

Change-Id: Iaedc340f84650af422bd2ea57d2a8b0a9d4a5330
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
12 years agoAndroid: wext: Add sched_scan functions for PNO
Dmitry Shmidt [Fri, 25 Nov 2011 19:49:03 +0000 (21:49 +0200)]
Android: wext: Add sched_scan functions for PNO

(jm: This is based on the Android change that used driver_cmd. The same
implementation is used for the actual driver interface, but the commands
are now accessed through sched_scan/stop_sched_scan driver_ops instead
of driver_cmd)

12 years agoAndroid: wext: Add driver state events
Dmitry Shmidt [Fri, 25 Nov 2011 19:08:52 +0000 (21:08 +0200)]
Android: wext: Add driver state events

12 years agoFix pno_start() to initialize SSID list properly
Dmitry Shmidt [Tue, 29 Nov 2011 10:56:32 +0000 (12:56 +0200)]
Fix pno_start() to initialize SSID list properly

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
12 years agoUse normal scan before sched_scan if that can speed up connection
Jouni Malinen [Mon, 28 Nov 2011 16:36:36 +0000 (18:36 +0200)]
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>

12 years agoAdd broadcast SSID for sched_scan for scan_ssid=0 networks
Jouni Malinen [Mon, 28 Nov 2011 16:12:38 +0000 (18:12 +0200)]
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>

12 years agoUse common code for disabled network case in sched_scan
Jouni Malinen [Mon, 28 Nov 2011 16:09:37 +0000 (18:09 +0200)]
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>

12 years agoDrop sched_scan filter if not enough match sets supported
Jouni Malinen [Mon, 28 Nov 2011 15:52:36 +0000 (17:52 +0200)]
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>

12 years agoMake sched_scan debug clearer on timeout use
Jouni Malinen [Mon, 28 Nov 2011 15:52:02 +0000 (17:52 +0200)]
Make sched_scan debug clearer on timeout use

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