aboutsummaryrefslogtreecommitdiff
path: root/tools/kwbimage.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/kwbimage.c')
-rw-r--r--tools/kwbimage.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/tools/kwbimage.c b/tools/kwbimage.c
index 875f636..224d815 100644
--- a/tools/kwbimage.c
+++ b/tools/kwbimage.c
@@ -8,6 +8,8 @@
* <thomas.petazzoni@free-electrons.com>
*/
+#define OPENSSL_API_COMPAT 0x10101000L
+
#include "imagetool.h"
#include <limits.h>
#include <image.h>
@@ -1398,9 +1400,6 @@ static void *image_create_v1(size_t *imagesz, struct image_tool_params *params,
headersz, image, secure_hdr))
return NULL;
- /* Calculate and set the header checksum */
- main_hdr->checksum = image_checksum8(main_hdr, headersz);
-
*imagesz = headersz;
/* Fill the real header size without padding into the main header */
@@ -1410,6 +1409,9 @@ static void *image_create_v1(size_t *imagesz, struct image_tool_params *params,
main_hdr->headersz_lsb = cpu_to_le16(headersz & 0xFFFF);
main_hdr->headersz_msb = (headersz & 0xFFFF0000) >> 16;
+ /* Calculate and set the header checksum */
+ main_hdr->checksum = image_checksum8(main_hdr, headersz);
+
return image;
}