[Mono-list] xmldsig fix to consume CR in advance
Atsushi Eno
atsushi@ximian.com
Wed, 30 Mar 2005 01:45:28 +0900
This is a multi-part message in MIME format.
--------------080500010704070801060209
Content-Type: text/plain; charset=ISO-2022-JP
Content-Transfer-Encoding: 7bit
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
--------------080500010704070801060209
Content-Type: text/plain;
name="consumeCRinAdvance.patch"
Content-Transfer-Encoding: base64
Content-Disposition: inline;
filename="consumeCRinAdvance.patch"
SW5kZXg6IFRlc3QvU3lzdGVtLlNlY3VyaXR5LkNyeXB0b2dyYXBoeS5YbWwvWG1sRHNpZ0Mx
NE5UcmFuc2Zvcm1UZXN0LmNzCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIFRlc3QvU3lzdGVtLlNlY3Vy
aXR5LkNyeXB0b2dyYXBoeS5YbWwvWG1sRHNpZ0MxNE5UcmFuc2Zvcm1UZXN0LmNzCShyZXZp
c2lvbiA0MjMwOSkKKysrIFRlc3QvU3lzdGVtLlNlY3VyaXR5LkNyeXB0b2dyYXBoeS5YbWw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-Type: text/plain;
name="XmlSignatureStreamReader.cs"
Content-Transfer-Encoding: base64
Content-Disposition: inline;
filename="XmlSignatureStreamReader.cs"
Ly8KLy8gWG1sU2lnbmF0dXJlU3RyZWFtUmVhZGVyLmNzOiBXcmFwIFRleHRSZWFkZXIgYW5k
IGVsaW1pbmF0ZSBccgovLwovLyBBdXRob3I6Ci8vCUF0c3VzaGkgRW5vbW90byAoYXRzdXNo
aUB4aW1pYW4uY29tKQovLwovLyAoQykgMjAwNSBOb3ZlbGwgSW5jLgovLwoKLy8KLy8gUGVy
bWlzc2lvbiBpcyBoZXJlYnkgZ3JhbnRlZCwgZnJlZSBvZiBjaGFyZ2UsIHRvIGFueSBwZXJz
b24gb2J0YWluaW5nCi8vIGEgY29weSBvZiB0aGlzIHNvZnR3YXJlIGFuZCBhc3NvY2lhdGVk
IGRvY3VtZW50YXRpb24gZmlsZXMgKHRoZQovLyAiU29mdHdhcmUiKSwgdG8gZGVhbCBpbiB0
aGUgU29mdHdhcmUgd2l0aG91dCByZXN0cmljdGlvbiwgaW5jbHVkaW5nCi8vIHdpdGhvdXQg
bGltaXRhdGlvbiB0aGUgcmlnaHRzIHRvIHVzZSwgY29weSwgbW9kaWZ5LCBtZXJnZSwgcHVi
bGlzaCwKLy8gZGlzdHJpYnV0ZSwgc3VibGljZW5zZSwgYW5kL29yIHNlbGwgY29waWVzIG9m
IHRoZSBTb2Z0d2FyZSwgYW5kIHRvCi8vIHBlcm1pdCBwZXJzb25zIHRvIHdob20gdGhlIFNv
ZnR3YXJlIGlzIGZ1cm5pc2hlZCB0byBkbyBzbywgc3ViamVjdCB0bwovLyB0aGUgZm9sbG93
aW5nIGNvbmRpdGlvbnM6Ci8vIAovLyBUaGUgYWJvdmUgY29weXJpZ2h0IG5vdGljZSBhbmQg
dGhpcyBwZXJtaXNzaW9uIG5vdGljZSBzaGFsbCBiZQovLyBpbmNsdWRlZCBpbiBhbGwgY29w
aWVzIG9yIHN1YnN0YW50aWFsIHBvcnRpb25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