Skip to content

Commit

Permalink
bootm: Boot custom exploit images
Browse files Browse the repository at this point in the history
  • Loading branch information
saleemrashid committed Dec 3, 2015
1 parent 6b8bcb4 commit 1ec48ab
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
20 changes: 10 additions & 10 deletions common/cmd_bootm.c
Expand Up @@ -1618,19 +1618,19 @@ int do_booti (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
* 0x80008000. With this trick we don't have to move kernel
* again
*/
load_addr = KERNEL_PHY_LOAD_ADDRESS -
(ISW_CERTIFICATE_LENGTH_FULL + CFG_FASTBOOT_MKBOOTIMAGE_PAGE_SIZE);
load_addr = KERNEL_PHY_LOAD_ADDRESS - CFG_FASTBOOT_MKBOOTIMAGE_PAGE_SIZE;

if(authentify_image(mmcc, pte->start) != 0) {
printf("booti: Authentification failure\n");
#ifdef CONFIG_MACH_OTTER2
show_authfailed();
#endif
goto fail;
}
if (mmc_read(mmcc, pte->start + ISW_CERTIFICATE_LENGTH_BLOCKS, load_addr, CFG_FASTBOOT_MKBOOTIMAGE_PAGE_SIZE) != 1) {
printf("booti: mmc failed to read certificate\n");
return -1;
}

/* set the boot.img header */
hdr = (unsigned char *)load_addr + ISW_CERTIFICATE_LENGTH_FULL;
hdr = (unsigned char *)load_addr;
if (mmc_read(mmcc, pte->start + ISW_CERTIFICATE_LENGTH_BLOCKS, load_addr, CFG_FASTBOOT_MKBOOTIMAGE_PAGE_SIZE + ALIGN(hdr->kernel_size, hdr->page_size) + hdr->ramdisk_size) != 1) {
printf("booti: mmc failed to read certificate\n");
return -1;
}

if (memcmp(hdr->magic, BOOT_MAGIC, 8)) {
printf("booti: bad boot image magic\n");
Expand Down
3 changes: 2 additions & 1 deletion include/asm-arm/arch-omap4/omap4_signature.h
Expand Up @@ -31,7 +31,8 @@
#define CERT_RSA_PK_Verify_KI (1<<7)

#define ISW_CERTIFICATE_LENGTH 0x238 /* SW certificate len excluding RSA signature */
#define ISW_CERTIFICATE_LENGTH_FULL 0x350 /* SW certificate len in full */
#define ISW_CERTIFICATE_LENGTH_FULL 0x400 /* SW certificate len in full */
#define ISW_CERTIFICATE_LENGTH_BLOCKS 2 /* SW certificate len in full in blocks */

typedef struct
{
Expand Down

0 comments on commit 1ec48ab

Please sign in to comment.