Add support for Zlib compression (.NET 6.0 onward only)#1326
Add support for Zlib compression (.NET 6.0 onward only)#1326Rob-Hague merged 27 commits intosshnet:developfrom
Conversation
… supports zlib (pre-auth)
… supports zlib (pre-auth)
|
With this PR, SSH.NET targeted to frameworks below .NET 6.0 can easily use 3rd party library to do the compression. For example: https://github.com/scott-xu/SSH.NET.Ionic.Zlib/blob/main/src/SshNet.IonicZlib/ZLib.cs |
|
The decompression works when receive SSH_MSG_GLOBAL_REQUEST. |
|
Ready to review @Rob-Hague @WojciechNagorski |
Rob-Hague
left a comment
There was a problem hiding this comment.
Nice. Is there a reason for not testing "zlib" as well?
Because sshd doesn't support "zlib"(pre-auth) anymore. |
ZLibStream from .NET 6.0+ with SSH.NET.
Rob-Hague
left a comment
There was a problem hiding this comment.
Ok, in that case I suggest we do not support the "zlib" algorithm since we can't test it easily. What do you think?
This is good to go otherwise.
Co-authored-by: Rob Hague <rob.hague00@gmail.com>
|
Thanks, this is good to merge. |
|
@WojciechNagorski Is there any other thing I can do to get this merged? Thanks! |
|
Yes. You can ask @Rob-Hague for review. I do not have time now. |
|
I've added @Rob-Hague to code owners. |
|
Perfect! |

This PR adds support for zlib@openssh.com described in https://www.openssh.com/txt/draft-miller-secsh-compression-delayed-00.txt
Resolves #1130
Resolves #559
Resolves #336
Resolves #119
Notes:
This PR only adds compression support for .NET 6.0+.
"none" is the first and preferred compression method which means no compression by default, just like ssh_config:
The description of ssh -C option explains the reason:
zlib (pre-auth) is not supported in OpenSSH server (sshd) but is listed in OpenSSH client (ssh).
Since it is not easy to do integration-test for zlib (pre-auth), this PR does not add zlib (pre-auth).