aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Jelen <jjelen@redhat.com>2017-10-23 15:06:12 +0200
committerAndreas Schneider <asn@cryptomilk.org>2017-12-15 12:00:49 +0100
commitf3754dc072df7a264c7db28a02604024f3f289b3 (patch)
tree215ac97be3fc263d1579bf259da58c3d2c548727
parent78a3ab2eaa05a5614f9321bfc54ab4a7211ea315 (diff)
downloadlibssh-f3754dc072df7a264c7db28a02604024f3f289b3.tar.gz
libssh-f3754dc072df7a264c7db28a02604024f3f289b3.tar.xz
libssh-f3754dc072df7a264c7db28a02604024f3f289b3.zip
tests/config: Text KexAlgorithms parsing in ssh_config
Signed-off-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
-rw-r--r--tests/unittests/torture_config.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/unittests/torture_config.c b/tests/unittests/torture_config.c
index 0b17a7ab..ec0dde53 100644
--- a/tests/unittests/torture_config.c
+++ b/tests/unittests/torture_config.c
@@ -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);
}
/**