diff --git a/CHANGELOG.md b/CHANGELOG.md index e40ee49..0fd1fbc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## Unreleased +- The holder verifier rejects a bundle whose reply token list is empty as an invalid receipt (exit 10). No receipt commits to an empty reply, so such a bundle is not an incomplete reply (exit 13). [Exit codes](verifier/README.md) - Rename the project to Akashi. The repository moved to `Lucid-Computing/akashi`. The CLI is now `akashi`, the wheel `akashi-verify`, the environment prefix `AKASHI_`, and the service units and paths `akashi*`. Protocol domains, the `x-akashi-receipt` header, `/.well-known/akashi.json` and the `akashi-pickup/1` envelope replace their `vig` forms. Receipts, pickups and verdicts made under the old domains no longer verify, and the reference vectors were regenerated. [Data model](docs/spec/03-data-model.md) - Document the recorded Maverick request and both offline CLI verdicts with exact measurement boundaries and machine-readable evidence. [Recorded demo](docs/demo/README.md) - Give contributors a CPU quickstart and issue forms that direct vulnerability reports to the private security channel. [Quickstart](README.md#try-it) ยท [Security reporting](SECURITY.md) diff --git a/tests/test_holder.py b/tests/test_holder.py index e847cb1..dc4d687 100644 --- a/tests/test_holder.py +++ b/tests/test_holder.py @@ -176,6 +176,16 @@ def test_wrong_original_budget_display_or_identity(self) -> None: self.assertEqual(verify(self.bundle((2,)), self.trusted).exit_code, 13) self.assertEqual(verify(self.bundle((200001, 3)), self.trusted).exit_code, 13) + def test_empty_reply_cannot_match_a_signed_transcript(self) -> None: + # A receipt never commits to an empty reply, so an emptied copy is invalid + # evidence, not an incomplete reply, whatever else the bundle carries. + bundle = self.bundle() + bundle["verification"]["reply_token_ids"] = [] + self.assertEqual(verify(bundle, self.trusted, now=self.now).exit_code, 10) + del bundle["history"] + bundle["text"] = "anything" + self.assertEqual(verify(bundle, self.trusted, now=self.now).exit_code, 10) + def test_checkpoint_and_inclusion_are_independent(self) -> None: first = self.bundle() old = first["history"]["sth"] diff --git a/verifier/holder.py b/verifier/holder.py index 412085f..66d6c38 100644 --- a/verifier/holder.py +++ b/verifier/holder.py @@ -167,8 +167,6 @@ def verify( if prompt != raw_ids(verification["prompt_token_ids"]): return result result = VerificationResult(10, "RECEIPT_INVALID") - if verification["reply_token_ids"] == []: - return VerificationResult(13, "INCOMPLETE") reply = raw_ids(verification["reply_token_ids"]) if receipt["transcript_commitment"] != transcript_commitment( COMMITMENT, profile, budget, receipt["salt"], prompt, reply