Dear all,
first off, thank you very much for ssh support! During testing I noticed that
ed25519 ssh keys were rejected with "Incorrect SSH key - base64 part is not
ed25519 as claimed but ed25519".
The reason for this is in the condition in lib/ssh.py that hard codes the
string length of the key type -- 7 or '\x07' -- which fits ssh-rsa and ssh-dss
but not ssh-ed25519. Find a patch attached that fixes the issue.
Thank you very much for your work on kallithea!
best regards,
Adi Kriegisch--- a/lib/ssh.py 2019-12-01 00:29:25.274828795 +0100
+++ b/lib/ssh.py 2019-12-01 00:27:50.716309946 +0100
@@ -86,7 +86,7 @@
except binascii.Error:
raise SshKeyParseError(_("Incorrect SSH key - failed to decode base64 part %r") % keyvalue)
- if not decoded.startswith('\x00\x00\x00\x07' + str(keytype) + '\x00'):
+ if not decoded.startswith('\x00\x00\x00'+ '{:02x}'.format(len(keytype)).decode('hex') + str(keytype) + '\x00'):
raise SshKeyParseError(_("Incorrect SSH key - base64 part is not %r as claimed but %r") % (str(keytype), str(decoded[4:].split('\0', 1)[0])))
return keytype, decoded, comment
_______________________________________________
kallithea-general mailing list
[email protected]
https://lists.sfconservancy.org/mailman/listinfo/kallithea-general