mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-04 12:20:42 +09:00
tests: Support other openssh versions ...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
(cherry-picked from commit 6e7eae96)
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user