Hi, Matthias!
Thanks for reporting the bug! It is a clear "copy-paste" error and I have fixed it by removing the xmlSetNs() call as you suggested (see the diff bellow).
Thanks, Aleksey
Index: src/templates.c
===================================================================
RCS file: /cvs/gnome/xmlsec/src/templates.c,v
retrieving revision 1.28
diff -u -r1.28 templates.c
--- src/templates.c 6 Feb 2004 07:38:58 -0000 1.28
+++ src/templates.c 16 Jun 2004 15:50:56 -0000
@@ -1764,7 +1764,6 @@
xmlSecErrorsSafeString(prefix));
return(-1);
}
- xmlSetNs(parentNode, ns);
}
return(0);
}Matthias Jung wrote:
Hi all,
migrating from xmlsec 1.2.4 to 1.2.5 caused a problem with signature creation.
Using the function xmlSecTmplTransformAddXPath(...) with a namespace list as argument will create a node like:
<ns1:XPath xmlns:ns1="urn:xxx"> ancestor-or-self::ns1:xxx[1] </ns1:XPath>
which is obviously in the wrong namespace.
Xmlsec 1.2.4 behaves correct, the node looks like:
<XPath xmlns:ns1="urn:xxx"> ancestor-or-self::ns1:xxx[1] </XPath>
Default namespace is dsig ns in parent node.
Diffing the transforms.c file shows that the function
xmlSecTmplNodeWriteNsList(...)
now (1.2.5) has one more line at the end changing the namespace of the node.
...
xmlSetNs(parentNode, ns);
...
Commenting it out xmlsec behaves correct again.
So my question, is there any reason why this line was added to the function, or was it just a mistake?
I currently have no overview in which other cases the (...) is used.
Removing the line at least fixes Signature template creation.
Cheers Matthias
_______________________________________________ xmlsec mailing list [EMAIL PROTECTED] http://www.aleksey.com/mailman/listinfo/xmlsec
_______________________________________________ xmlsec mailing list [EMAIL PROTECTED] http://www.aleksey.com/mailman/listinfo/xmlsec
