diff options
author | Eduardo Bacchi Kienetz <eduardo@kienetz.com> | 2020-12-04 08:52:26 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-04 21:52:26 +0800 |
commit | c875950c438b1ccbb546fecb4905680a0cbd38a7 (patch) | |
tree | 2fc428574c9471d067f8da8f535cbd30623cd0ea /internal/ssh/ssh.go | |
parent | 71eeb2f0c04019c891648316a0aac29cff109bf0 (diff) |
ssh: allow setting allowed MAC algorithms for built-in server (#6435)
Co-authored-by: ᴜɴᴋɴᴡᴏɴ <u@gogs.io>
Diffstat (limited to 'internal/ssh/ssh.go')
-rw-r--r-- | internal/ssh/ssh.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/internal/ssh/ssh.go b/internal/ssh/ssh.go index ff9fb8cc..a3df9909 100644 --- a/internal/ssh/ssh.go +++ b/internal/ssh/ssh.go @@ -162,10 +162,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, ciphers []string) { +func Listen(host string, port int, ciphers, macs []string) { config := &ssh.ServerConfig{ Config: ssh.Config{ Ciphers: ciphers, + MACs: macs, }, PublicKeyCallback: func(conn ssh.ConnMetadata, key ssh.PublicKey) (*ssh.Permissions, error) { pkey, err := db.SearchPublicKeyByContent(strings.TrimSpace(string(ssh.MarshalAuthorizedKey(key)))) |