sshnet / sshnet/SSH.NET

ssh-ed25519 fingerprint is invalid (in HostKeyEventArgs) with older servers

Open
#799 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
4.4k
Forks
993
Avg merge
9d 21h
Merged PRs (30d)
1

Description

Fantastic library, amazingly easy to use - thank you!. The library version 2020.0.1 seems to fail to provide a correct fingerprint (MD5) for e.HostKeyName that equals to "ssh-ed25519". The HostKeyEventArgs (e.Fingerprint) contains 16 bytes that absolutely don't match OS X ssh (nor Windows 10 built-in ssh command output.) I even made sure to execute the command like below to ensure I am requesting the "ssh-ed25519" (to match what's reported by e.HostKeyName).

The ssh command: ssh admin@host-address -o HostKeyAlgorithms=ssh-ed25519 -o FingerprintHash=md5

Please help! The library works correctly with e.HostKeyName of "ssh-rsa", but "ssh.net" doesn't pick "rsa" when connecting to AWS Ubuntu hosts in 2021.

How to reproduce:

  1. Connect to an AWS Linux host (Debian versions as recent as 2017),
  2. The e.HostKeyName will be "ssh-ed25519"
  3. The e.Fingerprint will "not" match the "ssh" command executed manually.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the HostKeyEventArgs entry point and inspect how e.Fingerprint is produced for the ssh-ed25519 host key. Reproduce against an AWS Linux host using the stated ssh command with FingerprintHash=md5, then compare the library's 16-byte fingerprint with the OS outputs. Done means the ssh-ed25519 fingerprint matches the command-line result while ssh-rsa behavior remains correct.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
networking, security
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.