-
Notifications
You must be signed in to change notification settings - Fork 148
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
fromBase64 won't deal with \r\n correctly #362
Comments
Hi @deskangel, We fixed handling of private key files that contain Thanks, |
Hi @deskangel, Disregard, I better understand now the issue you are having. Thanks, |
Hi @deskangel, Can you test with the JSch jar produced by Github CI from my #363 located here and confirm if it fixes the issue you are seeing with PEM type SSH private key files that contain Thanks, |
Hi @norrisjeremy Thank you so much for taking the time to address the issue and for your hard work on it. |
Hi @deskangel, Great, thanks for confirming! Thanks, |
…ndings due to regression from previous fix for mwiede#362.
As shown in the above figure (where
_len
is 1588 andi - start
is 1589), if the length of a base64-encoded key is not a multiple of 4 (does not end with the '=' symbol),fromBase64
cannot determine the correct length of the buffer (as a '\r' character is counted), resulting in an exception being thrown byfromBase64
.Removing these characters from the fromBase64 method may be a safer approach.
sample key:
The text was updated successfully, but these errors were encountered: