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

Unexpected format of host fingerprint: 1-character components in MD5-fingerprint #603

Open
RogerTinembart opened this issue Jan 28, 2025 · 0 comments

Comments

@RogerTinembart
Copy link

First of all, thank you for this wonderful work! I use Posh-SSH to transfer backups from a remote host to our system. Since security is crucial, I check the fingerprint of the remote host. In this context, I encountered the following problem:

The MD5 fingerprint consists of 16 hex numbers, which should be 2 characters long each. If a hex number starts with a 0, the 0 is not included in the fingerprint. No idea what happens if the entire hex number is 0... In any case, such a fingerprint looks like this: 4e:cc:12:2:82:d1:66:b8:d6:93:2e:d3:40:fb:53:2c
(the fourth component should actually be 02)

As long as I just confirm that the fingerprint is OK and this is then included in the Posh-SSH JSON file, everything still works.

However, our system knows all host IPs and the respective fingerprints and calls a script that does the work. The host IP and fingerprint are passed to the script. I do this:

  • first I delete the host's fingerprint with Remove-SSHTrustedHost -hostname XXX
  • then I insert the fingerprint that I get from the system: New-SSHTrustedHost -hostname XXX -fingerprint YYY

Then I can open the connection with New-SFTPSession -ComputerName XXX -Credential ZZZ -ErrorOnUntrusted

The problem is that if I pass a "normally" formatted fingerprint, which in this case contains 02 instead of just 2, I don't get a connection (Key exchange failed). I currently have to delete the leading 0 from my normal fingerprints so that Posh-SSH can understand it.

This is no longer a problem for me at the moment, I am now reformatting these fingerprints. I just wanted to report this point in case you want to adjust it. Of course, this could be problematic if users currently have fingerprints saved in the "wrong" format...

Thanks again for Posh-SSH!

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

No branches or pull requests

1 participant