[Mono-dev] [PATCH] System.Security: Remove "hack" from KeyInfoX509Data

Gert Driesen gert.driesen at telenet.be
Tue Sep 26 02:48:44 EDT 2006



> -----Original Message-----
> From: Lee Fisher [mailto:blibbet at gmail.com]
> Sent: dinsdag 26 september 2006 0:26
> To: Gert Driesen
> Subject: Re: [Mono-dev] [PATCH] System.Security: Remove "hack" from
> KeyInfoX509Data
> 
> hi,
> 
> what do you do to ensure XMLDSIG compatibiliy?
> 
> last month on security-dev at xml.apache.org there was a thread about
> interop problems with .NET.
> 
> i didn't know of any interop effort, or tests to point to.
> 
> so if you have something, it might be interesting for them to also test
> against?

Most of the interop problems come from using XmlDocument constructed from
non-normalized XML.

As pointed out by Atsushi, one should use an XmlValidatingReader constructed
from an XmlTextReader with Normalization set to true.

		XmlTextReader xtr = new XmlTextReader (new StringReader
(inputXml));
		xtr.Normalization = true;

		XmlValidatingReader vr = new XmlValidatingReader (xtr);
		vr.ValidationType = ValidationType.None;

		XmlDocument doc = new XmlDocument ();
		doc.Load (vr);

		SignedXml signedXml = new SignedXml (doc);
		.....

Gert

> Gert Driesen wrote:
> > Hi,
> >
> > The attached patch removed an (unnecessary) hack from
> KeyInfoX509Data.
> >
> > The hack added an explicit declaration of the XMLDSIG namespace. This
> > was supposedly for compatibility with MS, but I tested with .NET 1.0,
> > .NET 1.1 and .NET 2.0 and none of these emit that extra namespace
> > declaration or rely on it.
> >
> > All unit tests and standalone tests pass after removing this hack.
> >
> > Let me know if it's ok to commit.
> >
> > Gert
> >
> >
> > ---------------------------------------------------------------------
> -
> > --
> >
> > _______________________________________________
> > Mono-devel-list mailing list
> > Mono-devel-list at lists.ximian.com
> > http://lists.ximian.com/mailman/listinfo/mono-devel-list




More information about the Mono-devel-list mailing list