Skip to content

Commit

Permalink
feat(keyboxchecker/__init__.py): print parent certificate sn
Browse files Browse the repository at this point in the history
  • Loading branch information
real-LiHua committed Nov 29, 2024
1 parent aca2cf1 commit 211b669
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion keyboxchecker/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ def main(args):
"Serial number",
"Subject",
"Certificate within validity period",
"certificate chain",
"Valid keychain",
"Note",
"Not found in Google's revoked keybox list",
Expand Down Expand Up @@ -135,6 +136,7 @@ def main(args):
status = revoked_keybox_list.get(serial_number)

flag = True
certificates = []
for i in range(pem_number - 1):
try:
son_certificate = x509.load_pem_x509_certificate(
Expand All @@ -146,7 +148,6 @@ def main(args):
except ValueError:
rmjob.append(kb)
break

if son_certificate.issuer != father_certificate.subject:
flag = False
break
Expand Down Expand Up @@ -199,9 +200,11 @@ def main(args):
status = status or revoked_keybox_list.get(
hex(father_certificate.serial_number)[2:]
)
certificates.append(father_certificate.serial_number)
except Exception: # pylint: disable=W0718
flag = False
break
values.append(" | ".join(map(str,certificates)))
values.append("✅" if flag else "❌")

root_public_key = (
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "keyboxchecker"
version = "1.2.4"
version = "1.3.0"
description = ""
authors = ["Li Hua <[email protected]>"]
readme = "README.md"
Expand Down

0 comments on commit 211b669

Please sign in to comment.