Skip to content

fix(docmdp): ignore orphaned signatures in revision summary - #9667

Open
vitormattos wants to merge 2 commits into
mainfrom
fix/docmdp-ignore-orphaned-revision-count-20261122
Open

vitormattos wants to merge 2 commits into
mainfrom
fix/docmdp-ignore-orphaned-revision-count-20261122

Conversation

@vitormattos

Copy link
Copy Markdown
Member

Problem

After integrating pdf-signature-validator 0.6.0, the structural inventory ignores unreferenced /Sig dictionaries when deciding whether a document is certified or signed. The DocMDP revision summary still counted their /ByteRange with a broad regex, resulting in contradictory reported revision counts for structurally conclusive unsigned documents.

Change

  • When the PDF signature inventory is conclusive and reports zero active signatures, return zero signed revisions and no modifications. For inconclusive PDFs, keep existing fallback; PDFs with active signatures retain existing behavior.
  • Strengthen DocMdpHandlerTest::testOnlyReferencedSignatureDictionariesCertify for both orphan and referenced controls.

Validation

  • Source and regression expectations inspected against the current scoped PdfSignatureInventoryReader API.
  • Signature and DCO verified on the proposed commit.
  • PHPUnit, Psalm, and Behat require CI/runtime confirmation. This is a draft until the tests have been assessed.

Related to #9271 and the post-merge review of #9436. Does not supersede #9556 (DSS/document timestamps).

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
@github-actions

github-actions Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Code Metrics Report

Note: Metrics describe the revision analyzed by the successful PHPUnit run. Newer commits with pending, canceled or failed checks may not yet be represented in this report.

main (878d2bf) #9667 (0fe850e) +/-
Coverage 78.1% 78.1% 0.0%
Test Execution Time 3m52s 5m43s +1m51s
Details
  |                     | main (878d2bf) | #9667 (0fe850e) |  +/-   |
  |---------------------|----------------|-----------------|--------|
  | Coverage            |          78.1% |           78.1% |   0.0% |
  |   Files             |            537 |             537 |      0 |
  |   Lines             |          29818 |           29818 |      0 |
  |   Covered           |          23303 |           23303 |      0 |
- | Test Execution Time |          3m52s |           5m43s | +1m51s |

Reported by octocov

@lfals lfals left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When the signature inventory is conclusive and reports no active signatures, the revision summary now returns zero revisions, no modifications and no details. Orphaned /Sig dictionaries no longer produce a revision count.

Two gaps remain: the new tests do not prove the modified part of the fix, and PDFs with an active signature plus an orphan still go through the regex path.

Comment thread lib/Handler/DocMdpHandler.php Resolved
The active-signature inventory implementation is already on main via #9556.
Remove the superseded revision-count shortcut and cover orphan-only and
mixed active-certification scenarios with real incremental revisions.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
@vitormattos
vitormattos requested a review from lfals November 25, 2026 19:20

@lfals lfals left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The title and description still describe a production fix, but the diff is test-only (the fix is already on main via #9556):

  • fix(docmdp) lands under Fixed in the changelog.
  • The body says the handler now returns zero signed revisions, but no lib/ change is in the diff.
  • The body says testOnlyReferencedSignatureDictionariesCertify was strengthened, but that test is unchanged.

Please retitle to test(docmdp): cover orphaned signatures across revisions and rewrite the body to describe the two new test cases.

This branch has not been deployed

No deployments
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

Successfully merging this pull request may close these issues.

2 participants