summaryrefslogtreecommitdiffstats
path: root/models/ssh_key.go
diff options
context:
space:
mode:
authorArtemis Tosini <me@artem.ist>2021-01-20 20:36:55 +0000
committerGitHub <noreply@github.com>2021-01-20 20:36:55 +0000
commitcb08248c33a9e0f57c1480d0289b632da5d77668 (patch)
tree228f1786549b7365bd9ea2bff6a1b4bf3491a194 /models/ssh_key.go
parentef85bf84ee42678c1dcb3d6ea69565737c2f6eed (diff)
downloadgitea-cb08248c33a9e0f57c1480d0289b632da5d77668.tar.gz
gitea-cb08248c33a9e0f57c1480d0289b632da5d77668.zip
Add support for ed25519_sk and ecdsa_sk SSH keys (#13462)
* Add support for ed25519_sk and ecdsa_sk SSH keys These start with sk-ssh-ed25519@openssh.com and sk-ecdsa-sha2-nistp256@openssh.com. They are supported in recent versions of go x/crypto/ssh and OpenSSH 8.2 or higher. * skip ssh-keygen Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: Andrew Thornton <art27@cantab.net>
Diffstat (limited to 'models/ssh_key.go')
-rw-r--r--models/ssh_key.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/models/ssh_key.go b/models/ssh_key.go
index 70512dccf5..bb75b656c4 100644
--- a/models/ssh_key.go
+++ b/models/ssh_key.go
@@ -310,6 +310,10 @@ func SSHNativeParsePublicKey(keyLine string) (string, int, error) {
return "ecdsa", 521, nil
case ssh.KeyAlgoED25519:
return "ed25519", 256, nil
+ case ssh.KeyAlgoSKECDSA256:
+ return "ecdsa-sk", 256, nil
+ case ssh.KeyAlgoSKED25519:
+ return "ed25519-sk", 256, nil
}
return "", 0, fmt.Errorf("unsupported key length detection for type: %s", pkey.Type())
}