diff mbox series

[v2,3/3] rockchip: mkimage: fix wrong range of rc4 encoding for boot image

Message ID 20191205105829.14715-4-jeffy.chen@rock-chips.com
State Superseded
Delegated to: Kever Yang
Headers show
Series mkimage/rockchip: support packing optional second level boot-loader | expand

Commit Message

Jeffy Chen Dec. 5, 2019, 10:58 a.m. UTC
The rc4 encoding should cover spl header as well, and the file_size
contains spl header too.

Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
---

Changes in v2: None

 tools/rkimage.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Kever Yang Dec. 13, 2019, 3:24 a.m. UTC | #1
On 2019/12/5 下午6:58, Jeffy Chen wrote:
> The rc4 encoding should cover spl header as well, and the file_size
> contains spl header too.
>
> Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>

Thanks,
- Kever
> ---
>
> Changes in v2: None
>
>   tools/rkimage.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/rkimage.c b/tools/rkimage.c
> index ae50de55c9..1c5540b1c3 100644
> --- a/tools/rkimage.c
> +++ b/tools/rkimage.c
> @@ -18,7 +18,7 @@ static void rkimage_set_header(void *buf, struct stat *sbuf, int ifd,
>   	memcpy(buf, rkcommon_get_spl_hdr(params), RK_SPL_HDR_SIZE);
>   
>   	if (rkcommon_need_rc4_spl(params))
> -		rkcommon_rc4_encode_spl(buf, 4, params->file_size);
> +		rkcommon_rc4_encode_spl(buf, 0, params->file_size);
>   }
>   
>   static int rkimage_check_image_type(uint8_t type)
diff mbox series

Patch

diff --git a/tools/rkimage.c b/tools/rkimage.c
index ae50de55c9..1c5540b1c3 100644
--- a/tools/rkimage.c
+++ b/tools/rkimage.c
@@ -18,7 +18,7 @@  static void rkimage_set_header(void *buf, struct stat *sbuf, int ifd,
 	memcpy(buf, rkcommon_get_spl_hdr(params), RK_SPL_HDR_SIZE);
 
 	if (rkcommon_need_rc4_spl(params))
-		rkcommon_rc4_encode_spl(buf, 4, params->file_size);
+		rkcommon_rc4_encode_spl(buf, 0, params->file_size);
 }
 
 static int rkimage_check_image_type(uint8_t type)