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

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>