SSH with ed25519
Mads Kiilerich
mads at kiilerich.com
Sun Dec 1 03:18:57 UTC 2019
Thanks for reporting ... and for the patch.
But do you agree that
--- a/kallithea/lib/ssh.py
+++ b/kallithea/lib/ssh.py
@@ -86,7 +86,7 @@ def parse_pub_key(ssh_key):
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' + chr(len(keytype)) +
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
would be correct and a bit simpler?
/Mads
On 12/1/19 12:40 AM, Adi Kriegisch wrote:
> 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
>
> _______________________________________________
> kallithea-general mailing list
> kallithea-general at sfconservancy.org
> https://lists.sfconservancy.org/mailman/listinfo/kallithea-general
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sfconservancy.org/pipermail/kallithea-general/attachments/20191201/3c08e08a/attachment.html>
More information about the kallithea-general
mailing list