# Windows evidence for pingdotgg/t3code#37461 (electron-updater signature-check timeout 20 s -> 120 s)
#
# Machine: Windows 11 Pro 10.0.26200 x64, PowerShell 5.1.26100.7462, Node v26.8.2, npm 11.19.1, git 2.55.0.
# Antivirus: Windows Defender (RealTimeProtectionEnabled True, OnAccessProtectionEnabled True,
# AMRunningMode Normal). SecurityCenter2 lists no other antivirus. This machine does NOT reproduce the
# #20345 hold: a fresh copy of the signed exe passes in about 3 s (C1, C2). Case D injects
# `Start-Sleep -Seconds 55;` ahead of Get-AuthenticodeSignature to stand in for the hold.
#
# Setup, in a new scratch directory:
# pristine\ and patched\: `npm init -y` and `npm install electron-updater@6.8.9 --ignore-scripts`.
# The PR's patches/electron-updater@6.8.9.patch, downloaded from the PR branch, SHA-256
# d7d7b5d0b419553f8bca100a083f5c8ae65ac8e3f234e56ccd99a45a1198505f (the lockfile's patch hash), applied
# with `git apply --verbose` in patched\node_modules\electron-updater: clean, exit 0.
# Check: the patched verifier has `120 * 1000` (line 48), the pristine one `20 * 1000` (line 47).
# windows-verifier-proof.cjs SHA-256 05e61ae874f60e20930d1c3b7dce9809a1efcf0fd9acbe5d09561ff9edf2237b,
# unchanged before and after the run.
# Signed exe: the installed T3 Code nightly's "T3 Code (Nightly).exe": embedded Authenticode signature,
# Status Valid, signer CN=T3 Tools Inc. Publisher name "T3 Tools Inc" from its resources\app-update.yml.
#
# Command (the verifier paths need a leading .\ so require() treats them as paths):
# node windows-verifier-proof.cjs .\pristine\node_modules\electron-updater\out\windowsExecutableCodeSignatureVerifier.js .\patched\node_modules\electron-updater\out\windowsExecutableCodeSignatureVerifier.js "%LOCALAPPDATA%\Programs\t3code\T3 Code (Nightly).exe" "T3 Tools Inc" . > results.txt 2>&1
#
# results.txt, verbatim. The "#< CLIXML" blocks are PowerShell progress output on stderr from the script's
# own Get-CimInstance child-process lookups (cases A, D1, D2); the DEP0190 line is Node 26 warning about
# shell:true with an args array, the pattern electron-updater itself uses.
{"env":{"node":"v26.8.2","os":"Windows_NT 10.0.26200","arch":"x64","powershell":"5.1.26100.7462","signedExe":"T3 Code (Nightly).exe","publisher":"T3 Tools Inc"}}
(node:29312) [DEP0190] DeprecationWarning: Passing args to a child process with shell option true can lead to security vulnerabilities, as the arguments are not escaped, only concatenated.
(Use `node --trace-deprecation ...` to show where the warning was created)
#< CLIXML
System.Management.Automation.PSCustomObjectSystem.Object1Preparing modules for first use.0-1-1Completed-1 2Preparing modules for first use.0-1-1Completed-1 {"case":"A: execFile(shell:true, timeout:5000) with the verifier's command shape; PowerShell sleeps 15 s","callbackAfterMs":5020,"killed":true,"signal":"SIGTERM","cmdAliveAfterKill":false,"powershellFound":true,"powershellAliveAfterKill":true,"powershellExitedAtMsFromStart":15277}
{"case":"B: upstream's synchronous 'ConvertTo-Json test' probe (execFileSync), 3 runs","ms":[408,307,373]}
{"case":"C1: patched, first check of a freshly written copy","settledAfterMs":2793,"outcome":"accepted (verifier returned null)","execFile":[{"timeoutMs":120000,"shell":true,"callbackAfterMs":2793,"killed":false,"powershellFound":null}],"probes":[],"ignoringValidationWarning":false}
{"case":"C2: pristine, same file","settledAfterMs":3002,"outcome":"accepted (verifier returned null)","execFile":[{"timeoutMs":20000,"shell":true,"callbackAfterMs":3002,"killed":false,"powershellFound":null}],"probes":[],"ignoringValidationWarning":false}
{"case":"C3: patched, wrong publisher","settledAfterMs":2009,"outcome":"rejected: publisherNames: Not The Publisher, raw info: {","execFile":[{"timeoutMs":120000,"shell":true,"callbackAfterMs":2009,"killed":false,"powershellFound":null}],"probes":[],"ignoringValidationWarning":false}
#< CLIXML
System.Management.Automation.PSCustomObjectSystem.Object1Preparing modules for first use.0-1-1Completed-1 2Preparing modules for first use.0-1-1Completed-1 {"case":"D1: pristine, check held 55 s by injected Start-Sleep","settledAfterMs":20396,"outcome":"threw: Command failed: set \"PSModulePath=\" & chcp 65001 >NUL & powershell.exe -NoProfile -NonInteractive -I [killed]","execFile":[{"timeoutMs":20000,"shell":true,"callbackAfterMs":20023,"killed":true,"powershellFound":1}],"probes":[{"timeoutMs":10000,"ms":372}],"ignoringValidationWarning":false,"killedChecksPowershellAliveAfterSettle":[true],"thosePowershellsExitedMsAfterSettle":36907}
#< CLIXML
System.Management.Automation.PSCustomObjectSystem.Object1Preparing modules for first use.0-1-1Completed-1 2Preparing modules for first use.0-1-1Completed-1 {"case":"D2: patched, check held 55 s by injected Start-Sleep","settledAfterMs":56926,"outcome":"accepted (verifier returned null)","execFile":[{"timeoutMs":120000,"shell":true,"callbackAfterMs":56925,"killed":false,"powershellFound":1}],"probes":[],"ignoringValidationWarning":false}