Update SSHKey to generate fingerprint like ssh-keygen #52
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi @bensie, SHA256 fingerprint of an SSH public key generated by SSHKey differs from the fingerprint generated by
ssh-keygen
by 1 character. This is due to the truncating of padding character (=
) from the end byssh-keygen
. This PR allows SSHKey to generate a SHA256 fingerprint that matches the one generated byssh-keygen
.Goal
Match the SHA256 fingerprint of SSH public key generated by SSHKey with the fingerprint generated by
ssh-keygen
tool.Changes in this PR
Truncate the padding character at the end just like
ssh-keygen
.How to reproduce the difference
Truncation in ssh-keygen
/~https://github.com/openssh/openssh-portable/blob/922e54bbfe8c8479453693ef52350338f0c19124/sshkey.c#L1045-L1046
Testing