[xmlsec] Signature verification vs namespaces
matyc at redhat.com
Thu Jan 21 07:58:42 PST 2021
one of the use cases of XML signing is signing of security content of
SCAP datastreams, which is a XML format standardized by NIST, i.e. one
would consider that as mainstream rather than obscure. Contents of
datastreams can be signed, and if this is the case, the namespace of the
signature element and the element that is signed differs. The example
r900-rhel-datastream.xml from the test suite can be obtained at 
(extracted file for your convenience is available at ).
This namespace discrepancy causes the xmlsec1 utility not to work out of
the box.  points to a solution - one has to "declare" the missing
namespaces using the --id-attr flag, e.g. xmlsec1 --verify --id-attr
r900-rhel-datastream.xml . However, the project FAQ  refers to this
as if it was some kind of a dirty hack.
The recommended solution would be to use a DTD. SCAP XMLs are complex,
there are XSDs available, but not DTDs. And those would be really
murderous. And aside from that, we just need to point out to namespaces
that should be considered when searching for the signed element, so one
doesn't have a big incentive to deal with complex files.
Do you have any ideas how to approach this problem in a non-hackish way
that we may be missing?
More information about the xmlsec