Skip to content

Commit

Permalink
Adjusted authenticode_reader.py to use Attribute.TYPE instead of SIG_…
Browse files Browse the repository at this point in the history
…ATTRIBUTE_TYPES (#1111)

Inspired by this change: 8dd8a25
  • Loading branch information
TTMaZa authored Sep 28, 2024
1 parent 0fa2d49 commit b8b2ae0
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions api/python/examples/authenticode/authenticode_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,23 +41,23 @@ def __call__(self, *args, **kwargs):

@exceptions_handler(Exception)
def print_attr(indent: int, auth: lief.PE.Attribute):
if auth.type == lief.PE.SIG_ATTRIBUTE_TYPES.CONTENT_TYPE:
if auth.type == lief.PE.Attribute.TYPE.CONTENT_TYPE:
print_content_type(indent, auth)
elif auth.type == lief.PE.SIG_ATTRIBUTE_TYPES.PKCS9_SIGNING_TIME:
elif auth.type == lief.PE.Attribute.TYPE.PKCS9_SIGNING_TIME:
print_signing_time(indent, auth)
elif auth.type == lief.PE.SIG_ATTRIBUTE_TYPES.MS_SPC_STATEMENT_TYPE:
elif auth.type == lief.PE.Attribute.TYPE.MS_SPC_STATEMENT_TYPE:
print_ms_statement_type(indent, auth)
elif auth.type == lief.PE.SIG_ATTRIBUTE_TYPES.PKCS9_MESSAGE_DIGEST:
elif auth.type == lief.PE.Attribute.TYPE.PKCS9_MESSAGE_DIGEST:
print_pkcs_msg_dg(indent, auth)
elif auth.type == lief.PE.SIG_ATTRIBUTE_TYPES.PKCS9_COUNTER_SIGNATURE:
elif auth.type == lief.PE.Attribute.TYPE.PKCS9_COUNTER_SIGNATURE:
print_pkcs_counter_sig(indent, auth)
elif auth.type == lief.PE.SIG_ATTRIBUTE_TYPES.GENERIC_TYPE:
elif auth.type == lief.PE.Attribute.TYPE.GENERIC_TYPE:
print_generic_type(indent, auth)
elif auth.type == lief.PE.SIG_ATTRIBUTE_TYPES.SPC_SP_OPUS_INFO:
elif auth.type == lief.PE.Attribute.TYPE.SPC_SP_OPUS_INFO:
print_spc_sp_opus_info(indent, auth)
elif auth.type == lief.PE.SIG_ATTRIBUTE_TYPES.MS_SPC_NESTED_SIGN:
elif auth.type == lief.PE.Attribute.TYPE.MS_SPC_NESTED_SIGN:
print_ms_nested_sig(indent, auth)
elif auth.type == lief.PE.SIG_ATTRIBUTE_TYPES.PKCS9_AT_SEQUENCE_NUMBER:
elif auth.type == lief.PE.Attribute.TYPE.PKCS9_AT_SEQUENCE_NUMBER:
print_pkcs9_at_seq_number(indent, auth)
else:
print(" " * indent, type(auth), auth)
Expand Down

0 comments on commit b8b2ae0

Please sign in to comment.