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

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAtsushi Eno <atsushieno@gmail.com>2007-01-23 20:40:38 +0300
committerAtsushi Eno <atsushieno@gmail.com>2007-01-23 20:40:38 +0300
commit34dc209f21b08693acf11cbe222f76cf6b6c461a (patch)
treeee0678d8815a80570cc7c8e8f466aa3657a63d3b /mcs/class/System.Security/Test
parent5fb5a4687d9c0b1f83aeb51d06407a6d75e9692e (diff)
2007-01-23 Atsushi Enomoto <atsushi@ximian.com>
* XmlCanonicalizer.cs : it should be reset before being reused. * SignedXmlTest.cs : run the transformation in yesterday's test twice. svn path=/trunk/mcs/; revision=71529
Diffstat (limited to 'mcs/class/System.Security/Test')
-rw-r--r--mcs/class/System.Security/Test/System.Security.Cryptography.Xml/ChangeLog5
-rw-r--r--mcs/class/System.Security/Test/System.Security.Cryptography.Xml/SignedXmlTest.cs13
2 files changed, 15 insertions, 3 deletions
diff --git a/mcs/class/System.Security/Test/System.Security.Cryptography.Xml/ChangeLog b/mcs/class/System.Security/Test/System.Security.Cryptography.Xml/ChangeLog
index dd7279ce4f8..187042f2cac 100644
--- a/mcs/class/System.Security/Test/System.Security.Cryptography.Xml/ChangeLog
+++ b/mcs/class/System.Security/Test/System.Security.Cryptography.Xml/ChangeLog
@@ -1,3 +1,8 @@
+2007-01-23 Atsushi Enomoto <atsushi@ximian.com>
+
+ * SignedXmlTest.cs :
+ run the transformation in yesterday's test twice.
+
2007-01-22 Atsushi Enomoto <atsushi@ximian.com>
* XmlDsigExcC14NTransformTest.cs, XmlDsigC14NTransformTest.cs,
diff --git a/mcs/class/System.Security/Test/System.Security.Cryptography.Xml/SignedXmlTest.cs b/mcs/class/System.Security/Test/System.Security.Cryptography.Xml/SignedXmlTest.cs
index 8939a4cbe14..9ad25050cf4 100644
--- a/mcs/class/System.Security/Test/System.Security.Cryptography.Xml/SignedXmlTest.cs
+++ b/mcs/class/System.Security/Test/System.Security.Cryptography.Xml/SignedXmlTest.cs
@@ -546,7 +546,10 @@ namespace MonoTests.System.Security.Cryptography.Xml {
byte [] decrypted = Convert.FromBase64String (
"1W5EigVnbnRjGLbg99ElieOmuUgYO+KcwMJtE35SAGI=");
- AssertEquals (expected, SignWithHMACSHA1 (input, decrypted));
+ Transform t = new XmlDsigC14NTransform ();
+ AssertEquals ("#1", expected, SignWithHMACSHA1 (input, decrypted, t));
+ // The second result should be still identical.
+ AssertEquals ("#2", expected, SignWithHMACSHA1 (input, decrypted, t));
}
[Test]
@@ -563,6 +566,11 @@ namespace MonoTests.System.Security.Cryptography.Xml {
string SignWithHMACSHA1 (string input, byte [] key)
{
+ return SignWithHMACSHA1 (input, key, new XmlDsigC14NTransform ());
+ }
+
+ string SignWithHMACSHA1 (string input, byte [] key, Transform transform)
+ {
XmlDocument doc = new XmlDocument ();
doc.LoadXml (input);
SignedXml sxml = new SignedXml (doc);
@@ -574,8 +582,7 @@ namespace MonoTests.System.Security.Cryptography.Xml {
d.Id = "_1";
sxml.AddObject (d);
Reference r = new Reference ("#_1");
- //r.AddTransform (new XmlDsigExcC14NTransform ());
- r.AddTransform (new XmlDsigC14NTransform ());
+ r.AddTransform (transform);
r.DigestMethod = SignedXml.XmlDsigSHA1Url;
sxml.SignedInfo.AddReference (r);
sxml.ComputeSignature (keyhash);