Explorar o código

2004-09-16 Sebastien Pouliot <[email protected]>

	* Signature.cs: Fixed Xmldsig and broken unit tests.
	* SignedXml.cs: Fixed warning (level 4) for unused variable.
	* XmlDsigEnvelopedSignatureTransform.cs: Fixed warning (l4) for unused
	variable.

svn path=/trunk/mcs/; revision=33996
Sebastien Pouliot %!s(int64=21) %!d(string=hai) anos
pai
achega
4e61e9daf2

+ 7 - 0
mcs/class/System.Security/System.Security.Cryptography.Xml/ChangeLog

@@ -1,3 +1,10 @@
+2004-09-16  Sebastien Pouliot  <[email protected]>
+
+	* Signature.cs: Fixed Xmldsig and broken unit tests.
+	* SignedXml.cs: Fixed warning (level 4) for unused variable.
+	* XmlDsigEnvelopedSignatureTransform.cs: Fixed warning (l4) for unused
+	variable.
+
 2004-09-04  Tim Coleman <[email protected]>
 	* XmlDecryptionTransform.cs:
 		Implement rudimentary xpointer support for Except URIs.

+ 4 - 1
mcs/class/System.Security/System.Security.Cryptography.Xml/Signature.cs

@@ -101,7 +101,7 @@ namespace System.Security.Cryptography.Xml {
 
 		public XmlElement GetXml () 
 		{
-			return GetXml (new XmlDocument ());
+			return GetXml (null);
 		}
 
 		internal XmlElement GetXml (XmlDocument document)
@@ -114,6 +114,9 @@ namespace System.Security.Cryptography.Xml {
 			if (signature == null)
 				throw new CryptographicException ("SignatureValue");
 
+			if (document == null)
+				document = new XmlDocument ();
+
 			XmlElement xel = document.CreateElement (XmlSignature.ElementNames.Signature, XmlSignature.NamespaceURI);
 			if (id != null)
 				xel.SetAttribute (XmlSignature.AttributeNames.Id, id);

+ 1 - 1
mcs/class/System.Security/System.Security.Cryptography.Xml/SignedXml.cs

@@ -293,7 +293,7 @@ namespace System.Security.Cryptography.Xml {
 					try {
 						// no way to know if valid without throwing an exception
 						Uri uri = new Uri (r.Uri);
-						s = (Stream) xmlResolver.GetEntity (new Uri (r.Uri), null, typeof (Stream));
+						s = (Stream) xmlResolver.GetEntity (uri, null, typeof (Stream));
 					}
 					catch {
 						// may still be a local file (and maybe not xml)

+ 0 - 1
mcs/class/System.Security/System.Security.Cryptography.Xml/XmlDsigEnvelopedSignatureTransform.cs

@@ -146,7 +146,6 @@ namespace System.Security.Cryptography.Xml {
 
 		private XmlNode GetOutputFromNode (XmlNode input, XmlNamespaceManager nsmgr, bool remove)
 		{
-			XmlDocument doc = input is XmlDocument ? input as XmlDocument : input.OwnerDocument;
 			if (remove) {
 				XmlNodeList nl = input.SelectNodes ("descendant-or-self::dsig:Signature", nsmgr);
 				foreach (XmlNode n in nl)