Repository navigation
Conversation
…ation ISO 32000-2 12.8.2.2.1 and ETSI EN 319 142-1 5.4 exempt incremental updates that only add a DSS dictionary (VRI, Certs, CRLs, OCSPs) or a document timestamp from DocMDP restrictions. The validation classified such an update as an unknown modification, so a certified document became invalid as soon as long-term validation data was added, at every DocMDP level. Before classifying the modification, parse the bytes after the certified revision strictly as incremental updates: indirect objects, a classic xref table listing exactly those objects at their offsets, a trailer whose /Root, /Info and /Prev match the certified revision and has no /Encrypt, and startxref. Xref streams, unlisted or unparsable bytes and object streams mean the update is not validation data only. The certified revision is read through its classic xref tables. New objects must use numbers from the certified /Size on. Of the existing objects, an update may only rewrite the catalog (/DSS, /Extensions, /Version), the AcroForm (/SigFlags, timestamp fields appended to /Fields), a page (timestamp fields appended to /Annots) and the information dictionary (/ModDate, /Producer). A new field must be an invisible document timestamp field (zero-area /Rect, no /Kids, /Parent, /A or /AA) whose value is a new /DocTimeStamp with /SubFilter /ETSI.RFC3161; any other new signature, field or annotation keeps the update a violation. Rewritten objects are compared in a canonical form (sorted keys, names with #xx escapes decoded, strings by their bytes, duplicate keys rejected, bounded nesting), since LTV tools rewrite the catalog and the information dictionary with their own formatting. Signed-off-by: no84by <50858621+no84by@users.noreply.github.com>
This was referenced Nov 18, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves: #9534
Part of #8946
Summary
ISO 32000-2 12.8.2.2.1 and ETSI EN 319 142-1 5.4 exempt incremental updates that only add a DSS dictionary (VRI, Certs, CRLs, OCSPs) or a document timestamp from DocMDP restrictions.
DocMdpHandlerclassified such an update as an unknown modification, so a certified document was reported as a DocMDP violation as soon as long-term validation data was added, at every level (P=1, 2 and 3).Before the existing classification,
DocMdpHandlernow checks whether the bytes after the certified revision are validation data only. The check is strict, so a lenient reading cannot be used to slip content changes through:startxref. Each trailer must keep the certified/Rootand/Info, chain/Prevto the previous section and carry no/Encrypt. Xref streams, object streams, objects outside the xref and anything unparsable mean the update is not validation data only./Sizeon./DSS,/Extensions,/Version;/SigFlags, and timestamp fields appended to/Fields;/Annots;/ModDate,/Producer./Rect, no/Kids,/Parent,/Aor/AA, and/Vpointing to a new/DocTimeStampwith/SubFilter /ETSI.RFC3161. Any other new signature, field or annotation keeps the update a violation.#xxescapes decoded, strings by their bytes, duplicate keys rejected, bounded nesting. LTV tools rewrite the catalog and the information dictionary with their own formatting.Out of scope: a certified revision written with xref streams is not exempted (behaviour unchanged for such files).
How to test
DocumentSecurityStore.supply_dss_in_writer), or add a document timestamp (PdfTimeStamper)./Root: still reported as a DocMDP violation.Validation evidence
DocMdpHandlerTest(68 tests). Accepted: DSS at P=1/2/3, document timestamp, DSS and timestamp in one update, timestamp then DSS. Rejected at P=1:/OpenAction; duplicate catalog key; information dictionary/Titlechanged; page tree rewritten;/AAor/Kids;#xxname escape;/Root,/Info,/Encrypt,/Prev); object outside the update xref; xref stream update.DocMdpHandlerValidationDataTest(integration, 8 tests). A PDF certified with P=1 by the native engine with a throwaway certificate, then a DSS incremental update (catalog/DSSand/Version, information dictionary rewritten), is accepted, and the certification signature stays cryptographically valid. Still violations:/Rootswap to a new page tree;obj, or swallowed by an unterminated stream;/Pageskey;DocMdpHandler,lint:translator-hints)tests/php/Integration/Handler,PdfSignatureDetectionServiceTest)API / Back-end changes
DocMdpHandler: DSS-only and document-timestamp-only incremental updates after certification are reported asMODIFICATION_ALLOWEDwith a new translatable messagecomposer openapiwhen necessaryChecklist
AI (if applicable)