Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/corefx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Barton <jbarton@microsoft.com>2017-05-02 18:29:23 +0300
committerGitHub <noreply@github.com>2017-05-02 18:29:23 +0300
commit41b6a68a43f64217996489d4770c4024413a5957 (patch)
treef7164a3b361675d8af95e523f4adb2f25477ad19 /src/System.Security.Cryptography.Algorithms
parent94d80a0329742d759e9e3e9b6fa6e217eac075e0 (diff)
Make ECDsa.Create(ECCurve(.IsExplicit)) work on Windows. (#19208)
ECDsa.Create(ECCurve) had a check which rightly belonged in GenerateKey behind an IsNamed check. Moved that check to where it belonged, and added an Explicit (PrimeShortWeierstrass) test to the big create matrix. Adding the test resulted in debugging several tests which were assuming IsNamed. The extra debugging data seemed generally applicable, so it remains.
Diffstat (limited to 'src/System.Security.Cryptography.Algorithms')
-rw-r--r--src/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/ECDsaCng.Key.cs3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/ECDsaCng.Key.cs b/src/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/ECDsaCng.Key.cs
index 2f99f0e77a..6c5ffbae85 100644
--- a/src/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/ECDsaCng.Key.cs
+++ b/src/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/ECDsaCng.Key.cs
@@ -82,6 +82,9 @@ namespace System.Security.Cryptography
if (curve.IsNamed)
{
+ if (string.IsNullOrEmpty(curve.Oid.FriendlyName))
+ throw new PlatformNotSupportedException(string.Format(SR.Cryptography_InvalidCurveOid, curve.Oid.Value));
+
// Map curve name to algorithm to support pre-Win10 curves
algorithm = ECCng.EcdsaCurveNameToAlgorithm(curve.Oid.FriendlyName);
if (IsECNamedCurve(algorithm))