Files
simba-rmic-2026/client/scripts/test-windows-signing.ps1
T
sloray dac763eb3e
构建客户端 / 检查(类型 + 单元测试) (push) Canceled after 0s
构建客户端 / Linux x64(deb + AppImage) (push) Canceled after 0s
构建客户端 / Windows x64(NSIS 安装包) (push) Canceled after 0s
构建客户端 / macOS 通用(.app + .dmg) (push) Canceled after 0s
feat(client): 锁定终局结果并接入 Windows 签名构建
- fix(match): 首次归零结束对局并撤销双方扣血许可,裁判结果同步后不再改判

- fix(hud): 蓝方低血量始终保留队伍颜色

- build(windows): 校验代码签名身份和时间戳,明确标注未签名测试包

- docs(version): 说明发布标签基线与语义版本迭代
2026-10-31 10:18:09 +08:00

24 lines
1.4 KiB
PowerShell

[CmdletBinding()]
param()
$ErrorActionPreference = 'Stop'
Set-StrictMode -Version Latest
$build = Join-Path $PSScriptRoot 'build-windows-release.ps1'
function Must-Reject([scriptblock]$Action, [string]$Expected) {
$rejected = $false
try { & $Action } catch {
if ($_.Exception.Message -notmatch $Expected) { throw }
$rejected = $true
}
if (-not $rejected) { throw 'Signing preflight accepted an invalid configuration.' }
}
Must-Reject { & $build -CertificateThumbprint '' -PreflightOnly } 'certificate is required'
Must-Reject { & $build -CertificateThumbprint 'not-a-certificate' -AllowUnsigned -PreflightOnly } 'Invalid.*thumbprint'
Must-Reject { & $build -CertificateThumbprint ('0' * 40) -AllowUnsigned -PreflightOnly } 'not found'
Must-Reject { & $build -CertificateThumbprint '' -AllowUnsigned -TimestampUrl 'file:///tmp/timestamp' -PreflightOnly } 'Timestamp URL'
Must-Reject { & $build -CertificateThumbprint '' -AllowUnsigned -TimestampUrl 'https://user:secret@example.invalid' -PreflightOnly } 'Timestamp URL'
$result = & $build -CertificateThumbprint '' -AllowUnsigned -PreflightOnly
if ($result.signing -or -not $result.unsignedExplicitlyAllowed -or $result.digestAlgorithm -ne 'sha256' -or -not $result.tsp) {
throw 'Explicit unsigned preflight returned inconsistent signing metadata.'
}
Write-Host 'Windows signing preflight: 6 checks passed; no certificates or system settings were changed.'