Skip to content

CryptographicException in BaseClient.Connect() #805

Open
@IgorMilavec

Description

@IgorMilavec

Using SSH.NET 2020.0.1, occasionally CryptographicException is thrown in call to BaseClient.Connect():

System.Security.Cryptography.CryptographicException: Hash not valid for use in specified state.
   at System.Security.Cryptography.CryptographicException.ThrowCryptographicException(Int32 hr)
   at System.Security.Cryptography.Utils.HashData(SafeHashHandle hHash, Byte[] data, Int32 cbData, Int32 ibStart, Int32 cbSize)
   at System.Security.Cryptography.SHA1CryptoServiceProvider.HashCore(Byte[] rgb, Int32 ibStart, Int32 cbSize)
   at System.Security.Cryptography.HashAlgorithm.ComputeHash(Byte[] buffer)
   at Renci.SshNet.Security.Cryptography.CipherDigitalSignature.Sign(Byte[] input)
   at Renci.SshNet.Security.KeyHostAlgorithm.Sign(Byte[] data)
   at Renci.SshNet.PrivateKeyAuthenticationMethod.Authenticate(Session session)
   at Renci.SshNet.ClientAuthentication.TryAuthenticate(ISession session, AuthenticationState authenticationState, String[] allowedAuthenticationMethods, SshAuthenticationException& authenticationException)
   at Renci.SshNet.ClientAuthentication.Authenticate(IConnectionInfoInternal connectionInfo, ISession session)
   at Renci.SshNet.ConnectionInfo.Authenticate(ISession session, IServiceFactory serviceFactory)
   at Renci.SshNet.Session.Connect()
   at Renci.SshNet.BaseClient.CreateAndConnectSession()
   at Renci.SshNet.BaseClient.Connect()

Will try to gather more info and report back.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions