[Mono-devel-list] xmldsig fix to consume CR in advance

Atsushi Eno atsushi at ximian.com
Tue Mar 29 11:45:28 EST 2005


Hello,

Attached is a patch that _fixes_ c14n transformation that did not
consume CR (\r) in advance. It should remove \r, while the
corresponding character entity (
) must be preserved.

This patch affects on some XML signature verification.

For SignedXml, there is no standard way to specify non XmlElement
input, so this patch will break such signature verification that
depends on CRLF existence.

This is required to distinguish \r and 
 for Stream input. On
the other hand, if you LoadInput() from XmlDocument or XmlNodeList,
we can't do anything, since there is no way to distinguish them
(MS.NET also shows difference here).

To avoid this problem, XmlDocument must be loaded with such input
source that removes CR but preserves 
 . I attached an example
TextReader implementation that eliminates \r (actually it is what I
used to consume Stream passed for XmlDsigC14NTransform.LoadInput()).

Again, this patch affects on some XML signature verification.
For example, our standalone test runner for W3C "phaos" tests
won't run anymore without the attached TextReader.

I'm 75% sure that this is the way we should fix stuff, but 25% not
sure. So I wanted to ask if you guys have better or correct idea to
handle them. If there is no further discussion, I'll check them in.

Thanks,
Atsushi Eno
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: consumeCRinAdvance.patch
Url: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20050330/345efcfd/attachment.pl 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: XmlSignatureStreamReader.cs
Url: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20050330/345efcfd/attachment-0001.pl 


More information about the Mono-devel-list mailing list