From 8e002b94153a93c0bcb670acced888cc2d521394 Mon Sep 17 00:00:00 2001 From: Aris Adamantiadis Date: Sun, 28 Oct 2018 01:06:09 +0200 Subject: [PATCH] tests: Add tests for dh-group14, group16 and group18 Signed-off-by: Aris Adamantiadis Reviewed-by: Jakub Jelen Reviewed-by: Andreas Schneider --- tests/client/torture_algorithms.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/tests/client/torture_algorithms.c b/tests/client/torture_algorithms.c index 9bb67410..4f588e27 100644 --- a/tests/client/torture_algorithms.c +++ b/tests/client/torture_algorithms.c @@ -421,6 +421,24 @@ static void torture_algorithms_dh_group1(void **state) { test_algorithm(s->ssh.session, "diffie-hellman-group1-sha1", NULL/*cipher*/, NULL/*hmac*/); } +static void torture_algorithms_dh_group14(void **state) { + struct torture_state *s = *state; + + test_algorithm(s->ssh.session, "diffie-hellman-group14-sha1", NULL/*cipher*/, NULL/*hmac*/); +} + +static void torture_algorithms_dh_group16(void **state) { + struct torture_state *s = *state; + + test_algorithm(s->ssh.session, "diffie-hellman-group16-sha512", NULL/*cipher*/, NULL/*hmac*/); +} + +static void torture_algorithms_dh_group18(void **state) { + struct torture_state *s = *state; + + test_algorithm(s->ssh.session, "diffie-hellman-group18-sha512", NULL/*cipher*/, NULL/*hmac*/); +} + int torture_run_tests(void) { int rc; struct CMUnitTest tests[] = { @@ -516,6 +534,15 @@ int torture_run_tests(void) { cmocka_unit_test_setup_teardown(torture_algorithms_dh_group1, session_setup, session_teardown), + cmocka_unit_test_setup_teardown(torture_algorithms_dh_group14, + session_setup, + session_teardown), + cmocka_unit_test_setup_teardown(torture_algorithms_dh_group16, + session_setup, + session_teardown), + cmocka_unit_test_setup_teardown(torture_algorithms_dh_group18, + 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,