diff --git a/install b/install index fb9da1e..f28c169 100755 --- a/install +++ b/install @@ -215,7 +215,8 @@ openssl_ed25519() { # Before anything from the download runs. Dev builds aren't signed, but a signature one carries must hold. if [ "$os" = darwin ] && [ "$channel" != dev ]; then - /usr/bin/codesign --verify --strict "-R=$MACOS_REQUIREMENT" "$binary" 2>/dev/null || + # A bare binary has no stapled ticket, so codesign only finds it online, and only when asked to. + /usr/bin/codesign --verify --strict --check-notarization "-R=$MACOS_REQUIREMENT" "$binary" 2>/dev/null || fail "opencode-console $version isn't signed and notarized by Anomaly; nothing was installed" elif [ "$os" = linux ]; then if [ -f "$binary.sig" ] && openssl_ed25519; then diff --git a/src/update/signature.ts b/src/update/signature.ts index 9a9ac04..f51bcc2 100644 --- a/src/update/signature.ts +++ b/src/update/signature.ts @@ -5,8 +5,8 @@ export * as Signature from "./signature" // (a65a5e37): `src/updater/macos.rs`'s code-signing requirement and `src/updater/linux.rs`'s ed25519 check, with the // message and key layout of `.github/release/sign-linux.sh`. // -// macOS `codesign --verify --strict -R=`: a Developer ID from Anomaly's team, identified as -// `anomaly.opencode-console`, and notarized +// macOS `codesign --verify --strict --check-notarization -R=`: a Developer ID from Anomaly's team, +// identified as `anomaly.opencode-console`, and notarized (a bare binary's ticket is only found online) // Linux `package/bin/opencode-console.sig`: ed25519 by Anomaly's release key over the binary's SHA-256 // Windows Authenticode: Valid, by Anomaly's Artifact Signing certificate (Hex's `windows.rs` pins the same signer) // @@ -92,10 +92,14 @@ export function verifyLinux(binary: string, channel: CliInstall.Channel, key = L /** macOS: `codesign` against `requirement`, without running the binary. */ export function verifyMacos(binary: string, requirement = MACOS_REQUIREMENT) { return new Promise((resolve, reject) => { - const child = spawn("/usr/bin/codesign", ["--verify", "--strict", `-R=${requirement}`, binary], { - stdio: ["ignore", "ignore", "pipe"], - env: UpdateEnvironment.tool(), - }) + const child = spawn( + "/usr/bin/codesign", + ["--verify", "--strict", "--check-notarization", `-R=${requirement}`, binary], + { + stdio: ["ignore", "ignore", "pipe"], + env: UpdateEnvironment.tool(), + }, + ) const errors: Buffer[] = [] const timer = setTimeout(() => child.kill("SIGKILL"), 60_000) child.stderr.on("data", (chunk: Buffer) => errors.push(chunk))