Hash the plaintext, not the encrypted bytes, in verify --deep (closes #131) #138

Merged
clawbot merged 1 commits from issue-131-deep-verify-blob-hash into next 2026-09-21 20:24:37 +02:00
1 Commits
Author SHA1 Message Date
sneak c2720d4b08 Hash the plaintext, not the encrypted bytes, in verify --deep (closes #131)
check / check (pull_request) Failing after 0s
Deep verification's final blob-integrity check hashed the encrypted
downloaded bytes with a single SHA256 and compared that to the blob's
remote name, which is the double SHA256 of the plaintext
(blobgen.Writer.Sum256). The two can never be equal, so verify --deep
reported every healthy blob as "blob hash mismatch". The per-chunk and
blob-existence checks were correct; only this final comparison was wrong.

It now hashes the decompressed plaintext as chunk verification streams it
and compares its double SHA256 to the blob name.

Added a test that backs up a real snapshot, deep-verifies it (which fails
before this fix), then flips a byte in one stored blob and confirms deep
verification then fails.

Model: opus-4-8
2026-09-21 17:54:17 +00:00