mech_eap.git
11 years agoWPS: Remove old OOB NFC interface
Jouni Malinen [Sun, 28 Oct 2012 16:20:03 +0000 (18:20 +0200)]
WPS: Remove old OOB NFC interface

The old WPS interface for using NFC has no known deployments and even
the binary libraries referenced here are not easily available anymore.
Since the new interface for using NFC with WPS covers the same
functionality, remove the old implementation to clean up WPS
implementation.

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

11 years agoWPS: Use AP Channel attribute in credential to speed up scan
Jouni Malinen [Sun, 28 Oct 2012 16:02:04 +0000 (18:02 +0200)]
WPS: Use AP Channel attribute in credential to speed up scan

When WPS is used with NFC connection handover, the AP may indicate its
operating channel within the credential information. Use this
informatiom, if present, to speed up the scan process.

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

11 years agoWPS: Add preliminary NFC connection handover support for Enrollee
Jouni Malinen [Sun, 28 Oct 2012 15:39:46 +0000 (17:39 +0200)]
WPS: Add preliminary NFC connection handover support for Enrollee

This commit adds new wpa_supplicant ctrl_iface commands to allow
external programs to go through NFC connection handover mechanism
with wpa_supplicant taking care of the WPS processing. This version
includes only the case where wpa_supplicant is operating as a
station/Enrollee.

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

11 years agoFix EAPOL supplicant port authorization with PMKSA caching
Jouni Malinen [Sat, 27 Oct 2012 08:52:43 +0000 (11:52 +0300)]
Fix EAPOL supplicant port authorization with PMKSA caching

The previous eapol_sm_notify_cached() implementation forced the port
to be authorized when receiving EAPOL-Key msg 1/4 that included a
matching PMKID in cases when PMKSA caching is used. This is too early
since the port should really be authorized only after the PTK has been
configured which is the case when PMKSA caching is not used.

Fix this by using the EAPOL supplicant PAE state machine to go through
the AUTHENTICATING and AUTHENTICATED states instead of forcing a jump
to AUTHENTICATED without performing full state machine steps. This can
be achieved simply by marking eapSuccess TRUE at least with the current
version of EAP and EAPOL state machines (the earlier commits in this
function seemed to indicate that this may have not been that easy in
the older versions due to the hacks needed here).

This addresses an issue with nl80211-based driver interface when the
driver depends on the STA Authorized flag being used to prevent
unprotected frames from being accepted (both TX and RX) prior to PTK
configuration.

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

11 years agoP2P: Allow all channels with multi-channel concurrency
Jouni Malinen [Fri, 26 Oct 2012 15:10:46 +0000 (18:10 +0300)]
P2P: Allow all channels with multi-channel concurrency

If the driver indicates support for multi-channel concurrency, change
the p2p_connect behavior to not force the current operating channel, but
instead, just mark it as preferred for GO Negotiation. This change
applies only for the case when the freq parameter is not used with the
p2p_connect command.

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

11 years agoFix EAPOL processing when STA switches between multi-BSSes
David Bird [Thu, 25 Oct 2012 06:20:15 +0000 (09:20 +0300)]
Fix EAPOL processing when STA switches between multi-BSSes

There was an issue with EAPOL frame exchanges in a multi-BSS
configuration when a station switches between the BSSes controlled by
the same hostapd process. When processing the EAPOL packet, the array of
virtual APs (iface->bss) is searched looking for the station that sent
the packet in order to identify which signal context should be used
during processing. The first match of the station in its list gets used
in the ieee802_1x_receive() function. However, even after a station has
disassociated, it remains in the list of stations pending an inactivity
timeout. This leads to the wrong hapd context (one where the station had
already disassociated) being used in some cases (if the current/active
bss entry appears in the list after one where the station has just
disassociated from) for EAPOL processing.

Fix this by checking the WLAN_STA_ASSOC flag before assuming the right
hapd context was found for the given station.

Signed-hostap: David Bird <dbird@powercloudsystems.com>
intended-for: hostap-1

11 years agoP2P: Add secondary device types into p2p_peer output
Jouni Malinen [Thu, 25 Oct 2012 06:16:27 +0000 (09:16 +0300)]
P2P: Add secondary device types into p2p_peer output

This allows the P2P_PEER command to be used to fetch the list of
secondary device types that each P2P peer has advertised.

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

11 years agonl80211: Add support for SAE operations
Jouni Malinen [Wed, 24 Oct 2012 06:10:42 +0000 (09:10 +0300)]
nl80211: Add support for SAE operations

This uses the recent cfg80211 changes to allow SAE authentication to be
implemented with the nl80211 driver interface.

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

11 years agoSync with linux/nl80211.h in wireless-testing.git
Jouni Malinen [Wed, 24 Oct 2012 06:08:38 +0000 (09:08 +0300)]
Sync with linux/nl80211.h in wireless-testing.git

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

11 years agoP2P: Improve robustness against lost ctrl::ack frames
Jouni Malinen [Sat, 13 Oct 2012 14:33:16 +0000 (17:33 +0300)]
P2P: Improve robustness against lost ctrl::ack frames

P2P includes two use cases where one of the devices is going to start a
group and likely change channels immediately after processing a frame.
This operation may be fast enough to make the device leave the current
channel before the peer has completed layer 2 retransmission of the
frame in case the ctrl::ack frame was lost. This can result in the peer
not getting TX status success notification.

For GO Negotiation Confirm frame, p2p_go_neg_conf_cb() has a workaround
that ignores the TX status failure and will continue with the group
formation with the assumption that the peer actually received the frame
even though we did not receive ctrl::ack. For Invitation Response frame
to re-invoke a persistent group, no such workaround is used in
p2p_invitation_resp_cb(). Consequently, TX status failure due to lost
ctrl::ack frame results in one of the peers not starting the group.

Increase the likelihood of layer 2 retransmission getting acknowledged
and ctrl::ack being received by waiting a short duration after having
processed the GO Negotiation Confirm and Invitation Response frames for
the re-invocation case. For the former, use 20 ms wait since this case
has been worked around in deployed devices. For the latter, use 50 ms
wait to get even higher likelihood of getting ctrl::ack through since
deployed devices (and the current wpa_supplicant implementation) do not
have a workaround to ignore TX status failure.

20 ms is long enough to include at least couple of retries and that
should increase likelihood of getting ctrl::ack through quite a bit. The
longer 50 ms wait is likely to include full set of layer 2 retries.

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

11 years agoFix regression in LEAP
Jouni Malinen [Thu, 11 Oct 2012 18:50:57 +0000 (21:50 +0300)]
Fix regression in LEAP

Commit 458cb3019108b6cb8c0c1cab94ae6ebf244eda27 broke LEAP since it
rejects EAP-Success packet that is used within LEAP and this frame does
not have a payload. Fix LEAP by relaxing the generic EAP packet
validation if LEAP has been negotiated.

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

11 years agoWPS: Limit number of active wildcard PINs to one
Jouni Malinen [Wed, 10 Oct 2012 14:38:06 +0000 (17:38 +0300)]
WPS: Limit number of active wildcard PINs to one

Previously, WPS Registrar allowed multiple wildcard PINs to be
configured. This can get confusing since these PINs get assigned to any
Enrollee that does not have a specific PIN and as such, cannot really be
used with different PIN values in reasonable ways. To avoid confusion
with multiple enabled PINs, invalidate any previously configured
wildcard PIN whenever adding a new one.

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

11 years agoWPS: Allow PIN timeout to be specified with wpa_supplicant AP/GO
Jouni Malinen [Wed, 10 Oct 2012 14:22:35 +0000 (17:22 +0300)]
WPS: Allow PIN timeout to be specified with wpa_supplicant AP/GO

Extend the wpa_cli wps_pin command to support specification of the PIN
expiration time in seconds similarly to hostapd_cli wps_pin command when
using wpa_supplicant for AP mode (including P2P GO).

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

11 years agoP2P: Allow P2P functionality to be disabled per interface
Jouni Malinen [Wed, 10 Oct 2012 10:08:23 +0000 (13:08 +0300)]
P2P: Allow P2P functionality to be disabled per interface

By default, P2P is enabled globally for all virtual interfaces and this
makes wpa_supplicant include WSC and P2P IEs in Probe Request frames for
all scans even if this is for a non-P2P station connection to speed up
device discovery. If an interface is dedicated for non-P2P station mode
operations, it is now possible to disable addition of WSC and P2P IEs
into Probe Request frames with a per-interface p2p_disabled parameter.
This can be set either in the configuration file (p2p_disabled=1) or at
run time ("wpa_cli -i wlan0 set p2p_disabled 1"). Unlike the previous
mechanism ("wpa_cli p2p_set disabled 1"), the new parameter changes the
behavior only for the specified interface while other interfaces
continue to follow the global P2P enabled/disabled state.

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

11 years agoDo not clear PMKSA cache on all network block parameter changes
Jouni Malinen [Tue, 9 Oct 2012 10:06:37 +0000 (13:06 +0300)]
Do not clear PMKSA cache on all network block parameter changes

The bssid and priority parameters in a network block do not have any
effect on the validity of a PMKSA cache entry, so avoid flushing the
PMKSA cache when only these parameters are changed. This is mainly
to allow forced roaming or network selection changes without causing
a disconnection if the changes are done during RSN association that
used EAP.

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

11 years agoFilter out unlikely "pre-shared key may be incorrect" messages
Jouni Malinen [Mon, 8 Oct 2012 14:49:54 +0000 (17:49 +0300)]
Filter out unlikely "pre-shared key may be incorrect" messages

Add a function to filter out known cases of disconnection during 4-way
handshake that are caused by something else than mismatch in PSK. This
commit adds the case where the local end determines a mismatch in
WPA/RSN element between Beacon/Probe Response frames and EAPOL-Key msg
3/4.

This can avoid some potentially confusing "WPA: 4-Way Handshake failed -
pre-shared key may be incorrect" ctrl_iface messages.

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

11 years agoEAP-TLS: Add extra validation for TLS Message Length
Jouni Malinen [Sun, 7 Oct 2012 17:18:10 +0000 (20:18 +0300)]
EAP-TLS: Add extra validation for TLS Message Length

While the existing code already addresses TLS Message Length validation
for both EAP-TLS peer and server side, this adds explicit checks and
rejection of invalid messages in the functions handling reassembly. This
does not change externally observable behavior in case of EAP server.
For EAP peer, this starts rejecting invalid messages instead of
addressing them by reallocating the buffer (i.e., ignoring TLS Message
Length in practice).

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

11 years agoEAP-TLS server: Fix TLS Message Length validation
Jouni Malinen [Sun, 7 Oct 2012 17:06:29 +0000 (20:06 +0300)]
EAP-TLS server: Fix TLS Message Length validation

EAP-TLS/PEAP/TTLS/FAST server implementation did not validate TLS
Message Length value properly and could end up trying to store more
information into the message buffer than the allocated size if the first
fragment is longer than the indicated size. This could result in hostapd
process terminating in wpabuf length validation. Fix this by rejecting
messages that have invalid TLS Message Length value.

This would affect cases that use the internal EAP authentication server
in hostapd either directly with IEEE 802.1X or when using hostapd as a
RADIUS authentication server and when receiving an incorrectly
constructed EAP-TLS message. Cases where hostapd uses an external
authentication are not affected.

Thanks to Timo Warns for finding and reporting this issue.

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

11 years agoSAE: Add Finite Cyclic Group negotiation and Send-Confirm
Jouni Malinen [Sat, 6 Oct 2012 16:30:54 +0000 (19:30 +0300)]
SAE: Add Finite Cyclic Group negotiation and Send-Confirm

This replaces the previously used bogus test data in SAE messages with
the first real field. The actual SAE authentication mechanism is still
missing and the Scaler, Element, and Confirm fields are not included.

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

11 years agoP2P: Fix network removal on P2P connect to select correct block
Jouni Malinen [Fri, 5 Oct 2012 17:37:49 +0000 (20:37 +0300)]
P2P: Fix network removal on P2P connect to select correct block

If wpa_s->current_ssid is not set (e.g., after disconnection that
did not result in immediate group removal), an incorrect group could
have been removed since the network block iteration here could select
the network block that is used to store persistent group credentials.
Fix this by verifying that disabled != 2 to avoid picking the network
block that could not have been the temporary P2P group.

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

11 years agoWPS: Reenable the networks disabled during wpa_wpas_reassoc
Sunil Dutt [Thu, 4 Oct 2012 18:11:04 +0000 (21:11 +0300)]
WPS: Reenable the networks disabled during wpa_wpas_reassoc

During the association for the WPS handshake all the other configured
networks are disabled. This patch makes wpa_supplicant reenable the
disabled networks after the success/failure of the WPS handshake.

Signed-hostap: Sunil Dutt Undekari <duttus@codeaurora.org>

11 years ago60 GHz: Fix error while processing scan results
Vladimir Kondratiev [Thu, 4 Oct 2012 13:32:23 +0000 (16:32 +0300)]
60 GHz: Fix error while processing scan results

Channel frequency for 60 GHz band do not fit into 'short int', as was
used. Expand it to 'int'

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>

11 years agoInterworking: Unshare ANQP results on explicit ANQP requests
Jouni Malinen [Wed, 3 Oct 2012 11:17:41 +0000 (14:17 +0300)]
Interworking: Unshare ANQP results on explicit ANQP requests

When ANQP_GET or HS20_ANQP_GET is used to request ANQP information,
unshare the ANQP information (i.e., create a per-BSS copy of it) to
make sure the information from the specified BSS is available in case
the APs provide different information within HESSID.

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

11 years agoHS 2.0: Include parsed WAN Metrics in RX-HS20-ANQP event
Jouni Malinen [Wed, 3 Oct 2012 10:58:56 +0000 (13:58 +0300)]
HS 2.0: Include parsed WAN Metrics in RX-HS20-ANQP event

This adds parsed version of WAN Metrics information to the control
event message as follows:

RX-HS20-ANQP 02:00:00:00:01:00 WAN Metrics 01:8000:1000:80:240:3000

format: <WAN Info>:<DL Speed>:<UL Speed>:<DL Load>:<UL Load>:<LMD>
WAN Info: B0-B1: Link Status, B2: Symmetric Link, B3: At Capabity
   (encoded as two hex digits)
Downlink Speed: Estimate of WAN backhaul link current downlink speed in kbps;
1..4294967295; 0 = unknown
Uplink Speed: Estimate of WAN backhaul link current uplink speed in kbps
1..4294967295; 0 = unknown
Downlink Load: Current load of downlink WAN connection (scaled to 255 = 100%)
Uplink Load: Current load of uplink WAN connection (scaled to 255 = 100%)
Load Measurement Duration: Duration for measuring downlink/uplink load in
tenths of a second (1..65535); 0 if load cannot be determined

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

11 years agoWPS: Fix a potential memory leak on wps_init() error path
Jouni Malinen [Tue, 2 Oct 2012 13:51:27 +0000 (16:51 +0300)]
WPS: Fix a potential memory leak on wps_init() error path

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

11 years agoFix build without CONFIG_WPS=y
Jouni Malinen [Mon, 1 Oct 2012 13:07:07 +0000 (16:07 +0300)]
Fix build without CONFIG_WPS=y

Commit 620c783753bddd37988269314862dc7e4a62f700 modified
wpas_wps_ssid_bss_match() prototype but forgot to update the non-WPS
wrapper inline function. Fix that to match with the new bss parameter
type.

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

11 years agoP2P: Add a conf parameter to start a GO as HT40 if allowed
Arik Nemtsov [Sun, 30 Sep 2012 17:35:51 +0000 (20:35 +0300)]
P2P: Add a conf parameter to start a GO as HT40 if allowed

When specified in the conf file this parameter will make all invocations
of p2p_group_add, p2p_connect, and p2p_invite behave as if "ht40" has
been specified on the command line. This shouldn't do harm since
regulatory constraints and driver capabilities are consulted anyway
before starting HT40 mode.

Signed-hostap: Arik Nemtsov <arik@wizery.com>

11 years agoReserve AKM and cipher suite values
Jouni Malinen [Sun, 30 Sep 2012 17:26:55 +0000 (20:26 +0300)]
Reserve AKM and cipher suite values

These values are used with WAPI and CCX and reserving the definitions
here reduces the number of merge conflicts with repositories that
include these functions.

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

11 years agoAdd initial parts for SAE
Jouni Malinen [Sun, 30 Sep 2012 16:51:07 +0000 (19:51 +0300)]
Add initial parts for SAE

This introduces new AKM for SAE and FT-SAE and adds the initial parts
for going through the SAE Authentication frame exchange. The actual SAE
algorithm and new fields in Authentication frames are not yet included
in this commit and will be added separately. This version is able to
complete a dummy authentication with the correct authentication
algorithm and transaction values to allow cfg80211/mac80211 drivers to
be tested (all the missing parts can be handled with
hostapd/wpa_supplicant changes).

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

11 years agoSync with linux/nl80211.h in wireless-testing.git
Jouni Malinen [Sun, 30 Sep 2012 07:49:46 +0000 (10:49 +0300)]
Sync with linux/nl80211.h in wireless-testing.git

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

11 years agodbus: Add global capabilities property
Dan Williams [Sat, 29 Sep 2012 16:06:30 +0000 (19:06 +0300)]
dbus: Add global capabilities property

Otherwise it's difficult to determine if the supplicant was built with
CONFIG_AP, CONFIG_IBSS_RSN, CONFIG_P2P, etc. CONFIG_AP and CONFIG_P2P
can be inferred from the introspection data of the Interface object,
but CONFIG_IBSS_RSN does not change the introspection data at all and
thus it's impossible to determine whether the supplicant supports it
without knowing its compile-time options.

Signed-hostap: Dan Williams <dcbw@redhat.com>
intended-for: hostap-1

11 years agonl80211: Don't send BSSID with disconnect command
Mykyta Iziumtsev [Sat, 29 Sep 2012 16:01:50 +0000 (19:01 +0300)]
nl80211: Don't send BSSID with disconnect command

NL80211_CMD_DISCONNECT doesn't need BSSID, because cfg80211
uses locally saved value.

Signed-hostap: Mykyta Iziumtsev <mykyta.iziumtsev@gmail.com>

11 years agoP2P: Fix p2p_cancel processing during group formation
Jouni Malinen [Fri, 28 Sep 2012 19:01:48 +0000 (22:01 +0300)]
P2P: Fix p2p_cancel processing during group formation

The wpa_s->p2p_in_provisioning flag did not get cleared in some cases
where p2p_cancel command is used to stop group formation. This can result
in some operations (like p2p_find) failing afterwards. Fix this by using
wpas_group_formation_completed() when processing p2p_cancel for a group
that has not yet completed group formation.

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

11 years agoInterworking: Support Android JB keystore with EAP-TLS
Jouni Malinen [Fri, 28 Sep 2012 14:12:27 +0000 (17:12 +0300)]
Interworking: Support Android JB keystore with EAP-TLS

If the keystore:// prefix is used in the private_key entry, convert that
to the OpenSSL engine style configuration used for Android JB keystore.

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

11 years agoInterworking: Fix failed GAS query processing
Jouni Malinen [Fri, 28 Sep 2012 14:09:15 +0000 (17:09 +0300)]
Interworking: Fix failed GAS query processing

The pending GAS entry must be removed from the list when it is removed.
This fixes an issue with potential segfault due to freed memory being
accessed if the driver fails to accept a GAS query.

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

11 years agoAdd disallow_aps parameter to disallow BSSIDs/SSIDs
Jouni Malinen [Thu, 27 Sep 2012 14:36:59 +0000 (17:36 +0300)]
Add disallow_aps parameter to disallow BSSIDs/SSIDs

External programs can use this new parameter to prevent wpa_supplicant
from connecting to a list of BSSIDs and/or SSIDs. The disallowed BSSes
will still be visible in scan results and it is possible to run ANQP
operations with them, but BSS selection for connection will skip any
BSS that matches an entry in the disallowed list.

The new parameter can be set with the control interface SET command
using following syntax:

SET disallow_aps <disallow_list>
disallow_list ::= <ssid_spec> | <bssid_spec> | <disallow_list> | “”
SSID_SPEC ::= ssid <SSID_HEX>
BSSID_SPEC ::= bssid <BSSID_HEX>

For example:
wpa_cli set disallow_list "ssid 74657374 bssid 001122334455 ssid 68656c6c6f"
wpa_cli set disallow_list
(the empty value removes all entries)

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

11 years agoInclude connected time in AP mode STA-* commands
Raja Mani [Wed, 26 Sep 2012 10:52:19 +0000 (13:52 +0300)]
Include connected time in AP mode STA-* commands

This allows hostapd_cli and wpa_cli all_sta command to be used to
display connected time (in seconds) of each station in AP mode.

Signed-hostap: Raja Mani <rmani@qca.qualcomm.com>

11 years agoP2P: Fix ignoring of PD Response due to dialog token mismatch
Jouni Malinen [Tue, 25 Sep 2012 18:41:52 +0000 (21:41 +0300)]
P2P: Fix ignoring of PD Response due to dialog token mismatch

Commit 6b56cc2d97fe9efd1feea8d418714b4658b056f1 added clearing of the
p2p->pending_action_state too early in this function. This should not
be done if we are going to silently ignore the frame due to dialog
token mismatch. Fix this by moving the code around to check the dialog
token first.

This issue resulted in PD Request retries getting stopped too early if
the peer is sending out an unexpected PD Response (e.g., because of it
being excessively slow with the response so that the response is
received only after the next TX attempt with a new dialog token).

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

11 years agoP2P: Clear sta_scan_pending on group removal
Jouni Malinen [Mon, 24 Sep 2012 23:55:20 +0000 (02:55 +0300)]
P2P: Clear sta_scan_pending on group removal

It is possible for the P2P client group to be removed while waiting for
a pending scan operation (e.g., when p2p_group_idle timeout hits after
getting disconnected from the GO with something else than
Deauthentication with reason code 3). If this happens with a P2P
interface that is used both for P2P Device and group roles, scan state
could get stuck while waiting for the next scan to complete since no
more station (P2P client) mode scans are scheduled. Fix this by clearing
sta_scan_pending when removing the temporary group network block.

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

11 years agoP2P: Allow peer to propose channel in invitation process
Jouni Malinen [Mon, 24 Sep 2012 19:15:58 +0000 (22:15 +0300)]
P2P: Allow peer to propose channel in invitation process

Make Invitation process for re-invoking a persistent group behave
similarly to GO Negotiation as far as channel negotiation is concerned.
The Operating Channel value (if present) is used as a starting point if
the local device does not have a forced operating channel (e.g., due to
concurrent use). Channel lists from devices are then compared to check
that the selected channel is in the intersection. If not, channel is
selected based on GO Negotiation channel rules (best channel preferences
etc.). Invitation Request is rejected if no common channel can be
selected.

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

11 years agoP2P: Show own channel list in debug log
Jouni Malinen [Mon, 24 Sep 2012 19:14:50 +0000 (22:14 +0300)]
P2P: Show own channel list in debug log

This makes it easier to debug channel negotiation mechanisms.

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

11 years agoP2P: Fix pending-sta-scan processing for concurrent operation cases
Jouni Malinen [Mon, 24 Sep 2012 10:46:27 +0000 (13:46 +0300)]
P2P: Fix pending-sta-scan processing for concurrent operation cases

If two P2P_FIND commands and a station mode SCAN command are issued in a
sequence with the second P2P_FIND and SCAN commands started before the
initial scan from the first P2P_FIND command has completed,
sta_scan_pending may be left set without an automatic way of getting it
cleared. This can get P2P search stuck if no further station mode scan
operations are run.

Fix this by clearing the sta_scan_pending flag whenever station mode scans
are stopped due to no enabled networks resulting in INACTIVE mode getting
entered. In addition, avoid setting sta_scan_pending flag when a special
scan_res_handler is set so that this does not get enabled on the P2P
Device interface during a P2P search operation.

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

11 years agoP2P: Add more debug prints for GO start routines
Jouni Malinen [Sun, 23 Sep 2012 22:05:51 +0000 (01:05 +0300)]
P2P: Add more debug prints for GO start routines

This makes it easier to debug issues in starting GO mode.

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

11 years agoAdd debug print for no-enabled-networks case
Jouni Malinen [Sun, 23 Sep 2012 22:04:00 +0000 (01:04 +0300)]
Add debug print for no-enabled-networks case

If there are any disabled networks, show a debug print with the count
of those networks when no enabled networks are found. This can be
helpful in trying to figure out why scans are being skipped.

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

11 years agoPrint control interface commands in easier format
Jouni Malinen [Sun, 23 Sep 2012 22:01:26 +0000 (01:01 +0300)]
Print control interface commands in easier format

The ASCII hexdump is somewhat difficult to search for (especially on
Android builds), so make the debug log easier to parse by printing the
full control interface command as a text string. In addition, use
wpa_dbg() to get the interface name printed so that multi-interface
cases can be debugged.

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

11 years agoP2P: Fix PSK configuration for GO network
Jouni Malinen [Sun, 23 Sep 2012 21:56:57 +0000 (00:56 +0300)]
P2P: Fix PSK configuration for GO network

Setting just ssid->passphrase is not enough to complete the network
block for the GO entry. Also the PSK needs to be derived so that the
network is considered enabled by wpas_network_disabled(). The previous
version worked as long as something else allowed the scan request to be
performed (this is needed even though the actual scan is skipped when
starting GO).

The first GO start was allowed because wpa_s->scan_req is initialized to
1 in wpa_supplicant_alloc(). However, other attempts may fail if
wpa_s->scan_req is cleared. This failure shows up as "No enabled
networkas - do not scan" in debug log followed by state change to
INACTIVE when trying to start GO.

Fix this by deriving PSK from the passphrase for GO mode.

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

11 years agoP2P: Fix p2p_group_idle in no-group-interface P2P client case
Jouni Malinen [Sun, 23 Sep 2012 17:28:03 +0000 (20:28 +0300)]
P2P: Fix p2p_group_idle in no-group-interface P2P client case

Commit 30ee769235f3170d9bf6b62c11c6e018e97deb84 started skipping P2P
group removal if wpa_s->current_ssid is not set and commit
0d30cc240fa36905b034dc9676f9d8da0ac18e56 started clearing
wpa_s->current_ssid on disconnection. This combination broke
p2p_group_idle timeout on P2P client interface in a case where no
separate P2P group interface is used and when the disconnection is
triggered by something else than an explicit indication of GO
terminating the group.

Fix this by relaxing network block matching rules when figuring out
whether any of the configured network blocks could be in P2P use. The
p2p_group flag alone should be enough for this since temporary P2P group
network blocks are removed once the P2P group is terminated.

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

11 years agowpa_supplicant: Set state to DISCONNECTED on AP creation errors
Dan Williams [Sun, 23 Sep 2012 10:55:58 +0000 (13:55 +0300)]
wpa_supplicant: Set state to DISCONNECTED on AP creation errors

If the AP creation failed (missing freq= or driver error) the supplicant
would previously stay in SCANNING state forever. Instead, it should
handle the error a bit better and drop back to DISCONNECTED so clients
know something went wrong.

Signed-hostap: Dan Williams <dcbw@redhat.com>
intended-for: hostap-1

11 years agonl80211: Use the monitor interface if socket tx status is not supported
Felix Fietkau [Sun, 23 Sep 2012 10:28:31 +0000 (13:28 +0300)]
nl80211: Use the monitor interface if socket tx status is not supported

Fixes hostapd on recent compat-wireless builds with older kernels.

Signed-hostap: Felix Fietkau <nbd@openwrt.org>

11 years agohostapd: Add check for the wds sta flag before creating 4addr VLANs
Felix Fietkau [Sun, 23 Sep 2012 10:25:49 +0000 (13:25 +0300)]
hostapd: Add check for the wds sta flag before creating 4addr VLANs

Signed-hostap: Felix Fietkau <nbd@openwrt.org>

11 years agohostapd: Clear WLAN_STA_ASSOC_REQ_OK if sending the assoc response failed
Felix Fietkau [Sun, 23 Sep 2012 10:23:16 +0000 (13:23 +0300)]
hostapd: Clear WLAN_STA_ASSOC_REQ_OK if sending the assoc response failed

As long as WLAN_STA_ASSOC_REQ_OK is set in sta->flags, Class 3 frames do
not trigger a disassoc/deauth. If it is still set even after the assoc
response tx has already failed, it may take somewhat longer for clients
to realize that the connection wasn't fully established.

Signed-hostap: Felix Fietkau <nbd@openwrt.org>

11 years agoP2P: Remove channel 14 from supported P2P channels
Mykyta Iziumtsev [Sun, 23 Sep 2012 09:49:52 +0000 (12:49 +0300)]
P2P: Remove channel 14 from supported P2P channels

Channel 14 is available only in Japan and is DSSS-only according to
IEEE 802.11-2012 19.4.3 and MIC Equipment Ordinance (EO)
for Regulating Radio Equipment article 49.20.

At the same time, P2P should avoid using DSSS modulation in normal
operation according to P2P specification v1.2 2.4.1.

Signed-hostap: Mykyta Iziumtsev <mykyta.iziumtsev@gmail.com>
intended-for: hostap-1

11 years agohostapd: Send EAPOL frames from the VO queue if WMM is active
Felix Fietkau [Sun, 16 Sep 2012 05:40:00 +0000 (22:40 -0700)]
hostapd: Send EAPOL frames from the VO queue if WMM is active

This avoids extra latency caused by establishing an aggregation session
and makes the initial connection attempt more reliable

Signed-hostap: Felix Fietkau <nbd@openwrt.org>

11 years agohostapd: Fix WDS VLAN bridge handling
Felix Fietkau [Sun, 16 Sep 2012 05:38:14 +0000 (22:38 -0700)]
hostapd: Fix WDS VLAN bridge handling

This patch fixes an issue where removing a WDS VLAN interface also
removed the main AP interface from the same bridge.

Signed-hostap: Felix Fietkau <nbd@openwrt.org>

11 years agohostapd: Fix CONFIG_INTERWORKING=y build without CONFIG_HS20=y
Jouni Malinen [Sun, 16 Sep 2012 05:37:27 +0000 (22:37 -0700)]
hostapd: Fix CONFIG_INTERWORKING=y build without CONFIG_HS20=y

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

11 years agoP2P: Fix p2p_ctrl_invite_persistent() to parse peer parameter
Jouni Malinen [Sun, 16 Sep 2012 05:21:46 +0000 (22:21 -0700)]
P2P: Fix p2p_ctrl_invite_persistent() to parse peer parameter

Commit 4d32c0c44db43d496f45c5094a9b6ae60c35115e added another use for the
local pos variable and that broke the mechanism used to determine wheter
the peer address was provided. Fix this by using a separate pointer to the
peer address.

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

11 years agoRemove unused function warning in WPS NFC case
Masashi Honma [Sun, 16 Sep 2012 05:02:09 +0000 (22:02 -0700)]
Remove unused function warning in WPS NFC case

When I use CONFIG_WPS_NFC=y a warning appears.

wps_supplicant.c:1872:12: warning: 'wpas_wps_add_nfc_password_token'
defined but not used [-Wunused-function]

This patch removes this warning.

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

11 years agoDo not inform other virtual interfaces of scan results in all cases
Jouni Malinen [Fri, 14 Sep 2012 01:07:02 +0000 (18:07 -0700)]
Do not inform other virtual interfaces of scan results in all cases

If a connection operation is started on an interface based on scan
results, other virtual interfaces should not be information about the
results to avoid potential concurrent operations during the association
steps. Since the sibling notification of scan results received was added
as an optimization, skipping it for this type of cases is the simplest
way of avoiding unnecessary concurrent operations.

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

11 years agoP2P: Schedule new scan if P2P operation delays scan
Jouni Malinen [Fri, 14 Sep 2012 01:05:55 +0000 (18:05 -0700)]
P2P: Schedule new scan if P2P operation delays scan

This makes sure that the interrupted station mode scan can be completed
after the P2P operations have had their chance of using the radio.

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

11 years agoP2P: Check all interfaces for pending scan for p2p_scan failures
Jouni Malinen [Fri, 14 Sep 2012 01:03:14 +0000 (18:03 -0700)]
P2P: Check all interfaces for pending scan for p2p_scan failures

Driver could reject the new scan based on any virtual interface
running a concurrent scan. As such, mark the pending scan callback
for P2P based on any interfaces instead of just the one used for
the p2p_scan operation.

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

11 years agoP2P: Move p2p_cb_on_scan_complete to global context
Jouni Malinen [Fri, 14 Sep 2012 00:58:22 +0000 (17:58 -0700)]
P2P: Move p2p_cb_on_scan_complete to global context

Since we have a global P2P module, the flag to trigger scan completion
events to it needs to be in similar context. The previous design
maintained this separately for each virtual interface and if P2P module
did not run its scan operation on the virtual interface that completed
the scan, P2P module would not be allowed to restart operations
properly.

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

11 years agoFix last_scan_res update existing BSS entry is update
Jouni Malinen [Mon, 10 Sep 2012 10:33:29 +0000 (12:33 +0200)]
Fix last_scan_res update existing BSS entry is update

The BSS pointer may change if the entry needs to be reallocated
and the new pointer has to be added to the last_scan_res array
to avoid using pointers to freed memory.

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

11 years agowlantest: Add BIP-GMAC-128/256 test vectors
Jouni Malinen [Sun, 9 Sep 2012 16:04:53 +0000 (19:04 +0300)]
wlantest: Add BIP-GMAC-128/256 test vectors

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

11 years agowlantest: Add CCMP-256 test vector
Jouni Malinen [Sun, 9 Sep 2012 15:38:18 +0000 (18:38 +0300)]
wlantest: Add CCMP-256 test vector

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

11 years agoMove AES-CCM implementation into src/crypto
Jouni Malinen [Sun, 9 Sep 2012 15:07:19 +0000 (18:07 +0300)]
Move AES-CCM implementation into src/crypto

This is a generic AES CCM implementation that can be used for other
purposes than just implementing CCMP, so it fits better in a separate
file in src/crypto.

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

11 years agowlantest: Move generic AES-CCM into separate functions
Jouni Malinen [Sun, 9 Sep 2012 15:00:14 +0000 (18:00 +0300)]
wlantest: Move generic AES-CCM into separate functions

This part of the implementation is not specific to CCMP and could be
used for other purposes, too.

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

11 years agoEnable 256-bit key AES in internal TLS implementation
Jouni Malinen [Sun, 9 Sep 2012 11:16:05 +0000 (14:16 +0300)]
Enable 256-bit key AES in internal TLS implementation

Now that the internal AES implementation supports 256-bit keys, enable
use of the TLS cipher suites that use AES-256 regardless of which crypto
implementation is used.

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

11 years agoFix AES block size handling for internal cipher
Jouni Malinen [Sun, 9 Sep 2012 11:12:59 +0000 (14:12 +0300)]
Fix AES block size handling for internal cipher

AES uses the same 128-bit block size with 128, 192, 256 bit keys, so use
the fixed block size definition instead of trying to dynamically set the
block size based on key length. This fixes use of 192-bit and 256-bit
AES keys with crypto_cipher_*() API when using the internal AES
implementation.

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

11 years agowlantest: Add GCMP-256 test vector
Jouni Malinen [Sun, 9 Sep 2012 11:01:03 +0000 (14:01 +0300)]
wlantest: Add GCMP-256 test vector

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

11 years agoShare common GCM-AE and GCM-AD functionality
Jouni Malinen [Sun, 9 Sep 2012 10:54:33 +0000 (13:54 +0300)]
Share common GCM-AE and GCM-AD functionality

These operations are almost identical, so use common functions to
share the same implementation.

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

11 years agoAdd aes_gmac() as a wrapper for AES GMAC operations using GCM
Jouni Malinen [Sun, 9 Sep 2012 10:37:50 +0000 (13:37 +0300)]
Add aes_gmac() as a wrapper for AES GMAC operations using GCM

This is otherwise identical to aes_gcm_ae() but does not use the
plain/crypt pointers since no data is encrypted.

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

11 years agoAdd support for using 192-bit and 256-bit keys with AES-GCM
Jouni Malinen [Sun, 9 Sep 2012 09:26:22 +0000 (12:26 +0300)]
Add support for using 192-bit and 256-bit keys with AES-GCM

This adds 192-bit and 256-bit key support to the internal AES
implementation and extends the AES-GCM functions to accept key length to
enable longer AES key use.

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

11 years agoSupport arbitrary IV length with AES-GCM
Jouni Malinen [Sat, 8 Sep 2012 21:49:54 +0000 (00:49 +0300)]
Support arbitrary IV length with AES-GCM

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

11 years agoAdd AES-GCM test vectors from gcm-spec.pdf
Jouni Malinen [Sat, 8 Sep 2012 21:25:54 +0000 (00:25 +0300)]
Add AES-GCM test vectors from gcm-spec.pdf

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

11 years agoMove AES-GCM implementation into src/crypto
Jouni Malinen [Sat, 8 Sep 2012 20:48:08 +0000 (23:48 +0300)]
Move AES-GCM implementation into src/crypto

This is a generic AES GCM and GMAC implementation that can be used for
other purposes than just implementing GCMP, so it fits better in a
separate file in src/crypto.

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

11 years agowlantest: Allow GHASH update calls to avoid extra allocation
Jouni Malinen [Sat, 8 Sep 2012 20:40:06 +0000 (23:40 +0300)]
wlantest: Allow GHASH update calls to avoid extra allocation

There is no need to allocate a temporary buffer and build GHASH input
data into it. Instead, ghash() is trivial to split into update part that
can be called separately for each segment.

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

11 years agowlantest: Remove CCMP specific AAD handling from GCMP
Jouni Malinen [Sat, 8 Sep 2012 19:10:05 +0000 (22:10 +0300)]
wlantest: Remove CCMP specific AAD handling from GCMP

GCMP encodes length of AAD differently, so remove the unnecessary
code that got copied from the CCMP implementation.

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

11 years agowlantest: Move GCM-AE and GCM-AD into separate functions
Jouni Malinen [Sat, 8 Sep 2012 19:08:00 +0000 (22:08 +0300)]
wlantest: Move GCM-AE and GCM-AD into separate functions

This splits the more generic GCM operations from GCMP specific
implementation.

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

11 years agowlantest: Add GCMP implementation and test vectors from P802.11ad/D9.0
Jouni Malinen [Sat, 8 Sep 2012 17:00:54 +0000 (20:00 +0300)]
wlantest: Add GCMP implementation and test vectors from P802.11ad/D9.0

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

11 years agowlantest: Check TKIP/CCMP decryption routines for test vectors
Jouni Malinen [Sat, 8 Sep 2012 13:53:45 +0000 (16:53 +0300)]
wlantest: Check TKIP/CCMP decryption routines for test vectors

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

11 years agowlantest: Add IEEE Std 802.11-2012, M.9.1 BIP test vector
Jouni Malinen [Sat, 8 Sep 2012 13:43:11 +0000 (16:43 +0300)]
wlantest: Add IEEE Std 802.11-2012, M.9.1 BIP test vector

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

11 years agowlantest: Move BIP function into a separate function and file
Jouni Malinen [Sat, 8 Sep 2012 13:32:35 +0000 (16:32 +0300)]
wlantest: Move BIP function into a separate function and file

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

11 years agowlantest: Add IEEE Std 802.11-2012, M.9.2 CCMP (mgmt) test vector
Jouni Malinen [Sat, 8 Sep 2012 13:21:57 +0000 (16:21 +0300)]
wlantest: Add IEEE Std 802.11-2012, M.9.2 CCMP (mgmt) test vector

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

11 years agowlantest: Add program for generating IEEE 802.11 test vectors
Jouni Malinen [Sat, 8 Sep 2012 11:03:43 +0000 (14:03 +0300)]
wlantest: Add program for generating IEEE 802.11 test vectors

This version can generate CCMP and TKIP test vectors that match with
the IEEE Std 802.11-2012, Annex M.6.3 and M.6.4.

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

11 years agowlantest: Implement tkip_encrypt()
Jouni Malinen [Sat, 8 Sep 2012 11:03:10 +0000 (14:03 +0300)]
wlantest: Implement tkip_encrypt()

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

11 years agoAP: Configure basic rates from iface and not conf
Arik Nemtsov [Thu, 6 Sep 2012 21:22:40 +0000 (00:22 +0300)]
AP: Configure basic rates from iface and not conf

The conf doesn't contain any basic rates in some cases. Most notably,
when starting a P2P GO in 5 GHz. Use the iface rates which are
initialized in hostapd_prepare_rates() to the conf rates or set to
default values if no conf values exist. This fixes a bug introduced in
commit e5693c4775bae65faa960f80889f98b0a6cb2e1c.

Signed-hostap: Arik Nemtsov <arik@wizery.com>

11 years agoMake copies basic_rates list more useful
Jouni Malinen [Thu, 6 Sep 2012 21:15:53 +0000 (00:15 +0300)]
Make copies basic_rates list more useful

Commit e5693c4775bae65faa960f80889f98b0a6cb2e1c added a copy of the
determined basic rate set into struct hostapd_iface, but did not
actually copy the terminating -1 value. This could be problematic if
something were to actually try to use this list since would be no way to
know what is the last entry in the list. Fix this by copying the
terminating value.

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

11 years agoatheros: Fix RSN capabilities debug print
Baruch Siach [Wed, 5 Sep 2012 16:01:11 +0000 (19:01 +0300)]
atheros: Fix RSN capabilities debug print

Signed-hostap: Baruch Siach <baruch@tkos.co.il>

11 years agonl80211: Register read_sta_data() handler for station only builds
Jouni Malinen [Wed, 5 Sep 2012 14:07:03 +0000 (17:07 +0300)]
nl80211: Register read_sta_data() handler for station only builds

This driver_op can now be used in station mode, too, to fetch
information about the connection with the AP, so allow this to be used
even if wpa_supplicant is built without AP mode support.

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

11 years agowpa_supplicant: Add PKTCNT_POLL command to get TX/RX packet counters
Yuhao Zheng [Wed, 5 Sep 2012 14:02:02 +0000 (17:02 +0300)]
wpa_supplicant: Add PKTCNT_POLL command to get TX/RX packet counters

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
11 years agoWFD: Properly match group for WFD element in Invitation Response
Jouni Malinen [Wed, 5 Sep 2012 13:39:19 +0000 (16:39 +0300)]
WFD: Properly match group for WFD element in Invitation Response

The group matching should be done by comparing the P2P Interface Address
(which the group_bssid here is) to the group's BSSID and not the group
ID (which uses P2P Device Address and would have also needed the SSID).
Though, it should be noted that this case cannot really happen since a
GO in an active group would never be invited to join another group in
its GO role (i.e., if it receives an Invitation Request, it will reply
in P2P Device role). As such, this fix does not really change any
observable behavior, but anyway, it is good to keep the implementation
here consistent with the Invitation Request case.

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

11 years agoWFD: Properly match group for WFD element in Invitation Request
Jouni Malinen [Wed, 5 Sep 2012 13:27:07 +0000 (16:27 +0300)]
WFD: Properly match group for WFD element in Invitation Request

When building the Invitation Request for WFD use cases, match the BSSID,
i.e., P2P Interface Address, of the group on the GO to avoid using
information from another group should the device be operating multiple
concurrent groups as GO.

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

11 years agoInterworking: Share ANQP data within homogenous ESS
Jouni Malinen [Tue, 4 Sep 2012 14:22:42 +0000 (17:22 +0300)]
Interworking: Share ANQP data within homogenous ESS

If two BSS entries have the same HESSID and SSID, share the fetched ANQP
information between these BSS entries to save memory and GAS/ANQP
operations.

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

11 years agoInterworking: Store HESSID in BSS entry
Jouni Malinen [Tue, 4 Sep 2012 14:08:58 +0000 (17:08 +0300)]
Interworking: Store HESSID in BSS entry

This makes it more convenient to match BSS entries that belong to the
same homogenous ESS.

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

11 years agoInterworking: Allow EAP-SIM/AKA/AKA' override in cred block
Jouni Malinen [Tue, 4 Sep 2012 13:50:52 +0000 (16:50 +0300)]
Interworking: Allow EAP-SIM/AKA/AKA' override in cred block

The eap parameter in the cred block can now be used to override
automatic EAP-SIM/AKA/AKA' selection.

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

11 years agoInterworking: Move BSS ANQP information into separate struct
Jouni Malinen [Tue, 4 Sep 2012 13:02:29 +0000 (16:02 +0300)]
Interworking: Move BSS ANQP information into separate struct

This is an initial step in allowing the ANQP responses to be shared
among multiple BSSes if the BSSes are determined to be operating under
identical configuration.

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

11 years agoFix REMOVE_NETWORK to not run operations with invalid current_ssid
Deepthi Gowri [Mon, 3 Sep 2012 08:55:38 +0000 (11:55 +0300)]
Fix REMOVE_NETWORK to not run operations with invalid current_ssid

If the REMOVE_NETWORK command is used to delete the currently connected
network, some operations were run between removing the network and
clearing of wpa_s->current_ssid. This left wpa_s->current_ssid pointing
to freed memory and should any operation end up using it before the
pointer gets cleared, freed memory could be references. Avoid this by
removing the network only after having completed the operations that
clear wpa_s->current_ssid.

Signed-hostap: Deepthi Gowri <deepthi@codeaurora.org>
intended-for: hostap-1

11 years agoInterworking: Fetch only the needed ANQP information
Jouni Malinen [Sun, 2 Sep 2012 18:05:54 +0000 (21:05 +0300)]
Interworking: Fetch only the needed ANQP information

Use configured credentials to figure out which ANQP information needs to
be fetched and only fetch those when using Interworking network
selection. The fetch_anqp command is still fetching all ANQP
information.

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

11 years agoInterworking: Skip extra scan after network auto-select
Jouni Malinen [Sun, 2 Sep 2012 17:18:48 +0000 (20:18 +0300)]
Interworking: Skip extra scan after network auto-select

If the scan results from before ANQP fetch are fresh (less than five
seconds old), do not run a new scan when selecting the BSS after having
used Interworking network selection.

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

11 years agoUse BSS entries instead of scan results for BSS selection
Jouni Malinen [Sun, 2 Sep 2012 16:56:57 +0000 (19:56 +0300)]
Use BSS entries instead of scan results for BSS selection

This allows the BSS selection functions to be called without having the
scan result data structure. This can be used to skip extra scans in
cases where previous results can be considered fresh.

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