diff options
author | Atsushi Eno <atsushieno@gmail.com> | 2007-01-23 20:45:35 +0300 |
---|---|---|
committer | Atsushi Eno <atsushieno@gmail.com> | 2007-01-23 20:45:35 +0300 |
commit | f237dd4a61c41c692ae1ae4bb0040c2d26b9983b (patch) | |
tree | cee522deb64ca6e39d0007925658892d91e0dee5 /mcs/class/System.Security/Test | |
parent | 34dc209f21b08693acf11cbe222f76cf6b6c461a (diff) |
2007-01-23 Atsushi Enomoto <atsushi@ximian.com>
* SignedXmlTest.cs : fixed ambiguous variable name in previous tests.
svn path=/trunk/mcs/; revision=71530
Diffstat (limited to 'mcs/class/System.Security/Test')
-rw-r--r-- | mcs/class/System.Security/Test/System.Security.Cryptography.Xml/ChangeLog | 4 | ||||
-rw-r--r-- | mcs/class/System.Security/Test/System.Security.Cryptography.Xml/SignedXmlTest.cs | 10 |
2 files changed, 9 insertions, 5 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 187042f2cac..abe47ca9bde 100644 --- a/mcs/class/System.Security/Test/System.Security.Cryptography.Xml/ChangeLog +++ b/mcs/class/System.Security/Test/System.Security.Cryptography.Xml/ChangeLog @@ -1,5 +1,9 @@ 2007-01-23 Atsushi Enomoto <atsushi@ximian.com> + * SignedXmlTest.cs : fixed ambiguous variable name in previous tests. + +2007-01-23 Atsushi Enomoto <atsushi@ximian.com> + * SignedXmlTest.cs : run the transformation in yesterday's test twice. 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 9ad25050cf4..6c5d66dfde6 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 @@ -544,12 +544,12 @@ namespace MonoTests.System.Security.Cryptography.Xml { string input = "<Action xmlns='urn:foo'>http://tempuri.org/IFoo/Echo</Action>"; string expected = @"<Signature xmlns=""http://www.w3.org/2000/09/xmldsig#""><SignedInfo><CanonicalizationMethod Algorithm=""http://www.w3.org/TR/2001/REC-xml-c14n-20010315"" /><SignatureMethod Algorithm=""http://www.w3.org/2000/09/xmldsig#hmac-sha1"" /><Reference URI=""#_1""><Transforms><Transform Algorithm=""http://www.w3.org/TR/2001/REC-xml-c14n-20010315"" /></Transforms><DigestMethod Algorithm=""http://www.w3.org/2000/09/xmldsig#sha1"" /><DigestValue>zdFEZB8rNzvpNG/gFEJBWk/M5Nk=</DigestValue></Reference></SignedInfo><SignatureValue>+OyGVzrHjmKSDWLNyvgx8pjbPfM=</SignatureValue><Object Id=""_1""><Action xmlns=""urn:foo"">http://tempuri.org/IFoo/Echo</Action></Object></Signature>"; - byte [] decrypted = Convert.FromBase64String ( + byte [] key = Convert.FromBase64String ( "1W5EigVnbnRjGLbg99ElieOmuUgYO+KcwMJtE35SAGI="); Transform t = new XmlDsigC14NTransform (); - AssertEquals ("#1", expected, SignWithHMACSHA1 (input, decrypted, t)); + AssertEquals ("#1", expected, SignWithHMACSHA1 (input, key, t)); // The second result should be still identical. - AssertEquals ("#2", expected, SignWithHMACSHA1 (input, decrypted, t)); + AssertEquals ("#2", expected, SignWithHMACSHA1 (input, key, t)); } [Test] @@ -559,9 +559,9 @@ namespace MonoTests.System.Security.Cryptography.Xml { string input = "<a:Action xmlns:a='urn:foo'>http://tempuri.org/IFoo/Echo</a:Action>"; string expected = @"<Signature xmlns=""http://www.w3.org/2000/09/xmldsig#""><SignedInfo><CanonicalizationMethod Algorithm=""http://www.w3.org/TR/2001/REC-xml-c14n-20010315"" /><SignatureMethod Algorithm=""http://www.w3.org/2000/09/xmldsig#hmac-sha1"" /><Reference URI=""#_1""><Transforms><Transform Algorithm=""http://www.w3.org/TR/2001/REC-xml-c14n-20010315"" /></Transforms><DigestMethod Algorithm=""http://www.w3.org/2000/09/xmldsig#sha1"" /><DigestValue>6i5FlqkEfJOdUaOMCK7xn0I0HDg=</DigestValue></Reference></SignedInfo><SignatureValue>tASp+e2A0xqcm02jKg5TGqlhKpI=</SignatureValue><Object Id=""_1""><a:Action xmlns:a=""urn:foo"">http://tempuri.org/IFoo/Echo</a:Action></Object></Signature>"; - byte [] decrypted = Convert.FromBase64String ( + byte [] key = Convert.FromBase64String ( "1W5EigVnbnRjGLbg99ElieOmuUgYO+KcwMJtE35SAGI="); - AssertEquals (expected, SignWithHMACSHA1 (input, decrypted)); + AssertEquals (expected, SignWithHMACSHA1 (input, key)); } string SignWithHMACSHA1 (string input, byte [] key) |