diff options
author | spacetourist <guy.callum@gmail.com> | 2017-10-21 14:13:41 +0100 |
---|---|---|
committer | Lauris BH <lauris@nix.lv> | 2017-10-21 16:13:41 +0300 |
commit | 7131c7d40d4f5bd32b16031e884153548eee133f (patch) | |
tree | 99fa77ac1d785be873ddb0c955f6eeab828baaee /modules/ssh | |
parent | 985a39590ba07798dd6e6097e0c10401764c27fb (diff) | |
download | gitea-7131c7d40d4f5bd32b16031e884153548eee133f.tar.gz gitea-7131c7d40d4f5bd32b16031e884153548eee133f.zip |
Configurable SSH cipher suite (#913)
* Configurable SSH cipher suite
* Update configuration file comment
* Add default in settings loading code
* Fix fmt and log messsage
* Remove default from code as this could probably might not be good idea
Diffstat (limited to 'modules/ssh')
-rw-r--r-- | modules/ssh/ssh.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/modules/ssh/ssh.go b/modules/ssh/ssh.go index 36a383fa86..62edaf15bc 100644 --- a/modules/ssh/ssh.go +++ b/modules/ssh/ssh.go @@ -151,8 +151,11 @@ func listen(config *ssh.ServerConfig, host string, port int) { } // Listen starts a SSH server listens on given port. -func Listen(host string, port int) { +func Listen(host string, port int, ciphers []string) { config := &ssh.ServerConfig{ + Config: ssh.Config{ + Ciphers: ciphers, + }, PublicKeyCallback: func(conn ssh.ConnMetadata, key ssh.PublicKey) (*ssh.Permissions, error) { pkey, err := models.SearchPublicKeyByContent(strings.TrimSpace(string(ssh.MarshalAuthorizedKey(key)))) if err != nil { |