From db948bdac87ec9ad190cadbd9444902e5fbe691a Mon Sep 17 00:00:00 2001 From: Jakub Jelen Date: Wed, 15 Apr 2020 07:52:24 +0200 Subject: 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 Reviewed-by: Anderson Toshiyuki Sasaki --- tests/client/torture_auth.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tests') 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; } -- cgit v1.2.3