diff options
author | Atsushi Eno <atsushieno@gmail.com> | 2006-09-21 18:10:41 +0400 |
---|---|---|
committer | Atsushi Eno <atsushieno@gmail.com> | 2006-09-21 18:10:41 +0400 |
commit | 8d2ce38aaea10e25b4dbd3bfef32ee58b1a3327d (patch) | |
tree | d09bf7d84016d9b47aa298fd8565817e4f3d6f35 /mcs/class/System.Security/Test | |
parent | 107a12767be8111bffeba70b913b885336db1d91 (diff) |
2006-09-21 Atsushi Enomoto <atsushi@ximian.com>
* EncryptedXml.cs :
Handle orthodox padding (xmlenc spec section 5.2). However, like
EncryptedXmlSample1, it might not exist, so make it optional.
* EncryptedXmlTest.cs, EncryptedXmlSample2.xml :
Added another case that expects correct padding processing which is
specified in W3C xmlenc spec section 5.2.
* Makefile:
Added Test/S.S.C.Xml/EncryptedXmlSample2.xml to EXTRA_DISTFILES.
svn path=/trunk/mcs/; revision=65766
Diffstat (limited to 'mcs/class/System.Security/Test')
3 files changed, 25 insertions, 0 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 90e06764948..be98805a944 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,11 @@ 2006-09-21 Atsushi Enomoto <atsushi@ximian.com> + * EncryptedXmlTest.cs, EncryptedXmlSample2.xml : + Added another case that expects correct padding processing which is + specified in W3C xmlenc spec section 5.2. + +2006-09-21 Atsushi Enomoto <atsushi@ximian.com> + * EncryptedXmlTest.cs : removed problematic culture change (was for debugging). diff --git a/mcs/class/System.Security/Test/System.Security.Cryptography.Xml/EncryptedXmlSample2.xml b/mcs/class/System.Security/Test/System.Security.Cryptography.Xml/EncryptedXmlSample2.xml new file mode 100644 index 00000000000..a5c04026a48 --- /dev/null +++ b/mcs/class/System.Security/Test/System.Security.Cryptography.Xml/EncryptedXmlSample2.xml @@ -0,0 +1 @@ +<?xml version="1.0" encoding="shift_jis"?><EncryptedData Type="http://www.w3.org/2001/04/xmlenc#Element" xmlns="http://www.w3.org/2001/04/xmlenc#"><EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes256-cbc" /><CipherData><CipherValue>pBUM5P03rZ6AE4ZK5EyBr2iA7eYSJuVHCFBPMoSToOAh3EZAC62WZunZyBJH72M4nWBibM5C3u/Oe1X2S5VmyQ==</CipherValue></CipherData></EncryptedData>
\ No newline at end of file diff --git a/mcs/class/System.Security/Test/System.Security.Cryptography.Xml/EncryptedXmlTest.cs b/mcs/class/System.Security/Test/System.Security.Cryptography.Xml/EncryptedXmlTest.cs index 2491ced50ec..50b7213d1f2 100644 --- a/mcs/class/System.Security/Test/System.Security.Cryptography.Xml/EncryptedXmlTest.cs +++ b/mcs/class/System.Security/Test/System.Security.Cryptography.Xml/EncryptedXmlTest.cs @@ -51,6 +51,24 @@ namespace MonoTests.System.Security.Cryptography.Xml encxml.ReplaceData (ed, encxml.DecryptData (edata, aes)); } } + + [Test] + public void Sample2 () + { + RijndaelManaged aes = new RijndaelManaged (); + aes.Mode = CipherMode.CBC; + aes.KeySize = 256; + aes.Key = Convert.FromBase64String ("o/ilseZu+keLBBWGGPlUHweqxIPc4gzZEFWr2nBt640="); + aes.Padding = PaddingMode.Zeros; + + XmlDocument doc = new XmlDocument (); + doc.PreserveWhitespace = true; + doc.Load ("Test/System.Security.Cryptography.Xml/EncryptedXmlSample2.xml"); + EncryptedXml encxml = new EncryptedXml (doc); + EncryptedData edata = new EncryptedData (); + edata.LoadXml (doc.DocumentElement); + encxml.ReplaceData (doc.DocumentElement, encxml.DecryptData (edata, aes)); + } } } #endif |