Author: atsushi
Date: 2007-01-12 05:24:09 -0500 (Fri, 12 Jan 2007)
New Revision: 70909

Modified:
   trunk/mcs/class/System.Security/System.Security.Cryptography.Xml/ChangeLog
   trunk/mcs/class/System.Security/System.Security.Cryptography.Xml/SignedXml.cs
   
trunk/mcs/class/System.Security/Test/System.Security.Cryptography.Xml/ChangeLog
   
trunk/mcs/class/System.Security/Test/System.Security.Cryptography.Xml/SignedXmlTest.cs
Log:
2007-01-12  Atsushi Enomoto  <[EMAIL PROTECTED]>

        * SignedXml.cs : ComputeSignature() should check empty key.

        * SignedXmlTest.cs : added ComputeSignatureNoSigningKey().



Modified: 
trunk/mcs/class/System.Security/System.Security.Cryptography.Xml/ChangeLog
===================================================================
--- trunk/mcs/class/System.Security/System.Security.Cryptography.Xml/ChangeLog  
2007-01-12 09:59:34 UTC (rev 70908)
+++ trunk/mcs/class/System.Security/System.Security.Cryptography.Xml/ChangeLog  
2007-01-12 10:24:09 UTC (rev 70909)
@@ -1,3 +1,7 @@
+2007-01-12  Atsushi Enomoto  <[EMAIL PROTECTED]>
+
+       * SignedXml.cs : ComputeSignature() should check empty key.
+
 2006-10-11  Atsushi Enomoto  <[EMAIL PROTECTED]>
 
        * SignedXml.cs : when SigningMethod does not match the algorithm that

Modified: 
trunk/mcs/class/System.Security/System.Security.Cryptography.Xml/SignedXml.cs
===================================================================
--- 
trunk/mcs/class/System.Security/System.Security.Cryptography.Xml/SignedXml.cs   
    2007-01-12 09:59:34 UTC (rev 70908)
+++ 
trunk/mcs/class/System.Security/System.Security.Cryptography.Xml/SignedXml.cs   
    2007-01-12 10:24:09 UTC (rev 70909)
@@ -648,6 +648,12 @@
                                        m_signature.SignatureValue = 
signer.CreateSignature (digest);
                                }
                        }
+                       else
+#if NET_2_0 // correct
+                               throw new CryptographicException ("signing key 
is not specified");
+#else // silly
+                               throw new ArgumentNullException ("signing key 
is not specified");
+#endif
                }
 
                public void ComputeSignature (KeyedHashAlgorithm macAlg) 

Modified: 
trunk/mcs/class/System.Security/Test/System.Security.Cryptography.Xml/ChangeLog
===================================================================
--- 
trunk/mcs/class/System.Security/Test/System.Security.Cryptography.Xml/ChangeLog 
    2007-01-12 09:59:34 UTC (rev 70908)
+++ 
trunk/mcs/class/System.Security/Test/System.Security.Cryptography.Xml/ChangeLog 
    2007-01-12 10:24:09 UTC (rev 70909)
@@ -1,3 +1,7 @@
+2007-01-12  Atsushi Enomoto  <[EMAIL PROTECTED]>
+
+       * SignedXmlTest.cs : added ComputeSignatureNoSigningKey().
+
 2006-11-01  Atsushi Enomoto  <[EMAIL PROTECTED]>
 
        * SignedXmlTest.cs : added Ignore for failing wrong test by design.

Modified: 
trunk/mcs/class/System.Security/Test/System.Security.Cryptography.Xml/SignedXmlTest.cs
===================================================================
--- 
trunk/mcs/class/System.Security/Test/System.Security.Cryptography.Xml/SignedXmlTest.cs
      2007-01-12 09:59:34 UTC (rev 70908)
+++ 
trunk/mcs/class/System.Security/Test/System.Security.Cryptography.Xml/SignedXmlTest.cs
      2007-01-12 10:24:09 UTC (rev 70909)
@@ -481,7 +481,27 @@
                        Assert (!sx.CheckSignature ());
                }
 
+               [Test]
 #if NET_2_0
+               [ExpectedException (typeof (CryptographicException))] // correct
+#else
+               [ExpectedException (typeof (ArgumentNullException))] // silly
+#endif
+               public void ComputeSignatureNoSigningKey ()
+               {
+                       SignedXml signedXml = new SignedXml (new XmlDocument 
());
+
+                       Reference reference = new Reference ();
+                       reference.Uri = "";
+
+                       XmlDsigEnvelopedSignatureTransform env = new 
XmlDsigEnvelopedSignatureTransform ();
+                       reference.AddTransform (env);
+                       signedXml.AddReference (reference);
+
+                       signedXml.ComputeSignature ();
+               }
+
+#if NET_2_0
                [Test]
                [Category ("NotWorking")] // bug #79483
                public void DigestValue_CRLF ()

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to