sftpd: deprecate keys and add a new host_keys config param

host_key defines the private host keys as plain list of strings.

Remove the other deprecated config params from the default config too.

Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
Nicola Murino
2020-05-16 23:26:44 +02:00
parent 469d36d979
commit a08dd85efd
7 changed files with 70 additions and 37 deletions

View File

@@ -293,11 +293,7 @@ func TestInitialization(t *testing.T) {
sftpdConf.ProxyAllowed = []string{"1270.0.0.1"}
err = sftpdConf.Initialize(configDir)
assert.Error(t, err)
sftpdConf.Keys = []sftpd.Key{
{
PrivateKey: "missing file",
},
}
sftpdConf.HostKeys = []string{"missing file"}
err = sftpdConf.Initialize(configDir)
assert.Error(t, err)
sftpdConf.Keys = nil