[XML-SIG] [ pyxml-Bugs-827796 ] c14n: \011,
\012 and \015 incorrectly escaped in XML strings
SourceForge.net
noreply at sourceforge.net
Tue Oct 21 17:01:20 EDT 2003
Bugs item #827796, was opened at 2003-10-21 21:01
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=106473&aid=827796&group_id=6473
Category: DOM
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Benoit Goudreault-Emond (bge)
Assigned to: Nobody/Anonymous (nobody)
Summary: c14n: \011, \012 and \015 incorrectly escaped in XML strings
Initial Comment:
It seems the c14n algorithm incorrectly replaces \011
(tab) by 	 (without semicolon!). If one reads
http://www.w3.org/TR/xml-c14n#Example-Chars , it is
clear from the example that \011 should be replaced by
	
The same goes for \012 (LF) and \015 (CR).
Here's some test code that demonstrates the problem:
----
#! /usr/bin/env python
import sys
from xml.dom import minidom
from xml.dom.ext import c14n
example = '''<doc><elem attr=' '
  
	 ' '/></doc>'''
dom = minidom.parseString(example)
print c14n.Canonicalize(dom)
----
Prints:
<doc><elem attr=" ' 
	 ' "></elem></doc>
According to the spec, it should print:
<doc><elem attr=" ' 
	 ' "></elem></doc>
Interestingly enough, test_c14n.py's test data reflects
the problem--that is, eg4's expected result, base64
encoded, does not contain the semicolons :{)
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=106473&aid=827796&group_id=6473
More information about the XML-SIG
mailing list