]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
rockchip: mkimage: fix wrong range of rc4 encoding for boot image
authorJeffy Chen <jeffy.chen@rock-chips.com>
Thu, 5 Dec 2019 10:58:29 +0000 (18:58 +0800)
committerKever Yang <kever.yang@rock-chips.com>
Fri, 27 Dec 2019 07:17:07 +0000 (15:17 +0800)
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>
tools/rkimage.c

index ae50de55c93b1fe32a3072d7ef1403ea5c966bda..1c5540b1c3d1d1e73aaa88e71a7ba790950771eb 100644 (file)
@@ -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)