Skip to content

Commit 1ebd2ed

Browse files
committed
Add net47 target framework
1 parent 944f1ff commit 1ebd2ed

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

src/Renci.SshNet/Common/SshDataStream.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public bool IsEndOfData
5656
}
5757
}
5858

59-
#if NET462 || NETSTANDARD2_0
59+
#if NETFRAMEWORK || NETSTANDARD2_0
6060
private int Read(Span<byte> buffer)
6161
{
6262
var sharedBuffer = System.Buffers.ArrayPool<byte>.Shared.Rent(buffer.Length);

src/Renci.SshNet/Renci.SshNet.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<AssemblyName>Renci.SshNet</AssemblyName>
55
<Product>SSH.NET</Product>
66
<AssemblyTitle>SSH.NET</AssemblyTitle>
7-
<TargetFrameworks>net462;netstandard2.0;netstandard2.1;net6.0;net7.0;net8.0</TargetFrameworks>
7+
<TargetFrameworks>net462;net47;netstandard2.0;netstandard2.1;net6.0;net7.0;net8.0</TargetFrameworks>
88
</PropertyGroup>
99

1010
<PropertyGroup>
@@ -34,7 +34,7 @@
3434
<IsAotCompatible>true</IsAotCompatible>
3535
</PropertyGroup>
3636

37-
<ItemGroup Condition=" '$(TargetFramework)' == 'net462' or '$(TargetFramework)' == 'netstandard2.0' ">
37+
<ItemGroup Condition=" '$(TargetFramework)' == 'net462' or '$(TargetFramework)' == 'net47' or '$(TargetFramework)' == 'netstandard2.0' ">
3838
<!-- Must be kept at version 1.0.0 or higher, see https://github.com/sshnet/SSH.NET/pull/1288 for details. -->
3939
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="[1.0.0,)" />
4040
<PackageReference Include="System.Memory" Version="4.5.5" />

src/Renci.SshNet/Security/Cryptography/EcdsaDigitalSignature.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public override bool Verify(byte[] input, byte[] signature)
4141
// for 521 sig_size is 132
4242
var sig_size = _key.KeyLength == 521 ? 132 : _key.KeyLength / 4;
4343
var ssh_data = new SshDataSignature(signature, sig_size);
44-
#if NETFRAMEWORK
44+
#if NETFRAMEWORK && !NET47_OR_GREATER
4545
var ecdsa = _key.Ecdsa;
4646
ecdsa.HashAlgorithm = _key.HashAlgorithm;
4747
return ecdsa.VerifyData(input, ssh_data.Signature);
@@ -59,7 +59,7 @@ public override bool Verify(byte[] input, byte[] signature)
5959
/// </returns>
6060
public override byte[] Sign(byte[] input)
6161
{
62-
#if NETFRAMEWORK
62+
#if NETFRAMEWORK && !NET47_OR_GREATER
6363
var ecdsa = _key.Ecdsa;
6464
ecdsa.HashAlgorithm = _key.HashAlgorithm;
6565
var signed = ecdsa.SignData(input);

src/Renci.SshNet/Security/Cryptography/EcdsaKey.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
using System;
2-
#if NETFRAMEWORK
2+
#if NETFRAMEWORK && !NET47_OR_GREATER
33
using System.Globalization;
44
using System.IO;
55
using System.Runtime.InteropServices;
6-
#endif // NETFRAMEWORK
6+
#endif
77
using System.Security.Cryptography;
88
using System.Text;
99

@@ -26,7 +26,7 @@ public class EcdsaKey : Key, IDisposable
2626
private EcdsaDigitalSignature _digitalSignature;
2727
private bool _isDisposed;
2828

29-
#if NETFRAMEWORK
29+
#if NETFRAMEWORK && !NET47_OR_GREATER
3030
private CngKey _key;
3131

3232
internal enum KeyBlobMagicNumber
@@ -68,7 +68,7 @@ public override string ToString()
6868
return string.Format("ecdsa-sha2-nistp{0}", KeyLength);
6969
}
7070

71-
#if NETFRAMEWORK
71+
#if NETFRAMEWORK && !NET47_OR_GREATER
7272
/// <summary>
7373
/// Gets the HashAlgorithm to use.
7474
/// </summary>
@@ -153,7 +153,7 @@ public override BigInteger[] Public
153153
byte[] curve;
154154
byte[] qx;
155155
byte[] qy;
156-
#if NETFRAMEWORK
156+
#if NETFRAMEWORK && !NET47_OR_GREATER
157157
var blob = _key.Export(CngKeyBlobFormat.EccPublicBlob);
158158

159159
KeyBlobMagicNumber magic;
@@ -221,7 +221,7 @@ public override BigInteger[] Public
221221
/// </summary>
222222
public byte[] PrivateKey { get; private set; }
223223

224-
#if NETFRAMEWORK
224+
#if NETFRAMEWORK && !NET47_OR_GREATER
225225
/// <summary>
226226
/// Gets the <see cref="ECDsa"/> object.
227227
/// </summary>
@@ -322,7 +322,7 @@ public EcdsaKey(byte[] data)
322322

323323
private void Import(string curve_oid, byte[] publickey, byte[] privatekey)
324324
{
325-
#if NETFRAMEWORK
325+
#if NETFRAMEWORK && !NET47_OR_GREATER
326326
KeyBlobMagicNumber curve_magic;
327327

328328
switch (GetCurveName(curve_oid))
@@ -444,7 +444,7 @@ private static string GetCurveOid(string curve_s)
444444
}
445445
}
446446

447-
#if NETFRAMEWORK
447+
#if NETFRAMEWORK && !NET47_OR_GREATER
448448
private static string GetCurveName(string oid)
449449
{
450450
switch (oid)
@@ -459,7 +459,7 @@ private static string GetCurveName(string oid)
459459
throw new SshException("Unexpected OID: " + oid);
460460
}
461461
}
462-
#endif // NETFRAMEWORK
462+
#endif
463463

464464
private static string OidByteArrayToString(byte[] oid)
465465
{

0 commit comments

Comments
 (0)