Skip to content

Commit

Permalink
Work around V2Form tagging issue in asn1crypto
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthiasValvekens committed Dec 22, 2021
1 parent 4bcdf66 commit ca3cf24
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pyhanko_certvalidator/asn1_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,18 @@ def _make_tag_explicit(field_decl):
del tag_dict['implicit']


def _make_tag_implicit(field_decl):
tag_dict = field_decl[2]
if 'implicit' in tag_dict:
return
tag_dict['implicit'] = tag_dict['explicit']
del tag_dict['explicit']

# Deal with wbond/asn1crypto#218
_make_tag_explicit(cms.RoleSyntax._fields[1])
_make_tag_explicit(cms.SecurityCategory._fields[1])
# Deal with wbond/asn1crypto#220
_make_tag_implicit(cms.AttCertIssuer._alternatives[1])

# patch in attribute certificate extensions
# Note: unlike in Certomancer, we don't do this one conditionally, since
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified tests/fixtures/attribute-certs/basic-aa/aa/badsig.attr.crt
Binary file not shown.

0 comments on commit ca3cf24

Please sign in to comment.