mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-11 02:38:09 +09:00
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:
committed by
Andreas Schneider
parent
78a3ab2eaa
commit
f3754dc072
@@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
#include "torture.h"
|
#include "torture.h"
|
||||||
#include "libssh/options.h"
|
#include "libssh/options.h"
|
||||||
|
#include "libssh/session.h"
|
||||||
|
|
||||||
#define LIBSSH_TESTCONFIG1 "libssh_testconfig1.tmp"
|
#define LIBSSH_TESTCONFIG1 "libssh_testconfig1.tmp"
|
||||||
#define LIBSSH_TESTCONFIG2 "libssh_testconfig2.tmp"
|
#define LIBSSH_TESTCONFIG2 "libssh_testconfig2.tmp"
|
||||||
@@ -13,6 +14,7 @@
|
|||||||
#define USERNAME "testuser"
|
#define USERNAME "testuser"
|
||||||
#define PROXYCMD "ssh -q -W %h:%p gateway.example.com"
|
#define PROXYCMD "ssh -q -W %h:%p gateway.example.com"
|
||||||
#define ID_FILE "/etc/xxx"
|
#define ID_FILE "/etc/xxx"
|
||||||
|
#define KEXALGORITHMS "ecdh-sha2-nistp521,diffie-hellman-group14-sha1"
|
||||||
|
|
||||||
static int setup_config_files(void **state)
|
static int setup_config_files(void **state)
|
||||||
{
|
{
|
||||||
@@ -29,7 +31,8 @@ static int setup_config_files(void **state)
|
|||||||
"Include "LIBSSH_TESTCONFIG3"\n"
|
"Include "LIBSSH_TESTCONFIG3"\n"
|
||||||
"ProxyCommand "PROXYCMD"\n\n");
|
"ProxyCommand "PROXYCMD"\n\n");
|
||||||
torture_write_file(LIBSSH_TESTCONFIG3,
|
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. */
|
/* Multiple Port settings -> parsing returns early. */
|
||||||
torture_write_file(LIBSSH_TESTCONFIG4,
|
torture_write_file(LIBSSH_TESTCONFIG4,
|
||||||
@@ -85,6 +88,7 @@ static void torture_config_from_file(void **state) {
|
|||||||
assert_string_equal(v, USERNAME);
|
assert_string_equal(v, USERNAME);
|
||||||
ssh_string_free_char(v);
|
ssh_string_free_char(v);
|
||||||
|
|
||||||
|
assert_string_equal(session->opts.wanted_methods[SSH_KEX], KEXALGORITHMS);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user