Commit 46087aa2 authored by Marek Vasut's avatar Marek Vasut
Browse files

mxssb: Fix full-image hash checking

Check only 20 bytes of ths SHA1 sum of the whole image, as that's
the actual length of the SHA1 hash.
Signed-off-by: Marek Vasut's avatarMarek Vasut <>
parent 0b11a406
......@@ -1714,7 +1714,8 @@ static int sb_verify_image_end(struct sb_image_ctx *ictx, FILE *fp, off_t filesz
sb_aes_reinit(ictx, 0);
sb_aes_crypt(ictx, digest, digest, sizeof(digest));
ret = memcmp(digest, ictx->digest, sizeof(digest)) ? -EINVAL : 0;
/* Check all of 20 bytes of the SHA1 hash. */
ret = memcmp(digest, ictx->digest, 20) ? -EINVAL : 0;
if (ret)
fprintf(stdout, "[FAIL] Full-image checksum: BAD\n");
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment