diff options
author | Aris Adamantiadis <aris@0xbadc0de.be> | 2018-11-06 16:39:08 +0100 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2019-01-24 11:56:23 +0100 |
commit | 31da8025b2a138be823194866581741c568f44fe (patch) | |
tree | 8c8382264df32986f219c45f8350468443519fdb | |
parent | 574bfb54595870033af2927c692af5f0afd3073c (diff) | |
download | libssh-31da8025b2a138be823194866581741c568f44fe.tar.gz libssh-31da8025b2a138be823194866581741c568f44fe.tar.xz libssh-31da8025b2a138be823194866581741c568f44fe.zip |
tests: Add dh-group-exchange algorithm tests
Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
-rw-r--r-- | tests/client/torture_algorithms.c | 26 | ||||
-rw-r--r-- | tests/torture.c | 3 |
2 files changed, 28 insertions, 1 deletions
diff --git a/tests/client/torture_algorithms.c b/tests/client/torture_algorithms.c index d327d046..097e3c3c 100644 --- a/tests/client/torture_algorithms.c +++ b/tests/client/torture_algorithms.c @@ -438,6 +438,26 @@ static void torture_algorithms_dh_group18(void **state) { test_algorithm(s->ssh.session, "diffie-hellman-group18-sha512", NULL/*cipher*/, NULL/*hmac*/); } +static void torture_algorithms_dh_gex_sha1(void **state) +{ + struct torture_state *s = *state; + + test_algorithm(s->ssh.session, + "diffie-hellman-group-exchange-sha1", + NULL, /* cipher */ + NULL); /* hmac */ +} + +static void torture_algorithms_dh_gex_sha256(void **state) +{ + struct torture_state *s = *state; + + test_algorithm(s->ssh.session, + "diffie-hellman-group-exchange-sha256", + NULL, /* cipher */ + NULL); /* hmac */ +} + int torture_run_tests(void) { int rc; struct CMUnitTest tests[] = { @@ -544,6 +564,12 @@ int torture_run_tests(void) { cmocka_unit_test_setup_teardown(torture_algorithms_dh_group18, session_setup, session_teardown), + cmocka_unit_test_setup_teardown(torture_algorithms_dh_gex_sha1, + session_setup, + session_teardown), + cmocka_unit_test_setup_teardown(torture_algorithms_dh_gex_sha256, + 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, diff --git a/tests/torture.c b/tests/torture.c index fb6eb05f..73ef8faf 100644 --- a/tests/torture.c +++ b/tests/torture.c @@ -626,7 +626,8 @@ static void torture_setup_create_sshd_config(void **state, bool pam) # else /* OPENSSH_VERSION 7.0 - 7.5 */ "Ciphers +3des-cbc,aes128-cbc,aes192-cbc,aes256-cbc\n" # endif /* OPENSSH_VERSION 7.0 - 7.6 */ - "KexAlgorithms +diffie-hellman-group1-sha1" + "KexAlgorithms +diffie-hellman-group1-sha1," + "diffie-hellman-group-exchange-sha1" #else /* OPENSSH_VERSION >= 6.7 */ "Ciphers 3des-cbc,aes128-cbc,aes192-cbc,aes256-cbc,aes128-ctr," "aes192-ctr,aes256-ctr,aes128-gcm@openssh.com," |