Retain Windows signed sync responses across transient clock failures
Rust development slice / linux (push) Failing after 8s

This commit is contained in:
2026-11-16 12:09:52 +01:00
parent 2d5126876f
commit c7a69d9409
7 changed files with 399 additions and 22 deletions
@@ -12,10 +12,19 @@ $manifestPath = Join-Path (Join-Path $bootstrap $ManifestSha256) 'successor.json
if ((Get-FileHash -LiteralPath $manifestPath).Hash.ToLowerInvariant() -cne $ManifestSha256) { throw 'Manifest changed.' }
$m = Get-Content -LiteralPath $manifestPath -Raw | ConvertFrom-Json
$fields = 'agent_build_sha256,case_id,linux_proof_sha256,new_agent_sha256,old_agent_sha256,old_pin_sha256,old_profile_sha256,old_settings_sha256,previous_publication_sha256,windows_proof_sha256'
$previousCaseId = 'c62d698d-d044-4815-acbe-3eeb383d44d5'
$requestedPreviousRevision = 4
if ($null -ne $m.PSObject.Properties['previous_case_id']) {
$fields = 'agent_build_sha256,case_id,linux_proof_sha256,new_agent_sha256,old_agent_sha256,old_pin_sha256,old_profile_sha256,old_settings_sha256,previous_case_id,previous_publication_sha256,previous_revision,windows_proof_sha256'
$previousCaseId = [guid]::ParseExact($m.previous_case_id,'D').ToString()
if ($previousCaseId -cne $m.previous_case_id -or $m.previous_revision -isnot [int] -or
$m.previous_revision -lt 4 -or $m.previous_revision -gt 1000) { throw 'Expected exact previous publication identity.' }
$requestedPreviousRevision = $m.previous_revision
}
if ((($m.PSObject.Properties.Name | Sort-Object) -join ',') -cne $fields -or
[guid]::ParseExact($m.case_id,'D').ToString() -cne $m.case_id) { throw 'Unexpected development manifest schema.' }
foreach ($p in $m.PSObject.Properties) {
if ($p.Name -cne 'case_id' -and $p.Value -cnotmatch '^[0-9a-f]{64}$') { throw 'Manifest digest format.' }
if ($p.Name -notin @('case_id','previous_case_id','previous_revision') -and $p.Value -cnotmatch '^[0-9a-f]{64}$') { throw 'Manifest digest format.' }
}
if ($m.old_agent_sha256 -ceq $m.new_agent_sha256) { throw 'No successor code.' }
@@ -38,25 +47,25 @@ if ($i -lt 0 -or $j -le $i -or $i -ne $text.LastIndexOf($first,[StringComparison
$EchoPassive = $false
$Mode = 'Read'
. ([scriptblock]::Create($text.Substring($i,$j-$i)))
$previousRevision = $requestedPreviousRevision
CheckControl $bootstrap $true
CheckControl (Split-Path $manifestPath) $true
CheckControl $manifestPath $false
$previousCase = Join-Path $bootstrap 'job-passive-pair-c62d698d-d044-4815-acbe-3eeb383d44d5'
$previousCase = Join-Path $bootstrap ('job-passive-pair-' + $previousCaseId)
$previousPublication = Join-Path $previousCase 'profile-published.json'
CheckControl $previousCase $true
CheckControl $previousPublication $false
if ((Hash $previousPublication) -cne $m.previous_publication_sha256) { throw 'Previous publication changed.' }
$previous = Get-Content -LiteralPath $previousPublication -Raw | ConvertFrom-Json
if ($previous.successor_revision -ne 4 -or $previous.configuration.sha256 -cne $m.old_profile_sha256 -or
$previous.agent.image_file.sha256 -cne $m.old_agent_sha256) { throw 'Expected actual revision 4 predecessor.' }
if ($previous.successor_revision -ne $previousRevision -or $previous.configuration.sha256 -cne $m.old_profile_sha256 -or
$previous.agent.image_file.sha256 -cne $m.old_agent_sha256) { throw 'Expected actual predecessor publication.' }
$id = $m.case_id
$work = Join-Path $bootstrap ('job-passive-pair-' + $id)
$oldHashes = [ordered]@{agent=$m.old_agent_sha256;settings=$m.old_settings_sha256;pin=$m.old_pin_sha256}
$newHashes = [ordered]@{agent=$m.new_agent_sha256}
$source = Join-Path (Join-Path $bootstrap $newHashes.agent) 'rmm-agent-windows.exe'
$profileHash = $m.old_profile_sha256
$previousRevision = 4
$previousPublicationHash = $m.previous_publication_sha256
$platformArchive = Join-Path $previousCase 'profile-platform.json'
$roleArchive = Join-Path $previousCase 'profile-role-{0}.json'