You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I need to sign a XML file.
The signature process works in both cases (with and without the namespace declared in the root element), but the signature verification fails when there is the specific xmlns namespace declared.
Also, when I have less nested levels, then there is no error in both cases, but I need the nesting (the final XML file will have even more nested levels than this example).
The XML files need to be submitted to a government agency (Country Paraguay, SIFEN / EKUATIA, Sistema Nacional de Facturacion Electrónica) and the validation fails if I exclude the namespace from the file.
Here is my code to replicate the error (excluding my key files); I am using Ubuntu 20.04, Python 3.8.10, lxml==4.9.2 and signxml==2.10.1. (I also tried with the newer signxml==3.1.0 and got the same error; but I need to use the older version of signxml because it supports the older Python 3.6 which some of my machines still use).
Thanks for reporting this, you have identified a bug in how we handle canonicalization. When declaring a default namespace in the root element and then canonicalizing sub-elements of the document, we were detaching the sub-elements before canonicalizing when signing, but not when verifying. This has a subtle effect on the canonicalization algorithm when a default (unprefixed) namespace is used, which manifests as the presence or absence of xmlns="" declarations.
I've opened #226 to research the underlying question but I think what we're doing when signing is correct (and we have now fixed the verifying behavior to trust the signature in this situation).
I need to sign a XML file.
The signature process works in both cases (with and without the namespace declared in the root element), but the signature verification fails when there is the specific
xmlns
namespace declared.Also, when I have less nested levels, then there is no error in both cases, but I need the nesting (the final XML file will have even more nested levels than this example).
The XML files need to be submitted to a government agency (Country Paraguay, SIFEN / EKUATIA, Sistema Nacional de Facturacion Electrónica) and the validation fails if I exclude the namespace from the file.
Here is my code to replicate the error (excluding my key files); I am using
Ubuntu 20.04
,Python 3.8.10
,lxml==4.9.2
andsignxml==2.10.1
. (I also tried with the newersignxml==3.1.0
and got the same error; but I need to use the older version ofsignxml
because it supports the olderPython 3.6
which some of my machines still use).The code runs successfully without the namespace:
But when adding the namespace, I get this error:
Any ideas why this could be happening? Or how this could be solved?
The text was updated successfully, but these errors were encountered: