mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-04 20:30:38 +09:00
tortrue: Add ed25519 hostkey to sshd
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
(cherry-picked from commit 250bf37a)
This commit is contained in:
@@ -732,6 +732,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};
|
||||
char dsa_hostkey[1024];
|
||||
char rsa_hostkey[1024];
|
||||
char ecdsa_hostkey[1024];
|
||||
@@ -754,6 +755,7 @@ static void torture_setup_create_sshd_config(void **state)
|
||||
"HostKey %s\n"
|
||||
"HostKey %s\n"
|
||||
"HostKey %s\n"
|
||||
"HostKey %s\n"
|
||||
"\n"
|
||||
"LogLevel DEBUG3\n"
|
||||
"Subsystem sftp %s -l DEBUG2\n"
|
||||
@@ -805,6 +807,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));
|
||||
|
||||
snprintf(dsa_hostkey,
|
||||
sizeof(dsa_hostkey),
|
||||
"%s/sshd/ssh_host_dsa_key",
|
||||
@@ -840,6 +849,7 @@ static void torture_setup_create_sshd_config(void **state)
|
||||
|
||||
snprintf(sshd_config, sizeof(sshd_config),
|
||||
config_string,
|
||||
ed25519_hostkey,
|
||||
dsa_hostkey,
|
||||
rsa_hostkey,
|
||||
ecdsa_hostkey,
|
||||
|
||||
Reference in New Issue
Block a user