Make DSAKeyValueTests.LoadXml accept seed/counter may not roundtrip. (#38952)
authorJeremy Barton <jbarton@microsoft.com>
Thu, 9 Jul 2020 20:27:24 +0000 (13:27 -0700)
committerGitHub <noreply@github.com>
Thu, 9 Jul 2020 20:27:24 +0000 (16:27 -0400)
src/libraries/System.Security.Cryptography.Xml/tests/DSAKeyValueTest.cs

index e7eea144b54d238547090d74ac5a8078c4610a97..b0c6ebd780eb8b3327d26ccb2a6a17fbd76126ad 100644 (file)
@@ -89,7 +89,6 @@ namespace System.Security.Cryptography.Xml.Tests
             }
         }
 
-        [ActiveIssue("https://github.com/dotnet/runtime/issues/34786", TestPlatforms.AnyUnix)]
         [Fact]
         public void LoadXml()
         {
@@ -112,9 +111,14 @@ namespace System.Security.Cryptography.Xml.Tests
             Assert.Equal(Convert.ToBase64String(parameters.Q), qValue);
             Assert.Equal(Convert.ToBase64String(parameters.G), gValue);
             Assert.Equal(Convert.ToBase64String(parameters.Y), yValue);
-            Assert.NotNull(parameters.Seed);
-            Assert.Equal(Convert.ToBase64String(parameters.Seed), seedValue);
-            Assert.Equal(BitConverter.GetBytes(parameters.Counter)[0], Convert.FromBase64String(pgenCounterValue)[0]);
+
+            // Not all providers support round-tripping the seed value.
+            // Seed and PGenCounter are round-tripped together.
+            if (parameters.Seed != null)
+            {
+                Assert.Equal(Convert.ToBase64String(parameters.Seed), seedValue);
+                Assert.Equal(BitConverter.GetBytes(parameters.Counter)[0], Convert.FromBase64String(pgenCounterValue)[0]);
+            }
         }
 
         [Fact]