From 317c38ca1b265eb117c07b8718ea6b7f4637c80d Mon Sep 17 00:00:00 2001 From: Scott Xu Date: Sat, 2 Dec 2023 10:09:37 +0800 Subject: [PATCH 01/23] GeneratePackageOnBuild IncludeSymbols --- src/Renci.SshNet/Properties/AssemblyInfo.cs | 4 +- .../Properties/CommonAssemblyInfo.cs | 26 ----------- src/Renci.SshNet/Renci.SshNet.csproj | 46 +++++++++++++++---- 3 files changed, 40 insertions(+), 36 deletions(-) delete mode 100644 src/Renci.SshNet/Properties/CommonAssemblyInfo.cs diff --git a/src/Renci.SshNet/Properties/AssemblyInfo.cs b/src/Renci.SshNet/Properties/AssemblyInfo.cs index fe5eac0d1..8c1693ede 100644 --- a/src/Renci.SshNet/Properties/AssemblyInfo.cs +++ b/src/Renci.SshNet/Properties/AssemblyInfo.cs @@ -1,8 +1,8 @@ -using System.Reflection; +using System; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -[assembly: AssemblyTitle("SSH.NET")] +[assembly: CLSCompliant(false)] [assembly: Guid("ad816c5e-6f13-4589-9f3e-59523f8b77a4")] [assembly: InternalsVisibleTo("Renci.SshNet.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f9194e1eb66b7e2575aaee115ee1d27bc100920e7150e43992d6f668f9737de8b9c7ae892b62b8a36dd1d57929ff1541665d101dc476d6e02390846efae7e5186eec409710fdb596e3f83740afef0d4443055937649bc5a773175b61c57615dac0f0fd10f52b52fedf76c17474cc567b3f7a79de95dde842509fb39aaf69c6c2")] [assembly: InternalsVisibleTo("Renci.SshNet.IntegrationTests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f9194e1eb66b7e2575aaee115ee1d27bc100920e7150e43992d6f668f9737de8b9c7ae892b62b8a36dd1d57929ff1541665d101dc476d6e02390846efae7e5186eec409710fdb596e3f83740afef0d4443055937649bc5a773175b61c57615dac0f0fd10f52b52fedf76c17474cc567b3f7a79de95dde842509fb39aaf69c6c2")] diff --git a/src/Renci.SshNet/Properties/CommonAssemblyInfo.cs b/src/Renci.SshNet/Properties/CommonAssemblyInfo.cs deleted file mode 100644 index 31ae72dff..000000000 --- a/src/Renci.SshNet/Properties/CommonAssemblyInfo.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System; -using System.Reflection; -using System.Runtime.InteropServices; - -[assembly: AssemblyDescription("SSH.NET is a Secure Shell (SSH) library for .NET, optimized for parallelism.")] -[assembly: AssemblyCompany("Renci")] -[assembly: AssemblyProduct("SSH.NET")] -[assembly: AssemblyCopyright("Copyright © Renci 2010-2023")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -[assembly: AssemblyVersion("2023.0.1")] -[assembly: AssemblyFileVersion("2023.0.1")] -[assembly: AssemblyInformationalVersion("2023.0.1")] -[assembly: CLSCompliant(false)] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -#if DEBUG -[assembly: AssemblyConfiguration("Debug")] -#else -[assembly: AssemblyConfiguration("Release")] -#endif diff --git a/src/Renci.SshNet/Renci.SshNet.csproj b/src/Renci.SshNet/Renci.SshNet.csproj index 824ff52a7..21790c58d 100644 --- a/src/Renci.SshNet/Renci.SshNet.csproj +++ b/src/Renci.SshNet/Renci.SshNet.csproj @@ -1,23 +1,53 @@  - false Renci.SshNet - net462;netstandard2.0;netstandard2.1;net6.0;net7.0;net8.0 + SSH.NET + SSH.NET + net462;netstandard2.0;netstandard2.1;net6.0;net7.0;net8.0 + + + + True + SSH.NET + SSH.NET + 2023.0.1 + SSH.NET is a Secure Shell (SSH) library for .NET, optimized for parallelism. + Copyright © Renci 2010-2023 + MIT + Renci + SS-NET-icon-h500.png + README.md + ssh; scp; sftp + https://github.com/sshnet/SSH.NET/releases/tag/$(Version) + True + snupkg $(DefineConstants);FEATURE_BINARY_SERIALIZATION;FEATURE_SOCKET_EAP;FEATURE_SOCKET_APM;FEATURE_DNS_SYNC;FEATURE_HASH_RIPEMD160_CREATE;FEATURE_HMAC_RIPEMD160 + + $(DefineConstants);FEATURE_SOCKET_TAP;FEATURE_SOCKET_APM;FEATURE_SOCKET_EAP;FEATURE_DNS_SYNC;FEATURE_DNS_APM;FEATURE_DNS_TAP + + + + + + - - + + + True + \ + + + True + \ + - - $(DefineConstants);FEATURE_SOCKET_TAP;FEATURE_SOCKET_APM;FEATURE_SOCKET_EAP;FEATURE_DNS_SYNC;FEATURE_DNS_APM;FEATURE_DNS_TAP - - + \ No newline at end of file From 4eb236007f49d6ba40eb81111c79c417a4bde5b6 Mon Sep 17 00:00:00 2001 From: Scott Xu Date: Sat, 2 Dec 2023 10:12:22 +0800 Subject: [PATCH 02/23] Add packages to artifacts --- appveyor.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/appveyor.yml b/appveyor.yml index 56f84c117..98487674e 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -55,5 +55,7 @@ for: # - ps: Push-AppveyorArtifact artifacts/tcpdump.pcap artifacts: + - path: 'src\**\*.nupkg' + - path: 'src\**\*.snupkg' - path: artifacts name: artifacts From f33918a41daf01b50523f62d9eb9815b813f7a96 Mon Sep 17 00:00:00 2001 From: Scott Xu Date: Sun, 3 Dec 2023 12:01:20 +0800 Subject: [PATCH 03/23] Update src/Renci.SshNet/Renci.SshNet.csproj Co-authored-by: Rob Hague --- src/Renci.SshNet/Renci.SshNet.csproj | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Renci.SshNet/Renci.SshNet.csproj b/src/Renci.SshNet/Renci.SshNet.csproj index 21790c58d..a04311fd1 100644 --- a/src/Renci.SshNet/Renci.SshNet.csproj +++ b/src/Renci.SshNet/Renci.SshNet.csproj @@ -7,7 +7,6 @@ - True SSH.NET SSH.NET 2023.0.1 From 2a74e7a27fa594bc983e31473466f2b95f6b3e02 Mon Sep 17 00:00:00 2001 From: Scott Xu Date: Tue, 5 Dec 2023 07:13:42 +0800 Subject: [PATCH 04/23] Update Renci.SshNet.csproj Co-authored-by: Rob Hague --- src/Renci.SshNet/Renci.SshNet.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Renci.SshNet/Renci.SshNet.csproj b/src/Renci.SshNet/Renci.SshNet.csproj index a04311fd1..fe09880fa 100644 --- a/src/Renci.SshNet/Renci.SshNet.csproj +++ b/src/Renci.SshNet/Renci.SshNet.csproj @@ -11,7 +11,7 @@ SSH.NET 2023.0.1 SSH.NET is a Secure Shell (SSH) library for .NET, optimized for parallelism. - Copyright © Renci 2010-2023 + Copyright © Renci 2010-$([System.DateTime]::UtcNow.Year) MIT Renci SS-NET-icon-h500.png From faae7d6e2d7160ee2db203f383f745b7bc5c3634 Mon Sep 17 00:00:00 2001 From: Scott Xu Date: Sun, 7 Jan 2024 10:04:51 +0800 Subject: [PATCH 05/23] Delete build/nuget/SSH.NET.nuspec --- build/nuget/SSH.NET.nuspec | 40 -------------------------------------- 1 file changed, 40 deletions(-) delete mode 100644 build/nuget/SSH.NET.nuspec diff --git a/build/nuget/SSH.NET.nuspec b/build/nuget/SSH.NET.nuspec deleted file mode 100644 index a5b53b8e6..000000000 --- a/build/nuget/SSH.NET.nuspec +++ /dev/null @@ -1,40 +0,0 @@ - - - - SSH.NET - $version$ - SSH.NET - Renci - olegkap,drieseng - MIT - https://github.com/sshnet/SSH.NET/ - false - SSH.NET is a Secure Shell (SSH) library for .NET, optimized for parallelism and with broad framework support. - https://github.com/sshnet/SSH.NET/releases/tag/$version$ - A Secure Shell (SSH) library for .NET, optimized for parallelism. - $copyright$ - en-US - ssh scp sftp - - - - - - - - - - - - - - - - - - - - - - - From 196789cafd85373a2e0f019006b3198ea027fe5c Mon Sep 17 00:00:00 2001 From: Scott Xu Date: Sun, 28 Jan 2024 17:38:29 +0800 Subject: [PATCH 06/23] Delete SSH.NET.nuspec from .sln file --- Renci.SshNet.sln | 6 ------ 1 file changed, 6 deletions(-) diff --git a/Renci.SshNet.sln b/Renci.SshNet.sln index 0ca62c338..98c0988f6 100644 --- a/Renci.SshNet.sln +++ b/Renci.SshNet.sln @@ -5,11 +5,6 @@ VisualStudioVersion = 17.5.33326.253 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{2D6CAE62-D053-476F-9BDD-2B1F27FA9C5D}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "nuget", "nuget", "{94EE3919-19FA-4D9B-8DA9-249050B15232}" - ProjectSection(SolutionItems) = preProject - build\nuget\SSH.NET.nuspec = build\nuget\SSH.NET.nuspec - EndProjectSection -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "sandcastle", "sandcastle", "{A6C3FFD3-16A5-44D3-8C1F-3613D6DD17D1}" ProjectSection(SolutionItems) = preProject build\sandcastle\SSH.NET.shfbproj = build\sandcastle\SSH.NET.shfbproj @@ -202,7 +197,6 @@ Global EndGlobalSection GlobalSection(NestedProjects) = preSolution {2D6CAE62-D053-476F-9BDD-2B1F27FA9C5D} = {04E8CC26-116E-4116-9558-7ED542548E70} - {94EE3919-19FA-4D9B-8DA9-249050B15232} = {2D6CAE62-D053-476F-9BDD-2B1F27FA9C5D} {A6C3FFD3-16A5-44D3-8C1F-3613D6DD17D1} = {2D6CAE62-D053-476F-9BDD-2B1F27FA9C5D} {D21A4D03-0AC2-4613-BB6D-74D2D16A72CC} = {04E8CC26-116E-4116-9558-7ED542548E70} {2F4155AA-750A-4D33-B2E6-ED06660016CE} = {04E8CC26-116E-4116-9558-7ED542548E70} From 28ad3c13ddfe4149547cc4f07dddac240dd1dd8b Mon Sep 17 00:00:00 2001 From: Scott Xu Date: Sun, 28 Jan 2024 17:49:50 +0800 Subject: [PATCH 07/23] Update Renci.SshNet.csproj --- src/Renci.SshNet/Renci.SshNet.csproj | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/Renci.SshNet/Renci.SshNet.csproj b/src/Renci.SshNet/Renci.SshNet.csproj index 1939cc4a5..567f5aef9 100644 --- a/src/Renci.SshNet/Renci.SshNet.csproj +++ b/src/Renci.SshNet/Renci.SshNet.csproj @@ -32,18 +32,14 @@ $(DefineConstants);FEATURE_BINARY_SERIALIZATION;FEATURE_HASH_RIPEMD160_CREATE;FEATURE_HMAC_RIPEMD160 - - $(DefineConstants);FEATURE_SOCKET_TAP;FEATURE_SOCKET_APM;FEATURE_SOCKET_EAP;FEATURE_DNS_SYNC;FEATURE_DNS_APM;FEATURE_DNS_TAP - + + + - - - - True From 366c3241c5537d1ae26d24384a4ecb261c808e35 Mon Sep 17 00:00:00 2001 From: Scott Xu Date: Sun, 28 Jan 2024 17:59:09 +0800 Subject: [PATCH 08/23] Update build.proj --- build/build.proj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/build.proj b/build/build.proj index fc22896e1..96546aae6 100644 --- a/build/build.proj +++ b/build/build.proj @@ -83,7 +83,7 @@ - + @@ -160,4 +160,4 @@ - \ No newline at end of file + From 3efc9029376db30c3df513b12aaca050c0686c6f Mon Sep 17 00:00:00 2001 From: Scott Xu Date: Sun, 28 Jan 2024 18:15:38 +0800 Subject: [PATCH 09/23] init nbgv --- Directory.Build.props | 6 +++++- version.json | 4 ++++ 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 version.json diff --git a/Directory.Build.props b/Directory.Build.props index 65a489ddc..404469a3f 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -29,10 +29,14 @@ - + + all + 3.6.133 + diff --git a/version.json b/version.json new file mode 100644 index 000000000..799c6321a --- /dev/null +++ b/version.json @@ -0,0 +1,4 @@ +{ + "$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/main/src/NerdBank.GitVersioning/version.schema.json", + "version": "2024.0.0" +} \ No newline at end of file From 04a8c8901ea865b1c1de9b67fbd41d496ecab23e Mon Sep 17 00:00:00 2001 From: Scott Xu Date: Sun, 28 Jan 2024 19:17:55 +0800 Subject: [PATCH 10/23] Include version.json in "Solution Items" --- Renci.SshNet.sln | 1 + 1 file changed, 1 insertion(+) diff --git a/Renci.SshNet.sln b/Renci.SshNet.sln index 2ccb88b37..ec9532782 100644 --- a/Renci.SshNet.sln +++ b/Renci.SshNet.sln @@ -25,6 +25,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution README.md = README.md stylecop.json = stylecop.json THIRD-PARTY-NOTICES.TXT = THIRD-PARTY-NOTICES.TXT + version.json = version.json EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{D21A4D03-0AC2-4613-BB6D-74D2D16A72CC}" From 2536152f93bdea0791a278bc25964af1fbb018ce Mon Sep 17 00:00:00 2001 From: Scott Xu Date: Mon, 29 Jan 2024 21:56:17 +0800 Subject: [PATCH 11/23] Update Directory.Build.props --- Directory.Build.props | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index 404469a3f..87551fe3d 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -29,14 +29,11 @@ - - - all - 3.6.133 - + From be998eed290334b38bfedd9bf4e9a19e8e9418e2 Mon Sep 17 00:00:00 2001 From: Scott Xu Date: Mon, 29 Jan 2024 22:10:20 +0800 Subject: [PATCH 12/23] define publicReleaseRefSpec --- version.json | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/version.json b/version.json index 799c6321a..071961782 100644 --- a/version.json +++ b/version.json @@ -1,4 +1,8 @@ { "$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/main/src/NerdBank.GitVersioning/version.schema.json", - "version": "2024.0.0" -} \ No newline at end of file + "version": "2024.0.0", + "publicReleaseRefSpec": [ + "^refs/heads/master$", // we release out of master + "^refs/tags/\\d{4}\\.\\d+\\.\\d+(-beta\\d+)?$" // we also release tags starting with year.minor.build[-betaN] + ] +} From 8035be218df8f35397e1a920fc13e327d608172e Mon Sep 17 00:00:00 2001 From: Scott Xu Date: Mon, 29 Jan 2024 22:16:12 +0800 Subject: [PATCH 13/23] update version.json --- version.json | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/version.json b/version.json index 071961782..9dc2b7342 100644 --- a/version.json +++ b/version.json @@ -4,5 +4,17 @@ "publicReleaseRefSpec": [ "^refs/heads/master$", // we release out of master "^refs/tags/\\d{4}\\.\\d+\\.\\d+(-beta\\d+)?$" // we also release tags starting with year.minor.build[-betaN] - ] + ], + "assemblyVersion": { + "precision": "minor" + }, + "nugetPackageVersion": { + "precision": "minor" + }, + "release": { + "tagName" : "{version}", + "branchName" : "master", + "versionIncrement" : "build", + "firstUnstableTag" : "beta" + }, } From 6b533b601f62020667edb3fad747fbf757cf6391 Mon Sep 17 00:00:00 2001 From: Scott Xu Date: Mon, 29 Jan 2024 22:16:41 +0800 Subject: [PATCH 14/23] update version.json --- version.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.json b/version.json index 9dc2b7342..7a63670fd 100644 --- a/version.json +++ b/version.json @@ -16,5 +16,5 @@ "branchName" : "master", "versionIncrement" : "build", "firstUnstableTag" : "beta" - }, + } } From edf8dc6fb2c733e3e08ee79675226fe61720098f Mon Sep 17 00:00:00 2001 From: Scott Xu Date: Mon, 29 Jan 2024 22:36:26 +0800 Subject: [PATCH 15/23] set cloud build number --- version.json | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/version.json b/version.json index 7a63670fd..7363ee0a1 100644 --- a/version.json +++ b/version.json @@ -5,6 +5,11 @@ "^refs/heads/master$", // we release out of master "^refs/tags/\\d{4}\\.\\d+\\.\\d+(-beta\\d+)?$" // we also release tags starting with year.minor.build[-betaN] ], + "cloudBuild": { + "buildNumber": { + "enabled": true + } + }, "assemblyVersion": { "precision": "minor" }, From e82fc7545a17a3329bbb1ec292f720d664a366e1 Mon Sep 17 00:00:00 2001 From: Scott Xu Date: Mon, 29 Jan 2024 22:48:33 +0800 Subject: [PATCH 16/23] fix https://github.com/sshnet/SSH.NET/issues/1292 --- src/Renci.SshNet/Session.cs | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/Renci.SshNet/Session.cs b/src/Renci.SshNet/Session.cs index 122e28d3d..e6f7b9e05 100644 --- a/src/Renci.SshNet/Session.cs +++ b/src/Renci.SshNet/Session.cs @@ -308,20 +308,20 @@ public Message ClientInitMessage get { _clientInitMessage ??= new KeyExchangeInitMessage - { - KeyExchangeAlgorithms = ConnectionInfo.KeyExchangeAlgorithms.Keys.ToArray(), - ServerHostKeyAlgorithms = ConnectionInfo.HostKeyAlgorithms.Keys.ToArray(), - EncryptionAlgorithmsClientToServer = ConnectionInfo.Encryptions.Keys.ToArray(), - EncryptionAlgorithmsServerToClient = ConnectionInfo.Encryptions.Keys.ToArray(), - MacAlgorithmsClientToServer = ConnectionInfo.HmacAlgorithms.Keys.ToArray(), - MacAlgorithmsServerToClient = ConnectionInfo.HmacAlgorithms.Keys.ToArray(), - CompressionAlgorithmsClientToServer = ConnectionInfo.CompressionAlgorithms.Keys.ToArray(), - CompressionAlgorithmsServerToClient = ConnectionInfo.CompressionAlgorithms.Keys.ToArray(), - LanguagesClientToServer = new[] { string.Empty }, - LanguagesServerToClient = new[] { string.Empty }, - FirstKexPacketFollows = false, - Reserved = 0 - }; + { + KeyExchangeAlgorithms = ConnectionInfo.KeyExchangeAlgorithms.Keys.ToArray(), + ServerHostKeyAlgorithms = ConnectionInfo.HostKeyAlgorithms.Keys.ToArray(), + EncryptionAlgorithmsClientToServer = ConnectionInfo.Encryptions.Keys.ToArray(), + EncryptionAlgorithmsServerToClient = ConnectionInfo.Encryptions.Keys.ToArray(), + MacAlgorithmsClientToServer = ConnectionInfo.HmacAlgorithms.Keys.ToArray(), + MacAlgorithmsServerToClient = ConnectionInfo.HmacAlgorithms.Keys.ToArray(), + CompressionAlgorithmsClientToServer = ConnectionInfo.CompressionAlgorithms.Keys.ToArray(), + CompressionAlgorithmsServerToClient = ConnectionInfo.CompressionAlgorithms.Keys.ToArray(), + LanguagesClientToServer = new[] { string.Empty }, + LanguagesServerToClient = new[] { string.Empty }, + FirstKexPacketFollows = false, + Reserved = 0 + }; return _clientInitMessage; } @@ -562,7 +562,7 @@ internal Session(ConnectionInfo connectionInfo, IServiceFactory serviceFactory, throw new ArgumentNullException(nameof(socketFactory)); } - ClientVersion = "SSH-2.0-Renci.SshNet.SshClient.0.0.1"; + ClientVersion = $"SSH-2.0-Renci.SshNet.SshClient.{ThisAssembly.AssemblyVersion}"; // AssemblyVersion's format is "major.minor.build.revision" which has one more digit than before "0.0.1" ConnectionInfo = connectionInfo; _serviceFactory = serviceFactory; _socketFactory = socketFactory; @@ -1203,7 +1203,7 @@ private Message ReceiveMessage(Socket socket) // Determine the size of the first block, which is 8 or cipher block size (whichever is larger) bytes var blockSize = _serverCipher is null ? (byte) 8 : Math.Max((byte) 8, _serverCipher.MinimumSize); - var serverMacLength = _serverMac != null ? _serverMac.HashSize/8 : 0; + var serverMacLength = _serverMac != null ? _serverMac.HashSize / 8 : 0; byte[] data; uint packetLength; From ea14cbe8a5b1f734b74f51fce9ed3a939119b11a Mon Sep 17 00:00:00 2001 From: Scott Xu Date: Mon, 29 Jan 2024 22:51:09 +0800 Subject: [PATCH 17/23] remove unexpected code format --- src/Renci.SshNet/Session.cs | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/Renci.SshNet/Session.cs b/src/Renci.SshNet/Session.cs index e6f7b9e05..88afbfd84 100644 --- a/src/Renci.SshNet/Session.cs +++ b/src/Renci.SshNet/Session.cs @@ -308,20 +308,20 @@ public Message ClientInitMessage get { _clientInitMessage ??= new KeyExchangeInitMessage - { - KeyExchangeAlgorithms = ConnectionInfo.KeyExchangeAlgorithms.Keys.ToArray(), - ServerHostKeyAlgorithms = ConnectionInfo.HostKeyAlgorithms.Keys.ToArray(), - EncryptionAlgorithmsClientToServer = ConnectionInfo.Encryptions.Keys.ToArray(), - EncryptionAlgorithmsServerToClient = ConnectionInfo.Encryptions.Keys.ToArray(), - MacAlgorithmsClientToServer = ConnectionInfo.HmacAlgorithms.Keys.ToArray(), - MacAlgorithmsServerToClient = ConnectionInfo.HmacAlgorithms.Keys.ToArray(), - CompressionAlgorithmsClientToServer = ConnectionInfo.CompressionAlgorithms.Keys.ToArray(), - CompressionAlgorithmsServerToClient = ConnectionInfo.CompressionAlgorithms.Keys.ToArray(), - LanguagesClientToServer = new[] { string.Empty }, - LanguagesServerToClient = new[] { string.Empty }, - FirstKexPacketFollows = false, - Reserved = 0 - }; + { + KeyExchangeAlgorithms = ConnectionInfo.KeyExchangeAlgorithms.Keys.ToArray(), + ServerHostKeyAlgorithms = ConnectionInfo.HostKeyAlgorithms.Keys.ToArray(), + EncryptionAlgorithmsClientToServer = ConnectionInfo.Encryptions.Keys.ToArray(), + EncryptionAlgorithmsServerToClient = ConnectionInfo.Encryptions.Keys.ToArray(), + MacAlgorithmsClientToServer = ConnectionInfo.HmacAlgorithms.Keys.ToArray(), + MacAlgorithmsServerToClient = ConnectionInfo.HmacAlgorithms.Keys.ToArray(), + CompressionAlgorithmsClientToServer = ConnectionInfo.CompressionAlgorithms.Keys.ToArray(), + CompressionAlgorithmsServerToClient = ConnectionInfo.CompressionAlgorithms.Keys.ToArray(), + LanguagesClientToServer = new[] { string.Empty }, + LanguagesServerToClient = new[] { string.Empty }, + FirstKexPacketFollows = false, + Reserved = 0 + }; return _clientInitMessage; } @@ -1203,7 +1203,7 @@ private Message ReceiveMessage(Socket socket) // Determine the size of the first block, which is 8 or cipher block size (whichever is larger) bytes var blockSize = _serverCipher is null ? (byte) 8 : Math.Max((byte) 8, _serverCipher.MinimumSize); - var serverMacLength = _serverMac != null ? _serverMac.HashSize / 8 : 0; + var serverMacLength = _serverMac != null ? _serverMac.HashSize/8 : 0; byte[] data; uint packetLength; From 458550745afc72857f5f87931d22ad1e6e1fd987 Mon Sep 17 00:00:00 2001 From: Scott Xu Date: Tue, 30 Jan 2024 21:44:09 +0800 Subject: [PATCH 18/23] Delete version from csproj --- src/Renci.SshNet/Renci.SshNet.csproj | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Renci.SshNet/Renci.SshNet.csproj b/src/Renci.SshNet/Renci.SshNet.csproj index 567f5aef9..6d0022183 100644 --- a/src/Renci.SshNet/Renci.SshNet.csproj +++ b/src/Renci.SshNet/Renci.SshNet.csproj @@ -9,7 +9,6 @@ SSH.NET SSH.NET - 2023.0.1 SSH.NET is a Secure Shell (SSH) library for .NET, optimized for parallelism. Copyright © Renci 2010-$([System.DateTime]::UtcNow.Year) MIT From 5ab40eaa4c1724614e0fc8931750f25f8a158216 Mon Sep 17 00:00:00 2001 From: Scott Xu Date: Tue, 30 Jan 2024 21:58:54 +0800 Subject: [PATCH 19/23] move nbgv from Directory.Build.props to Renci.SshNet.csproj as only this particular project needs versioning. include package version in ThisAssembly and use nuget package version for the SSH client version. Since we define the precision of nuget package to "build", it has 3 digits. Nuget package version is unique which should be suffient. --- Directory.Build.props | 1 - src/Renci.SshNet/Renci.SshNet.csproj | 5 +++++ src/Renci.SshNet/Session.cs | 2 +- ...ersionExchangeTest_ServerResponseContainsNullCharacter.cs | 2 +- ...seInvalid_SshIdentificationOnlyContainsProtocolVersion.cs | 2 +- ...otocolVersionExchangeTest_ServerResponseValid_Comments.cs | 2 +- ...esponseValid_TerminatedByLineFeedWithoutCarriageReturn.cs | 2 +- ...VersionExchangeTest_TimeoutReadingIdentificationString.cs | 2 +- .../Classes/SessionTest_ConnectToServerFails.cs | 2 +- test/Renci.SshNet.Tests/Classes/SessionTest_Connected.cs | 2 +- test/Renci.SshNet.Tests/Classes/SessionTest_NotConnected.cs | 2 +- 11 files changed, 14 insertions(+), 10 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index 87551fe3d..65a489ddc 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -33,7 +33,6 @@ Use fixed version of analyzers. --> - diff --git a/src/Renci.SshNet/Renci.SshNet.csproj b/src/Renci.SshNet/Renci.SshNet.csproj index 6d0022183..6b5cbb664 100644 --- a/src/Renci.SshNet/Renci.SshNet.csproj +++ b/src/Renci.SshNet/Renci.SshNet.csproj @@ -19,6 +19,7 @@ https://github.com/sshnet/SSH.NET/releases/tag/$(Version) True snupkg + true @@ -30,6 +31,10 @@ $(DefineConstants);FEATURE_BINARY_SERIALIZATION;FEATURE_HASH_RIPEMD160_CREATE;FEATURE_HMAC_RIPEMD160 + + + + diff --git a/src/Renci.SshNet/Session.cs b/src/Renci.SshNet/Session.cs index 88afbfd84..d4ac3e228 100644 --- a/src/Renci.SshNet/Session.cs +++ b/src/Renci.SshNet/Session.cs @@ -562,7 +562,7 @@ internal Session(ConnectionInfo connectionInfo, IServiceFactory serviceFactory, throw new ArgumentNullException(nameof(socketFactory)); } - ClientVersion = $"SSH-2.0-Renci.SshNet.SshClient.{ThisAssembly.AssemblyVersion}"; // AssemblyVersion's format is "major.minor.build.revision" which has one more digit than before "0.0.1" + ClientVersion = "SSH-2.0-Renci.SshNet.SshClient." + ThisAssembly.NuGetPackageVersion; ConnectionInfo = connectionInfo; _serviceFactory = serviceFactory; _socketFactory = socketFactory; diff --git a/test/Renci.SshNet.Tests/Classes/Connection/ProtocolVersionExchangeTest_ServerResponseContainsNullCharacter.cs b/test/Renci.SshNet.Tests/Classes/Connection/ProtocolVersionExchangeTest_ServerResponseContainsNullCharacter.cs index 2b3245eef..9300af484 100644 --- a/test/Renci.SshNet.Tests/Classes/Connection/ProtocolVersionExchangeTest_ServerResponseContainsNullCharacter.cs +++ b/test/Renci.SshNet.Tests/Classes/Connection/ProtocolVersionExchangeTest_ServerResponseContainsNullCharacter.cs @@ -52,7 +52,7 @@ public void Cleanup() protected void Arrange() { - _clientVersion = "SSH-2.0-Renci.SshNet.SshClient.0.0.1"; + _clientVersion = "SSH-2.0-Renci.SshNet.SshClient." + ThisAssembly.NuGetPackageVersion; _timeout = TimeSpan.FromSeconds(5); _serverEndPoint = new IPEndPoint(IPAddress.Loopback, 8122); _dataReceivedByServer = new List(); diff --git a/test/Renci.SshNet.Tests/Classes/Connection/ProtocolVersionExchangeTest_ServerResponseInvalid_SshIdentificationOnlyContainsProtocolVersion.cs b/test/Renci.SshNet.Tests/Classes/Connection/ProtocolVersionExchangeTest_ServerResponseInvalid_SshIdentificationOnlyContainsProtocolVersion.cs index 3b0649517..a5c18462c 100644 --- a/test/Renci.SshNet.Tests/Classes/Connection/ProtocolVersionExchangeTest_ServerResponseInvalid_SshIdentificationOnlyContainsProtocolVersion.cs +++ b/test/Renci.SshNet.Tests/Classes/Connection/ProtocolVersionExchangeTest_ServerResponseInvalid_SshIdentificationOnlyContainsProtocolVersion.cs @@ -54,7 +54,7 @@ public void Cleanup() protected void Arrange() { - _clientVersion = "SSH-2.0-Renci.SshNet.SshClient.0.0.1"; + _clientVersion = "SSH-2.0-Renci.SshNet.SshClient." + ThisAssembly.NuGetPackageVersion; _timeout = TimeSpan.FromSeconds(5); _serverEndPoint = new IPEndPoint(IPAddress.Loopback, 8122); _dataReceivedByServer = new List(); diff --git a/test/Renci.SshNet.Tests/Classes/Connection/ProtocolVersionExchangeTest_ServerResponseValid_Comments.cs b/test/Renci.SshNet.Tests/Classes/Connection/ProtocolVersionExchangeTest_ServerResponseValid_Comments.cs index 4108c7c09..70db33bad 100644 --- a/test/Renci.SshNet.Tests/Classes/Connection/ProtocolVersionExchangeTest_ServerResponseValid_Comments.cs +++ b/test/Renci.SshNet.Tests/Classes/Connection/ProtocolVersionExchangeTest_ServerResponseValid_Comments.cs @@ -52,7 +52,7 @@ public void Cleanup() protected void Arrange() { - _clientVersion = "SSH-2.0-Renci.SshNet.SshClient.0.0.1"; + _clientVersion = "SSH-2.0-Renci.SshNet.SshClient." + ThisAssembly.NuGetPackageVersion; _timeout = TimeSpan.FromSeconds(5); _serverEndPoint = new IPEndPoint(IPAddress.Loopback, 8122); _dataReceivedByServer = new List(); diff --git a/test/Renci.SshNet.Tests/Classes/Connection/ProtocolVersionExchangeTest_ServerResponseValid_TerminatedByLineFeedWithoutCarriageReturn.cs b/test/Renci.SshNet.Tests/Classes/Connection/ProtocolVersionExchangeTest_ServerResponseValid_TerminatedByLineFeedWithoutCarriageReturn.cs index 2c35bce53..376a3d81c 100644 --- a/test/Renci.SshNet.Tests/Classes/Connection/ProtocolVersionExchangeTest_ServerResponseValid_TerminatedByLineFeedWithoutCarriageReturn.cs +++ b/test/Renci.SshNet.Tests/Classes/Connection/ProtocolVersionExchangeTest_ServerResponseValid_TerminatedByLineFeedWithoutCarriageReturn.cs @@ -53,7 +53,7 @@ public void Cleanup() protected void Arrange() { - _clientVersion = "SSH-2.0-Renci.SshNet.SshClient.0.0.1"; + _clientVersion = "SSH-2.0-Renci.SshNet.SshClient." + ThisAssembly.NuGetPackageVersion; _timeout = TimeSpan.FromSeconds(5); _serverEndPoint = new IPEndPoint(IPAddress.Loopback, 8122); _dataReceivedByServer = new List(); diff --git a/test/Renci.SshNet.Tests/Classes/Connection/ProtocolVersionExchangeTest_TimeoutReadingIdentificationString.cs b/test/Renci.SshNet.Tests/Classes/Connection/ProtocolVersionExchangeTest_TimeoutReadingIdentificationString.cs index 3710e2064..1aad66619 100644 --- a/test/Renci.SshNet.Tests/Classes/Connection/ProtocolVersionExchangeTest_TimeoutReadingIdentificationString.cs +++ b/test/Renci.SshNet.Tests/Classes/Connection/ProtocolVersionExchangeTest_TimeoutReadingIdentificationString.cs @@ -52,7 +52,7 @@ public void Cleanup() protected void Arrange() { - _clientVersion = "SSH-2.0-Renci.SshNet.SshClient.0.0.1"; + _clientVersion = "SSH-2.0-Renci.SshNet.SshClient." + ThisAssembly.NuGetPackageVersion; _timeout = TimeSpan.FromMilliseconds(200); _serverEndPoint = new IPEndPoint(IPAddress.Loopback, 8122); _dataReceivedByServer = new List(); diff --git a/test/Renci.SshNet.Tests/Classes/SessionTest_ConnectToServerFails.cs b/test/Renci.SshNet.Tests/Classes/SessionTest_ConnectToServerFails.cs index 16cfbb1ed..7688c3fb3 100644 --- a/test/Renci.SshNet.Tests/Classes/SessionTest_ConnectToServerFails.cs +++ b/test/Renci.SshNet.Tests/Classes/SessionTest_ConnectToServerFails.cs @@ -53,7 +53,7 @@ protected override void Act() [TestMethod] public void ClientVersionIsRenciSshNet() { - Assert.AreEqual("SSH-2.0-Renci.SshNet.SshClient.0.0.1", _session.ClientVersion); + Assert.AreEqual("SSH-2.0-Renci.SshNet.SshClient." + ThisAssembly.NuGetPackageVersion, _session.ClientVersion); } [TestMethod] diff --git a/test/Renci.SshNet.Tests/Classes/SessionTest_Connected.cs b/test/Renci.SshNet.Tests/Classes/SessionTest_Connected.cs index e4f7f2430..381340505 100644 --- a/test/Renci.SshNet.Tests/Classes/SessionTest_Connected.cs +++ b/test/Renci.SshNet.Tests/Classes/SessionTest_Connected.cs @@ -27,7 +27,7 @@ protected override void Act() [TestMethod] public void ClientVersionIsRenciSshNet() { - Assert.AreEqual("SSH-2.0-Renci.SshNet.SshClient.0.0.1", Session.ClientVersion); + Assert.AreEqual("SSH-2.0-Renci.SshNet.SshClient." + ThisAssembly.NuGetPackageVersion, Session.ClientVersion); } [TestMethod] diff --git a/test/Renci.SshNet.Tests/Classes/SessionTest_NotConnected.cs b/test/Renci.SshNet.Tests/Classes/SessionTest_NotConnected.cs index 04491fbc7..f1f4a4422 100644 --- a/test/Renci.SshNet.Tests/Classes/SessionTest_NotConnected.cs +++ b/test/Renci.SshNet.Tests/Classes/SessionTest_NotConnected.cs @@ -29,7 +29,7 @@ protected override void Act() [TestMethod] public void ClientVersionIsRenciSshNet() { - Assert.AreEqual("SSH-2.0-Renci.SshNet.SshClient.0.0.1", _session.ClientVersion); + Assert.AreEqual("SSH-2.0-Renci.SshNet.SshClient." + ThisAssembly.NuGetPackageVersion, _session.ClientVersion); } [TestMethod] From 1fc5c65bab19892927c1f98f67b634a1ab7d8419 Mon Sep 17 00:00:00 2001 From: Rob Hague Date: Sat, 3 Feb 2024 20:27:01 +0100 Subject: [PATCH 20/23] Use package from CI feed --- nuget.config | 20 ++++++++++++++++++++ src/.nuget/NuGet.Config | 6 ------ src/Renci.SshNet/Renci.SshNet.csproj | 8 +++++++- 3 files changed, 27 insertions(+), 7 deletions(-) create mode 100644 nuget.config delete mode 100644 src/.nuget/NuGet.Config diff --git a/nuget.config b/nuget.config new file mode 100644 index 000000000..99509da63 --- /dev/null +++ b/nuget.config @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/src/.nuget/NuGet.Config b/src/.nuget/NuGet.Config deleted file mode 100644 index 54d6ecc22..000000000 --- a/src/.nuget/NuGet.Config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/src/Renci.SshNet/Renci.SshNet.csproj b/src/Renci.SshNet/Renci.SshNet.csproj index 6b5cbb664..d2da4f0ad 100644 --- a/src/Renci.SshNet/Renci.SshNet.csproj +++ b/src/Renci.SshNet/Renci.SshNet.csproj @@ -33,7 +33,13 @@ - + + From 7f4a63eb3a9ea5c654dd27565881115c5478579b Mon Sep 17 00:00:00 2001 From: Scott Xu Date: Sun, 25 Feb 2024 15:21:28 +0800 Subject: [PATCH 21/23] Bump version to 2024.0.1; Update version precision --- version.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/version.json b/version.json index 7363ee0a1..815f9666e 100644 --- a/version.json +++ b/version.json @@ -1,6 +1,6 @@ { "$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/main/src/NerdBank.GitVersioning/version.schema.json", - "version": "2024.0.0", + "version": "2024.0.1-beta.{height}", "publicReleaseRefSpec": [ "^refs/heads/master$", // we release out of master "^refs/tags/\\d{4}\\.\\d+\\.\\d+(-beta\\d+)?$" // we also release tags starting with year.minor.build[-betaN] @@ -11,10 +11,10 @@ } }, "assemblyVersion": { - "precision": "minor" + "precision": "build" }, "nugetPackageVersion": { - "precision": "minor" + "precision": "build" }, "release": { "tagName" : "{version}", From 9362bbacaf12b90beba3dd8d3a3adb999b9b423b Mon Sep 17 00:00:00 2001 From: Robert Hague Date: Fri, 26 Jul 2024 18:32:53 +0200 Subject: [PATCH 22/23] Some tweaks: - Remove the "release" section. I don't think we will use that for now - Remove the "cloudBuild" section. Changing the CI build number doesn't seem that useful - In the "nugetPackageVersion" section: - Remove "precision". It defaults to build - Add "semVer"=2. This makes the package version e.g. 2024.1.1-prerelease.1 instead of 2024.1.1-prerelease-0001 - In "assemblyVersion" change "precision" to revision. Doesn't seem to change anything, I was just copying nbgv's setup: https://github.com/dotnet/Nerdbank.GitVersioning/blob/main/version.json - Make sure there are no '-' in the softwareversion string (change the test to a regex) --- src/Renci.SshNet/Session.cs | 12 +++++++++-- .../Classes/SessionTest_Connected.cs | 6 +++++- version.json | 21 +++++-------------- 3 files changed, 20 insertions(+), 19 deletions(-) diff --git a/src/Renci.SshNet/Session.cs b/src/Renci.SshNet/Session.cs index 3458bb4e8..98dc8419a 100644 --- a/src/Renci.SshNet/Session.cs +++ b/src/Renci.SshNet/Session.cs @@ -31,6 +31,9 @@ public class Session : ISession internal const byte CarriageReturn = 0x0d; internal const byte LineFeed = 0x0a; + private static readonly string ClientVersionString = + "SSH-2.0-Renci.SshNet.SshClient." + ThisAssembly.NuGetPackageVersion.Replace('-', '_'); + /// /// Specifies maximum packet size defined by the protocol. /// @@ -313,7 +316,13 @@ public bool IsConnected /// /// The client version. /// - public string ClientVersion { get; private set; } + public string ClientVersion + { + get + { + return ClientVersionString; + } + } /// /// Gets the connection info. @@ -534,7 +543,6 @@ internal Session(ConnectionInfo connectionInfo, IServiceFactory serviceFactory, throw new ArgumentNullException(nameof(socketFactory)); } - ClientVersion = "SSH-2.0-Renci.SshNet.SshClient." + ThisAssembly.NuGetPackageVersion; ConnectionInfo = connectionInfo; _serviceFactory = serviceFactory; _socketFactory = socketFactory; diff --git a/test/Renci.SshNet.Tests/Classes/SessionTest_Connected.cs b/test/Renci.SshNet.Tests/Classes/SessionTest_Connected.cs index 284d0a21f..d105d9a35 100644 --- a/test/Renci.SshNet.Tests/Classes/SessionTest_Connected.cs +++ b/test/Renci.SshNet.Tests/Classes/SessionTest_Connected.cs @@ -1,5 +1,6 @@ using System; using System.Linq; +using System.Text.RegularExpressions; using System.Threading; using Microsoft.VisualStudio.TestTools.UnitTesting; @@ -31,7 +32,10 @@ protected override void Act() [TestMethod] public void ClientVersionIsRenciSshNet() { - Assert.AreEqual("SSH-2.0-Renci.SshNet.SshClient." + ThisAssembly.NuGetPackageVersion, Session.ClientVersion); + Assert.IsTrue(Regex.IsMatch( + Session.ClientVersion, + // Ends with e.g. 2024.1.1 plus some optional metadata not containing '-' + @"^SSH-2\.0-Renci\.SshNet\.SshClient\.\d{4}\.\d+\.\d+(_[a-zA-Z0-9_\.]+)?$")); } [TestMethod] diff --git a/version.json b/version.json index 815f9666e..f933e7fd9 100644 --- a/version.json +++ b/version.json @@ -1,25 +1,14 @@ { "$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/main/src/NerdBank.GitVersioning/version.schema.json", - "version": "2024.0.1-beta.{height}", + "version": "2024.1.1-prerelease.{height}", "publicReleaseRefSpec": [ - "^refs/heads/master$", // we release out of master - "^refs/tags/\\d{4}\\.\\d+\\.\\d+(-beta\\d+)?$" // we also release tags starting with year.minor.build[-betaN] + "^refs/heads/develop$", + "^refs/tags/\\d{4}\\.\\d+\\.\\d+" ], - "cloudBuild": { - "buildNumber": { - "enabled": true - } - }, "assemblyVersion": { - "precision": "build" + "precision": "revision" }, "nugetPackageVersion": { - "precision": "build" - }, - "release": { - "tagName" : "{version}", - "branchName" : "master", - "versionIncrement" : "build", - "firstUnstableTag" : "beta" + "semVer": 2 } } From a0bf4b11e4063297f2a4fcc99b37257e2eebbce7 Mon Sep 17 00:00:00 2001 From: Robert Hague Date: Fri, 26 Jul 2024 20:44:13 +0200 Subject: [PATCH 23/23] Revert unnecessary test changes; remove unnecessary tests --- ...rsionExchangeTest_ServerResponseContainsNullCharacter.cs | 2 +- ...eInvalid_SshIdentificationOnlyContainsProtocolVersion.cs | 2 +- ...tocolVersionExchangeTest_ServerResponseValid_Comments.cs | 2 +- ...sponseValid_TerminatedByLineFeedWithoutCarriageReturn.cs | 2 +- ...ersionExchangeTest_TimeoutReadingIdentificationString.cs | 2 +- .../Classes/SessionTest_ConnectToServerFails.cs | 6 ------ test/Renci.SshNet.Tests/Classes/SessionTest_NotConnected.cs | 6 ------ 7 files changed, 5 insertions(+), 17 deletions(-) diff --git a/test/Renci.SshNet.Tests/Classes/Connection/ProtocolVersionExchangeTest_ServerResponseContainsNullCharacter.cs b/test/Renci.SshNet.Tests/Classes/Connection/ProtocolVersionExchangeTest_ServerResponseContainsNullCharacter.cs index 6121f7932..164cb6a70 100644 --- a/test/Renci.SshNet.Tests/Classes/Connection/ProtocolVersionExchangeTest_ServerResponseContainsNullCharacter.cs +++ b/test/Renci.SshNet.Tests/Classes/Connection/ProtocolVersionExchangeTest_ServerResponseContainsNullCharacter.cs @@ -54,7 +54,7 @@ public void Cleanup() protected void Arrange() { - _clientVersion = "SSH-2.0-Renci.SshNet.SshClient." + ThisAssembly.NuGetPackageVersion; + _clientVersion = "SSH-2.0-Renci.SshNet.SshClient.0.0.1"; _timeout = TimeSpan.FromSeconds(5); _serverEndPoint = new IPEndPoint(IPAddress.Loopback, 8122); _dataReceivedByServer = new List(); diff --git a/test/Renci.SshNet.Tests/Classes/Connection/ProtocolVersionExchangeTest_ServerResponseInvalid_SshIdentificationOnlyContainsProtocolVersion.cs b/test/Renci.SshNet.Tests/Classes/Connection/ProtocolVersionExchangeTest_ServerResponseInvalid_SshIdentificationOnlyContainsProtocolVersion.cs index a5c18462c..3b0649517 100644 --- a/test/Renci.SshNet.Tests/Classes/Connection/ProtocolVersionExchangeTest_ServerResponseInvalid_SshIdentificationOnlyContainsProtocolVersion.cs +++ b/test/Renci.SshNet.Tests/Classes/Connection/ProtocolVersionExchangeTest_ServerResponseInvalid_SshIdentificationOnlyContainsProtocolVersion.cs @@ -54,7 +54,7 @@ public void Cleanup() protected void Arrange() { - _clientVersion = "SSH-2.0-Renci.SshNet.SshClient." + ThisAssembly.NuGetPackageVersion; + _clientVersion = "SSH-2.0-Renci.SshNet.SshClient.0.0.1"; _timeout = TimeSpan.FromSeconds(5); _serverEndPoint = new IPEndPoint(IPAddress.Loopback, 8122); _dataReceivedByServer = new List(); diff --git a/test/Renci.SshNet.Tests/Classes/Connection/ProtocolVersionExchangeTest_ServerResponseValid_Comments.cs b/test/Renci.SshNet.Tests/Classes/Connection/ProtocolVersionExchangeTest_ServerResponseValid_Comments.cs index 2499289b7..2af8062b6 100644 --- a/test/Renci.SshNet.Tests/Classes/Connection/ProtocolVersionExchangeTest_ServerResponseValid_Comments.cs +++ b/test/Renci.SshNet.Tests/Classes/Connection/ProtocolVersionExchangeTest_ServerResponseValid_Comments.cs @@ -53,7 +53,7 @@ public void Cleanup() protected void Arrange() { - _clientVersion = "SSH-2.0-Renci.SshNet.SshClient." + ThisAssembly.NuGetPackageVersion; + _clientVersion = "SSH-2.0-Renci.SshNet.SshClient.0.0.1"; _timeout = TimeSpan.FromSeconds(5); _serverEndPoint = new IPEndPoint(IPAddress.Loopback, 8122); _dataReceivedByServer = new List(); diff --git a/test/Renci.SshNet.Tests/Classes/Connection/ProtocolVersionExchangeTest_ServerResponseValid_TerminatedByLineFeedWithoutCarriageReturn.cs b/test/Renci.SshNet.Tests/Classes/Connection/ProtocolVersionExchangeTest_ServerResponseValid_TerminatedByLineFeedWithoutCarriageReturn.cs index 376a3d81c..2c35bce53 100644 --- a/test/Renci.SshNet.Tests/Classes/Connection/ProtocolVersionExchangeTest_ServerResponseValid_TerminatedByLineFeedWithoutCarriageReturn.cs +++ b/test/Renci.SshNet.Tests/Classes/Connection/ProtocolVersionExchangeTest_ServerResponseValid_TerminatedByLineFeedWithoutCarriageReturn.cs @@ -53,7 +53,7 @@ public void Cleanup() protected void Arrange() { - _clientVersion = "SSH-2.0-Renci.SshNet.SshClient." + ThisAssembly.NuGetPackageVersion; + _clientVersion = "SSH-2.0-Renci.SshNet.SshClient.0.0.1"; _timeout = TimeSpan.FromSeconds(5); _serverEndPoint = new IPEndPoint(IPAddress.Loopback, 8122); _dataReceivedByServer = new List(); diff --git a/test/Renci.SshNet.Tests/Classes/Connection/ProtocolVersionExchangeTest_TimeoutReadingIdentificationString.cs b/test/Renci.SshNet.Tests/Classes/Connection/ProtocolVersionExchangeTest_TimeoutReadingIdentificationString.cs index 1aad66619..3710e2064 100644 --- a/test/Renci.SshNet.Tests/Classes/Connection/ProtocolVersionExchangeTest_TimeoutReadingIdentificationString.cs +++ b/test/Renci.SshNet.Tests/Classes/Connection/ProtocolVersionExchangeTest_TimeoutReadingIdentificationString.cs @@ -52,7 +52,7 @@ public void Cleanup() protected void Arrange() { - _clientVersion = "SSH-2.0-Renci.SshNet.SshClient." + ThisAssembly.NuGetPackageVersion; + _clientVersion = "SSH-2.0-Renci.SshNet.SshClient.0.0.1"; _timeout = TimeSpan.FromMilliseconds(200); _serverEndPoint = new IPEndPoint(IPAddress.Loopback, 8122); _dataReceivedByServer = new List(); diff --git a/test/Renci.SshNet.Tests/Classes/SessionTest_ConnectToServerFails.cs b/test/Renci.SshNet.Tests/Classes/SessionTest_ConnectToServerFails.cs index c8947eee7..1b3f53dca 100644 --- a/test/Renci.SshNet.Tests/Classes/SessionTest_ConnectToServerFails.cs +++ b/test/Renci.SshNet.Tests/Classes/SessionTest_ConnectToServerFails.cs @@ -50,12 +50,6 @@ protected override void Act() } } - [TestMethod] - public void ClientVersionIsRenciSshNet() - { - Assert.AreEqual("SSH-2.0-Renci.SshNet.SshClient." + ThisAssembly.NuGetPackageVersion, _session.ClientVersion); - } - [TestMethod] public void ConnectionInfoShouldReturnConnectionInfoPassedThroughConstructor() { diff --git a/test/Renci.SshNet.Tests/Classes/SessionTest_NotConnected.cs b/test/Renci.SshNet.Tests/Classes/SessionTest_NotConnected.cs index d005defe2..f2f133bd0 100644 --- a/test/Renci.SshNet.Tests/Classes/SessionTest_NotConnected.cs +++ b/test/Renci.SshNet.Tests/Classes/SessionTest_NotConnected.cs @@ -26,12 +26,6 @@ protected override void Act() _session = new Session(_connectionInfo, ServiceFactoryMock.Object, SocketFactoryMock.Object); } - [TestMethod] - public void ClientVersionIsRenciSshNet() - { - Assert.AreEqual("SSH-2.0-Renci.SshNet.SshClient." + ThisAssembly.NuGetPackageVersion, _session.ClientVersion); - } - [TestMethod] public void ConnectionInfoShouldReturnConnectionInfoPassedThroughConstructor() {