Repository navigation
fix(macos): skip revoked certificates when dev-run picks a signing identity - #20
Merged
Merged
Conversation
…entity dev-run.sh signed with the first "Apple Development" identity listed by `security find-identity -v`. That listing still counts a revoked certificate as valid, and a revoked certificate still signs and passes `codesign --verify`, but macOS refuses to launch the result (AMFI: "The signature on the file is invalid"; `open` fails with "Launchd job spawn failed", POSIX 163). With a revoked and a current certificate of the same name in the keychain, every dev run failed that way. Skip identities that find-identity flags with a CSSMERR_* note and identities whose certificate fails `security verify-cert -p codeSign -R ocsp`, report each skip, and use the first one that passes. If every candidate is skipped, exit with guidance to delete the revoked certificates or pin LCT_SIGN_IDENTITY. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
4 tasks done
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.
Summary
Scripts/dev-run.shsigned with the first "Apple Development" identity fromsecurity find-identity -v -p codesigning. On this machine the keychain holds two certificates with the same name, and the first one,45490EBA…, is revoked.security verify-certreportsCSSMERR_TP_CERT_REVOKEDfor it.A revoked certificate fails in a confusing way:
find-identity -vstill lists it as valid. At most it appends(CSSMERR_TP_CERT_REVOKED), and only once revocation status is cached.codesign --verify --strictpasses.-420 The signature on the file is invalid, andopenfails withLaunchd job spawn failed(POSIX 163).So every
dev-run.shrun failed untilLCT_SIGN_IDENTITYwas pinned by hand to the other certificate.Change
When
LCT_SIGN_IDENTITYis not set,dev-run.shnow goes through the Apple Development identities in order:find-identityflags with a(CSSMERR_*)note.security verify-cert -p codeSign -R ocspfails. If the network is unreachable, the revocation check soft-fails, so it never rejects a good certificate.LCT_SIGN_IDENTITY.Nothing changes when
LCT_SIGN_IDENTITYis set, or when the first certificate is fine.README.mdandRELEASE.mdare updated to match.Test plan
DevRunTestscases, using asecuritystub that answersfind-identity,find-certificateandverify-cert:find-identityis skipped without callingverify-cert;dev-run.sh, all 3 new tests fail.--no-launch: the script skips45490EBA…(CSSMERR_TP_CERT_REVOKED) and selects0AC25BFD….cd macos && ./Scripts/run_tests.sh: debug, release and-warnings-as-errorsbuilds pass, and all 507 tests pass with 0 failures.🤖 Generated with Claude Code