From ee1d1a710b8cc2d00fa711014028cb2250a5eab0 Mon Sep 17 00:00:00 2001 From: zeripath Date: Thu, 28 May 2020 14:29:15 +0100 Subject: [PATCH] Use -1 to disable key algorithm type in ssh.minimum_key_sizes (#11635) Fix #11634 Signed-off-by: Andrew Thornton --- modules/setting/setting.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/setting/setting.go b/modules/setting/setting.go index b8ec957535059..f4ec19387b531 100644 --- a/modules/setting/setting.go +++ b/modules/setting/setting.go @@ -730,6 +730,8 @@ func NewContext() { for _, key := range minimumKeySizes { if key.MustInt() != -1 { SSH.MinimumKeySizes[strings.ToLower(key.Name())] = key.MustInt() + } else { + delete(SSH.MinimumKeySizes, strings.ToLower(key.Name())) } } SSH.AuthorizedKeysBackup = sec.Key("SSH_AUTHORIZED_KEYS_BACKUP").MustBool(true)