Skip to content
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

Content in trailing section of signature xml #40

Open
johan-fm opened this issue Dec 8, 2017 · 6 comments
Open

Content in trailing section of signature xml #40

johan-fm opened this issue Dec 8, 2017 · 6 comments

Comments

@johan-fm
Copy link

johan-fm commented Dec 8, 2017

Digidoc4j fails to read a signature when the signature file has trailing information after the xml tags. DigiDoc3 client opens the container correctly and displays the signature. This invalid_signature.txt is the ending of the signature file in question. If the comment is correct for the file then it seems to be created by "libdigidoc Android".

The error produced from parsing is:

org.digidoc4j.impl.bdoc.xades.XadesValidationDssFacade - Failed to parse xades signature: org.xml.sax.SAXParseException; lineNumber: 210; columnNumber: 24; Content is not allowed in trailing section.
org.digidoc4j.exceptions.InvalidSignatureException: Invalid signature document
	at org.digidoc4j.impl.bdoc.xades.XadesValidationDssFacade.openXadesValidator(XadesValidationDssFacade.java:50)
	at org.digidoc4j.impl.bdoc.xades.XadesValidationReportGenerator.createXadesValidator(XadesValidationReportGenerator.java:93)
	at org.digidoc4j.impl.bdoc.xades.XadesValidationReportGenerator.initXadesValidator(XadesValidationReportGenerator.java:86)
	at org.digidoc4j.impl.bdoc.xades.XadesValidationReportGenerator.openDssSignature(XadesValidationReportGenerator.java:62)
	at org.digidoc4j.impl.bdoc.xades.XadesSignatureParser.parse(XadesSignatureParser.java:28)
	at org.digidoc4j.impl.bdoc.BDocSignatureOpener.createBDocSignature(BDocSignatureOpener.java:49)
	at org.digidoc4j.impl.bdoc.BDocSignatureOpener.parse(BDocSignatureOpener.java:42)
	at org.digidoc4j.impl.bdoc.BDocContainer.parseSignatureFiles(BDocContainer.java:111)
	at org.digidoc4j.impl.bdoc.ExistingBDocContainer.populateContainerWithParseResult(ExistingBDocContainer.java:196)
	at org.digidoc4j.impl.bdoc.ExistingBDocContainer.openContainer(ExistingBDocContainer.java:188)
	at org.digidoc4j.impl.bdoc.ExistingBDocContainer.<init>(ExistingBDocContainer.java:62)
	at org.digidoc4j.ContainerOpener.open(ContainerOpener.java:119)
@nostneji
Copy link
Contributor

Created issue in Jira: https://jira.ria.ee/browse/DD4J-177

@nostneji
Copy link
Contributor

Issue is resolved since DSS-5.0.

@Adresnik
Copy link

Adresnik commented Apr 9, 2018

Still getting this error with version 2.1.0
Failed to parse xades signature: org.xml.sax.SAXParseException; lineNumber: 205; columnNumber: 24; Content is not allowed in trailing section. [Fatal Error] :205:24: Content is not allowed in trailing section. Exception in thread "main" Invalid signature document

With .bdoc file that has two signatures and one of them has content in trailing section

@markoleek
Copy link

The error is still present in 3.3.0 and 4.0.0-RC1.

@naare
Copy link
Contributor

naare commented Jan 9, 2020

Could you provide us the test file you see the problem with? With the file we are using all seems to be okay.

@naare naare reopened this Jan 9, 2020
@naare naare assigned markoleek and unassigned nostneji Jan 9, 2020
@markoleek
Copy link

Unfortunately I cannot, as I do not own the contents of the file and did not get permission to share it. You can contact me via email for further information.

@markoleek markoleek removed their assignment Feb 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants