summaryrefslogtreecommitdiffstats
path: root/modules/setting
diff options
context:
space:
mode:
authormrsdizzie <info@mrsdizzie.com>2019-12-22 17:46:35 -0500
committerAntoine GIRARD <sapk@users.noreply.github.com>2019-12-22 23:46:35 +0100
commit2f9564f993ba02ba503d7088eb8cc70536b7a6df (patch)
tree9450b0b327cc2c0bcf745bf422652f49081f4989 /modules/setting
parent1df701fd1abbcee93dfcd3cdb114a0f35cb6be45 (diff)
downloadgitea-2f9564f993ba02ba503d7088eb8cc70536b7a6df.tar.gz
gitea-2f9564f993ba02ba503d7088eb8cc70536b7a6df.zip
Set default ssh.minimum_key_sizes (#9466)
The minimum key size defaults weren't set as suggested in app.ini.sample so if you enabled MINIMUM_KEY_SIZE_CHECK it would always fail since there would be no matching values to check against. This pr adds the default values that should have been there. Should fix #9465
Diffstat (limited to 'modules/setting')
-rw-r--r--modules/setting/setting.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/setting/setting.go b/modules/setting/setting.go
index 4354d8cdb8..dbf43f31ee 100644
--- a/modules/setting/setting.go
+++ b/modules/setting/setting.go
@@ -130,6 +130,7 @@ var (
ServerKeyExchanges: []string{"diffie-hellman-group1-sha1", "diffie-hellman-group14-sha1", "ecdh-sha2-nistp256", "ecdh-sha2-nistp384", "ecdh-sha2-nistp521", "curve25519-sha256@libssh.org"},
ServerMACs: []string{"hmac-sha2-256-etm@openssh.com", "hmac-sha2-256", "hmac-sha1", "hmac-sha1-96"},
KeygenPath: "ssh-keygen",
+ MinimumKeySizes: map[string]int{"ed25519": 256, "ecdsa": 256, "rsa": 2048, "dsa": 1024},
}
LFS struct {
@@ -690,7 +691,6 @@ func NewContext() {
}
SSH.MinimumKeySizeCheck = sec.Key("MINIMUM_KEY_SIZE_CHECK").MustBool()
- SSH.MinimumKeySizes = map[string]int{}
minimumKeySizes := Cfg.Section("ssh.minimum_key_sizes").Keys()
for _, key := range minimumKeySizes {
if key.MustInt() != -1 {