stabilizeApp: sign wrapped executables with the bundle's requirement #1
Loading…
Reference in a new issue
No description provided.
Delete branch "sign-wrapped-executables"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes https://github.com/natsukium/nix-mac-app-identity/issues/1.
Problem
A bundle wrapped with
makeBinaryWrapperkept its unstable identity afterstabilizeApp.Contents/MacOS/foois a C stub that execs.foo-wrappedby the absolute store path of the source derivation, andstabilize.shleft binaries inside the bundle untouched. The process the kernel holds, and the one TCC records the grant against, was therefore the unsigned original, which moves on every rebuild. Reproduced onpkgs.flameshotandpkgs.kitty.Fix
pname; amkAppBundleresult is now named<App>.app.Contents/MacOSis passed to rcodesign with a per-path--binary-identifier/--code-requirements-filescope and verified after signing, since rcodesign does not inherit either into nested Mach-Os. Nested bundles keep their own identity. Directory links, links into nested bundles, and names with:or@are unsupported.CFBundleIdentifiernaming the source store path is refused.Tests
20 → 50 checks. A self-signed team certificate (
tests/team.pem, fixed signing time) makes the vendor-signature fixtures reproducible in the sandbox.Verified on the real packages:
.flameshot-wrapped,.kitty-wrappedandkittencome out withdesignated => identifier "<bundle id>", no file in the output names the source path, and the binaries run.Sign every Mach-O under Contents/MacOS with the bundle's requirementto fix(stabilizeApp): sign wrapped executables with the bundle's requirement5a8398f5e5ecfaf9c6fbfix(stabilizeApp): sign wrapped executables with the bundle's requirementto stabilizeApp: sign wrapped executables with the bundle's requirementecfaf9c6fb3ccf1686393ccf168639fd67f94ab0