Skip to content

Commit

Permalink
Merge pull request #2 from daddycocoaman/fix-empty-x509
Browse files Browse the repository at this point in the history
fix empty x509 list
  • Loading branch information
daddycocoaman authored Jul 15, 2022
2 parents 6bd8cdc + 8d7b56b commit 691b6d7
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions dumpscan/common/scanners/x509.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import binascii
from base64 import b64encode
from collections import defaultdict
from pathlib import Path
from struct import unpack

Expand Down Expand Up @@ -34,7 +33,7 @@ def __init__(self, minidumpfile: MinidumpFile, output: Path) -> None:
self.rules = yara.compile(sources=YARA_RULES["x509"])
self.dump = minidumpfile
self.output = output
self.matching_objects = defaultdict(list)
self.matching_objects = {"x509": [], "pkcs": []}
self.modulus_dict = {}
self.public_private_matches = {}
self.current_section: MINIDUMP_MEMORY_DESCRIPTOR64 = None
Expand Down Expand Up @@ -116,7 +115,7 @@ def minidump_scan(cls, minidumpfile: MinidumpFile, output: Path) -> "x509Scanner
)

scanner.modulus_dict = {}
for cert in scanner.matching_objects.get("x509"):
for cert in scanner.matching_objects.get("x509", []):
public_key = cert.public_key()

if isinstance(public_key, RSAPublicKey):
Expand Down

0 comments on commit 691b6d7

Please sign in to comment.