fix(arcup): accept a valid checksum written in uppercase hex - #302
Conversation
verify_checksum_file accepts a checksum whose hash matches ^[0-9A-Fa-f]{64}$ —
either case — but then compares it against compute_sha256, which always returns
lowercase (sha256sum and shasum both do). The comparison is case-sensitive, so a
correct digest written in uppercase fails as "Checksum verification failed" and
the install is refused for a genuine release.
Fold the expected checksum to lowercase before comparing, the same normalization
detect_platform already applies to uname output. Adds an uppercase case to
test_checksum_validation, which fails on main and passes with the fix.
|
Verified this independently at Confirmed on
Severity, honestly framed: I pulled a real The gap: no |
verify_checksum_fileaccepts a checksum whose hash matches^[0-9A-Fa-f]{64}$— either case — but then compares it againstcompute_sha256, which always returns lowercase (sha256sumandshasumboth do). The comparison is case-sensitive, so a correct digest written in uppercase fails asChecksum verification failedand the install is refused for a genuine release.Fold the expected checksum to lowercase before comparing, the same normalization
detect_platformalready applies tounameoutput. Adds an uppercase case totest_checksum_validation; it fails onmainand passes with the fix.shellcheck arcup/arcupis clean and the suite is 26/26.This is a separate defect from the open trailing-newline fixes (#243, #262) and the self-update verification work (#204/#223) — same function, different failure. It applies after the format check and touches only the comparison, so it composes with those rather than competing.