Repository navigation
fix(macos): sign with any valid certificate when no Apple-class identity is installed - #119008
harjothkhara wants to merge 1 commit into
Conversation
|
CI is red on
Nondeterminism across retries points at the runner rather than the diff. Every failing suite is macOS app runtime behavior — process bounding, window smoke, gateway probing, port tunnels — and none of them touch code signing. This PR changes only Every other check is green, including I cannot re-run these jobs from a fork PR. A maintainer re-run would confirm the flake reading; happy to rebase onto a newer |
|
Codex review: needs real behavior proof before merge. Reviewed September 27, 2026, 7:38 PM ET / 23:38 UTC (Revision 9). ClawSweeper reviewWhat this changesThe PR changes macOS app packaging and restart to share a certificate selector that ranks Apple identities, accepts other valid Keychain identities, and rejects rows marked unusable. Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readiness⛔ Blocked before merge - 7 items remain Current main still has the nonworking fourth signing tier, so this PR remains useful. The new commit fixes the prior invalid-Keychain-row finding, but its broader automatic selection can turn a previously successful ad-hoc restart into a signing failure. The signing policy needs a maintainer decision and native proof. Priority: P1 Review scores
Verification
How this fits togetherMac packaging reads Keychain identities to choose a certificate before signing and auditing an app bundle. The restart script uses that choice to decide whether to package a signed app or use ad-hoc signing. flowchart LR
A[Keychain identities] --> B[Shared identity selector]
B --> C{Identity selected?}
C -->|Yes| D[Mac app signer]
C -->|No| E[Ad-hoc restart path]
D --> F[Signature and Team ID audit]
F --> G[Packaged app]
Decision needed
Why: The documented fourth tier never worked on current main, while enabling it changes the default certificate and can make existing ad-hoc restart setups fail. Before merge
Findings
Agent review detailsSecurityNeeds attention: The patch broadens implicit certificate selection for app signing before maintainers have accepted that default. PR surfaceTests +108, Other -11. Total +97 across 4 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep automatic restart on the proven Apple identity classes and let operators explicitly select a non-Apple certificate; align the signing guide with that policy and validate any broader default through native signing and Team ID audit. Do we have a high-confidence way to reproduce the issue? Yes at the source-path level: current main's malformed fallback cannot select a non-Apple identity, and the proposed restart branch can be traced to the Team ID audit. There is no native before-and-after signing run for this head. Is this the best way to solve the issue? No. Sharing the selector fixes policy drift and rejects marked-invalid rows, but broadening the automatic default before resolving Team ID behavior is not yet a safe end-to-end repair. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against b90999ac8dbd. LabelsLabel changes: No label changes. Label justifications:
EvidenceSecurity concerns:
What I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (8 earlier review cycles)
|
|
@steipete — this needs a product decision before I revise the branch, per the ClawSweeper review above. Tagging you as the author of the signing-identity requirement (f23b16d); happy to redirect if someone else owns this. The question: should automatic Mac signing select any keychain-valid codesigning identity, or only Apple-class ones, with other certificates requiring an explicit Right now the two entry points disagree, and the docs side with neither consistently:
One fact worth weighing: because the fourth tier never worked in any released build, no operator has ever relied on it. So this is not repair-versus-regression — nobody loses behavior either way. It is a forward-looking choice about the default. The cost of Apple-only is that a developer holding a valid enterprise or internal-CA certificate is routed to ad-hoc signing, and the script's own warning notes ad-hoc builds do not persist TCC permissions across rebuilds. The cost of the broader policy is that automatic selection can pick a certificate the operator did not intend. Either outcome is fine by me, and I will do the work:
On proof: I cannot capture a real Apple-issued signing session on this machine. For option 2 I can produce a genuine capture using a locally created self-signed codesigning certificate — a real non-Apple-class identity through the real |
3b15f51 to
0f5f32e
Compare
5883084 to
13c78c5
Compare
|
@vincentkoc could you make a call on this one? The defect is still on current main (75b736c): the tier 4 fallback in ClawSweeper gates this on real behavior proof from a real setup. That needs a macOS keychain with signing identities, which an outside contributor cannot supply, while a maintainer with certs installed can verify in one run. If this is not worth that verification, say so and I will close it to free the slot. |
13c78c5 to
e332b0d
Compare
e332b0d to
6fb6962
Compare
|
Could a maintainer confirm whether non-Apple signing certificates should require explicit SIGN_IDENTITY rather than automatic selection, so I can preserve the existing ad-hoc restart behavior and revise this patch accordingly? |
|
Thanks @harjothkhara for investigating this and clarifying the policy choice. On current main ( I verified 11 focused checks using current-main signing blocks and the real codesign script's identity-selection entry point with isolated stubs; no native signing or contributor code was executed. Direct packaging intentionally requires Closing because the local development fallback is already available and reported. We'll keep ad-hoc as that default and leave release/notarization behavior unchanged. Rejecting unusable Keychain rows is useful separate hardening. Thanks again for the investigation! |
Related: #118989, #119019
What Problem This Solves
OpenClaw documents a four-tier macOS signing selection order: Developer ID Application, Apple Distribution, Apple Development, then the first other valid codesigning identity. The fallback parser never selected the fourth tier, and
restart-mac.shindependently used an Apple-class-only predicate.The historical PR also accepted any quoted
security find-identityrow. That is unsafe because macOS can quote an identity while marking it unusable, for example(CSSMERR_TP_NOT_TRUSTED).Current-Main Change
Rebuilt as one commit on current
main.scripts/lib/mac-signing-identity.sh, now parses the completesecurity find-identity -p codesigning -voutput once.securityexits nonzero.restart-mac.shnow delegates signing-key detection to that same selector, eliminating policy drift.Evidence
Current exact-head focused checks:
CSSMERR_TP_NOT_TRUSTEDrowssecuritystatus is preservedoxlint: passedoxfmt --check: passedbash -n: passed for the shared owner and both entry pointsgit diff --check: passedThe repository's type-aware lint wrapper exceeded this 3.7 GiB host's compiled-boundary budget before producing a source diagnostic; GitHub Actions is the authoritative full integration/type-aware run.
Remaining External Decision / Proof
This patch does not decide the product policy. Maintainers still need to choose whether auto-selection should accept every identity macOS reports as valid, or only Apple-class identities.
If the documented fourth tier is retained, final native proof requires a macOS machine with an already-trusted non-Apple codesigning identity. This Linux VPS cannot fabricate that Keychain trust result. The committed synthetic regressions cover the parser and both entry points without treating invalid rows as valid.
AI-assisted; implementation and evidence reviewed before publication.