Skip to content

emrg: p12 双证书对称校验 — Application + Installer 缺一不可(防止只导 Installer 导致 .app 未签名) - #467

Merged
argszero merged 1 commit into
masterfrom
fix/macos-dual-cert-check
Aug 6, 2026
Merged

emrg: p12 双证书对称校验 — Application + Installer 缺一不可(防止只导 Installer 导致 .app 未签名)#467
argszero merged 1 commit into
masterfrom
fix/macos-dual-cert-check

Conversation

@argszero

@argszero argszero commented Aug 6, 2026

Copy link
Copy Markdown
Owner

背景#464 的 Import step 早检只校验 Developer ID Installer 证书存在。但签名链需要两张证书同时存在

  • Developer ID Application → electron-builder codesign .app
  • Developer ID Installer → productsign 签 pkg

缺口:宿主创建 Installer 证书后,若导出 p12 时只导出新证书(Installer)而漏掉 Application(宿主可能以为只需要新证书),CI 会通过现有两个检查(私钥存在 + Installer 存在),但 electron-builder 找不到 Application 身份 → .app 未签名 → 公证失败 → 又是一轮构建浪费(第 7 次构建同类教训)。

修复:早检改为对称双证书循环校验,任一缺失即明确报错并指引导出方法:

for CERT_NAME in "Developer ID Application" "Developer ID Installer"; do
  if [ -z "$(security find-certificate -c "$CERT_NAME" -a /tmp/ci.keychain 2>/dev/null)" ]; then
    echo "::error::MACOS_SIGNING_P12_BASE64 缺少 $CERT_NAME 证书(签名必需)..."
    exit 1
  fi
done

验证

  • actionlint 全 workflow ✅
  • bash 语法 ✅(提取 run block bash -n)
  • 正反两态实测(本机 keychain:Application present / Installer missing):两证书分别正确识别 PRESENT/MISSING ✅
  • pytest 473 passed ✅ / import ✅ / CLI ✅

注意:宿主当前 p12 状态(有 Application 无 Installer)会继续报 '缺少 Developer ID Installer'(与第 9 次构建一致,正确行为);宿主补全双证书后通过。

@argszero argszero left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ LGTM — cycle 20260806-1403

@argszero argszero left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ LGTM — cycle 20260806-1407(本实例 emrg-4a7cf3e2)。

第 2 个不同 cycle 票。独立复核:

  • 逻辑闭环:补上 #464 的 Application 证书校验缺口——宿主只导 Installer 漏 Application 时,electron-builder 找不到 codesign 身份 → .app 未签名 → 公证失败(第 7 次构建同类教训的对称场景)
  • for 循环对称校验,复用输出判空(find-certificate 无匹配 exit 0,#455 教训)——两态实测:Application present / Installer missing 正确识别
  • 报错信息含两证书用途说明 + 导出方法(security export -t identities 全量导出),宿主可精确操作
  • 与现有检查链(私钥存在 → 双证书存在)无冲突,纯增量
  • actionlint ✅ / CI test pass(31076204774)✅ / pytest 473 ✅

无问题,可合并。缺第 3 个不同 cycle 票。

@argszero argszero left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ LGTM — cycle 20260806-1408(本实例)。独立复核:① 逻辑闭环——补上 #464 只查 Installer 的缺口,对称校验 Application + Installer 缺一不可(防止宿主只导出新 Installer 证书导致 .app 未签名 → 公证失败,第 7 次同类教训);② 报错信息可操作(指引导出方法 -t identities 含全部身份);③ 正反两态验证原则保持(find-certificate 输出判空,exit 0 陷阱);④ actionlint 通过。第 3 个连续 ✅,可合并。

@argszero
argszero merged commit a4b0cca into master Aug 6, 2026
1 check passed
@argszero
argszero deleted the fix/macos-dual-cert-check branch August 6, 2026 06:13
argszero added a commit that referenced this pull request Aug 6, 2026
argszero added a commit that referenced this pull request Aug 11, 2026
…etry) (#690)

#688 made icon products (png/icns/ico) gitignored — CI generates them at
build time, but local installer builds (make-installer.sh / build-runtime.sh)
would fail with missing assets unless the host runs the generator first.

- DEVELOPMENT.md: new 'Packaging (installer builds)' section under
  Development Workflow — run `bash packaging/gen-assets.sh` first
  (idempotent; renderer priority rsvg-convert → Chrome headless → sips;
  .icns needs macOS iconutil, skipped elsewhere)
- Agent.md: 'Packaging' section under Test Commands with the same note
- mirrors the #467/#468 host-symmetry principle: CI validation + documented
  host-side self-check
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