-
-
Notifications
You must be signed in to change notification settings - Fork 951
DOTNETCORE: connecting with private key file >> NotSupportedException at at System.Security.Cryptography.HMAC.HashFinal() #776
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
Comments
I am encountering a similar issue with password authentication. I think the interesting commonality here is that the call to base.HashFinal() is somehow falling back to the abstract class HMAC instead of the subclassed parent. In my case, this problem only occurs with .NET Core. If I run the same code under .NET Framework, it works as expected. |
Interesting... maybe it's worth to cross post to dotnet core @ microsoft to see what's going on. |
Did you find a solution yet? I am still stuck with DOTNETCORE and unfortunately SSH.NET seems to be no longer maintained by the author. There are so many pull requests stuck to be approved... |
I finally forked the repository and added the explicit support for .NET Core 3.1 and .NET 5.0 and was able to bypass this problem, due to .NET Core runtime issue (see above). |
Out of curiosity: I dont understand why should a library get built for netcoreapp? I have no issues using SSH.NET with .NET Core or .NET5/6 on Linux and Windows. |
This is fixed in 2023.0.0 (by virtue of updated target framework support) |
Uh oh!
There was an error while loading. Please reload this page.
DOTNETCORE 3.1, with SSH.NET
I can successfully connect to a remote host with username and private key using Filezilla.
The same credentials and private key used with SSH.NET give me an exception.
The Exception seems to be some internal issue and not sure what to do to address it.
Can anyone help?
Exception:
Exception type:
{Name = "PlatformNotSupportedException" FullName = "System.PlatformNotSupportedException"} Assembly: {System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e} AssemblyQualifiedName: "System.PlatformNotSupportedException, System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e" Attributes: Public | Serializable | BeforeFieldInit BaseType: {Name = "NotSupportedException" FullName = "System.NotSupportedException"} Cache: {System.RuntimeType.RuntimeTypeCache} CacheIfExists: {System.RuntimeType.RuntimeTypeCache} ContainsGenericParameters: false CustomAttributes: Count = 4 DeclaredConstructors: {System.Reflection.ConstructorInfo[4]} DeclaredEvents: {System.Reflection.EventInfo[0]} DeclaredFields: {System.Reflection.FieldInfo[0]} DeclaredMembers: {System.Reflection.MemberInfo[4]} DeclaredMethods: {System.Reflection.MethodInfo[0]} DeclaredNestedTypes: {System.Reflection.TypeInfo.<get_DeclaredNestedTypes>d__22} DeclaredProperties: {System.Reflection.PropertyInfo[0]} DeclaringMethod: '((System.RuntimeType)exception.GetType()).DeclaringMethod' threw an exception of type 'System.InvalidOperationException' }
CODE:
` SftpClient client = null;
MemoryStream stream = null;
StreamWriter writer = null;
The text was updated successfully, but these errors were encountered: