Repository navigation
fix(verify): compare a checksum file's digests by the algorithm their length says - #318
Merged
Merged
Conversation
… length says A checksum file was taken to list the hash its name says, and one whose name says none was taken for SHA256. caddy's caddy_<version>_checksums.txt lists SHA512, so each digest was compared with the asset's SHA256, disagreed, and the release was reported as tampered: caddyserver/caddy v2.11.8 and v2.11.9 were never published, though every asset matches what the signed file lists. Each digest's length says which algorithm it is -- 32 hex digits MD5, 40 SHA1, 64 SHA256, 128 SHA512 -- so that is what it is compared under. An asset is hashed under all four as it is downloaded, which it is anyway, and a SHA256 is still held to the entry's checksum. An asset that wasn't downloaded has only its SHA256, so another algorithm's digest of it is skipped rather than guessed at. A file whose name says SHA512 or the like is now read as well, rather than left out. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ar2 assumed a checksum file lists the hash its name says, and treated a name that says none as SHA256. caddy's
caddy_<version>_checksums.txtlists SHA512. Each SHA512 digest was compared with the asset's SHA256, didn't match, and the release was reported as tampered. So caddyserver/caddy v2.11.8 and v2.11.9 were never published (aqua-registry-g2#16069), even though every asset matches what the signed file lists.Changes:
algorithmOf).hasher). A SHA256 digest is still compared with the entry's checksum.sha512sums.txt) was left out before. It is now read too.Checked locally:
ar2 run caddyserver/caddy@v2.11.9 --skip-prgenerates all six entries, and the log says they agree with the signedcaddy_2.11.9_checksums.txt.🤖 Generated with Claude Code