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

ByteRange, incremental update, and CR + LF = EOL #917

Closed
a20god opened this issue Sep 12, 2017 · 2 comments · Fixed by veraPDF/veraPDF-validation#252, veraPDF/veraPDF-parser#347 or veraPDF/veraPDF-validation#265
Assignees

Comments

@a20god
Copy link

a20god commented Sep 12, 2017

Suppose a PDF/A-2 document ends with CR, like this one:
B.1-unknown-3.pdf
The ByteRange entry covers the entire document, the document conforms to PDF/A-2. We add an incremental update. The incremental update begins with a LF as the object number must be preceded by an EOL marker (ISO 19005-2:2001, 6.1.9). Now, veraPDF reports that the ByteRange no longer covers the entire document (as signed). This is probably due to the LF being considered to by part of the document (as signed) as together with the CR it forms an EOL marker:
B.1-unknown-4.pdf
That is, the document (as signed) became longer by one byte. Is this really the intended behavior?

(For a PDF writer it's probably safer to start an incremental update with a CR rather than a LF in order to avoid this problem. Doesn't help for existing signed documents, though.)

@a20god
Copy link
Author

a20god commented Mar 16, 2018

veraPDF 1.11.11 still reports a ByteRange not covering the entire file for B.1-unknown-4.pdf above.

@a20god
Copy link
Author

a20god commented Apr 16, 2018

The logic might still be wrong. Consider this document:
B.1-01-fail-4.pdf
The document ends with CR+LF and ByteRange does not cover the final LF. veraPDF 1.11.19 does not report a violation of clause B.1. The logic allowing the document to be a bit longer (by a CR or CR+LF) should come into play only if an incremental update was added after the signature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment