* Bump the dependencies group
---------
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Robert Hague <rh@johnstreetcapital.com>
Co-authored-by: Rob Hague <rob.hague00@gmail.com>
* CI: add Windows Integration Tests for .NET
see https://github.com/sshnet/SSH.NET/pull/1702#issuecomment-3342506642
* fix podman setup with Windows and .NET
* debug
* x
* x
* x
* revert
* Run Windows .NET tests in separate job
so they run in parallel and we avoid the Common_CreateMoreChannelsThanMaxSessions test failure.
* fix coverlet artifacts
* fix missing PermitTTY in RemoteSshdConfig Reset
this fixes a test failure in Common_CreateMoreChannelsThanMaxSessions
when running the tests multiple times against the same SSH server
instance.
see https://github.com/sshnet/SSH.NET/pull/1704#issuecomment-3343210311
* speed up Windows tests
turns out this is caused by DNS resolution taking about
2 seconds on every new connection...
* add windows integration tests to Publish needs:
---------
Co-authored-by: Rob Hague <rob.hague00@gmail.com>
Co-authored-by: Robert Hague <rh@johnstreetcapital.com>
* CI: run .NET Framework Integration Tests on Windows
* use apt-get
* use vampire/setup-wsl
* Run Windows Integration Tests in separate job
so publish doesn't depend on it
* Ignore flakey Test from #1253 in CI
* Replace DiagnosticAbstrations with Microsoft.Extensions.Logging.Abstractions
* add documentation
* reduce allocations by SessionId hex conversion
generate the hex string once instead of every log
call and optimize ToHex().
* Update docfx/logging.md
Co-authored-by: Rob Hague <rob.hague00@gmail.com>
* reduce log levels
* hook up testcontainers logging
* drop packet logs further down to trace
* add kex traces
---------
Co-authored-by: Rob Hague <rob.hague00@gmail.com>
* Update SonarAnalyzer.CSharp
* fix S3993: Custom attributes should be marked with "System.AttributeUsageAttribute"
https://rules.sonarsource.com/csharp/RSPEC-3993/
* fix S6966: Awaitable method should be used
Introduced abstractions for CancellationTokenSource.CancelAsync()
and Stream.DisposeAsync() to avoid #ifdef.
Supressed pipeStream.WriteAsync because it deadlocks the test.
I assume because PipeStream doesn't override WriteAsync.
https://rules.sonarsource.com/csharp/RSPEC-6966/
temp
* fix S3431: "[ExpectedException]" should not be used
Removed the Connect() from Multifactor_PublicKeyWithEmptyPassPhrase
because the Exception is already thrown in the factory.
https://rules.sonarsource.com/csharp/RSPEC-3431/
* fix S2325: Methods and properties that don't access instance data should be static
This one is pretty redundant with CA1822 (which is also disabled in the
tests).
It caught a few more cases in the library itself, most of which can't
be changed because they are public API.
https://rules.sonarsource.com/csharp/RSPEC-2325/
* fix S127: "for" loop stop conditions should be invariant
not sure if this one is worth having. The only cases it found
are imho legitimate or not worth fixing, so I supressed them.
https://rules.sonarsource.com/csharp/RSPEC-127/
* fix S1964: An abstract class should have both abstract and concrete methods
Suppressed for public APIs, changed ExtendedReplyInfo to interface.
https://rules.sonarsource.com/csharp/RSPEC-1694/
* Remove redundant test
this is already covered by Test_PrivateKey_SSH2_Encrypted_ShouldThrowSshPassPhraseNullOrEmptyExceptionWhenPassphraseIsNull
* Revert "fix S2325: Methods and properties that don't access instance data should be static"
suppress it instead
This reverts commit 2020604958.
* Revert "fix S127: "for" loop stop conditions should be invariant"
suppress it instead
This reverts commit 1d8b4ac335.
* Use System.Security.Cryptography for DSA
This is the analogue of the RSA change #1373 for DSA. This has a couple of caveats:
- The BCL supports only FIPS 186-compliant keys, that is, public (P, Q) lengths
of (512 <= P <= 1024, 160) for FIPS 186-1/186-2; and (2048, 256), (3072, 256)
for FIPS 186-3/186-4. The latter also specifies (2048, 224) but due to a quirk
in the Windows API, the BCL does not support Q values of length 224[^1].
- OpenSSH, based on the SSH spec, only supports (supported) Q values of length 160,
but appears to also work in non-FIPS-compliant cases such as in our integration
tests with a (2048, 160) host key. That test now fails and I changed that host key
to (1024, 160).
This basically means that (1024, 160) is the largest DSA key size supported by both
SSH.NET and OpenSSH. However, given that OpenSSH deprecated DSA in 2015[^2], and the
alternative that I have been considering is just to delete support for DSA in the
library, this change seems reasonable to me. I don't think we can justify keeping the
current handwritten code around.
I think we may still consider dropping DSA from the library, I just had this branch
laying around and figured I'd finish it off.
[^1]: https://github.com/dotnet/runtime/blob/fadd8313653f71abd0068c8bf914be88edb2c8d3/src/libraries/Common/src/System/Security/Cryptography/DSACng.ImportExport.cs#L259-L265
[^2]: https://www.openssh.com/txt/release-7.0
* Appease mono
* test experiment
* Revert "Appease mono"
This reverts commit 881eefe5e8.
* Move test projects to test folder.
Move global.json to root of repo.
Update solution items in solution.
* Move test projects to test folder.
Move global.json to root of repo.
Update solution items in solution.
Update appveyor configuration/
* Attempt to have appveyor use the correct .NET SDK.
* Update .NET SDK to version 7.0.402.
* Move Data folder below Renci.SshNet.Tests.
* Make csinst less chatty.
* Move Data folder directly below test folder as it's used by multiple test projects.
* Remove CS1591 nowarn from concrete test projects as this is already defined in the Directory.Build.props that is in the test folder.
* Fix integration test after moving test projects
---------
Co-authored-by: drieseng <gert.driesen@telenet.be>