projects
/
oweals
/
u-boot.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Revert "video: mxsfb: Configure the clock after eLCDIF reset"
[oweals/u-boot.git]
/
tools
/
kwbimage.c
diff --git
a/tools/kwbimage.c
b/tools/kwbimage.c
index 3ca3b3b4a62f40e60d6d93fa70b2578803fa7ce2..b8f8d38212f5c00ee79bf89dd63ef585b27eacb2 100644
(file)
--- a/
tools/kwbimage.c
+++ b/
tools/kwbimage.c
@@
-1,3
+1,4
@@
+// SPDX-License-Identifier: GPL-2.0+
/*
* Image manipulator for Marvell SoCs
* supports Kirkwood, Dove, Armada 370, Armada XP, and Armada 38x
/*
* Image manipulator for Marvell SoCs
* supports Kirkwood, Dove, Armada 370, Armada XP, and Armada 38x
@@
-5,8
+6,6
@@
* (C) Copyright 2013 Thomas Petazzoni
* <thomas.petazzoni@free-electrons.com>
*
* (C) Copyright 2013 Thomas Petazzoni
* <thomas.petazzoni@free-electrons.com>
*
- * SPDX-License-Identifier: GPL-2.0+
- *
* Not implemented: support for the register headers in v1 images
*/
* Not implemented: support for the register headers in v1 images
*/
@@
-702,7
+701,7
@@
int kwb_verify(RSA *key, void *data, int datasz, struct sig_v1 *sig,
goto err_ctx;
}
goto err_ctx;
}
- if (
!EVP_VerifyFinal(ctx, sig->sig, sizeof(sig->sig), evp_key)
) {
+ if (
EVP_VerifyFinal(ctx, sig->sig, sizeof(sig->sig), evp_key) != 1
) {
ret = openssl_err("Could not verify signature");
goto err_ctx;
}
ret = openssl_err("Could not verify signature");
goto err_ctx;
}
@@
-1274,6
+1273,13
@@
static void *image_create_v1(size_t *imagesz, struct image_tool_params *params,
e = image_find_option(IMAGE_CFG_DEBUG);
if (e)
main_hdr->flags = e->debug ? 0x1 : 0;
e = image_find_option(IMAGE_CFG_DEBUG);
if (e)
main_hdr->flags = e->debug ? 0x1 : 0;
+ e = image_find_option(IMAGE_CFG_BINARY);
+ if (e) {
+ char *s = strrchr(e->binary.file, '/');
+
+ if (strcmp(s, "/binary.0") == 0)
+ main_hdr->destaddr = cpu_to_le32(params->addr);
+ }
#if defined(CONFIG_KWB_SECURE)
if (image_get_csk_index() >= 0) {
#if defined(CONFIG_KWB_SECURE)
if (image_get_csk_index() >= 0) {
@@
-1616,6
+1622,10
@@
static int kwbimage_verify_header(unsigned char *ptr, int image_size,
struct image_tool_params *params)
{
uint8_t checksum;
struct image_tool_params *params)
{
uint8_t checksum;
+ size_t header_size = kwbimage_header_size(ptr);
+
+ if (header_size > image_size)
+ return -FDT_ERR_BADSTRUCTURE;
if (!main_hdr_checksum_ok(ptr))
return -FDT_ERR_BADSTRUCTURE;
if (!main_hdr_checksum_ok(ptr))
return -FDT_ERR_BADSTRUCTURE;