Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ssh-key: support for reading PPK format private keys #324

Open
wants to merge 14 commits into
base: master
Choose a base branch
from

Conversation

Eugeny
Copy link
Contributor

@Eugeny Eugeny commented Dec 29, 2024

This PR implements full support for PuTTY's version 2 and 3 key formats, including encryption and all supported key types.

Format documentation: https://tartarus.org/~simon/putty-snapshots/htmldoc/AppendixC.html#ppk

New code and deps are gated behind the ppk feature:

  • argon2 - decryption KDF
  • hmac - key MAC
  • hex - for parsing the embedded MAC

Keys are decrypted immediately on parse, as PPK can't be cleanly integrated into the KeyData::Encrypted architecture because the existing decryption code just assumes OpenSSH format. PPK's private key part does not include the key elements present in the public key and has both different order and format of the fields (except for DSA)

New code is mostly confined in a separate ppk.rs mod

Tests included

@Eugeny Eugeny changed the title Support for PPK key format ssh-key: support for reading PPK format private keys Dec 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant