From 0c40b0badd9ebae4c4604616664935a672b586b3 Mon Sep 17 00:00:00 2001 From: zeripath Date: Fri, 29 May 2020 00:05:16 +0100 Subject: [PATCH] Use -1 to disable key algorithm type in ssh.minimum_key_sizes (#11635) (#11662) Backport #11635 Fix #11634 Signed-off-by: Andrew Thornton Co-authored-by: techknowlogick --- modules/setting/setting.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/setting/setting.go b/modules/setting/setting.go index b8ec95753..f4ec19387 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)