Skip to content

Commit 4a007ab

Browse files
committed
sign: size policy tlv before header build
1 parent 642def1 commit 4a007ab

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

tools/keytools/sign.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1242,9 +1242,13 @@ static uint32_t header_required_size(int is_diff, uint32_t cert_chain_sz,
12421242
}
12431243

12441244
if (CMD.policy_sign) {
1245+
uint32_t policy_sig_sz = CMD.policy_sz;
1246+
if (policy_sig_sz == 0U) {
1247+
policy_sig_sz = CMD.signature_sz;
1248+
}
12451249
header_size_align_8(&idx);
12461250
header_size_append_tag(&idx,
1247-
CMD.policy_sz + (uint32_t)sizeof(uint32_t));
1251+
policy_sig_sz + (uint32_t)sizeof(uint32_t));
12481252
}
12491253
}
12501254

0 commit comments

Comments
 (0)