]> source.dussan.org Git - gitea.git/commitdiff
add default ssh ciphers (#2761)
authorLunny Xiao <xiaolunwen@gmail.com>
Mon, 23 Oct 2017 15:20:44 +0000 (23:20 +0800)
committerGitHub <noreply@github.com>
Mon, 23 Oct 2017 15:20:44 +0000 (23:20 +0800)
modules/setting/setting.go

index 0be95daadd11af81b0f69d09b89e8f6c8c11c521..c991a1760c56d92559d20b3d9c854b9318d9d9d8 100644 (file)
@@ -108,6 +108,7 @@ var (
                StartBuiltinServer: false,
                Domain:             "",
                Port:               22,
+               ServerCiphers:      []string{"aes128-ctr", "aes192-ctr", "aes256-ctr", "aes128-gcm@openssh.com", "arcfour256", "arcfour128"},
                KeygenPath:         "ssh-keygen",
        }
 
@@ -709,7 +710,10 @@ func NewContext() {
                SSH.Domain = Domain
        }
        SSH.RootPath = path.Join(homeDir, ".ssh")
-       SSH.ServerCiphers = sec.Key("SSH_SERVER_CIPHERS").Strings(",")
+       serverCiphers := sec.Key("SSH_SERVER_CIPHERS").Strings(",")
+       if len(serverCiphers) > 0 {
+               SSH.ServerCiphers = serverCiphers
+       }
        SSH.KeyTestPath = os.TempDir()
        if err = Cfg.Section("server").MapTo(&SSH); err != nil {
                log.Fatal(4, "Failed to map SSH settings: %v", err)