Re: [PATCH 1/4] cksum: fix -a sha2 --check handling of mixed length chec
From:
Collin Funk
Subject:
Re: [PATCH 1/4] cksum: fix -a sha2 --check handling of mixed length checksums
Date:
Tue, 27 Oct 2026 19:28:05 -0700
User-agent:
Gnus/5.13 (Gnus v5.13)
PƔdraig Brady <P@draigBrady.com> writes:
> It's not a usual case, but for consistency "-a sha2" should support
> e.g. untagged checksums that are a mix of sha256sum and sha512sum.
>
> * src/cksum.c (split_3): Reset the sha2 variant search if
> the generic sha2 is specified. It's ok to reset the global
> CKSUM_ALGORITHM as its subsequent use is conflicting with
> the specific chosen variant.
> * tests/cksum/cksum-c.sh: Add test cases.
> * NEWS: Mention the bug fix.
>
> Discovered by Anthropic's OSS Scanner, as bug ANT-2026-83HIODH2.
> Discovered by SecBuddyF (with Hy4-preview) of Tencent KeenSecurityLab.
> ---
> NEWS | 6 ++++++
> src/cksum.c | 4 ++++
> tests/cksum/cksum-c.sh | 14 ++++++++++++++
> 3 files changed, 24 insertions(+)
Nice work. Much better than the ugly solution I mentioned privately.
Thanks for that and the other fixes.
Collin