Skip to content

Commit 94af71e

Browse files
committed
Fix for signing tool and SHA3 padding at 8-bytes.
1 parent 6af52ad commit 94af71e

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

tools/keytools/sign.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ int main(int argc, char** argv)
413413
&fw_version32);
414414

415415
/* Append Four pad bytes, so timestamp is aligned */
416-
header_append_u32(header, &header_idx, 0xFFFFFFFF);
416+
header_idx += 4; /* memset 0xFF above handles value */
417417

418418
/* Append Timestamp field */
419419
stat(image_file, &attrib);
@@ -427,6 +427,9 @@ int main(int argc, char** argv)
427427
header_append_tag(header, &header_idx, HDR_IMG_TYPE, HDR_IMG_TYPE_LEN,
428428
&image_type);
429429

430+
/* Six pad bytes, Sha-3 requires 8-byte alignment. */
431+
header_idx += 6; /* memset 0xFF above handles value */
432+
430433
/* Calculate hashes */
431434
if (hash_algo == HASH_SHA256)
432435
{

0 commit comments

Comments
 (0)