New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
XAdES validation fails with Reference URI=“” for document with stylesheet processing instruction #94
Comments
I've traced this issue to the problem with canonicalization of processing instruction in the xmldsigj library. Currently there is a commented out test case dealing with this. it("2.1 PIs, Comments, and Outside of Document Element", () => {
const xml = `<?xml version="1.0"?>
<?xml-stylesheet href="doc.xsl"
type="text/xsl" ?>
<!DOCTYPE doc SYSTEM "doc.dtd">
<doc>Hello, world!<!-- Comment 1 --></doc>
<?pi-without-data ?>
<!-- Comment 2 -->
<!-- Comment 3 -->`;
const xpath = "//*";
C14N(xml, xpath, `<?xml-stylesheet href="doc.xsl"
type="text/xsl" ?>
<doc>Hello, world!</doc>
<?pi-without-data?>`);
}); Currently the test case is failing by returning only the Am I on the right track? @microshine @alexey-pelykh @rmhrisk |
@zetsnotdead Please try a new version of
Also, I found that |
I am still seeing the issue. Testing with:
I can share the failing xml document privately if you'd like. |
The document I am signing looks like this.
I am using
xadesjs
to sign this XML with the following code:The generated signature is valid only if I remove the xml declaration and stylesheet instruction. So only signing this returns a correctly signed document:
Signing this
errors with message saying that not the entire document is signed.
I assume the problem is with the
URI=""
reference. It signs only the<ClinicalDocument>
and leaves the<?xml version>
and<?xml-stylesheet>
with no signature.I am not sure if this is an issue with the library or the incorrect usage on my part. I've also started related bounty on stackoverflow.
How do I sign everything?
The text was updated successfully, but these errors were encountered: