diff --git a/docs/releases/stage-itscreen-1.0.37.md b/docs/releases/stage-itscreen-1.0.37.md new file mode 100644 index 0000000..1aeca20 --- /dev/null +++ b/docs/releases/stage-itscreen-1.0.37.md @@ -0,0 +1,9 @@ +# stage_itscreen 1.0.37 — EVAx10 5.1.55 revision 2 + +- Correct the 1.0.36 publication: its binary actually reported 5.1.54 despite + the 5.1.55 manifest. Replace it with a clean ARM64 build reporting 5.1.55 / 5010055. +- Advance the stage version so devices with 1.0.36 are offered the correction. +- Preserve registration, media and settings; retain the existing stage update contract. +- Exact binary digest and source commit are in stage_itscreen/release-provenance.json. +- Before replacing the installed binary, execute `--version` and require both version + and native build number to match the release provenance; reject mislabeled files. diff --git a/stage-releases.json b/stage-releases.json index 7d2803e..0aa52df 100644 --- a/stage-releases.json +++ b/stage-releases.json @@ -23,7 +23,7 @@ "version": "1.0.0" }, "stage_itscreen": { - "version": "1.0.36" + "version": "1.0.37" }, "stage_reverse_tunnels": { "version": "1.0.2" diff --git a/stage_itscreen/itscreen b/stage_itscreen/itscreen index 5f39487..efa4cab 100755 Binary files a/stage_itscreen/itscreen and b/stage_itscreen/itscreen differ diff --git a/stage_itscreen/itscreen.sha256 b/stage_itscreen/itscreen.sha256 index 0a47528..513b6ab 100644 --- a/stage_itscreen/itscreen.sha256 +++ b/stage_itscreen/itscreen.sha256 @@ -1 +1 @@ -5e9ab66b072aaa64a1b033992bf6bdc77a1a83c4a35342cbde58f4581753505d itscreen +5e14d2cabd2821620e03467bc5d8bc98d87895d3f6f22c3f82a9cf414c6d13d0 itscreen diff --git a/stage_itscreen/release-provenance.json b/stage_itscreen/release-provenance.json index f335245..cd50bd6 100644 --- a/stage_itscreen/release-provenance.json +++ b/stage_itscreen/release-provenance.json @@ -1,14 +1,16 @@ { "schema_version": 1, "client_version": "5.1.55", - "stage_version": "1.0.36", + "stage_version": "1.0.37", "platform": "linux", "architecture": "arm64", "source_repository": "https://git.iomatex.com/Development/It-screenClient.git", "source_branch": "iomatex_dev", - "source_commit": "47147d767678bcbb19dc48b578b51ff65a2f2278", + "source_commit": "c4739d5dd87ba43c94578af0c6745b0086829175", "binary": "itscreen", - "sha256": "5e9ab66b072aaa64a1b033992bf6bdc77a1a83c4a35342cbde58f4581753505d", - "assembly_method": "Native release build and validation on the Debian 11 ARM64 bench with Qt 5.15.2", - "native_version_code": 5010055 + "sha256": "5e14d2cabd2821620e03467bc5d8bc98d87895d3f6f22c3f82a9cf414c6d13d0", + "assembly_method": "Clean isolated release build from git archive using iomatex-debian-dev:local; --version and linked libraries verified on Debian 11 ARM64", + "native_version_code": 5010055, + "release_revision": 2, + "verified_version_output": "5.1.55 5010055" } diff --git a/stage_itscreen/stage_itscreen_install.sh b/stage_itscreen/stage_itscreen_install.sh index fe24006..44fab12 100755 --- a/stage_itscreen/stage_itscreen_install.sh +++ b/stage_itscreen/stage_itscreen_install.sh @@ -517,6 +517,8 @@ install_itscreen_binary() ( src=$(mktemp /userdata/.iomatex-client.XXXXXX) trap 'rm -f "$src"' EXIT python3 "$IOMATEX_PROJECT_ROOT/offline/git_delivery.py" fetch stage_itscreen/itscreen "$src" + chmod 0755 "$src" + python3 "$SCRIPT_DIR/verify_client_release.py" "$src" "$SCRIPT_DIR/release-provenance.json" install -m 0755 -o "$ITS_USER" -g "$ITS_GROUP" "$src" "$ITS_BINARY" ) diff --git a/stage_itscreen/test_verify_client_release.py b/stage_itscreen/test_verify_client_release.py new file mode 100644 index 0000000..00a511d --- /dev/null +++ b/stage_itscreen/test_verify_client_release.py @@ -0,0 +1,23 @@ +import json +import tempfile +import unittest +from pathlib import Path +from verify_client_release import verify + + +class EmbeddedReleaseTest(unittest.TestCase): + def test_matching_and_mislabeled_binaries(self): + with tempfile.TemporaryDirectory() as directory: + root = Path(directory) + manifest = root / 'release.json' + manifest.write_text(json.dumps({'client_version': '5.1.55', 'native_version_code': 5010055})) + binary = root / 'client' + for output, accepted in [('5.1.55 5010055', True), ('5.1.54 5010054', False), ('5.1.55 5010054', False), ('', False)]: + with self.subTest(output=output): + binary.write_text('#!/bin/sh\nprintf "%s\\n" "' + output + '"\n') + binary.chmod(0o755) + if accepted: + self.assertEqual(verify(binary, manifest), output) + else: + with self.assertRaises(ValueError): + verify(binary, manifest) diff --git a/stage_itscreen/verify_client_release.py b/stage_itscreen/verify_client_release.py new file mode 100644 index 0000000..874f4c8 --- /dev/null +++ b/stage_itscreen/verify_client_release.py @@ -0,0 +1,21 @@ +#!/usr/bin/env python3 +"""Check the executable itself before installing a client release.""" +import json +import subprocess +import sys + + +def verify(binary, provenance): + with open(provenance, encoding="utf-8") as stream: + metadata = json.load(stream) + expected = f"{metadata['client_version']} {metadata['native_version_code']}" + result = subprocess.run([str(binary), "--version"], capture_output=True, + text=True, timeout=10, check=True) + actual = result.stdout.strip() + if actual != expected: + raise ValueError(f"Client release mismatch: expected {expected!r}, got {actual!r}") + return actual + + +if __name__ == "__main__": + print(verify(sys.argv[1], sys.argv[2])) diff --git a/stage_itscreen/version.json b/stage_itscreen/version.json index 06645c7..e37267d 100644 --- a/stage_itscreen/version.json +++ b/stage_itscreen/version.json @@ -1,3 +1,3 @@ { - "version": "1.0.36" + "version": "1.0.37" }