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

Server HMAC algorithm not found #837

Closed
AliceTJ opened this issue Jun 17, 2021 · 4 comments · Fixed by #1316
Closed

Server HMAC algorithm not found #837

AliceTJ opened this issue Jun 17, 2021 · 4 comments · Fixed by #1316
Milestone

Comments

@AliceTJ
Copy link

AliceTJ commented Jun 17, 2021

Hi ,

I used the shClient.Connect(), and catch an error "Server HMAC algorithm not found";I used the newest version 2020.0.1, and the server only support the "hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,umac-128-etm@openssh.com" MAC algorithms, How can I do? Is there a solution to add MAC algorithms or fix this error?

Thanks

@NN---
Copy link

NN--- commented Jul 7, 2021

#825

@SylvainSorlin
Copy link

Still no solutions ?

@sseilmann
Copy link

Well, it's been a while but maybe someone is still interested.
Seems, as if ssh.net has all you need, but it's not active.
Digging into ConnectionInfo I found the dictionary defining the hmac algorithms.
Since Security -> Cryptography -> Hashes already has a class for the sha256hash I just added one line to the dic ...

{"hmac-sha2-256", (key) => { return new HMac<SHA256Hash>(key.Take(32).ToArray());}},

...to make it:

        this.HmacAlgorithms = new Dictionary<string, Func<byte[], HashAlgorithm>>()
       {
           {"hmac-md5", (key) => { return new HMac<MD5Hash>(key.Take(16).ToArray());}},
           {"hmac-sha1", (key) => { return new HMac<SHA1Hash>(key.Take(20).ToArray());}},
           {"hmac-sha2-256", (key) => { return new HMac<SHA256Hash>(key.Take(32).ToArray());}},
           //{"umac-64@openssh.com", typeof(HMacSha1)},
           //{"hmac-ripemd160", typeof(HMacSha1)},
           //{"hmac-ripemd160@openssh.com", typeof(HMacSha1)},
           //{"hmac-md5-96", typeof(...)},
           //{"hmac-sha1-96", typeof(...)},
           //{"none", typeof(...)},
       };

That's allI had to to in my case

@WojciechNagorski
Copy link
Collaborator

This issue has been fixed in the 2024.0.0 version.

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

Successfully merging a pull request may close this issue.

5 participants