Skip to content

Commit

Permalink
Add test for diff on signature without /Type
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthiasValvekens committed Dec 13, 2023
1 parent 4ae8be8 commit 8e4185f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Binary file not shown.
12 changes: 12 additions & 0 deletions pyhanko_tests/test_diff_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -2656,3 +2656,15 @@ def test_cant_descend_into_non_container():

with pytest.raises(PdfReadError, match='Anchor'):
root_rel.descend('/Blah')


def test_signature_without_type_is_form_filling():
fname = f"{PDF_DATA_DIR}/minimal-signed-twice-no-sig-type.pdf"
with open(fname, 'rb') as inf:
r = PdfFileReader(inf)
s = r.embedded_signatures[0]
s.compute_integrity_info(DEFAULT_DIFF_POLICY)
assert s.field_name == 'Sig1'
assert (
s.diff_result.modification_level == ModificationLevel.FORM_FILLING
)

0 comments on commit 8e4185f

Please sign in to comment.