mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-07-31 00:03:07 +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:
committed by
Andreas Schneider
parent
574bfb5459
commit
31da8025b2
@ -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*/);
|
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 torture_run_tests(void) {
|
||||||
int rc;
|
int rc;
|
||||||
struct CMUnitTest tests[] = {
|
struct CMUnitTest tests[] = {
|
||||||
@ -544,6 +564,12 @@ int torture_run_tests(void) {
|
|||||||
cmocka_unit_test_setup_teardown(torture_algorithms_dh_group18,
|
cmocka_unit_test_setup_teardown(torture_algorithms_dh_group18,
|
||||||
session_setup,
|
session_setup,
|
||||||
session_teardown),
|
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)
|
#if ((OPENSSH_VERSION_MAJOR == 7 && OPENSSH_VERSION_MINOR >= 3) || OPENSSH_VERSION_MAJOR > 7)
|
||||||
cmocka_unit_test_setup_teardown(torture_algorithms_ecdh_curve25519_sha256,
|
cmocka_unit_test_setup_teardown(torture_algorithms_ecdh_curve25519_sha256,
|
||||||
session_setup,
|
session_setup,
|
||||||
|
@ -626,7 +626,8 @@ static void torture_setup_create_sshd_config(void **state, bool pam)
|
|||||||
# else /* OPENSSH_VERSION 7.0 - 7.5 */
|
# else /* OPENSSH_VERSION 7.0 - 7.5 */
|
||||||
"Ciphers +3des-cbc,aes128-cbc,aes192-cbc,aes256-cbc\n"
|
"Ciphers +3des-cbc,aes128-cbc,aes192-cbc,aes256-cbc\n"
|
||||||
# endif /* OPENSSH_VERSION 7.0 - 7.6 */
|
# 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 */
|
#else /* OPENSSH_VERSION >= 6.7 */
|
||||||
"Ciphers 3des-cbc,aes128-cbc,aes192-cbc,aes256-cbc,aes128-ctr,"
|
"Ciphers 3des-cbc,aes128-cbc,aes192-cbc,aes256-cbc,aes128-ctr,"
|
||||||
"aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,"
|
"aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,"
|
||||||
|
Reference in New Issue
Block a user