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
[email protected]
https://lists.sfconservancy.org/mailman/listinfo/kallithea-general
_______________________________________________
kallithea-general mailing list
[email protected]
https://lists.sfconservancy.org/mailman/listinfo/kallithea-general