Skip to content

Commit 5d80dcf

Browse files
committed
Added 6 bytes to padding in manifest
(fixes SHA-3 misaligned access) Spotted via test-81
1 parent f72e48f commit 5d80dcf

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

tools/keytools/sign.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,11 @@
232232

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

235+
# Six pad bytes, Sha-3 requires 8-byte alignment.
236+
header += struct.pack('BB', 0xFF, 0xFF)
237+
header += struct.pack('BB', 0xFF, 0xFF)
238+
header += struct.pack('BB', 0xFF, 0xFF)
239+
235240
print("Calculating %s digest..." % hash_algo)
236241

237242
if hash_algo == 'sha256':

0 commit comments

Comments
 (0)