-
Notifications
You must be signed in to change notification settings - Fork 715
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
Support AES-encrypted DER-encoded private keys #577
Comments
Please post an example key. Note that by definition of DER, there can't be any extra zero padding bytes, because every value is uniquely encoded using the shortest possible encoding. |
So, thanks for mentioning that.
Also, I'm renaming the issue. Feel free to close if inappropriate, and sorry for the noise. |
Alright, thrussh-keys now does this fine using #582. |
The thrussh-keys crate tries to parse as many different key formats as possible.
The encoding of older key formats (inherited from SSLeay) is AES-encrypted, and the plaintext is sometimes padded with zeros.
This causes the
read_all
method in yourder::nested
function to fail. I am doing the following, which seems to work in many cases: parse the ASN.1 encoding of the key manually to find out its length, truncate the buffer, and parse.The text was updated successfully, but these errors were encountered: