Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/launchpad/parsers/apple/code_signature_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -581,11 +581,20 @@ def _parse_signature(self, super_blob: CSSuperBlob, cs: CodeSignature) -> CMSSig

logger.debug(f"Signature magic: 0x{magic:08x}, length: {signature_length}")

# Check if there's actual signature data (not just the header)
if signature_length <= 8:
logger.debug("Signature slot present but empty (length <= 8)")
return None

# Extract the signature content (skip the 8-byte header)
sig_start = sig_offset + 8
sig_end = sig_offset + signature_length
signature_content = bytes(content[sig_start:sig_end])

if len(signature_content) == 0:
logger.debug("No signature content to parse")
return None

# Parse the CMS signature
try:
signature = cms.ContentInfo.load(signature_content) # type: ignore[attr-defined]
Expand Down
Loading