Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mac/776 dotnetcore issue #892

Closed
wants to merge 28 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
8ea1237
Merge remote-tracking branch 'refs/remotes/origin/develop'
drieseng Oct 15, 2017
0f08b85
Prepare for 2016.1.0 RTW.
drieseng Oct 15, 2017
fc114fb
Merge remote-tracking branch 'remotes/origin/develop'
drieseng May 3, 2020
23168f4
Merge remote-tracking branch 'remotes/origin/develop'
drieseng May 3, 2020
4583da5
Remove CWLs.
drieseng May 3, 2020
4eef090
Merge branch 'develop'
drieseng May 3, 2020
cca8255
Merge remote-tracking branch 'remotes/origin/develop'
drieseng Jun 1, 2020
66e24e7
Sponsoring (#691)
drieseng Jun 7, 2020
66cf838
Prepare for 2020.0.0-beta1
drieseng Jun 1, 2020
356b22a
Merge remote-tracking branch 'remotes/origin/develop'
drieseng Jun 7, 2020
61c09ff
Merge remote-tracking branch 'remotes/origin/develop'
drieseng Jun 7, 2020
d8fbae3
Update name of Sandcastle Help File Builder environment variable.
drieseng Jun 7, 2020
e9979a6
Merge remote-tracking branch 'remotes/origin/develop'
drieseng Jun 7, 2020
32f2615
Fix path to source file.
drieseng Jun 7, 2020
bf651ca
Remove local-use file.
drieseng Jun 7, 2020
9b21a46
Merge remote-tracking branch 'remotes/origin/develop'
drieseng Jun 7, 2020
1068694
Merge remote-tracking branch 'remotes/origin/develop'
drieseng Jun 7, 2020
5942469
Merge remote-tracking branch 'remotes/origin/develop'
drieseng Jun 7, 2020
84b9281
Merge branch 'develop'
drieseng Dec 30, 2020
8737fdb
Merge branch 'develop'
drieseng Dec 31, 2020
853ec99
Prepare for 2020.0.0 release.
drieseng Dec 31, 2020
2c99132
Merge branch 'develop'
drieseng Dec 31, 2020
f480937
Merge branch 'develop'
drieseng Dec 31, 2020
a06522c
Merge branch 'develop'
drieseng Jan 24, 2021
acda143
Prepare for 2020.0.1 release
drieseng Jan 24, 2021
5d8bced
Add specific .NET Core builds
Oct 20, 2021
ac7d339
remove .NET Framework 3.5 (way out of support) and fix packages for n…
Oct 25, 2021
428f1ed
remove remnants of .net35
Oct 25, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions build/build.proj
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,6 @@
</ItemGroup>

<ItemGroup>
<TargetFrameworkModern Include=".NET Framework 3.5">
<OutputDirectory>Renci.SshNet\bin\$(Configuration)\net35</OutputDirectory>
<Moniker>net35</Moniker>
</TargetFrameworkModern>
<TargetFrameworkModern Include=".NET Framework 4.0">
<OutputDirectory>Renci.SshNet\bin\$(Configuration)\net40</OutputDirectory>
<Moniker>net40</Moniker>
Expand All @@ -69,6 +65,14 @@
<OutputDirectory>Renci.SshNet\bin\$(Configuration)\netstandard2.0</OutputDirectory>
<Moniker>netstandard2.0</Moniker>
</TargetFrameworkModern>
<TargetFrameworkModern Include=".NET Core 3.1">
<OutputDirectory>Renci.SshNet\bin\$(Configuration)\netcoreapp3.1</OutputDirectory>
<Moniker>netcoreapp3.1</Moniker>
</TargetFrameworkModern>
<TargetFrameworkModern Include=".NET 5.0">
<OutputDirectory>Renci.SshNet\bin\$(Configuration)\net5.0</OutputDirectory>
<Moniker>netcoreapp3.1</Moniker>
</TargetFrameworkModern>
</ItemGroup>

<Target Name="CleanClassic" DependsOnTargets="CleanSolutionClassic">
Expand Down
7 changes: 6 additions & 1 deletion build/nuget/SSH.NET.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
<language>en-US</language>
<tags>ssh scp sftp</tags>
<dependencies>
<group targetFramework="net35" />
<group targetFramework="net40" />
<group targetFramework="netstandard1.3">
<dependency id="SshNet.Security.Cryptography" version="[1.3.0]" />
Expand All @@ -29,6 +28,12 @@
<dependency id="System.Xml.XmlDocument" version="4.3.0" />
<dependency id="System.Xml.XPath.XmlDocument" version="4.3.0" />
</group>
<group targetFramework="net5.0">
<dependency id="SshNet.Security.Cryptography" version="[1.3.0]" />
</group>
<group targetFramework="netcoreapp3.1">
<dependency id="SshNet.Security.Cryptography" version="[1.3.0]" />
</group>
<group targetFramework="netstandard2.0">
<dependency id="SshNet.Security.Cryptography" version="[1.3.0]" />
</group>
Expand Down
4 changes: 2 additions & 2 deletions src/Renci.SshNet.Tests/Classes/PrivateKeyFileTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ public void ConstructorWithFileNameAndPassphrase()
/// A test for <see cref="PrivateKeyFile(string, string)"/> ctor.
///</summary>
[TestMethod()]
public void ConstructorWithFileNameAndPassphraseShouldThrowSshPassPhraseNullOrEmptyExceptionWhenPrivateKeyIsEncryptedAndPassphraseIsEmpty()
public void ConstructorWithFileNameAndPassphraseShouldThrowSshPassPhraseNullOrEmptyExceptionWhenNeededPassphraseIsEmpty()
{
var passphrase = string.Empty;

Expand All @@ -460,7 +460,7 @@ public void ConstructorWithFileNameAndPassphraseShouldThrowSshPassPhraseNullOrEm
/// A test for <see cref="PrivateKeyFile(string, string)"/> ctor.
///</summary>
[TestMethod()]
public void ConstructorWithFileNameAndPassphraseShouldThrowSshPassPhraseNullOrEmptyExceptionWhenPrivateKeyIsEncryptedAndPassphraseIsNull()
public void ConstructorWithFileNameAndPassphraseShouldThrowSshPassPhraseNullOrEmptyExceptionWhenNeededPassphraseIsNull()
{
string passphrase = null;

Expand Down
35 changes: 24 additions & 11 deletions src/Renci.SshNet.Tests/Renci.SshNet.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,12 @@
</PropertyGroup>

<PropertyGroup Condition=" '$(VisualStudioVersion)' == '15.0' ">
<TargetFrameworks>net35;net40;netcoreapp2.1;netcoreapp2.2</TargetFrameworks>
<TargetFrameworks>net40;netcoreapp2.1;netcoreapp2.2</TargetFrameworks>
</PropertyGroup>
<PropertyGroup Condition=" '$(VisualStudioVersion)' == '16.0' ">
<TargetFrameworks>net35;net40;netcoreapp2.1;netcoreapp2.2;netcoreapp3.0</TargetFrameworks>
<TargetFrameworks>netcoreapp2.1;netcoreapp2.2;netcoreapp3.0;netcoreapp3.1;net5.0</TargetFrameworks>
</PropertyGroup>

<PropertyGroup Condition=" '$(TargetFramework)' == 'net35' ">
<DefineConstants></DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(TargetFramework)' == 'net40' ">
<DefineConstants>FEATURE_THREAD_COUNTDOWNEVENT;FEATURE_TPL</DefineConstants>
</PropertyGroup>
Expand All @@ -26,6 +23,12 @@
<PropertyGroup Condition=" '$(TargetFramework)' == 'netcoreapp3.0' ">
<DefineConstants>FEATURE_THREAD_COUNTDOWNEVENT;FEATURE_TPL</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(TargetFramework)' == 'netcoreapp3.1' ">
<DefineConstants>FEATURE_THREAD_COUNTDOWNEVENT;FEATURE_TPL</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(TargetFramework)' == 'net5.0' ">
<DefineConstants>FEATURE_THREAD_COUNTDOWNEVENT;FEATURE_TPL</DefineConstants>
</PropertyGroup>
<ItemGroup>
<EmbeddedResource Include="Data\Key.ECDSA.Encrypted.txt" />
<EmbeddedResource Include="Data\Key.ECDSA.txt" />
Expand Down Expand Up @@ -79,12 +82,6 @@
<MSTestV1UnitTestFrameworkAssembly Condition="'$(MSTestV1UnitTestFrameworkAssembly)' == '' and Exists('$(MSTestV1UnitTestFrameworkAssemblyCandidate)')">$(MSTestV1UnitTestFrameworkAssemblyCandidate)</MSTestV1UnitTestFrameworkAssembly>
</PropertyGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net35'">
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework">
<HintPath>$(MSTestV1UnitTestFrameworkAssembly)</HintPath>
</Reference>
<PackageReference Include="Moq" Version="4.2.1409.1722" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net40'">
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework">
<HintPath>$(MSTestV1UnitTestFrameworkAssembly)</HintPath>
Expand Down Expand Up @@ -115,6 +112,22 @@
</PackageReference>
<PackageReference Include="Moq" Version="4.13.1" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.1'">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.5.0" />
<PackageReference Include="MSTest.TestAdapter" Version="2.1.0" />
<PackageReference Include="MSTest.TestFramework">
<Version>2.1.0</Version>
</PackageReference>
<PackageReference Include="Moq" Version="4.13.1" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net5.0'">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.5.0" />
<PackageReference Include="MSTest.TestAdapter" Version="2.1.0" />
<PackageReference Include="MSTest.TestFramework">
<Version>2.1.0</Version>
</PackageReference>
<PackageReference Include="Moq" Version="4.13.1" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Renci.SshNet\Renci.SshNet.csproj" />
</ItemGroup>
Expand Down
8 changes: 4 additions & 4 deletions src/Renci.SshNet/Properties/CommonAssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
[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-2017")]
[assembly: AssemblyCopyright("Copyright � Renci 2010-2021")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

[assembly: AssemblyVersion("2017.0.0")]
[assembly: AssemblyFileVersion("2017.0.0")]
[assembly: AssemblyInformationalVersion("2017.0.0-beta1")]
[assembly: AssemblyVersion("2020.0.1")]
[assembly: AssemblyFileVersion("2020.0.1")]
[assembly: AssemblyInformationalVersion("2020.0.1")]
[assembly: CLSCompliant(false)]

// Setting ComVisible to false makes the types in this assembly not visible
Expand Down
9 changes: 3 additions & 6 deletions src/Renci.SshNet/Renci.SshNet.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<AssemblyOriginatorKeyFile>../Renci.SshNet.snk</AssemblyOriginatorKeyFile>
<LangVersion>5</LangVersion>
<SignAssembly>true</SignAssembly>
<TargetFrameworks>net35;net40;netstandard1.3;netstandard2.0</TargetFrameworks>
<TargetFrameworks>net40;netstandard1.3;netstandard2.0;netcoreapp3.1;net5.0</TargetFrameworks>
</PropertyGroup>

<!--
Expand All @@ -28,20 +28,17 @@
<PackageReference Include="System.Xml.XPath.XmlDocument" Version="4.3.0" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' or '$(TargetFramework)' == 'netstandard2.1' ">
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' or '$(TargetFramework)' == 'netstandard2.1' or '$(TargetFramework)' == 'netcoreapp3.1' or '$(TargetFramework)' == 'net5.0' ">
<PackageReference Include="SshNet.Security.Cryptography" Version="[1.3.0]" />
</ItemGroup>

<PropertyGroup Condition=" '$(TargetFramework)' == 'net35' ">
<DefineConstants>FEATURE_REGEX_COMPILE;FEATURE_BINARY_SERIALIZATION;FEATURE_RNG_CREATE;FEATURE_SOCKET_SYNC;FEATURE_SOCKET_EAP;FEATURE_SOCKET_APM;FEATURE_SOCKET_POLL;FEATURE_STREAM_APM;FEATURE_DNS_SYNC;FEATURE_THREAD_THREADPOOL;FEATURE_THREAD_SLEEP;FEATURE_HASH_MD5;FEATURE_HASH_SHA1_CREATE;FEATURE_HASH_SHA256_CREATE;FEATURE_HASH_SHA384_CREATE;FEATURE_HASH_SHA512_CREATE;FEATURE_HASH_RIPEMD160_CREATE;FEATURE_HMAC_MD5;FEATURE_HMAC_SHA1;FEATURE_HMAC_SHA256;FEATURE_HMAC_SHA384;FEATURE_HMAC_SHA512;FEATURE_HMAC_RIPEMD160;FEATURE_MEMORYSTREAM_GETBUFFER;FEATURE_DIAGNOSTICS_TRACESOURCE;FEATURE_ENCODING_ASCII;FEATURE_ECDSA</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(TargetFramework)' == 'net40' ">
<DefineConstants>FEATURE_STRINGBUILDER_CLEAR;FEATURE_HASHALGORITHM_DISPOSE;FEATURE_REGEX_COMPILE;FEATURE_BINARY_SERIALIZATION;FEATURE_RNG_CREATE;FEATURE_SOCKET_SYNC;FEATURE_SOCKET_EAP;FEATURE_SOCKET_APM;FEATURE_SOCKET_SELECT;FEATURE_SOCKET_POLL;FEATURE_SOCKET_DISPOSE;FEATURE_STREAM_APM;FEATURE_DNS_SYNC;FEATURE_THREAD_COUNTDOWNEVENT;FEATURE_THREAD_THREADPOOL;FEATURE_THREAD_SLEEP;FEATURE_WAITHANDLE_DISPOSE;FEATURE_HASH_MD5;FEATURE_HASH_SHA1_CREATE;FEATURE_HASH_SHA256_CREATE;FEATURE_HASH_SHA384_CREATE;FEATURE_HASH_SHA512_CREATE;FEATURE_HASH_RIPEMD160_CREATE;FEATURE_HMAC_MD5;FEATURE_HMAC_SHA1;FEATURE_HMAC_SHA256;FEATURE_HMAC_SHA384;FEATURE_HMAC_SHA512;FEATURE_HMAC_RIPEMD160;FEATURE_MEMORYSTREAM_GETBUFFER;FEATURE_DIAGNOSTICS_TRACESOURCE;FEATURE_ENCODING_ASCII;FEATURE_ECDSA</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard1.3' ">
<DefineConstants>FEATURE_STRINGBUILDER_CLEAR;FEATURE_HASHALGORITHM_DISPOSE;FEATURE_ENCODING_ASCII;FEATURE_DIAGNOSTICS_TRACESOURCE;FEATURE_DIRECTORYINFO_ENUMERATEFILES;FEATURE_MEMORYSTREAM_TRYGETBUFFER;FEATURE_REFLECTION_TYPEINFO;FEATURE_RNG_CREATE;FEATURE_SOCKET_TAP;FEATURE_SOCKET_EAP;FEATURE_SOCKET_SYNC;FEATURE_SOCKET_SELECT;FEATURE_SOCKET_POLL;FEATURE_SOCKET_DISPOSE;FEATURE_DNS_TAP;FEATURE_STREAM_TAP;FEATURE_THREAD_COUNTDOWNEVENT;FEATURE_THREAD_TAP;FEATURE_THREAD_THREADPOOL;FEATURE_THREAD_SLEEP;FEATURE_WAITHANDLE_DISPOSE;FEATURE_HASH_MD5;FEATURE_HASH_SHA1_CREATE;FEATURE_HASH_SHA256_CREATE;FEATURE_HASH_SHA384_CREATE;FEATURE_HASH_SHA512_CREATE;FEATURE_HMAC_MD5;FEATURE_HMAC_SHA1;FEATURE_HMAC_SHA256;FEATURE_HMAC_SHA384;FEATURE_HMAC_SHA512</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' or '$(TargetFramework)' == 'netstandard2.1' ">
<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' or '$(TargetFramework)' == 'netstandard2.1' or '$(TargetFramework)' == 'netcoreapp3.1' or '$(TargetFramework)' == 'net5.0' ">
<DefineConstants>FEATURE_STRINGBUILDER_CLEAR;FEATURE_HASHALGORITHM_DISPOSE;FEATURE_ENCODING_ASCII;FEATURE_DIAGNOSTICS_TRACESOURCE;FEATURE_DIRECTORYINFO_ENUMERATEFILES;FEATURE_MEMORYSTREAM_GETBUFFER;FEATURE_MEMORYSTREAM_TRYGETBUFFER;FEATURE_RNG_CREATE;FEATURE_SOCKET_TAP;FEATURE_SOCKET_APM;FEATURE_SOCKET_EAP;FEATURE_SOCKET_SYNC;FEATURE_SOCKET_SELECT;FEATURE_SOCKET_POLL;FEATURE_SOCKET_DISPOSE;FEATURE_DNS_SYNC;FEATURE_DNS_APM;FEATURE_DNS_TAP;FEATURE_STREAM_APM;FEATURE_STREAM_TAP;FEATURE_THREAD_COUNTDOWNEVENT;FEATURE_THREAD_TAP;FEATURE_THREAD_THREADPOOL;FEATURE_THREAD_SLEEP;FEATURE_WAITHANDLE_DISPOSE;FEATURE_HASH_MD5;FEATURE_HASH_SHA1_CREATE;FEATURE_HASH_SHA256_CREATE;FEATURE_HASH_SHA384_CREATE;FEATURE_HASH_SHA512_CREATE;FEATURE_HMAC_MD5;FEATURE_HMAC_SHA1;FEATURE_HMAC_SHA256;FEATURE_HMAC_SHA384;FEATURE_HMAC_SHA512;FEATURE_ECDSA</DefineConstants>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public override bool Verify(byte[] input, byte[] signature)
// for 521 sig_size is 132
var sig_size = _key.KeyLength == 521 ? 132 : _key.KeyLength / 4;
var ssh_data = new SshDataSignature(signature, sig_size);
#if NETSTANDARD2_0
#if (NETSTANDARD2_0 || NETCOREAPP3_1 || NET5_0)
return _key.Ecdsa.VerifyData(input, ssh_data.Signature, _key.HashAlgorithm);
#else
var ecdsa = (ECDsaCng)_key.Ecdsa;
Expand All @@ -57,7 +57,7 @@ public override bool Verify(byte[] input, byte[] signature)
/// </returns>
public override byte[] Sign(byte[] input)
{
#if NETSTANDARD2_0
#if (NETSTANDARD2_0 || NETCOREAPP3_1 || NET5_0)
var signed = _key.Ecdsa.SignData(input, _key.HashAlgorithm);
#else
var ecdsa = (ECDsaCng)_key.Ecdsa;
Expand Down
8 changes: 4 additions & 4 deletions src/Renci.SshNet/Security/Cryptography/EcdsaKey.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class EcdsaKey : Key, IDisposable
internal const string ECDSA_P384_OID_VALUE = "1.3.132.0.34"; // Also called nistP384 or secP384r1
internal const string ECDSA_P521_OID_VALUE = "1.3.132.0.35"; // Also called nistP521or secP521r1

#if !NETSTANDARD2_0
#if !(NETSTANDARD2_0 || NETCOREAPP3_1 || NET5_0 || NET5_0)
internal enum KeyBlobMagicNumber : int
{
BCRYPT_ECDSA_PUBLIC_P256_MAGIC = 0x31534345,
Expand Down Expand Up @@ -57,7 +57,7 @@ public override string ToString()
return string.Format("ecdsa-sha2-nistp{0}", KeyLength);
}

#if NETSTANDARD2_0
#if (NETSTANDARD2_0 || NETCOREAPP3_1 || NET5_0)
/// <summary>
/// Gets the HashAlgorithm to use
/// </summary>
Expand Down Expand Up @@ -144,7 +144,7 @@ public override BigInteger[] Public
byte[] curve;
byte[] qx;
byte[] qy;
#if NETSTANDARD2_0
#if (NETSTANDARD2_0 || NETCOREAPP3_1 || NET5_0)
var parameter = Ecdsa.ExportParameters(false);
qx = parameter.Q.X;
qy = parameter.Q.Y;
Expand Down Expand Up @@ -278,7 +278,7 @@ public EcdsaKey(byte[] data)

private void Import(string curve_oid, byte[] publickey, byte[] privatekey)
{
#if NETSTANDARD2_0
#if (NETSTANDARD2_0 || NETCOREAPP3_1 || NET5_0)
var curve = ECCurve.CreateFromValue(curve_oid);
var parameter = new ECParameters
{
Expand Down