AtlatestRepositorysigil-http3
sigil-http3 / tree / scriptsphantom-phone-query-check.sh
1
#!/usr/bin/env bash2
set -euo pipefail3
cd "$(dirname "$0")/.."4
mkdir -p build5
record_result() {6
local job_rc=$?7
printf 'RESULT phone-query-job rc=%s\n' "$job_rc" | tee -a build/phone-query-result.txt8
}9
trap record_result EXIT10
printf 'RESULT phone-query-loopback-only no-live-phone-listener\n' | tee build/phone-query-result.txt12
# This page-only check reuses a measured native binary without recompiling it.13
# Verify its exact hash, QUIC pin and completed real-echo/reaping receipt first.14
node --input-type=module <<'VERIFY'15
import { readFileSync, mkdirSync, copyFileSync, chmodSync } from 'node:fs';16
import { createHash } from 'node:crypto';17
const job = process.env.HTTP3_PREBUILT_JOB;18
if (!/^[a-z0-9][a-z0-9-]{0,63}$/.test(job ?? '')) throw new Error('Expected an admitted prebuilt job');19
const root = ((process.env.HTTP3_WORKSPACE_ROOT ?? (process.cwd() + '/build/workspaces')) + '/') + job + '/src';20
const receipt = JSON.parse(readFileSync(root + '/build/browser/capabilities.json'));21
const source = root + '/tools/interop/build/native/bin/http3-preflight';22
const hash = createHash('sha256').update(readFileSync(source)).digest('hex');23
if (receipt.mode !== 'webtransport-echo' || receipt.binarySha256 !== hash ||24
receipt.quicRevision !== readFileSync('quic.rev', 'utf8').trim() ||25
!['ready', 'bidirectionalEcho', 'unidirectionalEcho', 'datagramEcho', 'chromeReaped', 'serverReaped']26
.every(key => receipt[key] === true)) throw new Error('Prebuilt real-echo provenance mismatch');27
mkdirSync('tools/interop/build/native/bin', { recursive: true });28
copyFileSync(source, 'tools/interop/build/native/bin/http3-preflight');29
chmodSync('tools/interop/build/native/bin/http3-preflight', 0o700);30
console.log('RESULT verified-prebuilt-sha256=' + hash);31
VERIFY32
bash scripts/phantom-lifecycle-check.sh33
HTTP3_PREFLIGHT_PREBUILT=1 HTTP3_PREFLIGHT_HTTPS_PAGE=1 HTTP3_PREFLIGHT_QUERY=1 \34
bash scripts/phantom-browser-preflight.sh