aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2018-02-04 17:11:33 +0100
committerAndreas Schneider <asn@cryptomilk.org>2018-06-04 11:20:28 +0200
commit250bf37a28ab3e320db1c9fc93971ddfc9a5e88c (patch)
treeabf9d4d2171ad948c44456f22b1e0e907bed41d5
parent952c64b4c095b93678518e4e5bead07fd1110275 (diff)
downloadlibssh-250bf37a28ab3e320db1c9fc93971ddfc9a5e88c.tar.gz
libssh-250bf37a28ab3e320db1c9fc93971ddfc9a5e88c.tar.xz
libssh-250bf37a28ab3e320db1c9fc93971ddfc9a5e88c.zip
tortrue: Add ed25519 hostkey to sshd
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
-rw-r--r--tests/torture.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/torture.c b/tests/torture.c
index 9cae36af..43d8a2d0 100644
--- a/tests/torture.c
+++ b/tests/torture.c
@@ -555,6 +555,7 @@ void torture_setup_socket_dir(void **state)
static void torture_setup_create_sshd_config(void **state)
{
struct torture_state *s = *state;
+ char ed25519_hostkey[1024] = {0};
#ifdef HAVE_DSA
char dsa_hostkey[1024];
#endif
@@ -577,6 +578,7 @@ static void torture_setup_create_sshd_config(void **state)
const char config_string[]=
"Port 22\n"
"ListenAddress 127.0.0.10\n"
+ "HostKey %s\n"
#ifdef HAVE_DSA
"HostKey %s\n"
#endif
@@ -640,6 +642,13 @@ static void torture_setup_create_sshd_config(void **state)
rc = mkdir(sshd_path, 0755);
assert_return_code(rc, errno);
+ snprintf(ed25519_hostkey,
+ sizeof(ed25519_hostkey),
+ "%s/sshd/ssh_host_ed25519_key",
+ s->socket_dir);
+ torture_write_file(ed25519_hostkey,
+ torture_get_testkey(SSH_KEYTYPE_ED25519, 0, 0));
+
#ifdef HAVE_DSA
snprintf(dsa_hostkey,
sizeof(dsa_hostkey),
@@ -661,6 +670,13 @@ static void torture_setup_create_sshd_config(void **state)
torture_write_file(ecdsa_hostkey,
torture_get_testkey(SSH_KEYTYPE_ECDSA, 521, 0));
+ snprintf(ed25519_hostkey,
+ sizeof(ed25519_hostkey),
+ "%s/sshd/ssh_host_ed25519_key",
+ s->socket_dir);
+ torture_write_file(ed25519_hostkey,
+ torture_get_testkey(SSH_KEYTYPE_ED25519, 0, 0));
+
snprintf(trusted_ca_pubkey,
sizeof(trusted_ca_pubkey),
"%s/sshd/user_ca.pub",
@@ -684,6 +700,7 @@ static void torture_setup_create_sshd_config(void **state)
#ifdef HAVE_DSA
snprintf(sshd_config, sizeof(sshd_config),
config_string,
+ ed25519_hostkey,
dsa_hostkey,
rsa_hostkey,
ecdsa_hostkey,
@@ -693,6 +710,7 @@ static void torture_setup_create_sshd_config(void **state)
#else
snprintf(sshd_config, sizeof(sshd_config),
config_string,
+ ed25519_hostkey,
rsa_hostkey,
ecdsa_hostkey,
trusted_ca_pubkey,