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

11 years agoBSS: Add wpa_bss_get_vendor_ie_multi_beacon()
Jouni Malinen [Sun, 2 Sep 2012 16:54:42 +0000 (19:54 +0300)]
BSS: Add wpa_bss_get_vendor_ie_multi_beacon()

This can be used to fetch vendor IEs from Beacon frames.

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

11 years agoMaintain list of BSS entries in last scan result order
Jouni Malinen [Sun, 2 Sep 2012 16:53:15 +0000 (19:53 +0300)]
Maintain list of BSS entries in last scan result order

This allows last results to be used even after they have been freed
since the information is copied to the BSS entries anyway and this new
array provides the order in which scan results were processed.

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

11 years agoUse BSS table instead of scan results in need-to-roam determination
Jouni Malinen [Sun, 2 Sep 2012 14:39:35 +0000 (17:39 +0300)]
Use BSS table instead of scan results in need-to-roam determination

The same information is available in the BSS table, so we can reduce the
need for using the raw scan results in wpa_supplicant_need_to_roam().

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

11 years agoEAP-SIM/AKA: Store pseudonym identity in configuration
Jouni Malinen [Sun, 2 Sep 2012 10:04:18 +0000 (13:04 +0300)]
EAP-SIM/AKA: Store pseudonym identity in configuration

Use the anonymous_identity field to store EAP-SIM/AKA pseudonym identity
so that this can be maintained between EAP sessions (e.g., after
wpa_supplicant restart) even if fast re-authentication data was cleared.

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

11 years agoEAP-SIM DB: Remove unnecessary username prefix checks
Jouni Malinen [Sun, 2 Sep 2012 09:03:57 +0000 (12:03 +0300)]
EAP-SIM DB: Remove unnecessary username prefix checks

The EAP-SIM/AKA code is already validating the prefix and the following
lookup would not find matches if the prefix is incorrect, so there is no
need for the extra checks here.

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

11 years agoEAP-AKA server: Skip AKA/Identity exchange if EAP identity recognized
Jouni Malinen [Sun, 2 Sep 2012 08:27:39 +0000 (11:27 +0300)]
EAP-AKA server: Skip AKA/Identity exchange if EAP identity recognized

If EAP-Response/Identity includes a known pseudonym or re-auth username,
skip the AKA/Identity exchange since we already know the permanent
username of the peer.

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

11 years agohlr_auc_gw: Fix unknown-IMSI determination with SQLite
Jouni Malinen [Sun, 2 Sep 2012 08:24:59 +0000 (11:24 +0300)]
hlr_auc_gw: Fix unknown-IMSI determination with SQLite

Need to explicitly check that the SQL query returns a match before
returning values.

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

11 years agoEAP-SIM server: Move subtype validation from check into process
Jouni Malinen [Sat, 1 Sep 2012 22:26:05 +0000 (01:26 +0300)]
EAP-SIM server: Move subtype validation from check into process

This is needed to be able to use SIM-Notification round to indicate
failure per RFC 4186, chapter 6.3.3.

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

11 years agoEAP-SIM server: Use Notification before EAP-Failure
Jouni Malinen [Sat, 1 Sep 2012 22:20:29 +0000 (01:20 +0300)]
EAP-SIM server: Use Notification before EAP-Failure

RFC 4186, chapter 6.3.3 mandates that EAP-Failure is used only after
Client-Error and Notification messages. Convert the direct jumps to the
FAILURE state with a notification round before sending out EAP-Failure.

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

11 years agoEAP-SIM/AKA peer: Note sending of Client-Error in debug log
Jouni Malinen [Sat, 1 Sep 2012 21:58:03 +0000 (00:58 +0300)]
EAP-SIM/AKA peer: Note sending of Client-Error in debug log

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

11 years agoEAP-SIM peer: Fix AT_COUNTER_TOO_SMALL use
Jouni Malinen [Sat, 1 Sep 2012 21:39:48 +0000 (00:39 +0300)]
EAP-SIM peer: Fix AT_COUNTER_TOO_SMALL use

The AT_NONCE_S value needs to be used in AT_MAC calculation for
SIM/Re-authentication response even if re-authentication is rejected
with AT_COUNTER_TOO_SMALL.

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

11 years agoEAP-SIM server: Add support for AT_COUNTER_TOO_SMALL
Jouni Malinen [Sat, 1 Sep 2012 21:38:39 +0000 (00:38 +0300)]
EAP-SIM server: Add support for AT_COUNTER_TOO_SMALL

If the peer rejects re-authentication with AT_COUNTER_TOO_SMALL, fall
back to full authentication to allow the authentication session to be
completed.

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

11 years agoEAP-SIM DB: Use pointer to struct eap_sim_db_data instead of void*
Jouni Malinen [Sat, 1 Sep 2012 18:48:48 +0000 (21:48 +0300)]
EAP-SIM DB: Use pointer to struct eap_sim_db_data instead of void*

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

11 years agoEAP-SIM DB: Add debug print for AKA reauth identity addition
Jouni Malinen [Sat, 1 Sep 2012 18:41:23 +0000 (21:41 +0300)]
EAP-SIM DB: Add debug print for AKA reauth identity addition

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

11 years agoEAP-AKA server: Remove unnecessary protocol version check
Jouni Malinen [Sat, 1 Sep 2012 18:38:25 +0000 (21:38 +0300)]
EAP-AKA server: Remove unnecessary protocol version check

This validation is done automatically as part of the prefix value
use in the username.

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

11 years agoEAP-SIM DB: Get rid of unnecessary wrapper functions
Jouni Malinen [Sat, 1 Sep 2012 18:37:17 +0000 (21:37 +0300)]
EAP-SIM DB: Get rid of unnecessary wrapper functions

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

11 years agoEAP-SIM DB: Return pseudonym username instead of structure with it
Jouni Malinen [Sat, 1 Sep 2012 18:32:22 +0000 (21:32 +0300)]
EAP-SIM DB: Return pseudonym username instead of structure with it

This cleans up the implemenation a bit.

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

11 years agoEAP-SIM DB: Remove unneeded SQLite value copying
Jouni Malinen [Sat, 1 Sep 2012 18:26:26 +0000 (21:26 +0300)]
EAP-SIM DB: Remove unneeded SQLite value copying

These fields are used only as the search key, so the value is already
known and does not need to be copied from the database.

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

11 years agoEAP-SIM DB: Store permanent username as string in SQLite DB
Jouni Malinen [Sat, 1 Sep 2012 18:22:15 +0000 (21:22 +0300)]
EAP-SIM DB: Store permanent username as string in SQLite DB

Store permanent username (i.e., including prefix character) instead of
IMSI in the SQLite DB. Convert the string to a string since the EAP-AKA
prefix can start with zero. This cleans up the field names since the
value was already with the prefix included instead of just IMSI. In
addition, this explicitly removes some theoretical cases where the
different identity types could have been mixed.

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

11 years agoEAP-SIM DB: Rename valid_pseudonym_string to valid_db_string
Jouni Malinen [Sat, 1 Sep 2012 18:17:48 +0000 (21:17 +0300)]
EAP-SIM DB: Rename valid_pseudonym_string to valid_db_string

This will be used with other strings, too, so use a more generic
function name.

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

11 years agoEAP-SIM DB: Use char* strings instead of u8* pointer and length
Jouni Malinen [Sat, 1 Sep 2012 18:10:19 +0000 (21:10 +0300)]
EAP-SIM DB: Use char* strings instead of u8* pointer and length

Since the EAP-SIM/AKA identities are ASCII strings, there is no need to
use more complex way for storing and passing them. In addition, be more
strict about enforcing username (i.e., no realm part) to be used in the
EAP-SIM DB API. Similarly, require specific username type instead of any
of the types to be used as the key in the pseudonym and reauth
operations. This allows simpler lookup operations to be used.

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

11 years agoEAP-SIM DB: Remove unused eap_sim_db_identity_known()
Jouni Malinen [Sat, 1 Sep 2012 17:12:40 +0000 (20:12 +0300)]
EAP-SIM DB: Remove unused eap_sim_db_identity_known()

This function is not used anymore, so remove it.

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

11 years agoEAP-AKA server: Store permanent username in session data
Jouni Malinen [Sat, 1 Sep 2012 17:09:07 +0000 (20:09 +0300)]
EAP-AKA server: Store permanent username in session data

This allows identity use to be cleaned up in various operations.

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

11 years agoEAP-AKA server: Split fullauth setup into a separate function
Jouni Malinen [Sat, 1 Sep 2012 16:37:49 +0000 (19:37 +0300)]
EAP-AKA server: Split fullauth setup into a separate function

This is an initial cleanup step for AKA/Identity processing.

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

11 years agoEAP-AKA server: Require AKA/Identity response to include identity
Jouni Malinen [Sat, 1 Sep 2012 16:23:14 +0000 (19:23 +0300)]
EAP-AKA server: Require AKA/Identity response to include identity

Since we always request an identity in the request, the response
has to include AT_IDENTITY. This allows the AKA/Identity response
processing to be simplified a bit.

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

11 years agoEAP-AKA server: Use simpler AKA/Identity request determination
Jouni Malinen [Sat, 1 Sep 2012 16:19:45 +0000 (19:19 +0300)]
EAP-AKA server: Use simpler AKA/Identity request determination

There is no need to use eap_sim_db_identity_known() here since a new
AKA/Identity message is built only if the identity in the previous
response was not recognized. The first round is always used to request
AT_ANY_ID_REQ to meet the RFC 4187 recommendation on EAP method specific
identity request.

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

11 years agoEAP-SIM server: Store permanent username in session data
Jouni Malinen [Sat, 1 Sep 2012 16:10:33 +0000 (19:10 +0300)]
EAP-SIM server: Store permanent username in session data

This allows identity use to be cleaned up in various operations.

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

11 years agoEAP-SIM server: Require SIM/Start response to include identity
Jouni Malinen [Sat, 1 Sep 2012 15:56:35 +0000 (18:56 +0300)]
EAP-SIM server: Require SIM/Start response to include identity

Since we always request an identity in the request, the response
has to include AT_IDENTITY. This allows the SIM/Start response
processing to be simplified a bit.

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

11 years agoEAP-SIM server: Use simpler SIM/Start identity request determination
Jouni Malinen [Sat, 1 Sep 2012 15:51:09 +0000 (18:51 +0300)]
EAP-SIM server: Use simpler SIM/Start identity request determination

There is no need to use eap_sim_db_identity_known() here since a new
SIM/Start message is built only if the identity in the previous response
was not recognized. The first round will always request AT_ANY_ID_REQ to
meet the RFC 4186 recommendation on EAP method specific identity request
being used.

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

11 years agoEAP-SIM DB: Remove unnecessary aka_prime parameter
Jouni Malinen [Sat, 1 Sep 2012 15:41:35 +0000 (18:41 +0300)]
EAP-SIM DB: Remove unnecessary aka_prime parameter

The reauth_id prefix can be used to determine which AKA version is used,
so there is no need to store the aka_prime information in a separate
field.

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

11 years agoSME: Fix disconnec-while-authenticating
Jouni Malinen [Sat, 1 Sep 2012 14:20:27 +0000 (17:20 +0300)]
SME: Fix disconnec-while-authenticating

Commit 0d30cc240fa36905b034dc9676f9d8da0ac18e56 forced
wpa_s->current_ssid to be cleared in wpa_supplicant_mark_disassoc()
which gets called from wpa_supplicant_event_disassoc(). This broke SME
disassoc-while-authenticating workaround for cfg80211. Fix this by
restoring wpa_s->current_ssid in case SME authentication is in progress.

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

11 years agoFix disconnection event processing
Jouni Malinen [Fri, 31 Aug 2012 19:04:41 +0000 (22:04 +0300)]
Fix disconnection event processing

Commit 0d30cc240fa36905b034dc9676f9d8da0ac18e56 forced
wpa_s->current_ssid and wpa_s->key_mgmt to be cleared in
wpa_supplicant_mark_disassoc() which gets called from
wpa_supplicant_event_disassoc(). This broke IEEE 802.1X authentication
failure processing and P2P deauthentication notification (group
termination).

Fix this by splitting wpa_supplicant_event_disassoc() into two parts and
make wpas_p2p_deauth_notif() indicate whether the interface was removed.
If so, the last part of disassocition event processing is skipped. Since
the wpa_supplicant_mark_disassoc() call is in the second part, the above
mentioned issues are resolved. In addition, this cleans up the P2P group
interface removal case by not trying to use fast reconnection mechanism
just before the interface gets removed.

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

11 years agoP2P: Do not fail p2p_group_remove just based on current_ssid
Jouni Malinen [Fri, 31 Aug 2012 18:35:32 +0000 (21:35 +0300)]
P2P: Do not fail p2p_group_remove just based on current_ssid

The wpa_s->current_ssid pointer may get cleared, e.g., when
disconnected. Commit 30ee769235f3170d9bf6b62c11c6e018e97deb84 made
wpas_p2p_group_delete() exit early before removing a P2P interface in
this type of case. That can cause number of issues from p2p_group_remove
command failing to busy loop when terminating wpa_supplicant if there is
a P2P group interface in client mode and that interface happens to be in
disconnected state. Fix these issues by allowing wpas_p2p_group_delete()
remove the P2P group interface regardless of whether wpa_s->currnt_ssid
is set.

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

11 years agoP2P: Allow p2p_invite-persistent to specify channel for GO
Jouni Malinen [Fri, 31 Aug 2012 18:20:51 +0000 (21:20 +0300)]
P2P: Allow p2p_invite-persistent to specify channel for GO

The freq and ht40 parameters can now be used with the p2p_invite
command when reinvoking a persistent group as the GO.

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

11 years agoAndroid: Add Wi-Fi Display into the makefile
Jouni Malinen [Fri, 31 Aug 2012 15:33:42 +0000 (18:33 +0300)]
Android: Add Wi-Fi Display into the makefile

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

11 years agoAndroid: Include Hotspot 2.0 support in the default build
Jouni Malinen [Fri, 31 Aug 2012 15:28:54 +0000 (18:28 +0300)]
Android: Include Hotspot 2.0 support in the default build

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

11 years agoAndroid: Add new keystore include path for JB
Jouni Malinen [Fri, 31 Aug 2012 15:25:54 +0000 (18:25 +0300)]
Android: Add new keystore include path for JB

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

11 years agoAndroid: Sync with SHA256 hostapd makefile updates
Jouni Malinen [Fri, 31 Aug 2012 15:25:18 +0000 (18:25 +0300)]
Android: Sync with SHA256 hostapd makefile updates

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

11 years agoInclude notes on EAP SIM DB in hostapd using SQLite
Jouni Malinen [Thu, 30 Aug 2012 13:58:58 +0000 (16:58 +0300)]
Include notes on EAP SIM DB in hostapd using SQLite

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

11 years agoEAP-SIM DB: Optional use of SQLite database for reauth data
Jouni Malinen [Thu, 30 Aug 2012 13:55:36 +0000 (16:55 +0300)]
EAP-SIM DB: Optional use of SQLite database for reauth data

If hostapd is built and configured to use SQLite database, store
EAP-SIM/AKA reauth data into the database to allow this to persist
over hostapd restarts.

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

11 years agoEAP-SIM DB: Optional use of SQLite database for pseudonyms
Jouni Malinen [Thu, 30 Aug 2012 13:04:52 +0000 (16:04 +0300)]
EAP-SIM DB: Optional use of SQLite database for pseudonyms

This allows hostapd to use an SQLite database for storing EAP-SIM/AKA
pseudonyms over process restarts. CONFIG_SQLITE=y build option adds
support for this and the SQLite database file is specified in eap_sib_db
configuration parameter.

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

11 years agoMove WPA cipher information into a shared location
Jouni Malinen [Thu, 30 Aug 2012 08:53:54 +0000 (11:53 +0300)]
Move WPA cipher information into a shared location

Try to share most of the cipher information like key and RSC lengths and
suite selector conversions, etc. in wpa_common.c to avoid having similar
code throughout the WPA implementation for handling cipher specific
behavior.

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

11 years agoMove variable declaration into the beginning of function
Jouni Malinen [Wed, 29 Aug 2012 21:37:59 +0000 (00:37 +0300)]
Move variable declaration into the beginning of function

The variables used within the #ifndef block here needs to be defined in
the beginning of the function to avoid issues with some compilers.

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

11 years agoInterworking: Fix build without CONFIG_PCSC=y
Jouni Malinen [Wed, 29 Aug 2012 21:35:53 +0000 (00:35 +0300)]
Interworking: Fix build without CONFIG_PCSC=y

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

11 years agoWFD: Add preliminary WSD request processing and response
Jouni Malinen [Fri, 2 Mar 2012 20:31:04 +0000 (22:31 +0200)]
WFD: Add preliminary WSD request processing and response

This commit does not yet address support for different device roles,
i.e., the same set of subelements are returned regardless of which
role was indicated in the request.

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

11 years agoWFD: Add support for sending Wi-Fi Display service discovery requests
Jouni Malinen [Fri, 2 Mar 2012 19:48:57 +0000 (21:48 +0200)]
WFD: Add support for sending Wi-Fi Display service discovery requests

wpa_cli p2p_serv_disc_req command can now be used to request WSD
request to be sent to specified or all peers who support WSD.

format: wifi-display <list of roles> <list of subelements>
examples:
p2p_serv_disc_req 00:00:00:00:00:00 wifi-display [source] 2,3,4,5
p2p_serv_disc_req 02:01:02:03:04:05 wifi-display [pri-sink] 3
p2p_serv_disc_req 00:00:00:00:00:00 wifi-display [sec-source] 2
p2p_serv_disc_req 00:00:00:00:00:00 wifi-display [source+sink] 2,3,4,5
p2p_serv_disc_req 00:00:00:00:00:00 wifi-display [source][pri-sink] 2,3,4,5

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

11 years agoWFD: Add wfd_subelems hexdump in BSS ctrl_iface command output
Jouni Malinen [Fri, 2 Mar 2012 15:26:01 +0000 (17:26 +0200)]
WFD: Add wfd_subelems hexdump in BSS ctrl_iface command output

This makes it easier to parse the WFD subelements from scan results.

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

11 years agoWFD: Add Wi-Fi Display support
Jouni Malinen [Fri, 2 Mar 2012 15:26:01 +0000 (17:26 +0200)]
WFD: Add Wi-Fi Display support

This commit adds control interface commands and internal storage of
Wi-Fi Display related configuration. In addition, WFD IE is now added
to various P2P frames, Probe Request/Response, and (Re)Association
Request/Response frames. WFD subelements from peers are stored in the
P2P peer table.

Following control interface commands are now available:
SET wifi_display <0/1>
GET wifi_display
WFD_SUBELEM_SET <subelem> [hexdump of length+body]
WFD_SUBELEM_GET <subelem>

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

11 years agoAdd support for using GCMP cipher from IEEE 802.11ad
Jouni Malinen [Wed, 29 Aug 2012 08:52:15 +0000 (11:52 +0300)]
Add support for using GCMP cipher from IEEE 802.11ad

This allows both hostapd and wpa_supplicant to be used to derive and
configure keys for GCMP. This is quite similar to CCMP key
configuration, but a different cipher suite and somewhat different rules
are used in cipher selection. It should be noted that GCMP is not
included in default parameters at least for now, so explicit
pairwise/group configuration is needed to enable it. This may change in
the future to allow GCMP to be selected automatically in cases where
CCMP could have been used.

This commit does not included changes to WPS or P2P to allow GCMP to be
used.

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

11 years agonl80211: Set P2P multichan concurrency based on interface combinations
Wei-Jen Lin [Tue, 28 Aug 2012 16:31:58 +0000 (19:31 +0300)]
nl80211: Set P2P multichan concurrency based on interface combinations

Use the NL80211_IFACE_COMB_NUM_CHANNELS value > 1 as a trigger for
enabling support for P2P multichannel channel concurrency. This does not
handle all possible details of enforcing driver capabilities, but it is
a good first step for allowing nl80211 drivers to enable multichannel
concurrency.

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

11 years agowpa_cli: Add tab completion for p2p_find
Jouni Malinen [Tue, 28 Aug 2012 14:38:53 +0000 (17:38 +0300)]
wpa_cli: Add tab completion for p2p_find

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

11 years agowpa_cli: Fix tab completion
Jouni Malinen [Tue, 28 Aug 2012 14:25:09 +0000 (17:25 +0300)]
wpa_cli: Fix tab completion

Commit b49039bda906461ccee57a41a9012d3df2c9e6bc redesigned tab
completion, but added the new call to completion functions into wrong
location. This needs to be done within the loop to find the correct
completion function.

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

11 years agoInterworking: Add optional use of network selection on normal scans
Jouni Malinen [Tue, 28 Aug 2012 13:14:13 +0000 (16:14 +0300)]
Interworking: Add optional use of network selection on normal scans

auto_interworking=1 configuration parameter can be used to request
wpa_supplicant to use Interworking network selection automatically as a
part of the normal (non-Interworking) network selection if the scan
results do not match with enabled networks. This makes scanning work
similarly to the "interworking_select auto" command.

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

11 years agoAdd generic GAS request mechanism
Jouni Malinen [Mon, 27 Aug 2012 15:13:10 +0000 (18:13 +0300)]
Add generic GAS request mechanism

The new gas_request and gas_response_get commands can be used to request
arbitary GAS queries to be performed. These can be used with ANQP or
with other (including vendor specific) advertisement protocols.

gas_request <BSSID> <AdvProtoID> [Query]
gas_response_get <addr> <dialog token> [offset,length]

For example, ANQP query for Capability list in interactive wpa_cli
session:

> gas_request 02:00:00:00:01:00 00 000102000101
<3>GAS-RESPONSE-INFO addr=02:00:00:00:01:00 dialog_token=0
status_code=0 resp_len=32
> gas_response_get 02:00:00:00:01:00 00
01011c00010102010501070108010c01dddd0c00506f9a110200020304050607
> gas_response_get 02:00:00:00:01:00 00 0,10
01011c00010102010501
> gas_response_get 02:00:00:00:01:00 00 10,10
070108010c01dddd0c00
> gas_response_get 02:00:00:00:01:00 00 20,10
506f9a11020002030405
> gas_response_get 02:00:00:00:01:00 00 30,2
0607

It should be noted that the maximum length of the response buffer is
currently 4096 bytes which allows about 2000 bytes of the response data
to be fetched with a single gas_response_get command. If the response is
longer, it can be fetched in pieces as shown in the example above.

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

11 years agoAdd parameter for vendor specific elements into Beacon/Probe Response
Jouni Malinen [Mon, 27 Aug 2012 13:20:10 +0000 (16:20 +0300)]
Add parameter for vendor specific elements into Beacon/Probe Response

The new vendor_elements parameter in hostapd.conf can be used to add new
vendor specific element(s) into Beacon and Probe Response frames.

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

11 years agoWPS: Allow AP that becomes active be tried immediately
Jouni Malinen [Mon, 27 Aug 2012 10:51:35 +0000 (13:51 +0300)]
WPS: Allow AP that becomes active be tried immediately

Clear the possible blacklisting of a WPS AP during WPS PIN iteration if
the AP moves to selected registrar TRUE state or if it adds our MAC
address to the list of authorized MACs.

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

11 years agoWPS: Maintain more AP state during WPS PIN iteration
Jouni Malinen [Mon, 27 Aug 2012 10:48:11 +0000 (13:48 +0300)]
WPS: Maintain more AP state during WPS PIN iteration

Maintain state of WPS APs during iteration to find the correct AP for
WPS PIN operation when no specific BSSID is specified. This information
can be used for optimizing the order in which the APs are tried. This
commit is only adding the collection of the information and more
detailed debug information to make debug logs more helpful in figuring
out how the AP selection order could be improved.

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

11 years agoClear current_ssid and key_mgmt when disconnected
Jouni Malinen [Sun, 26 Aug 2012 20:20:41 +0000 (23:20 +0300)]
Clear current_ssid and key_mgmt when disconnected

This makes wpa_supplicant state somewhat cleaner since the information
from previously used connection is not maintained after getting
disconnected.

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

11 years agoClear idleWhile timer when EAP peer state machine is not in use
Jouni Malinen [Sun, 26 Aug 2012 20:19:32 +0000 (23:19 +0300)]
Clear idleWhile timer when EAP peer state machine is not in use

This allows the EAPOL tick timer to be stopped more quickly when
getting disconnected.

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

11 years agoDisable network block temporarily on authentication failures
Jouni Malinen [Sun, 26 Aug 2012 20:01:26 +0000 (23:01 +0300)]
Disable network block temporarily on authentication failures

If 4-way handshake fails due to likely PSK failure or if EAP
authentication fails, disable the network block temporarily. Use longer
duration if multiple consecutive failures are seen.

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

11 years agowpa_cli: Add optional argument for the help command
Jouni Malinen [Sun, 26 Aug 2012 18:30:06 +0000 (21:30 +0300)]
wpa_cli: Add optional argument for the help command

"help <cmd>" can now be used to print the usage text for the
specified command (or set of commands matching the prefix).

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

11 years agowpa_cli: Add tab completion function into the command table
Jouni Malinen [Sun, 26 Aug 2012 18:20:15 +0000 (21:20 +0300)]
wpa_cli: Add tab completion function into the command table

Instead of using a separate list of commands, use the main command table
to assign tab completion functions. In addition, use the existing BSS
and P2P peer completions functions with the commands that use BSSID or
P2P Device address the first argument.

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

11 years agoInterworking: Fix home SP check with real SIM card
Jouni Malinen [Sun, 26 Aug 2012 17:52:19 +0000 (20:52 +0300)]
Interworking: Fix home SP check with real SIM card

The NAI building routine assumed that the credential included the IMSI,
but that is not the case when using a real SIM card. Build the NAI based
on the IMSI read for the card in such a case.

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

11 years agoInterworking: Fix PLMN matching with multiple entries
Jouni Malinen [Sun, 26 Aug 2012 17:37:11 +0000 (20:37 +0300)]
Interworking: Fix PLMN matching with multiple entries

The pos variable was not advanced when comparing PLMN entries in
3GPP Cellular Network information and as such, only the first
entry was really used.

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

11 years agoHS 2.0: Add NAI Home Realm query
Jay Katabathuni [Sat, 25 Aug 2012 13:28:29 +0000 (16:28 +0300)]
HS 2.0: Add NAI Home Realm query

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

11 years agoInterworking: Add advertising of NAI Realm list
Jay Katabathuni [Sat, 25 Aug 2012 12:58:30 +0000 (15:58 +0300)]
Interworking: Add advertising of NAI Realm list

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

11 years agoHS 2.0: Add advertisement of Operator Friendly Name
Jay Katabathuni [Sat, 25 Aug 2012 13:03:51 +0000 (16:03 +0300)]
HS 2.0: Add advertisement of Operator Friendly Name

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

11 years agoInterworking: Use generic language,string parser
Jouni Malinen [Sat, 25 Aug 2012 17:49:30 +0000 (20:49 +0300)]
Interworking: Use generic language,string parser

Replace the Venue Name specific data structure and parser with a
generic mechanism that can be used with other fields that use the
same format.

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

11 years agoHS 2.0: Add advertisement of WAN Metrics
Jay Katabathuni [Sat, 25 Aug 2012 13:09:01 +0000 (16:09 +0300)]
HS 2.0: Add advertisement of WAN Metrics

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

11 years agoHS 2.0: Add advertisement of Connection Capability
Jay Katabathuni [Sat, 25 Aug 2012 13:12:40 +0000 (16:12 +0300)]
HS 2.0: Add advertisement of Connection Capability

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

11 years agoHS 2.0: Add advertising of Operating Class Indication
Jay Katabathuni [Sat, 25 Aug 2012 13:17:21 +0000 (16:17 +0300)]
HS 2.0: Add advertising of Operating Class Indication

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

11 years agoInterworking: Add advertising of 3GPP Cellular Network info
Jay Katabathuni [Mon, 30 Jul 2012 19:07:35 +0000 (22:07 +0300)]
Interworking: Add advertising of 3GPP Cellular Network info

The anqp_3gpp_cell_net parameter can be used to configure hostapd
to advertise 3GPP Cellular Network ANQP information.

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

11 years agoSupport no-config-file in WPS AP settings updates
Shan Palanisamy [Mon, 18 Jun 2012 15:11:54 +0000 (18:11 +0300)]
Support no-config-file in WPS AP settings updates

This is required for WPS open mode with control interface -based
configuration.

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

11 years agoAllow hostapd to be started without interfaces
Shan Palanisamy [Sat, 25 Aug 2012 08:42:30 +0000 (11:42 +0300)]
Allow hostapd to be started without interfaces

If the control interface is enabled, allow hostapd to be started
without any configuration files specific on the command line since
the interfaces can be added dynamically.

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

11 years agohostapd: Add global ctrl_iface commands for adding/removing interfaces
Shan Palanisamy [Sat, 25 Aug 2012 08:37:12 +0000 (11:37 +0300)]
hostapd: Add global ctrl_iface commands for adding/removing interfaces

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

11 years agohostapd: Add ctrl_iface for enabling/reloading/disabling interface
Shan Palanisamy [Fri, 16 Dec 2011 18:42:40 +0000 (20:42 +0200)]
hostapd: Add ctrl_iface for enabling/reloading/disabling interface

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

11 years agohostapd: Add global control interface
Shan Palanisamy [Tue, 20 Dec 2011 15:10:47 +0000 (17:10 +0200)]
hostapd: Add global control interface

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

11 years agoMove hostapd global callback functions into hapd_interfaces
Jouni Malinen [Sat, 25 Aug 2012 09:43:27 +0000 (12:43 +0300)]
Move hostapd global callback functions into hapd_interfaces

These function pointers are going to be the same for each interface so
there is no need to keep them in struct hostapd_iface. Moving them to
struct hapd_interfaces makes it easier to add interfaces at run time.

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

11 years agowpa_cli: Add a 'raw' command for sending unprocessed data
Jouni Malinen [Sat, 25 Aug 2012 10:33:29 +0000 (13:33 +0300)]
wpa_cli: Add a 'raw' command for sending unprocessed data

This can be used to test new control interface commands and to use
commands that may not yet be supported by wpa_cli.

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

11 years agowpa_supplicant: Add bss_flush command to invalidate scan results
Dmitry Shmidt [Sat, 25 Aug 2012 07:23:22 +0000 (10:23 +0300)]
wpa_supplicant: Add bss_flush command to invalidate scan results

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
11 years agoP2P: Fix memory leak with driver-based P2P management
Jouni Malinen [Fri, 24 Aug 2012 17:45:22 +0000 (20:45 +0300)]
P2P: Fix memory leak with driver-based P2P management

If the P2P management operations are handled within the driver, the
P2P service entries were not freed when terminating wpa_supplicant.
Fix this by calling wpas_p2p_service_flush() even if the P2P module
within wpa_supplicant has not been initialized.

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

11 years agotest: Fix driver data pointer for the P2P commands
Jouni Malinen [Fri, 24 Aug 2012 17:44:24 +0000 (20:44 +0300)]
test: Fix driver data pointer for the P2P commands

The driver_test.c data structures had been changed to use a separate
BSS structure, but the P2P commands were not using the new design.

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

11 years agoAdd wps_cancel to hostapd_cli help text
Anirban Sirkhell [Fri, 24 Aug 2012 16:02:56 +0000 (19:02 +0300)]
Add wps_cancel to hostapd_cli help text

Commit 4c374cde2f0b789d5aa1180667173358b71d492c added a new wps_cancel
command, but didn't add it to the usage text in hostapd_cli. Add an
entry for this command.

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

11 years agoP2P: Fix PD retries on delay in off channel transmission
Sunil Dutt [Fri, 24 Aug 2012 08:54:02 +0000 (11:54 +0300)]
P2P: Fix PD retries on delay in off channel transmission

Commit 488f4a7108e021be97fc1841fff9042d2b7d737f configures a timer
before p2p_send_action(). This may result in the timer getting fired
earlier to the off channel transmission of the frame and thus another PD
request being retransmitted. This shall lead to the new PD request with
an incremented dialog token being transmitted. For the cases where the
later PD request might not be transmitted as the host driver is busy
transmitting the earlier frame, the received PD response could be
dropped for the dialog token mismatch. Remove the timer configuration to
avoid this behavior.

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

11 years agoP2P: Limit maximum number of stored P2P clients to 100
Jouni Malinen [Thu, 23 Aug 2012 21:23:44 +0000 (00:23 +0300)]
P2P: Limit maximum number of stored P2P clients to 100

This limits the maximum size of the p2p_client_list parameter that
is maintained at the GO for a persistent group. In other words, only
the 100 most recently seen P2P clients are kept in the list.

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

11 years agoImprove p2p_client_list updates in configuration file
Jouni Malinen [Thu, 23 Aug 2012 20:56:51 +0000 (23:56 +0300)]
Improve p2p_client_list updates in configuration file

This list can get truncated due to too many addresses getting added.
Reorder the entries in a way that allows the most recently added values
to be maintained in the list and use better debug/error messages when
parsing the value.

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

11 years agoHandle long configuration file lines more gracefully
Jouni Malinen [Thu, 23 Aug 2012 20:52:45 +0000 (23:52 +0300)]
Handle long configuration file lines more gracefully

Skip the end of long configuration lines that get truncated in
wpa_config_get_line(). Without this, the rest of the file was being
parsed as another line and that resulted in an unexpected error
message (wrong line number and wrong starting point).

In addition, increase the read buffer for network blocks from 256
to 2000 since p2p_client_list parameter can have long values. These
were supposed to truncated cleanly, but the unexpected processing of
the end of the file (which is now fixed in this commit) could cause
configuration file to be rejected.

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

11 years agoP2P: Remove unnecessary call in resuming p2p_find
Jouni Malinen [Thu, 23 Aug 2012 17:28:04 +0000 (20:28 +0300)]
P2P: Remove unnecessary call in resuming p2p_find

Commit 99fcd404091a90317f6619e466f544ee32128a23 added a call to update
search delay after failed authentication attempt. This change was
supposed to be only in p2p_supplicant.c for the successful case. The
extra call does not really do anything, but it's good to remove it to
avoid any confusion in the future.

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

11 years agoP2P: Allow scan operations during p2p_find
Jouni Malinen [Thu, 23 Aug 2012 16:42:53 +0000 (19:42 +0300)]
P2P: Allow scan operations during p2p_find

Previously, all station mode scan operations were either skipped or
delayed while any P2P operation was in progress. To make concurrent
operations easier to use, reduce this limitation by allowing a scan
operation to be completed in the middle of a p2p_find. In addition,
allow station mode association to be completed. When the station mode
operation is run to its completion (scan results not acted on,
connection to an AP completed, connection failed), resume the p2p_find
operation.

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

11 years agoP2P: Use 500 ms search delay by default during concurrent operations
Jouni Malinen [Thu, 23 Aug 2012 15:34:57 +0000 (18:34 +0300)]
P2P: Use 500 ms search delay by default during concurrent operations

If the p2p_find command is used without the delay parameter, a 500 ms
default search delay will now be used when any interface using the same
radio is in an concurrent operation. "p2p_find delay=0" can be used to
enforce the old behavior in such a case if needed.

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

11 years agoP2P: Add option for adding extra delay to p2p_find
Jouni Malinen [Thu, 23 Aug 2012 15:20:58 +0000 (18:20 +0300)]
P2P: Add option for adding extra delay to p2p_find

A new optional delay=<search delay in milliseconds> parameter can now be
used with p2p_find command to request an extra delay between search
iterations. This can be used, e.g., to make p2p_find friendlier to
concurrent operations by avoiding it from taking 100% of the radio
resources.

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

11 years agoAdd UNAUTH-TLS vendor specific EAP type
Jouni Malinen [Wed, 22 Aug 2012 19:34:11 +0000 (22:34 +0300)]
Add UNAUTH-TLS vendor specific EAP type

This EAP type uses a vendor specific expanded EAP header to encapsulate
EAP-TLS with a configuration where the EAP server does not authenticate
the EAP peer. In other words, this method includes only server
authentication. The peer is configured with only the ca_cert parameter
(similarly to other TLS-based EAP methods). This method can be used for
cases where the network provides free access to anyone, but use of RSN
with a securely derived unique PMK for each station is desired.

The expanded EAP header uses the hostapd/wpa_supplicant vendor
code 39068 and vendor type 1 to identify the UNAUTH-TLS method.

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

11 years agoUse proper private enterprise number for EAP VENDOR-TEST
Jouni Malinen [Wed, 22 Aug 2012 18:37:19 +0000 (21:37 +0300)]
Use proper private enterprise number for EAP VENDOR-TEST

Now that the project has its own code, it should be used with the
VENDOR-TEST EAP method.

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