commit 6bb5d0b24b807fa77efc79f72bc8c2a2285713c9
parent 8b842c789c63b376f054d65163d7c7cc279e147c
Author: Quentin Rameau <quinq@fifth.space>
Date: Thu, 2 Apr 2026 23:45:53 +0200
crypt: Improve hash length verification
The current version would not detect incorrect hashes
of one more character than expected.
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libutil/crypt.c b/libutil/crypt.c
@@ -53,7 +53,7 @@ mdchecklist(FILE *listfp, struct crypt_ops *ops, uint8_t *md, size_t sz,
(*formatsucks)++;
continue;
}
- if ((file - line) / 2 != sz) {
+ if (file - line != sz * 2) {
(*formatsucks)++; /* checksum length mismatch */
continue;
}