]> source.dussan.org Git - gitea.git/commitdiff
Allow ssh-keygen on Windows to detect ssh key type (#14413)
authorChester Liu <skyline75489@outlook.com>
Thu, 21 Jan 2021 20:10:36 +0000 (04:10 +0800)
committerGitHub <noreply@github.com>
Thu, 21 Jan 2021 20:10:36 +0000 (21:10 +0100)
models/ssh_key.go

index bb75b656c4771ae14b28da752039c1520c4f8d71..c4a6df89a187f2e555e7a253aba181d07eca954c 100644 (file)
@@ -223,11 +223,6 @@ func writeTmpKeyFile(content string) (string, error) {
 
 // SSHKeyGenParsePublicKey extracts key type and length using ssh-keygen.
 func SSHKeyGenParsePublicKey(key string) (string, int, error) {
-       // The ssh-keygen in Windows does not print key type, so no need go further.
-       if setting.IsWindows {
-               return "", 0, nil
-       }
-
        tmpName, err := writeTmpKeyFile(key)
        if err != nil {
                return "", 0, fmt.Errorf("writeTmpKeyFile: %v", err)