Prepare the retained passive Windows echo build and time-profile successor
Rust development slice / linux (push) Failing after 7s

This commit is contained in:
2026-11-15 23:54:35 +01:00
parent b0b7e4e2f7
commit 7b4c71483b
6 changed files with 268 additions and 27 deletions
+17 -14
View File
@@ -2,9 +2,12 @@
#requires -RunAsAdministrator
# Publish the next trusted-OS profile from actual passive service observations.
[CmdletBinding()]
param([Parameter(Mandatory)][ValidateSet('Prepare','Publish','Read','FinishStarts')][string]$Action)
param(
[Parameter(Mandatory)][ValidateSet('Prepare','Publish','Read','FinishStarts')][string]$Action,
[switch]$EchoPassive
)
$ErrorActionPreference='Stop'
$commonHash='c54e36b32a2fcccb072f2cca52a38b6c4da31755d86205599016c5d180f5cec4'
$commonHash='723bd03d809191455f5909644f518ae2bebabbbb9ce6399f3007cb4cc0bc9341'
$common=Join-Path $PSScriptRoot 'Set-PassiveJobPair.ps1'
if ((Get-FileHash -LiteralPath $common -Algorithm SHA256).Hash -ne $commonHash) {
throw 'The reviewed passive-pair controller must be next to this script'
@@ -17,6 +20,7 @@ $j=$text.IndexOf($last,[StringComparison]::Ordinal)
if ($i -lt 0 -or $j -le $i -or $i -ne $text.LastIndexOf($first,[StringComparison]::Ordinal) -or
$j -ne $text.LastIndexOf($last,[StringComparison]::Ordinal)) { throw 'Passive-pair definition boundary' }
# Fixed declarations and functions only. Its Prepare, Install and Restore bodies are excluded.
$Mode='Read'
. ([scriptblock]::Create($text.Substring($i,$j-$i)))
CheckControl $work $true
$activation=(Marker 'profile-publish-intent')
@@ -34,11 +38,11 @@ function RoleDigests($platformHash,$installedHash,$independentHash,$previous) {
if ($name -ceq 'system_helper') { $bound=$installed.helper }
$old=@($previous.trusted_os_active_guest.qualifications | Where-Object { $_.role -ceq $name })
if ($old.Count -ne 1) { throw 'Expected one predecessor witness per role' }
$archive=Join-Path $oldFolder ($name+'-qualification.json')
$archive=$roleArchive -f $name
CheckControl $archive $false
if ((Hash $archive) -cne $old[0].qualification_sha256) { throw 'Original role provenance changed' }
$archived=Get-Content -LiteralPath $archive -Raw | ConvertFrom-Json
$build='a003dfa8cc2397a99933aceeb2d8dab51f883ab9cdf27876fbfc94a78873044c'
$build=$agentBuildHash
if ($name -ceq 'system_helper') {
# The old pair receipt linked the later agent and referenced the
# separately built helper. Identify the actual helper link itself.
@@ -58,8 +62,7 @@ function RoleDigests($platformHash,$installedHash,$independentHash,$previous) {
}
function BuildSuccessor {
$installedHash=Hash (Marker 'installed')
$unit=Join-Path $boot 'profile-unit-fcec400-result.json'
if ((Hash $unit) -cne '48de474d842ebc87550ba2e27b66086e6aa573973f252f4b8e19ac7b12b75a63') { throw 'Windows unit evidence changed' }
if ((Hash $unitProof) -cne $unitHash) { throw 'Windows unit evidence changed' }
$independent=[ordered]@{agent=(LiveRole 'agent' $newHashes.agent);helper=(LiveRole 'helper' $helperHash);files=(CurrentFiles);device=(PreservedDevice)}
foreach ($field in $independent.Keys) {
if (!(JsonEqual $installed.$field $independent.$field)) { throw "Independent native pair read differs: $field" }
@@ -74,7 +77,7 @@ function BuildSuccessor {
$old.trusted_os_active_guest.operating_assumption -cne 'active_guest_no_pause_save_restore_snapshot_migration_host_suspend' -or
$old.trusted_os_active_guest.platform -cne 'kvm_qemu_hypervclock' -or
@($old.trusted_os_active_guest.qualifications).Count -ne 2) { throw 'Unexpected original V2 contract' }
$platform=Join-Path $oldFolder 'platform-provenance.json'
$platform=$platformArchive
CheckControl $platform $false
$oldPlatformHash=Hash $platform
if ($oldPlatformHash -cne $old.trusted_os_active_guest.platform_provenance_sha256) { throw 'Original platform provenance changed' }
@@ -83,9 +86,8 @@ function BuildSuccessor {
platform=$old.trusted_os_active_guest.platform;previous_platform_provenance_sha256=$oldPlatformHash
predecessor_profile_sha256=$profileHash;pair_case_id=$id;pair_result_sha256=$installedHash
independent_pair_readback_sha256=$independentHash;independent_physical_calibration_claimed=$false
agent_build_receipt_sha256='a003dfa8cc2397a99933aceeb2d8dab51f883ab9cdf27876fbfc94a78873044c'
linux_profile_unit_sha256='ee3a2c99651491a2fd876f1a3463919dc32d9509d9f9ef4eb73a36aa848bb56d'
windows_profile_unit_sha256=(Hash $unit)
agent_build_receipt_sha256=$agentBuildHash;linux_profile_unit_sha256=$linuxProofHash
windows_profile_unit_sha256=(Hash $unitProof)
})
$platformHash=Hash (Marker 'profile-platform')
$roles=RoleDigests $platformHash $installedHash $independentHash $old
@@ -116,13 +118,14 @@ function BuildSuccessor {
Record 'profile-prepared' ([ordered]@{
id=$id;utc=[DateTime]::UtcNow.ToString('o');predecessor=(FileIdentity $target);successor_sha256=(Hash $draft)
source_sha256=$installedHash;independent_sha256=$independentHash;platform_sha256=$platformHash;role_sha256=$roles
original_publish_result_sha256='62a04be9c7d08d3687b51eacd6adbe290b91e16ba934d6b5bb531e8764a56cf5'
predecessor_revision=1;successor_revision=2;signing_key_generation=$old.key_generation;clock_qualified=$false
original_publish_result_sha256=$previousPublicationHash
predecessor_revision=$previousRevision;successor_revision=($previousRevision+1);signing_key_generation=$old.key_generation;clock_qualified=$false
})
}
function CheckPrepared {
if ($prepared.id -cne $id -or $prepared.predecessor.sha256 -cne $profileHash -or
$prepared.successor_revision -ne 2 -or $prepared.predecessor_revision -ne 1 -or $prepared.signing_key_generation -ne 1 -or
$prepared.successor_revision -ne ($previousRevision+1) -or $prepared.predecessor_revision -ne $previousRevision -or $prepared.signing_key_generation -ne 1 -or
$prepared.original_publish_result_sha256 -cne $previousPublicationHash -or
$prepared.source_sha256 -cne (Hash (Marker 'installed')) -or
$prepared.independent_sha256 -cne (Hash (Marker 'profile-independent-native-read')) -or
$prepared.platform_sha256 -cne (Hash (Marker 'profile-platform')) -or
@@ -169,7 +172,7 @@ function FinishPublication {
}
Record 'profile-published' ([ordered]@{
id=$id;utc=[DateTime]::UtcNow.ToString('o');configuration=(FileIdentity $target)
predecessor=$prepared.predecessor; successor_revision=2; signing_key_generation=1
predecessor=$prepared.predecessor; successor_revision=($previousRevision+1); signing_key_generation=1
role_proofs=$prepared.role_sha256; publication_since=$intent.utc
agent=(LiveRole 'agent' $newHashes.agent); helper=(LiveRole 'helper' $helperHash)
signed_runtime_verified=$false; job_mode=$false;privileged_effects=$false