Skip to content

Detect an inner framework's signature without assuming Versions/A - #16

Merged
FeodorFitsner merged 1 commit into
mainfrom
verify-signature-layout-agnostic
Jul 30, 2026
Merged

Detect an inner framework's signature without assuming Versions/A#16
FeodorFitsner merged 1 commit into
mainfrom
verify-signature-layout-agnostic

Conversation

@FeodorFitsner

Copy link
Copy Markdown
Contributor

Verification-only, no version bump — v1.7.1 is unaffected and needs no re-release.

What was wrong

xcf_verify_one probed for _CodeSignature or Versions/A/_CodeSignature. A versioned bundle keeps its signature at Versions/<name>/_CodeSignature, and the version directory is not always A — CPython's macOS framework uses the Python version, e.g. Versions/3.14. A correctly signed framework there was reported as unsigned.

dart_bridge's own macOS slice does use Versions/A, which is why this never fired here. It surfaced in python-build, whose Python.framework doesn't — see python-build#39, where a real signing run produced a valid Apple Distribution signature with a secure timestamp and then failed verification for this reason.

The fix

Ask codesign -dv. It exits non-zero with "code object is not signed at all", which is precisely the question being asked, and it doesn't care where the bundle keeps its _CodeSignature.

Verified

case result
published v1.7.1 (Versions/A) still verifies
macOS Python.framework (Versions/3.14), freshly signed now verifies
inner signature stripped still fails

Keeps this helper byte-identical to python-build's copy.

xcf_verify_one probed for `_CodeSignature` or `Versions/A/_CodeSignature`. A
versioned bundle keeps its signature at Versions/<name>/_CodeSignature, and the
version directory is not always "A": CPython's macOS framework uses the Python
version, e.g. Versions/3.14. A correctly signed framework there was therefore
reported as unsigned.

dart_bridge's own macOS slice does use Versions/A, so this never fired here --
it surfaced in python-build, whose Python.framework does not
(flet-dev/python-build#39).

Ask `codesign -dv` instead. It exits non-zero with "code object is not signed at
all", which is precisely the question, and it is layout-agnostic.

Verified: v1.7.1 still verifies, a macOS framework using Versions/3.14 now
verifies, and stripping an inner signature still fails.

Keeps this helper byte-identical to python-build's copy.
@FeodorFitsner
FeodorFitsner merged commit 77f7f67 into main Jul 30, 2026
36 checks passed
@FeodorFitsner
FeodorFitsner deleted the verify-signature-layout-agnostic branch July 30, 2026 21:26
@FeodorFitsner
FeodorFitsner restored the verify-signature-layout-agnostic branch July 30, 2026 21:26
@FeodorFitsner
FeodorFitsner deleted the verify-signature-layout-agnostic branch July 30, 2026 21:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant