diff options
-rw-r--r-- | tests/CMakeLists.txt | 8 | ||||
-rw-r--r-- | tests/client/torture_session.c | 7 | ||||
-rw-r--r-- | tests/torture.c | 17 |
3 files changed, 29 insertions, 3 deletions
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 04838f03..c0405f9c 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -59,6 +59,14 @@ if (WITH_CLIENT_TESTING) message(SEND_ERROR "Could not find sshd which is required for client testing") endif() + find_program(SSH_EXECUTABLE NAMES ssh) + if (SSH_EXECUTABLE) + execute_process(COMMAND ${SSH_EXECUTABLE} -V ERROR_VARIABLE OPENSSH_VERSION_STR) + string(REGEX REPLACE "^OpenSSH_([0-9]).[0-9].*$" "\\1" OPENSSH_VERSION_MAJOR "${OPENSSH_VERSION_STR}") + string(REGEX REPLACE "^OpenSSH_[0-9].([0-9]).*$" "\\1" OPENSSH_VERSION_MINOR "${OPENSSH_VERSION_STR}") + add_definitions(-DOPENSSH_VERSION_MAJOR=${OPENSSH_VERSION_MAJOR} -DOPENSSH_VERSION_MINOR=${OPENSSH_VERSION_MINOR}) + endif() + # homedir will be used in passwd set(HOMEDIR ${CMAKE_CURRENT_BINARY_DIR}/home) diff --git a/tests/client/torture_session.c b/tests/client/torture_session.c index 94296a3f..bdc11af2 100644 --- a/tests/client/torture_session.c +++ b/tests/client/torture_session.c @@ -92,7 +92,12 @@ static void torture_channel_read_error(void **state) { if (rc == SSH_ERROR) break; } - assert_true(rc == SSH_ERROR); +#if OPENSSH_VERSION_MAJOR == 6 && OPENSSH_VERSION_MINOR >= 7 + /* With openssh 6.7 this doesn't produce and error anymore */ + assert_int_equal(rc, SSH_OK); +#else + assert_int_equal(rc, SSH_ERROR); +#endif ssh_channel_free(channel); } diff --git a/tests/torture.c b/tests/torture.c index 738cacc9..30f9ab36 100644 --- a/tests/torture.c +++ b/tests/torture.c @@ -802,9 +802,22 @@ static void torture_setup_create_sshd_config(void **state) "UsePrivilegeSeparation no\n" "StrictModes no\n" "\n" - "Ciphers +3des-cbc,aes128-cbc,aes192-cbc,aes256-cbc,blowfish-cbc\n" - "KexAlgorithms +diffie-hellman-group1-sha1\n" +#if OPENSSH_VERSION_MAJOR == 6 && OPENSSH_VERSION_MINOR >= 7 "HostKeyAlgorithms +ssh-dss\n" + "Ciphers +3des-cbc,aes128-cbc,aes192-cbc,aes256-cbc,blowfish-cbc\n" + "KexAlgorithms +diffie-hellman-group1-sha1" +#else + "Ciphers 3des-cbc,aes128-cbc,aes192-cbc,aes256-cbc,aes128-ctr," + "aes192-ctr,aes256-ctr,aes128-gcm@openssh.com," + "aes256-gcm@openssh.com,arcfour128,arcfour256,arcfour," + "blowfish-cbc,cast128-cbc,chacha20-poly1305@openssh.com\n" + "KexAlgorithms curve25519-sha256@libssh.org,ecdh-sha2-nistp256," + "ecdh-sha2-nistp384,ecdh-sha2-nistp521," + "diffie-hellman-group-exchange-sha256," + "diffie-hellman-group-exchange-sha1," + "diffie-hellman-group14-sha1," + "diffie-hellman-group1-sha1\n" +#endif "\n" "AcceptEnv LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES\n" "AcceptEnv LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT\n" |