mech_eap.git
8 years agonl80211: Add support for multiple scan plans for scheduled scan
Avraham Stern [Tue, 17 Nov 2015 13:08:23 +0000 (15:08 +0200)]
nl80211: Add support for multiple scan plans for scheduled scan

Add 'scan plans' to driver scan parameters for scheduled scan.
Each 'scan plan' specifies the number of iterations to run the scan
request and the interval between iterations. When a scan plan
finishes (i.e., it was run for the specified number of iterations),
the next scan plan is executed. The last scan plan will run
infinitely.

The maximum number of supported scan plans, the maximum number of
iterations for a single scan plan and the maximum scan interval
are advertised by the driver.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
8 years agotests: Extend scan_dfs to cover US-disallowed channels 12 and 13
Jouni Malinen [Mon, 30 Nov 2015 09:59:45 +0000 (11:59 +0200)]
tests: Extend scan_dfs to cover US-disallowed channels 12 and 13

Verify that active scanning is not used in US regulatory domain on 2.4
GHz channels 12 and 13.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoP2P: Make p2p_go_configured() more robust against unexpected calls
Jouni Malinen [Sun, 29 Nov 2015 23:25:24 +0000 (01:25 +0200)]
P2P: Make p2p_go_configured() more robust against unexpected calls

A hwsim test sequence was able to hit a SIGSEGV in
p2p_go_save_group_common_freqs() called by p2p_go_configured() callback
in a case where a non-P2P AP mode operation is started in wpa_supplicant
(wpas_ap_wep test case). This callback should not have happened for
non-P2P case and the debug logs did not make it clear how this could
happen. In addition, it is unclear how this could be reproduced.

To avoid this type of issues, clear the wpa_s->ap_configured_cb pointer
as soon as the first call to the function happens. In addition, verify
that wpa_s->go_params is available before processing the GO configured
callback.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: EAP-TLS with SHA512/SHA384 signature
Jouni Malinen [Sun, 29 Nov 2015 22:39:38 +0000 (00:39 +0200)]
tests: EAP-TLS with SHA512/SHA384 signature

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: ap_wpa2_eap_fast_prf_oom with internal TLS implementation
Jouni Malinen [Sun, 29 Nov 2015 21:57:39 +0000 (23:57 +0200)]
tests: ap_wpa2_eap_fast_prf_oom with internal TLS implementation

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoTLS client: Fix session_resumed status after TLS session ticket use
Jouni Malinen [Sun, 29 Nov 2015 21:52:30 +0000 (23:52 +0200)]
TLS client: Fix session_resumed status after TLS session ticket use

conn->session_resumed was not set to 1 after successful use of a TLS
session ticket with EAP-FAST. This resulted in the wpa_supplicant STATUS
tls_session_reused showing incorrect value (0 instead of 1) when
EAP-FAST PAC was used. Fix this by setting conn->session_resumed = 1
when TLS handshake using the session ticket succeeds.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoFix tls_connection_prf() regression with CONFIG_TLS=internal
Jouni Malinen [Sun, 29 Nov 2015 21:40:54 +0000 (23:40 +0200)]
Fix tls_connection_prf() regression with CONFIG_TLS=internal

Commit af851914f810978909dd8598ab88030fe43d0051 ('Make
tls_connection_get_keyblock_size() internal to tls_*.c') broke
tls_connection_prf() with the internal TLS implementation when using
skip_keyblock=1. In practice, this broke EAP-FAST. Fix this by deriving
the correct number of PRF bytes before skipping the keyblock.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoTLS: Add support for extKeyUsage X.509v3 extension
Jouni Malinen [Sun, 29 Nov 2015 19:53:23 +0000 (21:53 +0200)]
TLS: Add support for extKeyUsage X.509v3 extension

If the server/client certificate includes the extKeyUsage extension,
verify that the listed key purposes include either the
anyExtendedKeyUsage wildcard or id-kp-serverAuth/id-kp-clientAuth,
respectively.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Skip ap_wpa2_eap_ttls_dh_params_dsa with internal TLS
Jouni Malinen [Sun, 29 Nov 2015 19:09:44 +0000 (21:09 +0200)]
tests: Skip ap_wpa2_eap_ttls_dh_params_dsa with internal TLS

DH DSA parameters are not yet supported.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Skip PKCS#12 tests with internal TLS client implementation
Jouni Malinen [Sun, 29 Nov 2015 19:07:39 +0000 (21:07 +0200)]
tests: Skip PKCS#12 tests with internal TLS client implementation

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoAdd TEST_FAIL() support for internal hash functions
Jouni Malinen [Sun, 29 Nov 2015 19:01:33 +0000 (21:01 +0200)]
Add TEST_FAIL() support for internal hash functions

md4_vector(), md5_vector(), sha1_vector(), and sha256_vector() already
supported TEST_FAIL() with the OpenSSL crypto implementation, but the
same test functionality is needed for the internal crypto implementation
as well.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Skip dbus_connect_eap if altsubject_match is not supported
Jouni Malinen [Sun, 29 Nov 2015 18:57:26 +0000 (20:57 +0200)]
tests: Skip dbus_connect_eap if altsubject_match is not supported

This test case fails with the current internal TLS client implementation
since the needed altsubject_match parameter is not yet supported.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoFix memory leak on NFC DH generation error path
Jouni Malinen [Sun, 29 Nov 2015 18:53:20 +0000 (20:53 +0200)]
Fix memory leak on NFC DH generation error path

It was possible for some NFC DH generation error paths to leak memory
since the old private/public key was not freed if an allocation failed.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Fix wpas_ctrl_oom with the internal TLS implementation
Jouni Malinen [Sun, 29 Nov 2015 18:43:44 +0000 (20:43 +0200)]
tests: Fix wpas_ctrl_oom with the internal TLS implementation

One of the OOM cases does not apply for internal crypto implementation.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Fix wpas_ctrl_network without SAE
Jouni Malinen [Sun, 29 Nov 2015 18:38:34 +0000 (20:38 +0200)]
tests: Fix wpas_ctrl_network without SAE

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Skip domain_match and domain_suffix_match with internal TLS
Jouni Malinen [Sun, 29 Nov 2015 18:35:05 +0000 (20:35 +0200)]
tests: Skip domain_match and domain_suffix_match with internal TLS

The internal TLS client in wpa_supplicant does not yet support the
functionality needed for these test cases.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoTLS client: Add certificate chain validation failure callbacks
Jouni Malinen [Sun, 29 Nov 2015 18:32:52 +0000 (20:32 +0200)]
TLS client: Add certificate chain validation failure callbacks

This adds more support for event_cb() calls for various server
certificate chain validation failures.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: TLS v1.2 check in ap_wpa2_eap_tls_versions for internal TLS
Jouni Malinen [Sun, 29 Nov 2015 18:04:26 +0000 (20:04 +0200)]
tests: TLS v1.2 check in ap_wpa2_eap_tls_versions for internal TLS

The internal TLS implementation in wpa_supplicant supports TLS v1.2, so
verify that this version can be disabled.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoTLS client: Add support for disabling TLS versions
Jouni Malinen [Sun, 29 Nov 2015 18:03:11 +0000 (20:03 +0200)]
TLS client: Add support for disabling TLS versions

The internal TLS client implementation in wpa_supplicant can now be used
with the phase2 parameters tls_disable_tlsv1_0=1, tls_disable_tlsv1_1=1,
and tls_disable_tlsv1_2=1 to disable the specified TLS version(s).

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoTLS client: Use TLS_CONN_* flags
Jouni Malinen [Sun, 29 Nov 2015 17:48:17 +0000 (19:48 +0200)]
TLS client: Use TLS_CONN_* flags

This makes it simpler to add support for new TLS_CONN_* flags without
having to add a new configuration function for each flag.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoTLS: Add support for tls_get_version()
Jouni Malinen [Sun, 29 Nov 2015 17:41:37 +0000 (19:41 +0200)]
TLS: Add support for tls_get_version()

This allows wpa_supplicant to return eap_tls_version STATUS information
when using the internal TLS client implementation.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Skip OCSP test cases with the internal TLS implementation
Jouni Malinen [Sun, 29 Nov 2015 17:32:45 +0000 (19:32 +0200)]
tests: Skip OCSP test cases with the internal TLS implementation

The internal TLS client implementation does not yet support OCSP.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: ap_wpa2_eap_ttls_server_cert_hash with internal TLS client
Jouni Malinen [Sun, 29 Nov 2015 17:02:04 +0000 (19:02 +0200)]
tests: ap_wpa2_eap_ttls_server_cert_hash with internal TLS client

Since the internal TLS client implementation in wpa_supplicant now has
sufficient support for this functionality, allow the test case to be
executed.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoTLS client: Add support for server certificate probing
Jouni Malinen [Sun, 29 Nov 2015 16:59:27 +0000 (18:59 +0200)]
TLS client: Add support for server certificate probing

The internal TLS client implementation can now be used with
ca_cert="probe://" to probe the server certificate chain. This is also
adding the related CTRL-EVENT-EAP-TLS-CERT-ERROR and
CTRL-EVENT-EAP-PEER-CERT events.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoTLS: Add TLS v1.2 signature algorithm support for SHA384 and SHA512
Jouni Malinen [Sun, 29 Nov 2015 16:16:07 +0000 (18:16 +0200)]
TLS: Add TLS v1.2 signature algorithm support for SHA384 and SHA512

This extends the internal TLS client implementation to support signature
algorithms SHA384 and SHA512 in addition to the previously supported
SHA256.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agocrypto: Add CRYPTO_HASH_ALG_SHA384 and CRYPTO_HASH_ALG_SHA512
Jouni Malinen [Sun, 29 Nov 2015 16:14:50 +0000 (18:14 +0200)]
crypto: Add CRYPTO_HASH_ALG_SHA384 and CRYPTO_HASH_ALG_SHA512

This extends the crypto_hash_*() API to support SHA384 and SHA512 when
built with CONFIG_TLS=internal.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoTLS client: Add signature_algorithms extension into ClientHello
Jouni Malinen [Sun, 29 Nov 2015 15:30:37 +0000 (17:30 +0200)]
TLS client: Add signature_algorithms extension into ClientHello

Since we support only SHA256 (and not the default SHA1) with TLS v1.2,
the signature_algorithms extensions needs to be added into ClientHello.
This fixes interop issues with the current version of OpenSSL that uses
the default SHA1 hash if ClientHello does not specify allowed signature
algorithms.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoTLS client: Validate certificates with SHA384 and SHA512 hashes
Pali Rohár [Sun, 22 Nov 2015 01:02:58 +0000 (02:02 +0100)]
TLS client: Validate certificates with SHA384 and SHA512 hashes

This commit adds support for validating certificates with SHA384 and
SHA512 hashes. Those certificates are now very common so wpa_supplicant
needs support for them.

SHA384 and SHA512 hash functions are included in the previous commit.

Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
8 years agoAdd SHA384 and SHA512 implementations from LibTomCrypt library
Pali Rohár [Sun, 22 Nov 2015 01:02:57 +0000 (02:02 +0100)]
Add SHA384 and SHA512 implementations from LibTomCrypt library

These will be used with the internal TLS implementation to extend hash
algorithm support for new certificates and TLS v1.2.

Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
8 years agoTLS client: Add support for validating server certificate hash
Pali Rohár [Sun, 22 Nov 2015 01:02:56 +0000 (02:02 +0100)]
TLS client: Add support for validating server certificate hash

This commit adds support for "hash://server/sha256/cert_hash_in_hex"
scheme in ca_cert property for the internal TLS implementation.

Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
8 years agoTLS client: Do not verify CA certificates when ca_cert is not specified
Pali Rohár [Sun, 22 Nov 2015 01:02:55 +0000 (02:02 +0100)]
TLS client: Do not verify CA certificates when ca_cert is not specified

In documentation is written: "If ca_cert and ca_path are not included,
server certificate will not be verified". This is the case when
wpa_supplicant is compiled with OpenSSL library, but when using the
internal TLS implementation and some certificates in CA chain are in
unsupported format (e.g., use SHA384 or SHA512 hash functions) then
verification fails even if ca_cert property is not specified.

This commit changes behavior so that certificate verification in
internal TLS implementation is really skipped when ca_cert is not
specified.

Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
8 years agotests: Fix OOM eloop_register_sock() test cases with new gcc
Jouni Malinen [Sat, 28 Nov 2015 17:07:35 +0000 (19:07 +0200)]
tests: Fix OOM eloop_register_sock() test cases with new gcc

gcc 4.8 vs 5.2 seem to compile eloop_register_sock() differently. With
5.2, that function name does not show up in the backtrace since
eloop_sock_table_add_sock() is used without a separate function call.
This broke the memory allocation failure checking in this test case. Fix
this by matching against the eloop_sock_table_add_sock() function which
shows up in the backtrace for both gcc versions.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: EAP-SIM/AKA/AKA' error cases
Jouni Malinen [Sat, 28 Nov 2015 17:20:18 +0000 (19:20 +0200)]
tests: EAP-SIM/AKA/AKA' error cases

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoAdd TEST_FAIL() condition to aes_128_cbc_encrypt/decrypt()
Jouni Malinen [Sat, 28 Nov 2015 17:00:32 +0000 (19:00 +0200)]
Add TEST_FAIL() condition to aes_128_cbc_encrypt/decrypt()

This enables more error path testing.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoEAP-SIM peer: Fix memory leak on reauth error path
Jouni Malinen [Sat, 28 Nov 2015 17:43:55 +0000 (19:43 +0200)]
EAP-SIM peer: Fix memory leak on reauth error path

If init_for_reauth fails, the EAP-SIM peer state was not freed properly.
Use eap_sim_deinit() to make sure all allocations get freed. This could
be hit only if no random data could be derived for NONCE_MT.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoEAP-SAKE: Fix a typo in attribute parser debug print
Jouni Malinen [Sat, 28 Nov 2015 10:25:42 +0000 (12:25 +0200)]
EAP-SAKE: Fix a typo in attribute parser debug print

Parsing AT_MSK_LIFE ended up writing a debug log entry with incorrect
attribute name (AT_IV).

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Extended coverage for the EAP-SAKE attribute parser
Jouni Malinen [Sat, 28 Nov 2015 10:25:22 +0000 (12:25 +0200)]
tests: Extended coverage for the EAP-SAKE attribute parser

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: EAP-SAKE local error cases
Jouni Malinen [Sat, 28 Nov 2015 09:53:31 +0000 (11:53 +0200)]
tests: EAP-SAKE local error cases

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Convert eap_proto_sake to use newer design
Jouni Malinen [Sat, 28 Nov 2015 09:22:21 +0000 (11:22 +0200)]
tests: Convert eap_proto_sake to use newer design

This makes it more convenient to extend the test case with new
message exchanges.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Fix error message for ap_open_out_of_memory
Jouni Malinen [Fri, 27 Nov 2015 22:23:35 +0000 (00:23 +0200)]
tests: Fix error message for ap_open_out_of_memory

If hostapd AP started unexpectedly, this test case would fail with
NameError due to incorrect variable name being used to construct the
exception text.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: run-tests: Print more details about NameError
Johannes Berg [Fri, 27 Nov 2015 18:54:58 +0000 (19:54 +0100)]
tests: run-tests: Print more details about NameError

If encountering a NameError, print the entire traceback so that
it's actually debuggable.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agotests: ERP protocol tests
Jouni Malinen [Fri, 27 Nov 2015 22:18:49 +0000 (00:18 +0200)]
tests: ERP protocol tests

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Enable 802.11ac support in example wpa_supplicant config
Jouni Malinen [Fri, 27 Nov 2015 18:59:38 +0000 (20:59 +0200)]
tests: Enable 802.11ac support in example wpa_supplicant config

This is needed for proper test execution. The recently added VHT 80+80
test cases started verifying channel bandwidth on the station side and
those checks fail if wpa_supplicant is built without
CONFIG_IEEE80211AC=y.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Honor HWSIM_TEST_LOG_DIR variable in VM runs
Johannes Berg [Tue, 24 Nov 2015 16:39:58 +0000 (17:39 +0100)]
tests: Honor HWSIM_TEST_LOG_DIR variable in VM runs

If /tmp has a relatively small size limit, or multiple people run the
tests on the same machine, using the same output directory can easily
cause problems.

Make the test framework honor the new HWSIM_TEST_LOG_DIR environment
variable to make it easier to avoid those problems.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agotests: Add a simple wmediumd test
Johannes Berg [Fri, 27 Nov 2015 14:41:37 +0000 (15:41 +0100)]
tests: Add a simple wmediumd test

If wmediumd is available on the path, test that it can forward
packets between two virtual nodes and that stopping it makes
the regular in-kernel datapath do the needed work again.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agotests: Remove HwsimSkip from p2p_channel
Jouni Malinen [Fri, 27 Nov 2015 17:38:17 +0000 (19:38 +0200)]
tests: Remove HwsimSkip from p2p_channel

With the optimizations from the previous commits, none of the test cases
here need to be skipped.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Optimize p2p_go_move_active initial wait
Jouni Malinen [Fri, 27 Nov 2015 17:37:35 +0000 (19:37 +0200)]
tests: Optimize p2p_go_move_active initial wait

There is no need to wait for the initial client timeout in this type of
test sequence since that wait can be cleared by connecting and
disconnecting a client to the group. This allows the test case to be
executed much more quickly and the dependency on --long can be removed.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Optimize p2p_go_move_reg_change initial wait
Jouni Malinen [Fri, 27 Nov 2015 17:34:18 +0000 (19:34 +0200)]
tests: Optimize p2p_go_move_reg_change initial wait

There is no need to wait for the initial client timeout in this type of
test sequence since that wait can be cleared by connecting and
disconnecting a client to the group. This allows the test case to be
executed much more quickly and the dependency on --long can be removed.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Optimize p2p_go_move_scm_multi initial wait
Jouni Malinen [Fri, 27 Nov 2015 17:31:44 +0000 (19:31 +0200)]
tests: Optimize p2p_go_move_scm_multi initial wait

There is no need to wait for the initial client timeout in this type of
test sequence since that wait can be cleared by connecting and
disconnecting a client to the group. This allows the test case to be
executed much more quickly and the dependency on --long can be removed.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Convert p2p_go_move_scm_multi to use dynamic hwsim
Jouni Malinen [Fri, 27 Nov 2015 17:30:02 +0000 (19:30 +0200)]
tests: Convert p2p_go_move_scm_multi to use dynamic hwsim

Use a dynamically added HWSimRadio to allow the MCC case to be covered
with a single test run with the mac80211_hwsim default radios disabling
MCC.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Convert p2p_go_move_scm_peer_does_not_support to dynamic hwsim
Jouni Malinen [Fri, 27 Nov 2015 17:27:25 +0000 (19:27 +0200)]
tests: Convert p2p_go_move_scm_peer_does_not_support to dynamic hwsim

Use a dynamically added HWSimRadio to allow the MCC case to be covered
with a single test run with the mac80211_hwsim default radios disabling
MCC.

In addition, remove dependency on --long since this test case does not
really take that long.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Convert p2p_go_move_scm_peer_supports to use dynamic hwsim
Jouni Malinen [Fri, 27 Nov 2015 17:24:33 +0000 (19:24 +0200)]
tests: Convert p2p_go_move_scm_peer_supports to use dynamic hwsim

Use a dynamically added HWSimRadio to allow the MCC case to be covered
with a single test run with the mac80211_hwsim default radios disabling
MCC.

In addition, remove dependency on --long since this test case does not
really take that long (just couple of seconds).

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Optimize p2p_go_move_scm initial wait
Jouni Malinen [Fri, 27 Nov 2015 17:20:11 +0000 (19:20 +0200)]
tests: Optimize p2p_go_move_scm initial wait

There is no need to wait for the initial client timeout in this type of
test sequence since that wait can be cleared by connecting and
disconnecting a client to the group. This allows the test case to be
executed much more quickly and the dependency on --long can be removed.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Convert p2p_go_move_scm to use dynamic hwsim
Jouni Malinen [Fri, 27 Nov 2015 17:14:38 +0000 (19:14 +0200)]
tests: Convert p2p_go_move_scm to use dynamic hwsim

Use a dynamically added HWSimRadio to allow the MCC case to be covered
with a single test run with the mac80211_hwsim default radios disabling
MCC.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Convert p2p_go_move_active to use dynamic hwsim
Jouni Malinen [Fri, 27 Nov 2015 17:11:27 +0000 (19:11 +0200)]
tests: Convert p2p_go_move_active to use dynamic hwsim

Use a dynamically added HWSimRadio to allow the MCC case to be covered
with a single test run with the mac80211_hwsim default radios disabling
MCC.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Dynamic hwsim p2ps_channel_active_go_and_station_different_mcc
Jouni Malinen [Fri, 27 Nov 2015 17:01:10 +0000 (19:01 +0200)]
tests: Dynamic hwsim p2ps_channel_active_go_and_station_different_mcc

Convert p2ps_channel_active_go_and_station_different_mcc to use a
dynamically added HWSimRadio to allow the MCC case to be covered with a
single test run with the mac80211_hwsim default radios disabling MCC.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoAbort ongoing scans on FLUSH command
Jouni Malinen [Thu, 26 Nov 2015 23:09:42 +0000 (01:09 +0200)]
Abort ongoing scans on FLUSH command

This may speed up some hwsim test case sequencies by avoiding a wait for
a scan at the end of a test case to complete.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Use wlantest without capture file write buffering
Jouni Malinen [Thu, 26 Nov 2015 22:12:38 +0000 (00:12 +0200)]
tests: Use wlantest without capture file write buffering

This makes the run_tshark() operations more reliable while still
allowing to reduce the extra wait by forcing wlantest to flush the
packets to the pcapng file.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agowlantest: Add -N command line argument to remove write buffering
Jouni Malinen [Thu, 26 Nov 2015 22:10:53 +0000 (00:10 +0200)]
wlantest: Add -N command line argument to remove write buffering

This makes it easier to do live parsing of captured pcap files from
wlantest without having to rename and restart the capture file. Packet
writes are flushed to disk after each packet if -N is included in the
command line.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Clean up frequency list in scan_dfs
Jouni Malinen [Thu, 26 Nov 2015 21:42:30 +0000 (23:42 +0200)]
tests: Clean up frequency list in scan_dfs

This makes the test log more readable by converting the values to
integers and sorting the array.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: VHT with 80 MHz channel width and local power constraint
Jouni Malinen [Thu, 26 Nov 2015 18:40:40 +0000 (20:40 +0200)]
tests: VHT with 80 MHz channel width and local power constraint

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agohostapd: Add Transmit Power Envelope IE when VHT is enabled
Rajkumar Manoharan [Mon, 23 Nov 2015 13:10:26 +0000 (18:40 +0530)]
hostapd: Add Transmit Power Envelope IE when VHT is enabled

Add Transmit Power Envelope element defined in IEEE P802.11-REVmc/D4.3,
8.4.2.161.

Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
8 years agotests: Abort scan
Jouni Malinen [Tue, 27 Oct 2015 09:06:14 +0000 (11:06 +0200)]
tests: Abort scan

This verifies the nl80211 behavior to abort a scan on an explicit
control interface request and on connection request.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoAdd control interface command for aborting an ongoing scan
Jouni Malinen [Tue, 27 Oct 2015 08:58:52 +0000 (10:58 +0200)]
Add control interface command for aborting an ongoing scan

The new ABORT_SCAN command can be used to request an ongoing scan to be
aborted.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoAbort an ongoing scan before connect
Kanchanapally, Vidyullatha [Mon, 19 Oct 2015 14:00:34 +0000 (19:30 +0530)]
Abort an ongoing scan before connect

Connect radio work is sometimes delayed for a considerable duration if
there is an ongoing scan radio work. To avoid these delays abort the
ongoing scan on that interface before queuing a connect request. Upon a
scan done indication from the driver, connect radio work will be
scheduled.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agonl80211: Add support for aborting an ongoing scan
Kanchanapally, Vidyullatha [Mon, 19 Oct 2015 14:00:34 +0000 (19:30 +0530)]
nl80211: Add support for aborting an ongoing scan

This adds the driver interface commands for issuing a request to abort
an ongoing scan operation.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoSync with mac80211-next.git include/uapi/linux/nl80211.h
Jouni Malinen [Tue, 27 Oct 2015 08:54:09 +0000 (10:54 +0200)]
Sync with mac80211-next.git include/uapi/linux/nl80211.h

This brings in nl80211 definitions as of 2015-11-26.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Scan on DFS channels
Jouni Malinen [Thu, 26 Nov 2015 17:24:25 +0000 (19:24 +0200)]
tests: Scan on DFS channels

This is a test case for mac80211 behavior regarding active scanning on
DFS channels.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: Open mesh network on VHT 80+80 MHz channel
Jouni Malinen [Thu, 26 Nov 2015 15:56:45 +0000 (17:56 +0200)]
tests: Open mesh network on VHT 80+80 MHz channel

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: IBSS on VHT 80+80 MHz channel
Jouni Malinen [Thu, 26 Nov 2015 15:48:55 +0000 (17:48 +0200)]
tests: IBSS on VHT 80+80 MHz channel

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agomesh: Clear wpa_s cipher selection on starting mesh
Jouni Malinen [Thu, 26 Nov 2015 16:45:59 +0000 (18:45 +0200)]
mesh: Clear wpa_s cipher selection on starting mesh

This is needed to avoid hitting WEP/TKIP detection in
ibss_mesh_setup_freq() if the previous connection used WEP or TKIP.
Previously, that could have resulted in VHT and HT getting disabled for
the mesh connection.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agonl80211: Fix SIGNAL_POLL in IBSS and mesh
Jouni Malinen [Thu, 26 Nov 2015 15:47:36 +0000 (17:47 +0200)]
nl80211: Fix SIGNAL_POLL in IBSS and mesh

NL80211_CMD_GET_STATION does not work with the IBSS/mesh BSSID, so clear
the signal strength instead of returning failure when SIGNAL_POLL is
used in an IBSS/mesh.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoIBSS/mesh: Add support for VHT80P80 configuration
Ahmad Kholaif [Wed, 25 Nov 2015 03:51:43 +0000 (19:51 -0800)]
IBSS/mesh: Add support for VHT80P80 configuration

A new network profile configuration parameter max_oper_chwidth=3 can be
used to specify preference to enable 80+80 MHz VHT channel for IBSS. If
that is set, the first 80 MHz segment is specified based on the
frequency parameter in the network profile and the second segment is
selected automatically (which will practically be limited to a single
possibility due to DFS requirements in most countries).

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: P2P client joining a group before having found GO Device Address
Jouni Malinen [Thu, 26 Nov 2015 13:17:06 +0000 (15:17 +0200)]
tests: P2P client joining a group before having found GO Device Address

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: AP with open mode and REASSOCIATE not finding a match
Jouni Malinen [Thu, 26 Nov 2015 10:23:19 +0000 (12:23 +0200)]
tests: AP with open mode and REASSOCIATE not finding a match

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: Verify P2P group formation with 80+80 MHz channel
Jouni Malinen [Thu, 29 Oct 2015 18:47:36 +0000 (20:47 +0200)]
tests: Verify P2P group formation with 80+80 MHz channel

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoP2P: Add support for VHT 80+80 MHz and 160 MHz
Ahmad Kholaif [Wed, 28 Oct 2015 21:14:10 +0000 (14:14 -0700)]
P2P: Add support for VHT 80+80 MHz and 160 MHz

The new max_oper_chwidth and freq2 arguments to P2P_CONNECT, P2P_INVITE,
and P2P_GROUP_ADD control interface commands can be used to request
larger VHT operating channel bandwidth to be used than the previously
used maximum 80 MHz.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agonl80211: Add VHT 160 MHz channel flags
Ahmad Kholaif [Wed, 28 Oct 2015 21:14:10 +0000 (14:14 -0700)]
nl80211: Add VHT 160 MHz channel flags

This extends the previous design that covered only the VHT 80 MHz cases
for VHT channel flags. New functions are introduced to allow 160 MHz
bandwidth cases to determine the center channel and check availability
of a 160 MHz channel.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoP2P: Define operating classes for VHT 80+80 and 160
Ahmad Kholaif [Wed, 28 Oct 2015 21:14:10 +0000 (14:14 -0700)]
P2P: Define operating classes for VHT 80+80 and 160

This adds definitions for the global operating classes 129 and 130 for
VHT 80+80 MHz and 160 MHz use cases.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoFST: Improve parsing of Multiband IEs
Dedy Lansky [Sun, 22 Nov 2015 12:46:54 +0000 (14:46 +0200)]
FST: Improve parsing of Multiband IEs

Previously, MB IEs were parsed only from association event. Try to get
MB IEs from other management frames like Probe Response frames. The MB
IEs from the association event may not be up-to-date and in some cases
may actually be missing and updating the information based on other
frames can improve robustness of FST exchanges.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoFST: Make FST peer connection check more permissive in hostapd
Anton Nayshtut [Tue, 10 Nov 2015 13:51:07 +0000 (15:51 +0200)]
FST: Make FST peer connection check more permissive in hostapd

Modify the FST peer connection check so it won't skip peers without MB
IEs making it more permissive for peers that didn't provide MB IEs
during association request. This can be helpful, e.g., in cases where a
STA's interface connected before it was added to the FST group. This
allows the AP to receive FST Action frames and initiate session with a
STA via STA's interface that doesn't expose MB IEs.

The adjusted FST protocol is still safe, as it protects itself in many
other ways (checking band info and it's accordance to the interfaces,
Setup IDs, connection states of the interfaces involved, etc.)
effectively avoiding all types of invalid situations.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: Import p2p_utils instead of functions from old locations
Jouni Malinen [Wed, 25 Nov 2015 13:47:16 +0000 (15:47 +0200)]
tests: Import p2p_utils instead of functions from old locations

These couple of files were forgotten when moving P2P helper functions
into the new p2p_utils.py file.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Print test name to kernel log buffer
Johannes Berg [Tue, 24 Nov 2015 12:27:57 +0000 (13:27 +0100)]
tests: Print test name to kernel log buffer

Print the test name to the kernel log buffer so debugging
cross-test issues becomes easier.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agoRemove wpa_supplicant/tests
Jouni Malinen [Mon, 23 Nov 2015 21:55:33 +0000 (23:55 +0200)]
Remove wpa_supplicant/tests

There was only a single file remaining in this directory. All the other
old test functionality has been moved under the top level tests
directory. Move the remaining file to the wpa_supplicant directory to
get rid of the subdirectory.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Move EAP-SIM PRF module test into the hwsim framework
Jouni Malinen [Mon, 23 Nov 2015 21:52:52 +0000 (23:52 +0200)]
tests: Move EAP-SIM PRF module test into the hwsim framework

The old wpa_supplicant/Makefile target test-eap_sim_common did not work
anymore and anyway, this test is better placed in the newer hwsim
framework to make sure the test case gets executed automatically.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoRemove link_test and test_wpa
Jouni Malinen [Mon, 23 Nov 2015 21:45:10 +0000 (23:45 +0200)]
Remove link_test and test_wpa

These wpa_supplicant test programs have not been maintained for years
and it would take significant effort to get these into working state.
Since there does not seem to be any real need for these based on lack of
maintenance, it is easier to just drop these tools for now.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoFix CONFIG_NO_WPA=y build
Jouni Malinen [Mon, 23 Nov 2015 21:34:52 +0000 (23:34 +0200)]
Fix CONFIG_NO_WPA=y build

Number of places were calling functions that are not included in
CONFIG_NO_WPA=y build anymore. Comment out such calls. In addition, pull
in SHA1 and MD5 for config_internal.c, if needed.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoComment out wpas_reenabled_network_time with CONFIG_NO_SCAN_PROCESSING
Jouni Malinen [Mon, 23 Nov 2015 21:33:55 +0000 (23:33 +0200)]
Comment out wpas_reenabled_network_time with CONFIG_NO_SCAN_PROCESSING

This removes a compiler warning about unused function.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: Make FST tests aware of unconditional station's MB IE exposure
Anton Nayshtut [Wed, 18 Nov 2015 17:00:40 +0000 (19:00 +0200)]
tests: Make FST tests aware of unconditional station's MB IE exposure

This syncs the test cases with the implementation change in station's MB
IE creation. FST tests should expect MB IE regardless of the station
connection state and whether the current connection is FST-enabled or
not. This fixes the follow test cases that started reporting failures
with the previous commit change in src/fst/fst_group.c:
fst_disconnect_1_of_2_stas_from_non_fst_ap
fst_sta_connect_to_non_fst_ap
fst_second_sta_connect_to_non_fst_ap
fst_disconnect_2_of_2_stas_from_non_fst_ap
fst_second_sta_connect_to_fst_ap
fst_disconnect_1_of_2_stas_from_fst_ap

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agoFST: Fix STA MB IEs creation
Anton Nayshtut [Wed, 12 Aug 2015 09:04:22 +0000 (12:04 +0300)]
FST: Fix STA MB IEs creation

FST STA should always expose its MB IEs regardless of its connection
state and whether the connected AP is currently FST-enabled or not.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years agotests: Test no P2P GO move when invitation is in progress
Ilan Peer [Sun, 22 Nov 2015 13:57:52 +0000 (15:57 +0200)]
tests: Test no P2P GO move when invitation is in progress

Add a test to verify that a P2P GO does not start a CSA
once invitation signalling is done, and the P2P client is
about to connect.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
8 years agoP2P: Add a testing option to force P2P GO CSA
Ilan Peer [Sun, 22 Nov 2015 13:57:51 +0000 (15:57 +0200)]
P2P: Add a testing option to force P2P GO CSA

Add a testing option to force a P2P GO CSA on successful
invitation to join an active P2P GO.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
8 years agoP2P: Set p2p_go_wait_client in invitation_result() cb
Ilan Peer [Sun, 22 Nov 2015 13:57:50 +0000 (15:57 +0200)]
P2P: Set p2p_go_wait_client in invitation_result() cb

When an invitation to join an existing group is accepted by the
peer device, set p2p_go_wait_client to the current time so
that wpas_p2p_in_progress() would return != 0, thus preventing
P2P CSA, scanning etc., that would interfere with the peer
device connection.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
8 years agotests: Make dbus_p2p_group_idle_timeout more robust
Jouni Malinen [Sun, 22 Nov 2015 19:28:49 +0000 (21:28 +0200)]
tests: Make dbus_p2p_group_idle_timeout more robust

This test case was failing if a PropertiesChanged signal for P2P peer
gets delivered from a previous test case. Avoid that by waiting for the
new group to be formed before processing any PropertiesChanged signals.

This failure was triggered by the following test case sequence:
dbus_p2p_two_groups dbus_p2p_group_idle_timeout

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agoAndroid: Give user the option for selecting browser for HS 2.0 OSU
Somdas Bandyopadhyay [Tue, 3 Nov 2015 12:48:35 +0000 (18:18 +0530)]
Android: Give user the option for selecting browser for HS 2.0 OSU

When built with browser-android.c, hs20-osu-client used to always launch
the native/stock Android browser for OSU user interaction. This browser
is not present in all devices. It is better to give the option to the
user to select his/her browser.

Here the user will be shown a pop up to select the browser that he/she
wants.

Signed-off-by: Somdas Bandyopadhyay <somdas.bandyopadhyay@intel.com>
8 years agotests: Make ap_open_select_twice less likely to fail
Jouni Malinen [Sun, 22 Nov 2015 18:14:06 +0000 (20:14 +0200)]
tests: Make ap_open_select_twice less likely to fail

It looks like a previous P2P test case can cause the initial single
channel scan in ap_open_select_twice take more than five seconds in some
cases. While that is not really expected behavior, this test case should
not fail. Increase the timeout to avoid reporting false failures here.

This could be triggered with the following test case sequence:
p2p_msg_unexpected_go_neg_resp ap_open_select_twice

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: INTERFACE_ADD create testing coverage
Jouni Malinen [Sun, 22 Nov 2015 15:59:54 +0000 (17:59 +0200)]
tests: INTERFACE_ADD create testing coverage

This covers an invalid interface type and interface type 'sta'.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years agotests: wpa_supplicant interface creation in AP mode
Ilan Peer [Tue, 3 Nov 2015 14:30:12 +0000 (16:30 +0200)]
tests: wpa_supplicant interface creation in AP mode

Add a test case that creates a new interface in AP mode.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
8 years agowpa_cli: Add an option to set created interface type
Avraham Stern [Tue, 3 Nov 2015 14:30:11 +0000 (16:30 +0200)]
wpa_cli: Add an option to set created interface type

Add an option to set the interface type when creating
a driver interface.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
8 years agoAdd an option to create interface of a certain type with INTERFACE_ADD
Avraham Stern [Tue, 3 Nov 2015 14:30:10 +0000 (16:30 +0200)]
Add an option to create interface of a certain type with INTERFACE_ADD

Some drivers do not support having two station interfaces, so the fact
that wpa_supplicant always creates a new interface in station mode, even
if it will be used as another type of interface, may prevent
wpa_supplicant from creating new interfaces. Allow setting the interface
type when a new interface is created so that interfaces of supported
types can be created.

Currently supported types are station ("sta") and AP ("ap"). If the
interface type is not specified, a station interface will be created.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>