Commit graph

93 commits

Author SHA1 Message Date
Jouni Malinen 378bf90848 tests: EAP-IKEV2 server local errors and protocol testing
Signed-off-by: Jouni Malinen <j@w1.fi>
2019-04-20 23:56:23 +03:00
Jouni Malinen c862496d0d tests: EAP-MD5 server local errors and protocol testing
Signed-off-by: Jouni Malinen <j@w1.fi>
2019-04-20 11:55:31 +03:00
Jouni Malinen 349ddab020 tests: EAP-PAX server local errors and protocol testing
Signed-off-by: Jouni Malinen <j@w1.fi>
2019-04-20 11:55:31 +03:00
Jouni Malinen 431802df00 tests: EAP-PSK server local errors and protocol testing
Signed-off-by: Jouni Malinen <j@w1.fi>
2019-04-20 00:27:15 +03:00
Jouni Malinen 9ddc773d1a tests: EAP-GPSK server local errors and protocol testing
Signed-off-by: Jouni Malinen <j@w1.fi>
2019-04-19 18:59:39 +03:00
Jouni Malinen 94758682b7 tests: Additional EAP-SAKE peer error path coverage
Signed-off-by: Jouni Malinen <j@w1.fi>
2019-04-19 16:57:50 +03:00
Jouni Malinen 92d2a99163 tests: EAP-SAKE server local errors and protocol testing
Signed-off-by: Jouni Malinen <j@w1.fi>
2019-04-19 16:53:42 +03:00
Jouni Malinen 9f721917e7 tests: EAP-pwd protocol testing for the server
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
2019-04-17 14:15:42 +03:00
Jouni Malinen 778ce8ae0b tests: EAP-pwd protocol tests - unexpected more-fragment frame
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
2019-04-17 13:24:37 +03:00
Jouni Malinen a143bdc0d1 tests: EAP-pwd local error cases on server
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
2019-04-17 13:24:37 +03:00
Jouni Malinen 50b915f055 tests: Additional coverage for EAP-MSCHAPv2 local error cases
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
2019-04-16 21:25:27 +03:00
Jouni Malinen d804155783 tests: Milenage local error cases
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
2019-04-16 21:09:50 +03:00
Jouni Malinen 63215b32a8 tests: AES-EAX error cases that were previously missed in EAP-PSK
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
2019-04-16 20:39:45 +03:00
Jouni Malinen d7c98f9558 tests: eap_pwd_perform_confirm_exchange() local failure
Signed-off-by: Jouni Malinen <j@w1.fi>
2019-04-13 18:35:47 +03:00
Jouni Malinen b95d79e7bc tests: eap_pwd_perform_commit_exchange() local failures
Signed-off-by: Jouni Malinen <j@w1.fi>
2019-04-13 18:34:38 +03:00
Jouni Malinen c9065bd265 tests: EAP-pwd commit request error cases
Signed-off-by: Jouni Malinen <j@w1.fi>
2019-04-13 18:28:05 +03:00
Jouni Malinen 6fe3ee722d tests: EAP-pwd local failure in crypto_bignum_rand()
Signed-off-by: Jouni Malinen <j@w1.fi>
2019-04-13 18:28:05 +03:00
Jouni Malinen 8ff2401d54 tests: EAP-pwd eap_pwd_get_element() local failures
Signed-off-by: Jouni Malinen <j@w1.fi>
2019-04-13 18:28:03 +03:00
Jouni Malinen 4f183becf0 tests: EAP-pwd compute_password_element() local failures
Signed-off-by: Jouni Malinen <j@w1.fi>
2019-04-13 16:58:38 +03:00
Jouni Malinen 52b1cb5d73 tests: crypto_hash_finish() failure in eap_pwd_kdf()
Signed-off-by: Jouni Malinen <j@w1.fi>
2019-04-13 12:53:42 +03:00
Jouni Malinen 2e3849bcf5 tests: EAP-pwd protocol tests for invalid EAP-pwd-Commit
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
2019-04-09 17:11:15 +03:00
Jouni Malinen fab49f6145 tests: Python coding style cleanup (pylint3 bad-whitespace)
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
2019-03-16 18:52:09 +02:00
Jouni Malinen 9efd3447c7 tests: Make AP discovery more robust in eap_proto test cases
Number of these test cases start connection attempt in wpa_supplicant
and then expected a specific failure to happen relatively quickly. This
could result in timeouts if the first scanning round missed to find the
AP (e.g., due to CPU load pushing out the Probe Response frame long
enough for the station having left the channel) and wpa_supplicant then
waiting five seconds before starting a new scan.

Make this more robust by scanning explicitly for the specific BSSID
before starting the connection attempt.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
2019-03-12 16:24:15 +02:00
Jouni Malinen 43e3114c5f tests: Fix EAP-FAST protocol testing with python3
This was hit on Ubuntu 18.04 (newer python3 and OpenSSL library versions
compared to earlier tests).

Signed-off-by: Jouni Malinen <j@w1.fi>
2019-02-05 15:50:45 +02:00
Jouni Malinen 55845e190b tests: Clean up pyrad test cases for python3 compatibility
All other test cases seem to work, but radius_das_disconnect_time_window
is still failing due to incorrect authenticator or Message-Authenticator
in Disconnect-Request.

Signed-off-by: Jouni Malinen <j@w1.fi>
2019-02-04 20:03:29 +02:00
Masashi Honma 15dfcb69df tests: Use 'b' prefix to mark Bytes literals explicitly for python3
Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
Signed-off-by: Jouni Malinen <j@w1.fi>
2019-02-04 12:26:33 +02:00
Masashi Honma f94df3c0b0 tests: Explicitly encode str to bytes when needed for python3
Avoid implicit conversion errors when constructing bytes objects or
passing a str object to a function that needs a bytes object.

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
Signed-off-by: Jouni Malinen <j@w1.fi>
2019-02-04 12:26:33 +02:00
Masashi Honma 7ab74770e7 tests: Convert binascii.hexlify() output to a string object for python3
This is needed in cases the hexlify() output is used to concatenate with
a string or used in string comparisons.

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
Signed-off-by: Jouni Malinen <j@w1.fi>
2019-02-04 12:26:33 +02:00
Jouni Malinen 182a0b4dae tests: EAP-pwd local error case in eap_pwd_perform_confirm_exchange()
This is a regression test case for a memory leak on these error paths.

Signed-off-by: Jouni Malinen <j@w1.fi>
2018-10-16 12:22:58 +03:00
Jouni Malinen 0a3742950e tests: Extend eap_proto_aka_prime to cover additional AT_KDF cases
Verify that EAP-AKA' client rejects Challenge with an appended AT_KDF
and a modified AT_KDF value during KDF negotiation.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
2018-08-02 15:36:24 +03:00
Jouni Malinen b30639b77e tests: Adjust eap_proto_pwd_errors to match implementation changes
Signed-off-by: Jouni Malinen <j@w1.fi>
2018-05-28 22:09:20 +03:00
Sean Parkinson 7d5df79f2d tests: Use a valid key exchange value in eap_proto_ikev2
Signed-off-by: Sean Parkinson <sean@wolfssl.com>
2018-05-02 00:37:38 +03:00
Jouni Malinen c1361765fd tests: Additional EAP-TTLS error path
This is a regression test for a memory leak on an error path.

Signed-off-by: Jouni Malinen <j@w1.fi>
2017-07-08 16:21:38 +03:00
Jouni Malinen e4e99927bf tests: Additional LEAP error path
This is a regression test for a memory leak on an error path.

Signed-off-by: Jouni Malinen <j@w1.fi>
2017-07-08 16:14:03 +03:00
Jouni Malinen 0a0c4dc1d7 tests: Use a domain name in the identity for get_emsk OOM tests
These test cases depend on ERP processing to reach the get_emsk handler
function. Since ERP really needs the realm to derive a proper
keyName-NAI, modify these test cases to pass the realm part in the
identity to allow error checking to be introduced for rejecting ERP
cases where the realm is not available.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2017-05-22 13:51:07 +03:00
Jouni Malinen 33a6da6908 tests: Work around pyopenssl API change
OpenSSL.SSL.Connection.state_string() was replaced with
get_state_string() in pyopenssl. Add workaround code to be able to use
either of these names.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2017-03-01 00:20:29 +02:00
Jouni Malinen db98b58736 tests: Remove trailing whitespace
Signed-off-by: Jouni Malinen <j@w1.fi>
2016-12-28 14:31:42 +02:00
Jouni Malinen 6219943d57 tests: Fix eap_fast_tlv_nak_oom and eap_fast_proto_phase2
Something broke eap_fast_tlv_nak_oom when moving from Ubuntu 14.04 to
16.04. OpenSSL.SSL.Connection() state_string() returns None in these
cases and the debug log prints for that were causing the case to fail.
For now, work around this by checking whether the state string is None
before trying to print it.

Signed-off-by: Jouni Malinen <j@w1.fi>
2016-12-25 00:19:26 +02:00
Jouni Malinen 677c2283e7 tests: Update eap_proto_psk_errors and ap_wpa2_eap_psk_oom
The extension of aes_128_ctr_encrypt() to allow AES-192 and AES-256 to
be used in addition to AES-128 for CTR mode encryption resulted in the
backtrace for the function calls changing. Update the test cases that
started failing due to that change.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2016-10-10 20:27:31 +03:00
Janusz Dziedzic 5eee514de9 tests: Pass full apdev to add_ap() function (3)
Pass the full apdev to the add_ap() function instead of just ifname.
This allows us to handle also remote hosts while we can check
apdev['hostname'], apdev['port'].

This step (3) converts the cases that use the start_ap() helper
function.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
2016-04-03 22:46:00 +03:00
Janusz Dziedzic 8b8a1864ff tests: Pass full apdev to add_ap() function (1)
Pass the full apdev to the add_ap() function instead of just ifname.
This allows us to handle also remote hosts while we can check
apdev['hostname'], apdev['port'].

This step (1) converts the cases where apdev[#]['ifname'] was used as
the argument to hostapd.add_ap().

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
2016-04-03 22:45:57 +03:00
Jouni Malinen bccd22f356 tests: EAP-FAST protocol testing
Signed-off-by: Jouni Malinen <j@w1.fi>
2016-02-20 18:25:13 +02:00
Jouni Malinen b333f53f6e tests: Fix eap_proto_sake_errors with OpenSSL 1.1.0
The use of the newer OpenSSL API in openssl_hmac_vector() removes one of
the memory allocations, so the TEST_ALLOC_FAIL here could not trigger.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2016-02-16 15:28:16 +02:00
Jouni Malinen 7dbd2c6c69 tests: EAP Notification errors
Signed-off-by: Jouni Malinen <j@w1.fi>
2016-02-07 21:01:06 +02:00
Jouni Malinen b81e50cddb tests: EAP-Nak special cases
Signed-off-by: Jouni Malinen <j@w1.fi>
2016-02-07 20:43:48 +02:00
Jouni Malinen 3d85fd5a12 tests: EAP-Success/Failure prior to any EAP method
Signed-off-by: Jouni Malinen <j@w1.fi>
2016-02-07 20:27:13 +02:00
Jouni Malinen d4af4d275a tests: EAP-TLS protocol tests
Signed-off-by: Jouni Malinen <j@w1.fi>
2016-02-02 00:24:36 +02:00
Jouni Malinen fb3db14a6f tests: Fix EAP-SAKE error test case coverage
This was missing the second eap_sake_compute_mic() call in
eap_sake_process_confirm().

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2016-01-15 18:18:25 +02:00
Jouni Malinen 5b0ec907c1 tests: More EAP-MSCHAPv2 error coverage
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2016-01-15 17:42:13 +02:00
Jouni Malinen 1a6f86593b tests: Clean up eap_proto_ikev2
Use helper variable to indicate end of the test case instead of having
to use a fixed length of the loop.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2016-01-15 10:37:04 +02:00