From f3754dc072df7a264c7db28a02604024f3f289b3 Mon Sep 17 00:00:00 2001 From: Jakub Jelen Date: Mon, 23 Oct 2017 15:06:12 +0200 Subject: [PATCH] tests/config: Text KexAlgorithms parsing in ssh_config Signed-off-by: Jakub Jelen Reviewed-by: Andreas Schneider --- tests/unittests/torture_config.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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); } /**