You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
"Data longer than 2147483647 is not supported" exception when connecting to Tectia ssh server running on a mainframe #713
This is similar to issue #41 but not exactly the same.
When connecting to Tectia ssh server running on a mainframe, I intermittently got an exception: Data longer than 2147483647 is not supported.
Tracing into the code I found that it looks like sometimes the first 4 bytes in the SSH_MSG_IGNORE message are filled with arbitrary numbers instead of the actual data length. When the number is greater than int.MaxValue the exception is thrown.
Changing IgnoreMessage.LoadData to the following fixed the issue:
protected override void LoadData()
{
var dataLength = ReadUInt32();
if (dataLength > (DataStream.Length - DataStream.Position))
{
DiagnosticAbstraction.Log("SSH_MSG_IGNORE: Length exceeds data bytes, data ignored.");
Data = Array<byte>.Empty;
}
else if (dataLength > int.MaxValue)
{
throw new NotSupportedException(string.Format(CultureInfo.CurrentCulture, "Data longer than {0} is not supported.", int.MaxValue));
}
else
{
Data = ReadBytes((int) dataLength);
}
}
The server version says "SSH-2.0-4.3.6500.1 SSH Secure Shell".
@edmlin Would it be possible to contact Tectia, and ask them whether this is a know issue? I'm ok with adding targeted workarounds, but for this to happen we need to be able to uniquely identify the SSH (server) software and version to which the workaround applies.
I can't get a confirmation from Tectia.
The change in above post only swaps the 2 abnormal condition handling and protect clients from malformed messages. I don't think there will be any negative effect. Maybe there's a better way to do it. I hope this can be addressed in this repo so in the future when I upgrade to a newer version my app won't break.
Thanks.
Hi Edmin,
Thanks for your reply.
You mean to download the source code of this library "Renci.ssh" and do
that change what you mentioned on that post right?.
Thanks,
Dinesh
Hi Drisen,
I am not sure about the sever but we are connecting mainframe there only
getting this issue.
And we connecting another SFTP server which is not mainframe it got
connected without issues.
Thanks,
Dinesh
Hi,
I am working on file upload to mainframe that is mainframe dataset.
The issues when I upload with the specified command "/FTADV:P=WIN" for
dataset file to mainframe the .net cursor will not come out the upload
function of ssh.net ,that looks waiting for some response from server I
guess.
Do you have any fix for that issue?
Thanks,
Dinesh
On Sat, 9 Jan, 2021, 11:53 pm dinesh k, <[email protected]>
wrote:
Is there any way we can get this compiled into the nuget package? My company will not allow me to download source or bring in "unknown" software. Nuget is fine though.
Activity
drieseng commentedon Aug 1, 2020
@edmlin Would it be possible to contact Tectia, and ask them whether this is a know issue? I'm ok with adding targeted workarounds, but for this to happen we need to be able to uniquely identify the SSH (server) software and version to which the workaround applies.
edmlin commentedon Aug 4, 2020
I can't get a confirmation from Tectia.
The change in above post only swaps the 2 abnormal condition handling and protect clients from malformed messages. I don't think there will be any negative effect. Maybe there's a better way to do it. I hope this can be addressed in this repo so in the future when I upgrade to a newer version my app won't break.
Thanks.
dinehs commentedon Jan 7, 2021
Hi Edmin,
Do you have any workarounds of this issues.
I am used the latest ssh.net 2020 version, but still the issue persist again.
Thanks,
Dinesh
edmlin commentedon Jan 7, 2021
Yes my workaround is the code change I mentioned above in file src/Renci.SshNet/Messages/Transport/IgnoreMessage.cs.
dinehs commentedon Jan 7, 2021
edmlin commentedon Jan 7, 2021
Yes. Then you can build a DLL from the modified source code or include the project to you solution.
dinehs commentedon Jan 7, 2021
dinehs commentedon Jan 7, 2021
Hi Drieseng,
Do you have any plan to fix the issue for the upcoming release?.
Thanks,
Dinesh
drieseng commentedon Jan 9, 2021
@edmlin @dinehs Are you both using (the same version of) "Tectia ssh server"?
dinehs commentedon Jan 9, 2021
dinehs commentedon Feb 25, 2021
jglazer63 commentedon Apr 8, 2021
Is there any way we can get this compiled into the nuget package? My company will not allow me to download source or bring in "unknown" software. Nuget is fine though.
WojciechNagorski commentedon Dec 29, 2023
The 2023.0.1 version has been released to Nuget: https://www.nuget.org/packages/SSH.NET/2023.0.1