From bac6ad02be380163b270539ee1fee6f2df9c8bae Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 1 Oct 2026 21:03:10 +0000 Subject: [PATCH 1/3] Bump the dependencies group with 9 updates Bumps Meziantou.Analyzer from 3.0.125 to 3.0.290 Bumps Microsoft.Bcl.Cryptography from 10.0.10 to 10.0.12 Bumps Microsoft.Extensions.Logging.Console from 10.0.10 to 10.0.12 Bumps Moq from 4.20.72 to 4.21.0 Bumps MSTest from 4.3.3 to 4.4.1 Bumps Nerdbank.GitVersioning from 3.10.91 to 3.10.94 Bumps SonarAnalyzer.CSharp from 10.27.0.140913 to 10.34.0.3385 Bumps System.Formats.Asn1 from 10.0.10 to 10.0.12 Bumps Testcontainers from 4.13.0 to 4.15.0 --- updated-dependencies: - dependency-name: Meziantou.Analyzer dependency-version: 3.0.290 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: dependencies - dependency-name: Microsoft.Bcl.Cryptography dependency-version: 10.0.12 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: dependencies - dependency-name: Microsoft.Extensions.Logging.Console dependency-version: 10.0.12 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: dependencies - dependency-name: Moq dependency-version: 4.21.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: dependencies - dependency-name: MSTest dependency-version: 4.4.1 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: dependencies - dependency-name: Nerdbank.GitVersioning dependency-version: 3.10.94 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: dependencies - dependency-name: SonarAnalyzer.CSharp dependency-version: 10.34.0.3385 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: dependencies - dependency-name: System.Formats.Asn1 dependency-version: 10.0.12 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: dependencies - dependency-name: Testcontainers dependency-version: 4.15.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: dependencies ... Signed-off-by: dependabot[bot] --- Directory.Packages.props | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 0ffc049d3..74cb26508 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -9,19 +9,19 @@ - + - + - - - - + + + + - + - - + + \ No newline at end of file From 7ed06fb78fba6c7e0ab7a30b75d7fe6fc4b0f540 Mon Sep 17 00:00:00 2001 From: Rob Hague Date: Sun, 18 Oct 2026 16:11:16 +0200 Subject: [PATCH 2/3] x --- .editorconfig | 26 +++++++++++++++++++ Directory.Packages.props | 20 +++++++------- .../Abstractions/SocketAbstraction.cs | 9 ++++--- .../Transport/IKeyExchangedAllowed.cs | 4 +-- 4 files changed, 43 insertions(+), 16 deletions(-) diff --git a/.editorconfig b/.editorconfig index f92acc7da..e107f2173 100644 --- a/.editorconfig +++ b/.editorconfig @@ -32,6 +32,9 @@ dotnet_diagnostic.S101.severity = none # This is a duplicate of CA2201 and MA0012. dotnet_diagnostic.S112.severity = none +# S125: Remove this commented out code +dotnet_diagnostic.S125.severity = silent + # S127: "for" loop stop conditions should be invariant # https://rules.sonarsource.com/csharp/RSPEC-127 # @@ -324,6 +327,23 @@ dotnet_diagnostic.S4487.severity = none # This is a partial duplicate of MA0067, and we do not want to report the use of 'default' for a Guid as error. dotnet_diagnostic.S4581.severity = none +# S4790: Weak hashing algorithms should not be used +dotnet_diagnostic.S4790.severity = none + +# S5766: Serializable objects should validate data during deserialization +dotnet_diagnostic.S5766.severity = none + +# S6444: Pass a regex timeout +dotnet_diagnostic.S6444.severity = silent + +# S8949: The overload accepting a 'CancellationToken' should be used +dotnet_diagnostic.S8949.severity = silent + +# S8969: Remove unnecessary suppression +# +# Dupe of IDE0370 +dotnet_diagnostic.S8969.severity = none + # S4830: Server certificates should be verified during SSL/TLS connections # https://rules.sonarsource.com/csharp/RSPEC-4830/ dotnet_diagnostic.S4830.severity = none @@ -612,6 +632,9 @@ MA0053.exceptions_should_be_sealed = true # Also report diagnostic for types that define (new) virtual members. MA0053.class_with_virtual_member_shoud_be_sealed = true +# MA0071: Avoid using redundant else +dotnet_diagnostic.MA0071.severity = silent + # MA0112: Use 'Count > 0' instead of 'Any()' # # This rule is disabled by default, hence we need to explicitly enable it. @@ -635,6 +658,9 @@ dotnet_diagnostic.MA0190.severity = none # MA0192 - Use HasFlag instead of bitwise checks dotnet_diagnostic.MA0192.severity = none +# MA0219: Set the language attribute in XML comment +dotnet_diagnostic.MA0219.severity = none + #### MSTest rules #### # MSTEST0015: Test method should not be ignored diff --git a/Directory.Packages.props b/Directory.Packages.props index 74cb26508..6d65e51ea 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -6,22 +6,22 @@ - - + + - + - + - - + + - + - - + + - \ No newline at end of file + diff --git a/src/Renci.SshNet/Abstractions/SocketAbstraction.cs b/src/Renci.SshNet/Abstractions/SocketAbstraction.cs index 080d2231a..24768a468 100644 --- a/src/Renci.SshNet/Abstractions/SocketAbstraction.cs +++ b/src/Renci.SshNet/Abstractions/SocketAbstraction.cs @@ -238,9 +238,12 @@ public static int Read(Socket socket, byte[] buffer, int offset, int size, TimeS if (ex.SocketErrorCode == SocketError.TimedOut) { - throw new SshOperationTimeoutException(string.Format(CultureInfo.InvariantCulture, - "Socket read operation has timed out after {0:F0} milliseconds.", - readTimeout.TotalMilliseconds)); + throw new SshOperationTimeoutException( + string.Format( + CultureInfo.InvariantCulture, + "Socket read operation has timed out after {0:F0} milliseconds.", + readTimeout.TotalMilliseconds), + ex); } throw; diff --git a/src/Renci.SshNet/Messages/Transport/IKeyExchangedAllowed.cs b/src/Renci.SshNet/Messages/Transport/IKeyExchangedAllowed.cs index 1f06aeb31..1c8a56756 100644 --- a/src/Renci.SshNet/Messages/Transport/IKeyExchangedAllowed.cs +++ b/src/Renci.SshNet/Messages/Transport/IKeyExchangedAllowed.cs @@ -4,8 +4,6 @@ /// Indicates that message that implement this interface is allowed during key exchange phase. /// #pragma warning disable CA1040 // Avoid empty interfaces - public interface IKeyExchangedAllowed + public interface IKeyExchangedAllowed; #pragma warning restore CA1040 // Avoid empty interfaces - { - } } From d1993747b14060485755adb2deb024af9a6295a8 Mon Sep 17 00:00:00 2001 From: Rob Hague Date: Mon, 19 Oct 2026 23:37:23 +0200 Subject: [PATCH 3/3] x --- Directory.Packages.props | 4 ++-- .../HttpConnectorTest_Connect_TimeoutReadingHttpContent.cs | 1 - .../HttpConnectorTest_Connect_TimeoutReadingStatusLine.cs | 1 - ...lVersionExchangeTest_TimeoutReadingIdentificationString.cs | 1 - ...4ConnectorTest_Connect_TimeoutReadingDestinationAddress.cs | 1 - .../Socks4ConnectorTest_Connect_TimeoutReadingReplyCode.cs | 1 - .../Socks4ConnectorTest_Connect_TimeoutReadingReplyVersion.cs | 1 - .../Socks5ConnectorTest_Connect_TimeoutConnectionReply.cs | 1 - 8 files changed, 2 insertions(+), 9 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 6d65e51ea..687954d8c 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -9,7 +9,7 @@ - + @@ -24,4 +24,4 @@ - + \ No newline at end of file diff --git a/test/Renci.SshNet.Tests/Classes/Connection/HttpConnectorTest_Connect_TimeoutReadingHttpContent.cs b/test/Renci.SshNet.Tests/Classes/Connection/HttpConnectorTest_Connect_TimeoutReadingHttpContent.cs index 817cc27a3..46fc1e384 100644 --- a/test/Renci.SshNet.Tests/Classes/Connection/HttpConnectorTest_Connect_TimeoutReadingHttpContent.cs +++ b/test/Renci.SshNet.Tests/Classes/Connection/HttpConnectorTest_Connect_TimeoutReadingHttpContent.cs @@ -119,7 +119,6 @@ protected override void Act() [TestMethod] public void ConnectShouldHaveThrownSshOperationTimeoutException() { - Assert.IsNull(_actualException.InnerException); Assert.AreEqual(string.Format(CultureInfo.InvariantCulture, "Socket read operation has timed out after {0:F0} milliseconds.", _connectionInfo.Timeout.TotalMilliseconds), _actualException.Message); } diff --git a/test/Renci.SshNet.Tests/Classes/Connection/HttpConnectorTest_Connect_TimeoutReadingStatusLine.cs b/test/Renci.SshNet.Tests/Classes/Connection/HttpConnectorTest_Connect_TimeoutReadingStatusLine.cs index e325c88f8..b72007ccb 100644 --- a/test/Renci.SshNet.Tests/Classes/Connection/HttpConnectorTest_Connect_TimeoutReadingStatusLine.cs +++ b/test/Renci.SshNet.Tests/Classes/Connection/HttpConnectorTest_Connect_TimeoutReadingStatusLine.cs @@ -95,7 +95,6 @@ protected override void Act() [TestMethod] public void ConnectShouldHaveThrownSshOperationTimeoutException() { - Assert.IsNull(_actualException.InnerException); Assert.AreEqual(string.Format(CultureInfo.InvariantCulture, "Socket read operation has timed out after {0:F0} milliseconds.", _connectionInfo.Timeout.TotalMilliseconds), _actualException.Message); } diff --git a/test/Renci.SshNet.Tests/Classes/Connection/ProtocolVersionExchangeTest_TimeoutReadingIdentificationString.cs b/test/Renci.SshNet.Tests/Classes/Connection/ProtocolVersionExchangeTest_TimeoutReadingIdentificationString.cs index 82fc25419..9dde3563f 100644 --- a/test/Renci.SshNet.Tests/Classes/Connection/ProtocolVersionExchangeTest_TimeoutReadingIdentificationString.cs +++ b/test/Renci.SshNet.Tests/Classes/Connection/ProtocolVersionExchangeTest_TimeoutReadingIdentificationString.cs @@ -88,7 +88,6 @@ protected void Act() public void StartShouldHaveThrownSshOperationTimeoutException() { Assert.IsNotNull(_actualException); - Assert.IsNull(_actualException.InnerException); Assert.AreEqual(string.Format("Socket read operation has timed out after {0} milliseconds.", _timeout.TotalMilliseconds), _actualException.Message); } diff --git a/test/Renci.SshNet.Tests/Classes/Connection/Socks4ConnectorTest_Connect_TimeoutReadingDestinationAddress.cs b/test/Renci.SshNet.Tests/Classes/Connection/Socks4ConnectorTest_Connect_TimeoutReadingDestinationAddress.cs index 35fe071ae..f390b854f 100644 --- a/test/Renci.SshNet.Tests/Classes/Connection/Socks4ConnectorTest_Connect_TimeoutReadingDestinationAddress.cs +++ b/test/Renci.SshNet.Tests/Classes/Connection/Socks4ConnectorTest_Connect_TimeoutReadingDestinationAddress.cs @@ -97,7 +97,6 @@ protected override void Act() [TestMethod] public void ConnectShouldHaveThrownSshOperationTimeoutException() { - Assert.IsNull(_actualException.InnerException); Assert.AreEqual(string.Format(CultureInfo.InvariantCulture, "Socket read operation has timed out after {0:F0} milliseconds.", _connectionInfo.Timeout.TotalMilliseconds), _actualException.Message); } diff --git a/test/Renci.SshNet.Tests/Classes/Connection/Socks4ConnectorTest_Connect_TimeoutReadingReplyCode.cs b/test/Renci.SshNet.Tests/Classes/Connection/Socks4ConnectorTest_Connect_TimeoutReadingReplyCode.cs index e101b9035..fb0c992a7 100644 --- a/test/Renci.SshNet.Tests/Classes/Connection/Socks4ConnectorTest_Connect_TimeoutReadingReplyCode.cs +++ b/test/Renci.SshNet.Tests/Classes/Connection/Socks4ConnectorTest_Connect_TimeoutReadingReplyCode.cs @@ -93,7 +93,6 @@ protected override void Act() [TestMethod] public void ConnectShouldHaveThrownSshOperationTimeoutException() { - Assert.IsNull(_actualException.InnerException); Assert.AreEqual(string.Format(CultureInfo.InvariantCulture, "Socket read operation has timed out after {0:F0} milliseconds.", _connectionInfo.Timeout.TotalMilliseconds), _actualException.Message); } diff --git a/test/Renci.SshNet.Tests/Classes/Connection/Socks4ConnectorTest_Connect_TimeoutReadingReplyVersion.cs b/test/Renci.SshNet.Tests/Classes/Connection/Socks4ConnectorTest_Connect_TimeoutReadingReplyVersion.cs index d01b1c562..4e1bda469 100644 --- a/test/Renci.SshNet.Tests/Classes/Connection/Socks4ConnectorTest_Connect_TimeoutReadingReplyVersion.cs +++ b/test/Renci.SshNet.Tests/Classes/Connection/Socks4ConnectorTest_Connect_TimeoutReadingReplyVersion.cs @@ -85,7 +85,6 @@ protected override void Act() [TestMethod] public void ConnectShouldHaveThrownSshOperationTimeoutException() { - Assert.IsNull(_actualException.InnerException); Assert.AreEqual(string.Format(CultureInfo.InvariantCulture, "Socket read operation has timed out after {0:F0} milliseconds.", _connectionInfo.Timeout.TotalMilliseconds), _actualException.Message); } diff --git a/test/Renci.SshNet.Tests/Classes/Connection/Socks5ConnectorTest_Connect_TimeoutConnectionReply.cs b/test/Renci.SshNet.Tests/Classes/Connection/Socks5ConnectorTest_Connect_TimeoutConnectionReply.cs index a1dfb236b..11546750a 100644 --- a/test/Renci.SshNet.Tests/Classes/Connection/Socks5ConnectorTest_Connect_TimeoutConnectionReply.cs +++ b/test/Renci.SshNet.Tests/Classes/Connection/Socks5ConnectorTest_Connect_TimeoutConnectionReply.cs @@ -95,7 +95,6 @@ protected override void Act() [TestMethod] public void ConnectShouldHaveThrownSshOperationTimeoutException() { - Assert.IsNull(_actualException.InnerException); Assert.IsInstanceOfType(_actualException); }