diff options
author | Cum Gun <cumgun@users.noreply.github.com> | 2017-11-02 16:26:41 +0100 |
---|---|---|
committer | Lunny Xiao <xiaolunwen@gmail.com> | 2017-11-02 23:26:41 +0800 |
commit | eecaba20310483f64e0e4500fa3ac85e23ced18e (patch) | |
tree | 42a1525202072337feda5795596d27db9f89690d /modules/ssh | |
parent | d94e2a1c22ae18e8439aa4ebd49884c70095619b (diff) | |
download | gitea-eecaba20310483f64e0e4500fa3ac85e23ced18e.tar.gz gitea-eecaba20310483f64e0e4500fa3ac85e23ced18e.zip |
Configurable SSH key exchange algorithm and MAC suite (#2806)
Diffstat (limited to 'modules/ssh')
-rw-r--r-- | modules/ssh/ssh.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/modules/ssh/ssh.go b/modules/ssh/ssh.go index 62edaf15bc..aea46daad4 100644 --- a/modules/ssh/ssh.go +++ b/modules/ssh/ssh.go @@ -151,10 +151,12 @@ func listen(config *ssh.ServerConfig, host string, port int) { } // Listen starts a SSH server listens on given port. -func Listen(host string, port int, ciphers []string) { +func Listen(host string, port int, ciphers []string, keyExchanges []string, macs []string) { config := &ssh.ServerConfig{ Config: ssh.Config{ - Ciphers: ciphers, + Ciphers: ciphers, + KeyExchanges: keyExchanges, + MACs: macs, }, PublicKeyCallback: func(conn ssh.ConnMetadata, key ssh.PublicKey) (*ssh.Permissions, error) { pkey, err := models.SearchPublicKeyByContent(strings.TrimSpace(string(ssh.MarshalAuthorizedKey(key)))) |