Write signature size even when it's empty

Normally this has no effect, but when we generate metadata for small
files (<=4KB), merkle tree isn't generated. In such case, writing zero
will make the metadata format simpler and unconditional.

Test: manual
Change-Id: Ibe18175b580af3409c896a8bb97323792ad9c459
This commit is contained in:
Inseob Kim
2022-01-07 10:56:17 +09:00
parent 135c1f144f
commit 3d5ae80f50

View File

@@ -178,6 +178,7 @@ class FSVerityMetadataGenerator:
out.write(sig)
else:
out.write(pack('<I', SIG_TYPE_NONE))
out.write(pack('<I', 0))
# 4. merkle tree
with open(merkletree_file, 'rb') as f: