SSH with ed25519

Thomas De Schampheleire patrickdepinguin at gmail.com
Sat Dec 7 20:18:38 UTC 2019


Hi Adi,

El dom., 1 dic. 2019 a las 4:19, Mads Kiilerich (<mads at kiilerich.com>) escribió:
>
> 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?

I pushed this fix along with a doctest to the stable branch of Kallithea.

https://kallithea-scm.org/repos/kallithea/changeset/690e7a0355211c99ad58e4485eb781c495068ba1
https://kallithea-scm.org/repos/kallithea/changeset/e7be0cbb78505fb3a4ab023b92c8a4618a9d4a5a

There are some other fixes in the pipeline, when ready this will be
released as 0.5.1.

Thanks for your contribution!

Best regards,
Thomas


More information about the kallithea-general mailing list