1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-07-29 13:01:13 +03:00

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>
This commit is contained in:
Aris Adamantiadis
2018-11-06 16:39:08 +01:00
committed by Andreas Schneider
parent 574bfb5459
commit 31da8025b2
2 changed files with 28 additions and 1 deletions

View File

@ -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,