Detect an inner framework's signature without assuming Versions/A - #16
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Verification-only, no version bump — v1.7.1 is unaffected and needs no re-release.
What was wrong
xcf_verify_oneprobed for_CodeSignatureorVersions/A/_CodeSignature. A versioned bundle keeps its signature atVersions/<name>/_CodeSignature, and the version directory is not alwaysA— 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, whosePython.frameworkdoesn'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
Versions/A)Python.framework(Versions/3.14), freshly signedKeeps this helper byte-identical to python-build's copy.