mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-21 10:32:51 +02:00
Configurable SSH key exchange algorithm and MAC suite (#2806)
This commit is contained in:
1 parent
d94e2a1c22
commit
eecaba2031
4 files changed
+24
-4
No files matched your search
+4
-2
@@ -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))))
|
||||
|
||||
Reference in new issue
Block a user