Skip to content

Commit

Permalink
feat(keyboxchecker/__init__.py): checks if any certificates in the ce…
Browse files Browse the repository at this point in the history
…rtificate chain are revoked
  • Loading branch information
real-LiHua authored Nov 16, 2024
1 parent 6ad3912 commit 95a542d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions keyboxchecker/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ def main(args):
is_valid = not_valid_before <= current_time <= not_valid_after
values.append("✅" if is_valid else "❌")

status = revoked_keybox_list.get(serial_number)

flag = True
for i in range(pem_number - 1):
try:
Expand Down Expand Up @@ -186,6 +188,9 @@ def main(args):
)
else:
raise ValueError("Unsupported signature algorithms")
status = status or revoked_keybox_list.get(
hex(father_certificate.serial_number)[2:]
)
except Exception: # pylint: disable=W0718
flag = False
break
Expand Down Expand Up @@ -214,8 +219,6 @@ def main(args):
flag = False
values.append("❌ Unknown root certificate")

status = revoked_keybox_list.get(serial_number)

if status or (is_aosp and not args.aosp) or not flag or not is_valid:
kb.rename(dead / f"{serial_number}.xml")
else:
Expand Down

0 comments on commit 95a542d

Please # to comment.