mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-07 06:40:54 +03:00
sshd: improve docs about supported ciphers, KEX and MACs
also added a check to ensure that the configured values are valid Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
@@ -373,6 +373,23 @@ func TestInitialization(t *testing.T) {
|
||||
sftpdConf.Bindings = nil
|
||||
err = sftpdConf.Initialize(configDir)
|
||||
assert.EqualError(t, err, common.ErrNoBinding.Error())
|
||||
sftpdConf = config.GetSFTPDConfig()
|
||||
sftpdConf.Ciphers = []string{"not a cipher"}
|
||||
err = sftpdConf.Initialize(configDir)
|
||||
if assert.Error(t, err) {
|
||||
assert.Contains(t, err.Error(), "unsupported cipher")
|
||||
}
|
||||
sftpdConf.Ciphers = nil
|
||||
sftpdConf.MACs = []string{"not a MAC"}
|
||||
err = sftpdConf.Initialize(configDir)
|
||||
if assert.Error(t, err) {
|
||||
assert.Contains(t, err.Error(), "unsupported MAC algorithm")
|
||||
}
|
||||
sftpdConf.KexAlgorithms = []string{"not a KEX"}
|
||||
err = sftpdConf.Initialize(configDir)
|
||||
if assert.Error(t, err) {
|
||||
assert.Contains(t, err.Error(), "unsupported key-exchange algorithm")
|
||||
}
|
||||
}
|
||||
|
||||
func TestBasicSFTPHandling(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user