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-12 13:51:17 +0300
committerAtsushi Eno <atsushieno@gmail.com>2007-01-12 13:51:17 +0300
commit56d4be29825025ec51e2291b71c25acec2253e6f (patch)
treeba46de05428fe16b16205a2e424ef443e23d6093 /mcs/class/System.Security/System.Security.Cryptography.Xml
parent48a1f3002ef68af72140c6bb76a0fc28b01b7747 (diff)
2007-01-12 Atsushi Enomoto <atsushi@ximian.com>
* SignedXml.cs : actually ComputeSignature() itself does not raise silly exception. It always use CryptographicException. Added another check; malformed reference object. * SignedXmlTest.cs : fixed ComputeSignatureNoSigningKey() to not expect silly exception. Added test for malformed reference. svn path=/trunk/mcs/; revision=70911
Diffstat (limited to 'mcs/class/System.Security/System.Security.Cryptography.Xml')
-rw-r--r--mcs/class/System.Security/System.Security.Cryptography.Xml/ChangeLog6
-rw-r--r--mcs/class/System.Security/System.Security.Cryptography.Xml/SignedXml.cs8
2 files changed, 10 insertions, 4 deletions
diff --git a/mcs/class/System.Security/System.Security.Cryptography.Xml/ChangeLog b/mcs/class/System.Security/System.Security.Cryptography.Xml/ChangeLog
index cc246338137..b290b234dce 100644
--- a/mcs/class/System.Security/System.Security.Cryptography.Xml/ChangeLog
+++ b/mcs/class/System.Security/System.Security.Cryptography.Xml/ChangeLog
@@ -1,5 +1,11 @@
2007-01-12 Atsushi Enomoto <atsushi@ximian.com>
+ * SignedXml.cs : actually ComputeSignature() itself does not raise
+ silly exception. It always use CryptographicException.
+ Added another check; malformed reference object.
+
+2007-01-12 Atsushi Enomoto <atsushi@ximian.com>
+
* SignedXml.cs : ComputeSignature() should check empty key.
2006-10-11 Atsushi Enomoto <atsushi@ximian.com>
diff --git a/mcs/class/System.Security/System.Security.Cryptography.Xml/SignedXml.cs b/mcs/class/System.Security/System.Security.Cryptography.Xml/SignedXml.cs
index 29144c2e432..1005fe52238 100644
--- a/mcs/class/System.Security/System.Security.Cryptography.Xml/SignedXml.cs
+++ b/mcs/class/System.Security/System.Security.Cryptography.Xml/SignedXml.cs
@@ -314,14 +314,18 @@ namespace System.Security.Cryptography.Xml {
}
}
if (objectName != null) {
+ bool found = false;
foreach (DataObject obj in m_signature.ObjectList) {
if (obj.Id == objectName) {
XmlElement xel = obj.GetXml ();
doc.LoadXml (xel.OuterXml);
FixupNamespaceNodes (xel, doc.DocumentElement);
+ found = true;
break;
}
}
+ if (!found)
+ throw new CryptographicException (String.Format ("Malformed reference object: {0}", objectName));
}
}
@@ -649,11 +653,7 @@ namespace System.Security.Cryptography.Xml {
}
}
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)