Skip to content

Server HMAC algorithm not found #837

Closed

Description

@AliceTJ

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 "[email protected],[email protected],[email protected]" MAC algorithms, How can I do? Is there a solution to add MAC algorithms or fix this error?

Thanks

Activity

  1. NN--- commented on Jul 7, 2021

    @NN---
  2. SylvainSorlin commented on Nov 24, 2022

    @SylvainSorlin

    Still no solutions ?

  3. sseilmann commented on Jun 14, 2023

    @sseilmann

    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());}},
               //{"[email protected]", typeof(HMacSha1)},
               //{"hmac-ripemd160", typeof(HMacSha1)},
               //{"[email protected]", typeof(HMacSha1)},
               //{"hmac-md5-96", typeof(...)},
               //{"hmac-sha1-96", typeof(...)},
               //{"none", typeof(...)},
           };
    

    That's allI had to to in my case

  4. added this to the 2024.0.0 milestone on Feb 22, 2024
  5. WojciechNagorski commented on Feb 22, 2024

    @WojciechNagorski
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions