tools: kwbimage: Fix checksum calculation for v1 images
authorPierre Bourdon <delroth@gmail.com>
Sat, 25 Dec 2021 19:50:19 +0000 (20:50 +0100)
committerStefan Roese <sr@denx.de>
Wed, 5 Jan 2022 15:31:58 +0000 (16:31 +0100)
commit9203c73895ab410f7a57f56ec26201253a1f008b
tree126947ea7614970b1e7d8bb889a626a00222651b
parentb3f84a939f514a266a5a3aa97cbe2787c2d73d89
tools: kwbimage: Fix checksum calculation for v1 images

Recent changes caused fields in the image main header to be modified
after the header checksum had already been computed. Move the checksum
computation to once again be the last operation performed on the header.

Fixes: 2b0980c24027 ("tools: kwbimage: Fill the real header size into the main header")
Signed-off-by: Pierre Bourdon <delroth@gmail.com>
Reviewed-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
tools/kwbimage.c