Skip to content

Commit 2f9564f

Browse files
mrsdizziesapk
authored andcommitted
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
1 parent 1df701f commit 2f9564f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

modules/setting/setting.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ var (
130130
ServerKeyExchanges: []string{"diffie-hellman-group1-sha1", "diffie-hellman-group14-sha1", "ecdh-sha2-nistp256", "ecdh-sha2-nistp384", "ecdh-sha2-nistp521", "[email protected]"},
131131
ServerMACs: []string{"[email protected]", "hmac-sha2-256", "hmac-sha1", "hmac-sha1-96"},
132132
KeygenPath: "ssh-keygen",
133+
MinimumKeySizes: map[string]int{"ed25519": 256, "ecdsa": 256, "rsa": 2048, "dsa": 1024},
133134
}
134135

135136
LFS struct {
@@ -690,7 +691,6 @@ func NewContext() {
690691
}
691692

692693
SSH.MinimumKeySizeCheck = sec.Key("MINIMUM_KEY_SIZE_CHECK").MustBool()
693-
SSH.MinimumKeySizes = map[string]int{}
694694
minimumKeySizes := Cfg.Section("ssh.minimum_key_sizes").Keys()
695695
for _, key := range minimumKeySizes {
696696
if key.MustInt() != -1 {

0 commit comments

Comments
 (0)