tests/config: Text KexAlgorithms parsing in ssh_config

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
Jakub Jelen
2017-10-23 15:06:12 +02:00
committed by Andreas Schneider
parent 78a3ab2eaa
commit f3754dc072

View File

@@ -4,6 +4,7 @@
#include "torture.h"
#include "libssh/options.h"
#include "libssh/session.h"
#define LIBSSH_TESTCONFIG1 "libssh_testconfig1.tmp"
#define LIBSSH_TESTCONFIG2 "libssh_testconfig2.tmp"
@@ -13,6 +14,7 @@
#define USERNAME "testuser"
#define PROXYCMD "ssh -q -W %h:%p gateway.example.com"
#define ID_FILE "/etc/xxx"
#define KEXALGORITHMS "ecdh-sha2-nistp521,diffie-hellman-group14-sha1"
static int setup_config_files(void **state)
{
@@ -29,7 +31,8 @@ static int setup_config_files(void **state)
"Include "LIBSSH_TESTCONFIG3"\n"
"ProxyCommand "PROXYCMD"\n\n");
torture_write_file(LIBSSH_TESTCONFIG3,
"\n\nIdentityFile "ID_FILE"\n");
"\n\nIdentityFile "ID_FILE"\n"
"\n\nKexAlgorithms "KEXALGORITHMS"\n");
/* Multiple Port settings -> parsing returns early. */
torture_write_file(LIBSSH_TESTCONFIG4,
@@ -85,6 +88,7 @@ static void torture_config_from_file(void **state) {
assert_string_equal(v, USERNAME);
ssh_string_free_char(v);
assert_string_equal(session->opts.wanted_methods[SSH_KEX], KEXALGORITHMS);
}
/**