]> git.baikalelectronics.ru Git - uboot.git/commit
tools: kwbimage: Fix generating secure boot data image signature
authorPali Rohár <pali@kernel.org>
Sun, 29 Jan 2023 13:33:36 +0000 (14:33 +0100)
committerStefan Roese <sr@denx.de>
Wed, 1 Mar 2023 05:39:17 +0000 (06:39 +0100)
commita1139fdeaa01a5647d797f1c8698ccb4d884ba34
treea18ae6db99c2e7933715c44e271d803d30e20599
parentc4cf0dcd6a73ef00c42085924181da4ad300aa00
tools: kwbimage: Fix generating secure boot data image signature

Secure boot data image signature is calculated from the data image without
trailing 4-bit checksum. Commit 77bf89a1f015 ("tools: kwbimage: Simplify
aligning and calculating checksum") unintentionally broke this calculation
when it increased payloadsz variable by 4 bytes which was propagated also
into the add_secure_header_v1() function. Fix this issue by decreasing size
of buffer by 4 bytes from which is calculated secure boot data image
signature.

Fixes: 77bf89a1f015 ("tools: kwbimage: Simplify aligning and calculating checksum")
Signed-off-by: Pali Rohár <pali@kernel.org>
tools/kwbimage.c