Commit graph

10 commits

Author SHA1 Message Date
Ram Chandra Jangir
90c4bba23c sysupgrade: Add support to authenticate rootfs image
Add rootfs section to authenticate signed rootfs image
Parse the hlos elf header and get the rootfs metadata offset
Reads metadata available at the end of hlos image and write to /tmp/metadata.bin
Calculate sha384 and write to /tmp/sha384_XXXXX file
Use /tmp/metadata.bin and /tmp/sha384_XXXXX to get rootfs auth by TZ

Change-Id: Iaa4bf6b0cfbae4f4a56187f80f2873cb69550051
Signed-off-by: Ram Chandra Jangir <quic_rjangir@quicinc.com>
2023-02-20 13:09:06 +05:30
Sandhya KS
564a735cdf sysupgrade : Enable support for APDP secure sysupgrade
Change-Id: I8d5c9b2287a7eb61ea6366506d32d35e35e15db9
Signed-off-by: Sandhya KS <quic_sandhyks@quicinc.com>
2022-04-26 13:08:42 +05:30
Naresh Kumar Mehta
488a613637 sysupgrade: Fix compiler warnings
Change-Id: I69e4d5cf06212feb9e67d7071779846581096bec
Signed-off-by: Naresh Kumar Mehta <naresh@codeaurora.org>
2019-04-05 17:41:16 +05:30
Ram Chandra Jangir
62928dc964 sysupgrade: Add SBL_NAND_PREAMBLE if preamble bytes exist in image
Now we are adding preamble value to read SBL header if ubi section
is present in the image. But in case of NOR+NAND images, though we are
having SBL in NOR and ubi section is also present and NAND_PREAMBLE
is getting added. which is breaking NOR+NAND sysupgrade.

Added functionality to compare first 12 bytes of section with pre
defined PREAMBLE value. If values matches, add the NAND_PREAMBLE to
read SBL header.

Change-Id: I704ee86cc50aa3ce3b2ab6ec34beab866ffde4b9
Signed-off-by: Anto Norbert <norbrt@codeaurora.org>
2018-02-20 15:23:40 +05:30
Ram Chandra Jangir
f40cda9a42 sysupgrade: Add support to process SBL for ipq806x nand boot
This change adds the correct Sbl_Hdr instead of Mbn_Hdr, since
sbl header is different than normal Mbn_Hdr, and adds the sbl
header size as 80.
SBL in nand starts with preamble before the sbl header, so here
it adds the preamble for header start address as well as
src, sig and cert offset values.

Change-Id: I9a56d7b4a51890b74a5ee5fe3047a38801d23803
Signed-off-by: Ram Chandra Jangir <rjangir@codeaurora.org>
2018-02-20 15:20:10 +05:30
Avinash Pandey
bcfcba7eb2 sysupgrade: Add support to authenticate image using TZ
This change will look for existence of file /sys/sec_upgrade/sec_auth
if the file exists, it performs image authentication with the new
approach i.e TZ enabled mechanism.

It reads all the sections of the single image and writes each
section's type and image file path in /sys/sec_upgrade/sec_auth.
If a written section image is a proper signed image, then it will
return success else will cause the failure.

Change-Id: I649581e0ab74a66d677e5bfbf1c34fd83cb2465d
Signed-off-by: Avinash Pandey <avinasv@codeaurora.org>
2018-02-08 16:14:32 +05:30
Pavithra Palanisamy
a392418a4f Sysupgrade: Add support for devcfg version check
This change adds support to check devcfg version and
allows sysupgrade only if the version is higher.

Change-Id: I7192f428c50c1b1b9eeddd1aac0d57d341d32436
Signed-off-by: Pavithra Palanisamy <pavip@codeaurora.org>
2017-11-03 04:18:26 -07:00
Pavithra Palanisamy
0e3043fd78 sysupgrade: Use memcmp() instead of strcmp()
Currently our sysupgrade is comparing the calculated hash,
and referenced hash using strcmp(), A valid binary hash can
contain zeros or null, this can make strcmp() to stop when it
encounters a zero or null. To check the entire hash, not just
the bytes of the hash up to the first zero, we will use memcmp().

The existing code uses mbn_header->code_size for calculating
source offset from the image, this change adds mbn_header_size
for the calculation.

Change-Id: Iaae39d04e8e4aafc686a5acbc499b11b2b8d6602
Signed-off-by: Pavithra Palanisamy <pavip@codeaurora.org>
2017-10-16 10:59:25 +05:30
pavip
fb8e307bbc sysupgrade: Add support to process 64 bit image
The existing sysupgrade treats all images as 32-bit image.
This change adds a check to signify the image class and
adds functions to process the headers respectively.

Change-Id: I04040fdc6e1a9c6c2df2407cd4b26dddaf4a008c
Signed-off-by: Pavithra Palanisamy <pavip@codeaurora.org>
2017-10-13 20:05:52 +05:30
Sachin Sundar
1ed5f5b1a2 sysupgrade: Add sysupgrade support for signed images.
Change-Id: I2b4a5aeaa311e08ec59f70c3a9e3a88e11dc10f1
Signed-off-by: Sachin Sundar <ssundar@codeaurora.org>
2017-06-08 11:18:32 +05:30