Skip to content

Commit

Permalink
Added 6 bytes to padding in manifest
Browse files Browse the repository at this point in the history
(fixes SHA-3 misaligned access)
Spotted via test-81
  • Loading branch information
danielinux committed Mar 19, 2020
1 parent f72e48f commit 5d80dcf
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tools/keytools/sign.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,11 @@

header += struct.pack('<H', img_type)

# Six pad bytes, Sha-3 requires 8-byte alignment.
header += struct.pack('BB', 0xFF, 0xFF)
header += struct.pack('BB', 0xFF, 0xFF)
header += struct.pack('BB', 0xFF, 0xFF)

print("Calculating %s digest..." % hash_algo)

if hash_algo == 'sha256':
Expand Down

0 comments on commit 5d80dcf

Please sign in to comment.