chevah / chevah-keycert

SSH Keys and SSL certificates handling
http://styleguide.chevah.com
MIT License
3 stars 0 forks source link

Fix loading keys with comments starting with a space. #52

Open dumol opened 3 years ago

dumol commented 3 years ago
$ echo 'password' > pass_file
$ puttygen -t ed25519 -C " comment" --new-passphrase pass_file -o putty_ed25519_private.key
$ ./build-keycert/bin/python keycert-demo.py ssh-load-key --file putty_ed25519_private.key  --type putty --password $(cat pass_file)
EXPECTED ERROR
Bad password or HMAC mismatch.

Interestingly, this generated an expected error…

adiroiban commented 3 years ago

For the record, there is also #51 ... for generating keys with non-ascii

They might be fixed together as might be generated by the same bug.

But for now we can have separate issues. Thanks!

dumol commented 3 years ago

Well, a blank space is an ASCII character… Interestingly, blank spaces work fine if they are placed somewhere else inside the comment. I've only seen this error when a blank space is at the beginning of a comment for a key to be loaded.

adiroiban commented 3 years ago

True. Thanks. This should be fixed

dumol commented 3 years ago

OK, thanks! But where? The use-cryptography-take2 branch currently exhibits this problem.

adiroiban commented 3 years ago

Ah... sorry. This should be fixed in the future :) So this ticket is valid. Thanks :) and sorry for the confusion.