aboutsummaryrefslogtreecommitdiff
path: root/tests/client
diff options
context:
space:
mode:
authorJakub Jelen <jjelen@redhat.com>2020-04-15 07:52:24 +0200
committerJakub Jelen <jjelen@redhat.com>2020-04-20 14:14:33 +0200
commitdb948bdac87ec9ad190cadbd9444902e5fbe691a (patch)
treef7add2f439020219c8a2ee89309fc8e1e6fd9d83 /tests/client
parent6941958b495435debf8a40a6adb1e6edcb0c4630 (diff)
downloadlibssh-db948bdac87ec9ad190cadbd9444902e5fbe691a.tar.gz
libssh-db948bdac87ec9ad190cadbd9444902e5fbe691a.tar.xz
libssh-db948bdac87ec9ad190cadbd9444902e5fbe691a.zip
tests: Enable RSA SHA1 certs for testing against older OpenSSH
The OpenSSH 7.4 or 7.6 in Ubuntu and CentOS 7 does not support SHA2 RSA certificates and libssh automatically falls back to SHA1, which is not allowed by default. Signed-off-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
Diffstat (limited to 'tests/client')
-rw-r--r--tests/client/torture_auth.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/client/torture_auth.c b/tests/client/torture_auth.c
index b89f4334..24ecc507 100644
--- a/tests/client/torture_auth.c
+++ b/tests/client/torture_auth.c
@@ -52,6 +52,7 @@ static int session_setup(void **state)
{
struct torture_state *s = *state;
int verbosity = torture_libssh_verbosity();
+ const char *all_keytypes = NULL;
struct passwd *pwd;
bool b = false;
int rc;
@@ -71,6 +72,11 @@ static int session_setup(void **state)
rc = ssh_options_set(s->ssh.session, SSH_OPTIONS_PROCESS_CONFIG, &b);
assert_ssh_return_code(s->ssh.session, rc);
+ /* Enable all hostkeys */
+ all_keytypes = ssh_kex_get_supported_method(SSH_HOSTKEYS);
+ rc = ssh_options_set(s->ssh.session, SSH_OPTIONS_PUBLICKEY_ACCEPTED_TYPES, all_keytypes);
+ assert_ssh_return_code(s->ssh.session, rc);
+
return 0;
}