Skip to content

Commit

Permalink
handle fields with no /Type set
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefano Cipriani authored and MatthiasValvekens committed Dec 13, 2023
1 parent 5f9ac0f commit 4ae8be8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pyhanko/sign/diff_analysis/rules/form_field_rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,11 @@ def check_form_field(
# /DocTimeStamps added for LTA validation purposes shouldn't have
# an appearance (as per the recommendation in ISO 32000-2, which we
# enforce as a rigid rule here)
if sig_obj.raw_get('/Type') == '/DocTimeStamp' and not visible:
if (
'/Type' in sig_obj
and sig_obj.raw_get('/Type') == '/DocTimeStamp'
and not visible
):
sig_whitelist = ModificationLevel.LTA_UPDATES
valid_when_locked = True
else:
Expand Down

0 comments on commit 4ae8be8

Please sign in to comment.