Skip to content

A lightweight, macOS-style dock for Windows 11, with glass visuals, smooth magnification, and Genie effect.

feat: add timeouts for verification steps in release workflow and improve Authenticode script logging

CristianOlivera1bb372210bcab
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index c0ea6d2..d7d537d 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -106,6 +106,7 @@ jobs:
- name: Verify both signed programs
if: env.SIGNING_MODE != 'Unsigned'
+ timeout-minutes: 5
shell: pwsh
env:
PRODUCTION_THUMBPRINT: ${{ vars.SIGNPATH_PRODUCTION_CERTIFICATE_THUMBPRINT }}
@@ -119,6 +120,7 @@ jobs:
# (checked locally with a test certificate).
- name: Rebuild the installer around the signed programs
if: env.SIGNING_MODE != 'Unsigned'
+ timeout-minutes: 10
shell: pwsh
env:
PRODUCTION_THUMBPRINT: ${{ vars.SIGNPATH_PRODUCTION_CERTIFICATE_THUMBPRINT }}
@@ -160,6 +162,7 @@ jobs:
- name: Verify and use the signed installer
if: env.SIGNING_MODE != 'Unsigned'
+ timeout-minutes: 5
shell: pwsh
env:
PRODUCTION_THUMBPRINT: ${{ vars.SIGNPATH_PRODUCTION_CERTIFICATE_THUMBPRINT }}
diff --git a/scripts/Assert-Authenticode.ps1 b/scripts/Assert-Authenticode.ps1
index 2bd2150..b11faba 100644
--- a/scripts/Assert-Authenticode.ps1
+++ b/scripts/Assert-Authenticode.ps1
@@ -17,6 +17,7 @@ $reports = [Collections.Generic.List[object]]::new()
try {
foreach ($file in $Path) {
$resolved = (Resolve-Path -LiteralPath $file).Path
+ Write-Host "Reading Authenticode signature: $resolved"
$signature = Get-AuthenticodeSignature -LiteralPath $resolved
$cert = $signature.SignerCertificate
$row = [ordered]@{
@@ -30,6 +31,7 @@ try {
thumbprint = if ($cert) { $cert.Thumbprint } else { $null }
status = [string]$signature.Status
message = $signature.StatusMessage
+ stage = 'initial-status'
}
$reports.Add($row)
Write-Host ($row | ConvertTo-Json -Compress)
@@ -44,12 +46,27 @@ try {
throw 'Test certificate trust may only be installed temporarily on a GitHub-hosted Actions runner.'
}
if (-not $store) {
- $store = [Security.Cryptography.X509Certificates.X509Store]::new('Root', 'CurrentUser')
+ # CurrentUser\Root can open a Security Warning confirmation,
+ # which cannot be answered by an unattended runner. Only this
+ # disposable, GitHub-hosted VM may trust the pinned test root.
+ $row.stage = 'opening-test-root-store'
+ Write-Host 'Opening temporary test trust: LocalMachine\Root (GitHub-hosted runner only).'
+ $store = [Security.Cryptography.X509Certificates.X509Store]::new('Root', 'LocalMachine')
$store.Open([Security.Cryptography.X509Certificates.OpenFlags]::ReadWrite)
+ $row.stage = 'finding-test-root'
+ Write-Host "Checking pinned test root: $testThumbprint"
$existing = $store.Certificates.Find(
[Security.Cryptography.X509Certificates.X509FindType]::FindByThumbprint, $testThumbprint, $false)
- if ($existing.Count -eq 0) { $store.Add($cert); $added = $true }
+ if ($existing.Count -eq 0) {
+ $row.stage = 'adding-test-root'
+ Write-Host 'Installing the pinned test root temporarily.'
+ $store.Add($cert)
+ $added = $true
+ Write-Host 'Temporary test root installed.'
+ }
}
+ $row.stage = 'rechecking-signature'
+ Write-Host "Rechecking Authenticode with temporary test trust: $file"
$signature = Get-AuthenticodeSignature -LiteralPath $resolved
} elseif ($cert.Thumbprint -eq $testThumbprint -or $cert.Subject -eq $cert.Issuer) {
throw "$file uses a test/self-signed certificate and cannot be released. Configure the production certificate in SignPath."
@@ -58,16 +75,19 @@ try {
}
$row.status = [string]$signature.Status
$row.message = $signature.StatusMessage
+ $row.stage = 'final-status'
Write-Host "Final Authenticode status for ${file}: $($signature.Status): $($signature.StatusMessage)"
if ($signature.Status -ne 'Valid') {
throw "Authenticode verification failed for ${file}: $($signature.Status): $($signature.StatusMessage). See signature-report.json; do not bypass this check."
}
+ $row.stage = 'complete'
}
} finally {
try {
if ($store) {
try {
if ($added) {
+ Write-Host 'Removing the temporary pinned test root.'
foreach ($certificate in $store.Certificates.Find(
[Security.Cryptography.X509Certificates.X509FindType]::FindByThumbprint, $testThumbprint, $false)) {
$store.Remove($certificate)
diff --git a/scripts/Test-CodeSigning.ps1 b/scripts/Test-CodeSigning.ps1
index ed891e8..9d04c8c 100644
--- a/scripts/Test-CodeSigning.ps1
+++ b/scripts/Test-CodeSigning.ps1
@@ -88,6 +88,22 @@ try {
throw 'Test lane must never generate an updater signature.'
}
Write-Host 'PASS: tests cannot prepare release files, updater signatures or draft releases'
+ # A native verification call can wait on Windows UI or certificate services.
+ # Bound every step containing one, independently of SignPath approval waits.
+ foreach ($entry in @(
+ @{ Name = 'Verify both signed programs'; Minutes = 5 },
+ @{ Name = 'Rebuild the installer around the signed programs'; Minutes = 10 },
+ @{ Name = 'Verify and use the signed installer'; Minutes = 5 }
+ )) {
+ $block = "- name: " + [regex]::Escape($entry.Name) + "\r?\n if: env.SIGNING_MODE != 'Unsigned'\r?\n timeout-minutes: " + $entry.Minutes + "\r?\n"
+ if ($workflow -notmatch $block) { throw "$($entry.Name) must have a bounded timeout." }
+ }
+ Write-Host 'PASS: native verification steps have bounded timeouts'
+ $verifier = Get-Content $verifyScript -Raw
+ if (-not $verifier.Contains("::new('Root', 'LocalMachine')") -or $verifier.Contains("::new('Root', 'CurrentUser')")) {
+ throw 'Hosted test trust must avoid the interactive CurrentUser root store.'
+ }
+ Write-Host 'PASS: hosted test trust avoids the interactive CurrentUser root store'
} finally {
$env:GITHUB_ACTIONS = $savedActions
$env:RUNNER_ENVIRONMENT = $savedRunner