<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>i.MX ProcessorsのトピックRe: How to sign a kernel+ramdisk+dtb FIT image with HAB?</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/How-to-sign-a-kernel-ramdisk-dtb-FIT-image-with-HAB/m-p/1366629#M182621</link>
    <description>&lt;P&gt;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/192380"&gt;@jclsn&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; yes, it is needed to sign each of the three components instead of a FIT;&lt;BR /&gt;and use hab_auth_img to authenticate each additional image.&lt;BR /&gt;&amp;nbsp; Appears, we don't have a guide to sign a whole (kernel) FIT image.&lt;/P&gt;
&lt;P&gt;Regards,&lt;BR /&gt;Yuri.&lt;/P&gt;</description>
    <pubDate>Thu, 04 Nov 2021 10:36:33 GMT</pubDate>
    <dc:creator>Yuri</dc:creator>
    <dc:date>2021-11-04T10:36:33Z</dc:date>
    <item>
      <title>How to sign a kernel+ramdisk+dtb FIT image with HAB?</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/How-to-sign-a-kernel-ramdisk-dtb-FIT-image-with-HAB/m-p/1365030#M182480</link>
      <description>&lt;P&gt;I have alredy read&lt;/P&gt;&lt;P&gt;&lt;A href="https://source.codeaurora.org/external/imx/uboot-imx/tree/doc/imx/habv4/guides/mx8m_secure_boot.txt?h=imx_v2020.04_5.4.47_2.2.0" target="_blank" rel="noopener"&gt;https://source.codeaurora.org/external/imx/uboot-imx/tree/doc/imx/habv4/guides/mx8m_secure_boot.txt?h=imx_v2020.04_5.4.47_2.2.0&lt;/A&gt;&lt;/P&gt;&lt;P&gt;and the PDF on Secure Boot on i.MX boards, but I am still unsure how to do this.&lt;/P&gt;&lt;P&gt;I have three files with the corresponding load addresses contained in the FIT image&lt;/P&gt;&lt;P&gt;Image&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x40480000&lt;BR /&gt;ramdisk-recovery.img&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x43100000&lt;BR /&gt;imx8mm-gpv-distec.dtb&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x43000000&lt;/P&gt;&lt;P&gt;The load address of the FIT image is 0x44000000 and its size is 0x0285d200. Its padded size is 0x285E000&lt;SPAN&gt;.&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;So in my ./genIVT I guess I need&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;#! /usr/bin/perl -w&lt;BR /&gt;use strict;&lt;BR /&gt;open(my $out, '&amp;gt;:raw', 'ivt.bin') or die "Unable to open: $!";&lt;BR /&gt;print $out pack("V", 0x412000D1); # Signature&lt;BR /&gt;print $out pack("V", 0x44000000); # Load Address (*load_address)&lt;BR /&gt;print $out pack("V", 0x0); # Reserved&lt;BR /&gt;print $out pack("V", 0x0); # DCD pointer&lt;BR /&gt;print $out pack("V", 0x0); # Boot Data&lt;BR /&gt;print $out pack("V", 0x4685E000); # Self Pointer (*ivt)&lt;BR /&gt;print $out pack("V", 0x4685E020); # CSF Pointer (*csf)&lt;BR /&gt;print $out pack("V", 0x0); # Reserved&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;P&gt;I am unsure what to put in the csf_additional_images now. I have put this&lt;/P&gt;&lt;PRE&gt;Blocks = 0x40480000 0x00000000 0x01ec9a00 "Image", \&lt;BR /&gt;0x43000000 0x00000000 0x0000a638 "imx8mm-gpv-distec.dtb", \&lt;BR /&gt;0x43100000 0x00000000 0x00988a7a "ramdisk-recovery.img"&lt;/PRE&gt;&lt;P&gt;which corresponds to the sizes and load addresses of the individual components of the fitImage. Is that correct?&lt;/P&gt;&lt;P&gt;I cannot authenticate it with HAB&lt;/P&gt;&lt;PRE&gt;u-boot=&amp;gt; usb reset&lt;BR /&gt;resetting USB...&lt;BR /&gt;USB0: &amp;nbsp;&amp;nbsp;Port not available.&lt;BR /&gt;USB1: &amp;nbsp;&amp;nbsp;USB EHCI 1.00&lt;BR /&gt;scanning bus 1 for devices... Warning using limited usb xfer size 1024 &amp;nbsp;&lt;BR /&gt;2 USB Device(s) found&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;scanning usb for storage devices... 1 Storage Device(s) found&lt;BR /&gt;u-boot=&amp;gt; fatload usb 0 0x44000000 vti2/fitImage&lt;BR /&gt;42332016 bytes read in 1880 ms (21.5 MiB/s)&lt;BR /&gt;u-boot=&amp;gt; bootm 0x44000000&lt;BR /&gt;&lt;BR /&gt;Authenticate image from DDR location 0x40480000...&lt;BR /&gt;bad magic magic=0xfd length=0xbc7b version=0xa9&lt;BR /&gt;bad length magic=0xfd length=0xbc7b version=0xa9&lt;BR /&gt;bad version magic=0xfd length=0xbc7b version=0xa9&lt;BR /&gt;Error: Invalid IVT structure&lt;BR /&gt;&lt;BR /&gt;Allowed IVT structure:&lt;BR /&gt;IVT HDR &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;= 0x4X2000D1&lt;BR /&gt;IVT ENTRY &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;= 0xXXXXXXXX&lt;BR /&gt;IVT RSV1 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;= 0x0&lt;BR /&gt;IVT DCD &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;= 0x0&lt;BR /&gt;IVT BOOT_DATA = 0xXXXXXXXX&lt;BR /&gt;IVT SELF &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;= 0xXXXXXXXX&lt;BR /&gt;IVT CSF &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;= 0xXXXXXXXX&lt;BR /&gt;IVT RSV2 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;= 0x0&lt;BR /&gt;Authenticate uImage Fail, Please check&lt;BR /&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;I am wondering why the image is detected as a uImage and loaded from the uImage's load address. I could successfully load the FIT image without secure boot this way.&lt;/P&gt;</description>
      <pubDate>Tue, 02 Nov 2021 13:58:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/How-to-sign-a-kernel-ramdisk-dtb-FIT-image-with-HAB/m-p/1365030#M182480</guid>
      <dc:creator>jclsn</dc:creator>
      <dc:date>2021-11-02T13:58:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to sign a kernel+ramdisk+dtb FIT image with HAB?</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/How-to-sign-a-kernel-ramdisk-dtb-FIT-image-with-HAB/m-p/1365176#M182495</link>
      <description>&lt;P&gt;I would also be happy to find out about any other way to authenticate the ramdisk and dtb. It does not have to be a FIT image.&lt;/P&gt;&lt;P&gt;In the csf_additional_images.txt there is a device tree blob listed:&lt;/P&gt;&lt;PRE&gt;Blocks = 0x80800000 0x00000000 0x006EA000 "zImage", \&lt;BR /&gt;0x83800000 0x00000000 0x0000B927 "imx7d-sdb.dtb", \&lt;BR /&gt;0x84000000 0x00000000 0x000425B8 "uTee-7dsdb"&lt;/PRE&gt;&lt;P&gt;I was assuming those to be the components of a FIT image. How would I sign the .dtb (or ramdisk) when loading all three components instead of a FIT? I can load all three components in my case with the bootm command without the .dtb or ramdisk being signed. Would I have to add hab_auth_img for those files in my boot script?&lt;/P&gt;&lt;P&gt;As soon as I add these images like this&lt;/P&gt;&lt;PRE&gt;Blocks = 0x40480000 0x00000000 0x01ec9a20 "uImage-pad-ivt", \&lt;BR /&gt;0x43000000 0x00000000 0x0000a638 "imx8mm-gpv-distec.dtb", \&lt;BR /&gt;0x43100000 0x00000000 0x00988a7a "ramdisk-recovery.img"&lt;/PRE&gt;&lt;P&gt;HAB authentication fails&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt; &lt;BR /&gt;Authenticate image from DDR location 0x40480000... &lt;BR /&gt;&lt;BR /&gt;Secure boot enabled &lt;BR /&gt;&lt;BR /&gt;HAB Configuration: 0xcc, HAB State: 0x99 &lt;BR /&gt;&lt;BR /&gt;--------- HAB Event 1 ----------------- &lt;BR /&gt;event data: &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;0xdb 0x00 0x2c 0x43 0x33 0x18 0xc0 0x00 &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;0xca 0x00 0x24 0x00 0x02 0xc5 0x1d 0x00 &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;0x00 0x00 0x0d 0x54 0x40 0x48 0x00 0x00 &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;0x01 0xec 0xa0 0x20 0x43 0x00 0x00 0x00 &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;0x00 0x00 0xa6 0x38 0x43 0x10 0x00 0x00 &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;0x00 0x98 0x89 0x96 &lt;BR /&gt;&lt;BR /&gt;STS = HAB_FAILURE (0x33) &lt;BR /&gt;RSN = HAB_INV_SIGNATURE (0x18) &lt;BR /&gt;CTX = HAB_CTX_COMMAND (0xC0) &lt;BR /&gt;ENG = HAB_ENG_ANY (0x00) &lt;BR /&gt;&lt;BR /&gt;Error loading the OS&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I just put&lt;/P&gt;&lt;PRE&gt;Blocks = 0x40480000 0x00000000 0x01ec9a20 "uImage-pad-ivt"&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Everything works fine&lt;/P&gt;</description>
      <pubDate>Tue, 02 Nov 2021 13:55:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/How-to-sign-a-kernel-ramdisk-dtb-FIT-image-with-HAB/m-p/1365176#M182495</guid>
      <dc:creator>jclsn</dc:creator>
      <dc:date>2021-11-02T13:55:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to sign a kernel+ramdisk+dtb FIT image with HAB?</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/How-to-sign-a-kernel-ramdisk-dtb-FIT-image-with-HAB/m-p/1366629#M182621</link>
      <description>&lt;P&gt;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/192380"&gt;@jclsn&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; yes, it is needed to sign each of the three components instead of a FIT;&lt;BR /&gt;and use hab_auth_img to authenticate each additional image.&lt;BR /&gt;&amp;nbsp; Appears, we don't have a guide to sign a whole (kernel) FIT image.&lt;/P&gt;
&lt;P&gt;Regards,&lt;BR /&gt;Yuri.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Nov 2021 10:36:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/How-to-sign-a-kernel-ramdisk-dtb-FIT-image-with-HAB/m-p/1366629#M182621</guid>
      <dc:creator>Yuri</dc:creator>
      <dc:date>2021-11-04T10:36:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to sign a kernel+ramdisk+dtb FIT image with HAB?</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/How-to-sign-a-kernel-ramdisk-dtb-FIT-image-with-HAB/m-p/1584170#M200275</link>
      <description>&lt;P&gt;Hi jclsn,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Did you find a way to sign and authenticate your fitImage ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you found it, I will be so grateful if you can share it for the public.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 17 Jan 2023 20:16:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/How-to-sign-a-kernel-ramdisk-dtb-FIT-image-with-HAB/m-p/1584170#M200275</guid>
      <dc:creator>mbelouarga</dc:creator>
      <dc:date>2023-01-17T20:16:28Z</dc:date>
    </item>
  </channel>
</rss>

