Skip to content

Commit 048a02c

Browse files
committed
Enable netstandard2.1 build
FEATURE_ECDSA catches netstandard1.3, which doesnt have ECDSA Support. So enable it for all other netstandard versions.
1 parent 638504d commit 048a02c

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public override bool Verify(byte[] input, byte[] signature)
3939
// for 521 sig_size is 132
4040
var sig_size = _key.KeyLength == 521 ? 132 : _key.KeyLength / 4;
4141
var ssh_data = new SshDataSignature(signature, sig_size);
42-
#if NETSTANDARD2_0
42+
#if NETSTANDARD
4343
return _key.Ecdsa.VerifyData(input, ssh_data.Signature, _key.HashAlgorithm);
4444
#else
4545
var ecdsa = (ECDsaCng)_key.Ecdsa;
@@ -57,7 +57,7 @@ public override bool Verify(byte[] input, byte[] signature)
5757
/// </returns>
5858
public override byte[] Sign(byte[] input)
5959
{
60-
#if NETSTANDARD2_0
60+
#if NETSTANDARD
6161
var signed = _key.Ecdsa.SignData(input, _key.HashAlgorithm);
6262
#else
6363
var ecdsa = (ECDsaCng)_key.Ecdsa;

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

+4-4
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public class EcdsaKey : Key, IDisposable
1818
internal const string ECDSA_P384_OID_VALUE = "1.3.132.0.34"; // Also called nistP384 or secP384r1
1919
internal const string ECDSA_P521_OID_VALUE = "1.3.132.0.35"; // Also called nistP521or secP521r1
2020

21-
#if !NETSTANDARD2_0
21+
#if !NETSTANDARD
2222
internal enum KeyBlobMagicNumber : int
2323
{
2424
BCRYPT_ECDSA_PUBLIC_P256_MAGIC = 0x31534345,
@@ -57,7 +57,7 @@ public override string ToString()
5757
return string.Format("ecdsa-sha2-nistp{0}", KeyLength);
5858
}
5959

60-
#if NETSTANDARD2_0
60+
#if NETSTANDARD
6161
/// <summary>
6262
/// Gets the HashAlgorithm to use
6363
/// </summary>
@@ -144,7 +144,7 @@ public override BigInteger[] Public
144144
byte[] curve;
145145
byte[] qx;
146146
byte[] qy;
147-
#if NETSTANDARD2_0
147+
#if NETSTANDARD
148148
var parameter = Ecdsa.ExportParameters(false);
149149
qx = parameter.Q.X;
150150
qy = parameter.Q.Y;
@@ -283,7 +283,7 @@ public EcdsaKey(byte[] data)
283283

284284
private void Import(string curve_oid, byte[] publickey, byte[] privatekey)
285285
{
286-
#if NETSTANDARD2_0
286+
#if NETSTANDARD
287287
var curve = ECCurve.CreateFromValue(curve_oid);
288288
var parameter = new ECParameters
289289
{

0 commit comments

Comments
 (0)