common: android: move crypto_sha_init() after load IMG_RK_DTB

We call crypto to verify dtb alone, so move the crypto_sha_init()
after load IMG_RK_DTB when begin another hash verification.

Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: I12f36172a5d03fa8baa0236503be5627fa18adf0
This commit is contained in:
Jason Zhu 2020-10-30 14:59:31 +08:00
parent 1817f8c289
commit 651b0d0dfc
1 changed files with 2 additions and 2 deletions

View File

@ -523,11 +523,11 @@ static int android_image_separate(struct andr_img_hdr *hdr,
if (hdr->header_version > 1)
ctx.length += hdr->dtb_size + sizeof(hdr->dtb_size);
crypto_sha_init(dev, &ctx);
/* load, never change order ! */
if (image_load(IMG_RK_DTB, hdr, bstart, ram_base, NULL))
return -1;
crypto_sha_init(dev, &ctx);
if (image_load(IMG_KERNEL, hdr, bstart, ram_base, dev))
return -1;
if (image_load(IMG_RAMDISK, hdr, bstart, ram_base, dev))