diff options
author | Tilo Eckert <tilo.eckert@flam.de> | 2018-06-25 13:07:30 +0200 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2018-06-29 15:57:45 +0200 |
commit | a4a6017e6ef6fdf73db0b3163d8064f34a273f3a (patch) | |
tree | 8cbdf6a46cfddefe9238e108e28285b529e3fc19 /tests/client/torture_algorithms.c | |
parent | e60cb2ee10d052c32fc6f2169fb5a34100374c0d (diff) | |
download | libssh-a4a6017e6ef6fdf73db0b3163d8064f34a273f3a.tar.gz libssh-a4a6017e6ef6fdf73db0b3163d8064f34a273f3a.tar.xz libssh-a4a6017e6ef6fdf73db0b3163d8064f34a273f3a.zip |
tests: add algorithm tests for kex curve25519
Signed-off-by: Tilo Eckert <tilo.eckert@flam.de>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Diffstat (limited to 'tests/client/torture_algorithms.c')
-rw-r--r-- | tests/client/torture_algorithms.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/client/torture_algorithms.c b/tests/client/torture_algorithms.c index 56061388..44cfd8ec 100644 --- a/tests/client/torture_algorithms.c +++ b/tests/client/torture_algorithms.c @@ -385,6 +385,22 @@ static void torture_algorithms_ecdh_sha2_nistp521(void **state) { } #endif +#if ((OPENSSH_VERSION_MAJOR == 7 && OPENSSH_VERSION_MINOR >= 3) || OPENSSH_VERSION_MAJOR > 7) +static void torture_algorithms_ecdh_curve25519_sha256(void **state) { + struct torture_state *s = *state; + + test_algorithm(s->ssh.session, "curve25519-sha256", NULL/*cipher*/, NULL/*hmac*/); +} +#endif + +#if ((OPENSSH_VERSION_MAJOR == 6 && OPENSSH_VERSION_MINOR >= 5) || OPENSSH_VERSION_MAJOR > 6) +static void torture_algorithms_ecdh_curve25519_sha256_libssh_org(void **state) { + struct torture_state *s = *state; + + test_algorithm(s->ssh.session, "curve25519-sha256@libssh.org", NULL/*cipher*/, NULL/*hmac*/); +} +#endif + static void torture_algorithms_dh_group1(void **state) { struct torture_state *s = *state; @@ -480,6 +496,16 @@ int torture_run_tests(void) { cmocka_unit_test_setup_teardown(torture_algorithms_dh_group1, session_setup, session_teardown), +#if ((OPENSSH_VERSION_MAJOR == 7 && OPENSSH_VERSION_MINOR >= 3) || OPENSSH_VERSION_MAJOR > 7) + cmocka_unit_test_setup_teardown(torture_algorithms_ecdh_curve25519_sha256, + session_setup, + session_teardown), +#endif +#if ((OPENSSH_VERSION_MAJOR == 6 && OPENSSH_VERSION_MINOR >= 5) || OPENSSH_VERSION_MAJOR > 6) + cmocka_unit_test_setup_teardown(torture_algorithms_ecdh_curve25519_sha256_libssh_org, + session_setup, + session_teardown), +#endif #if defined(HAVE_ECC) cmocka_unit_test_setup_teardown(torture_algorithms_ecdh_sha2_nistp256, session_setup, |