<?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>topic Re: Patch for u-boot-imx: Using FIT and HAB in bootm command in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/Patch-for-u-boot-imx-Using-FIT-and-HAB-in-bootm-command/m-p/1485282#M192236</link>
    <description>&lt;P&gt;Is there any way to get this patch upstream? I'm absolutely willing to send patches around on some mailing list or gitlabs if someone tells me how to contribute.&lt;/P&gt;&lt;P&gt;Cheers,&lt;BR /&gt;Sascha&lt;/P&gt;</description>
    <pubDate>Wed, 06 Jul 2022 09:50:48 GMT</pubDate>
    <dc:creator>sascha1</dc:creator>
    <dc:date>2022-07-06T09:50:48Z</dc:date>
    <item>
      <title>Patch for u-boot-imx: Using FIT and HAB in bootm command</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Patch-for-u-boot-imx-Using-FIT-and-HAB-in-bootm-command/m-p/1164472#M163116</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;i want to propose the following patch to bootm.c.&lt;/P&gt;&lt;P&gt;If you want to use FIT Images and HAB together you always get this on bootm:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Not valid image format for Authentication, Please check&lt;/LI-CODE&gt;&lt;P&gt;This is because there is no case for FIT Images in the switch statement.&lt;/P&gt;&lt;P&gt;I tested the patch below and was able to boot a HAB signed FIT Image without problems.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;diff --git "a/cmd/bootm.c" "b/cmd/bootm.c"
index 03ea3b8998..47122e50cc 100644
--- "a/cmd/bootm.c"
+++ "b/cmd/bootm.c"
@@ -176,6 +176,15 @@ int do_bootm(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 	case IMAGE_FORMAT_ANDROID:
 		/* Do this authentication in boota command */
 		break;
+#endif
+#ifdef CONFIG_FIT
+	case IMAGE_FORMAT_FIT:
+		if (authenticate_image(image_load_addr,
+			image_get_image_size((image_header_t *)image_load_addr)) != 0) {
+			printf("Authenticate FIT image Fail, Please check\n");
+			return 1;
+		}
+		break;
 #endif
 	default:
 		printf("Not valid image format for Authentication, Please check\n"); &lt;/LI-CODE&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;</description>
      <pubDate>Thu, 08 Oct 2020 11:27:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Patch-for-u-boot-imx-Using-FIT-and-HAB-in-bootm-command/m-p/1164472#M163116</guid>
      <dc:creator>tmuthmann</dc:creator>
      <dc:date>2020-10-08T11:27:04Z</dc:date>
    </item>
    <item>
      <title>Re: Patch for u-boot-imx: Using FIT and HAB in bootm command</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Patch-for-u-boot-imx-Using-FIT-and-HAB-in-bootm-command/m-p/1223563#M168694</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/178832"&gt;@tmuthmann&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Will you please give some ideas,&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.nxp.com/t5/i-MX-Processors/Build-FIT-image-for-IMX8MNano/m-p/1223538/highlight/false" target="_blank"&gt;https://community.nxp.com/t5/i-MX-Processors/Build-FIT-image-for-IMX8MNano/m-p/1223538/highlight/false&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 30 Jan 2021 19:47:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Patch-for-u-boot-imx-Using-FIT-and-HAB-in-bootm-command/m-p/1223563#M168694</guid>
      <dc:creator>vinothkumars</dc:creator>
      <dc:date>2021-01-30T19:47:51Z</dc:date>
    </item>
    <item>
      <title>Re: Patch for u-boot-imx: Using FIT and HAB in bootm command</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Patch-for-u-boot-imx-Using-FIT-and-HAB-in-bootm-command/m-p/1234954#M169874</link>
      <description>&lt;P&gt;Is this already implemented somewhere by NXP? We are running into the same problem with v2020.04_5.4.24_2.1.0. I think it's rather strange NXP does not see this as a valid usecase.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anyway, Thanks for the patch &lt;LI-EMOJI id="lia_slightly-smiling-face" title=":slightly_smiling_face:"&gt;&lt;/LI-EMOJI&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Feb 2021 12:05:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Patch-for-u-boot-imx-Using-FIT-and-HAB-in-bootm-command/m-p/1234954#M169874</guid>
      <dc:creator>paul_geurts</dc:creator>
      <dc:date>2021-02-23T12:05:36Z</dc:date>
    </item>
    <item>
      <title>Re: Patch for u-boot-imx: Using FIT and HAB in bootm command</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Patch-for-u-boot-imx-Using-FIT-and-HAB-in-bootm-command/m-p/1278934#M174261</link>
      <description>&lt;P&gt;I try on imx8mp with BSP Linux 5.10.9_1.0.0​, still need this patch for booting&amp;nbsp; FIT image with HAB feature&lt;/P&gt;</description>
      <pubDate>Wed, 19 May 2021 10:44:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Patch-for-u-boot-imx-Using-FIT-and-HAB-in-bootm-command/m-p/1278934#M174261</guid>
      <dc:creator>kunyichen</dc:creator>
      <dc:date>2021-05-19T10:44:42Z</dc:date>
    </item>
    <item>
      <title>Re: Patch for u-boot-imx: Using FIT and HAB in bootm command</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Patch-for-u-boot-imx-Using-FIT-and-HAB-in-bootm-command/m-p/1281673#M174492</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/178832"&gt;@tmuthmann&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your solution helped me a lot. After using your patch I was able to boot HAB signed fitImage.&lt;/P&gt;&lt;P&gt;But when I rebuild my images and disabled Mender it was not working for me. After some investigation I think that&lt;/P&gt;&lt;P&gt;the image_get_image_size is picking bytes 12..15 as size of the image which is a little less than the image size in bytes 4..7 which seems to be more correct. In some cases this made authenticate_image() not be able to find the IVT structure and verification failed.&lt;/P&gt;&lt;P&gt;So, it did not depend on Mender but the size of the fitImage, so maybe you can get into the same problem when rebuilding your images.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Jonny&lt;/P&gt;</description>
      <pubDate>Tue, 25 May 2021 09:00:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Patch-for-u-boot-imx-Using-FIT-and-HAB-in-bootm-command/m-p/1281673#M174492</guid>
      <dc:creator>jonnye</dc:creator>
      <dc:date>2021-05-25T09:00:19Z</dc:date>
    </item>
    <item>
      <title>Re: Patch for u-boot-imx: Using FIT and HAB in bootm command</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Patch-for-u-boot-imx-Using-FIT-and-HAB-in-bootm-command/m-p/1281763#M174501</link>
      <description>&lt;P&gt;Thx everyone for the replies and kudos.&lt;/P&gt;&lt;P&gt;Meanwhile i'm using U-Boot Mainline, so you will get no more updates from me.&lt;/P&gt;&lt;P&gt;To be sure to use the correct address and size my code is like that now:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;uint32_t fileaddr = env_get_hex("fileaddr", 0);&lt;BR /&gt;uint32_t filesize = env_get_hex("filesize", 0);&lt;BR /&gt;uint32_t ivt_offset = filesize - CONFIG_CSF_SIZE;&lt;/P&gt;&lt;P&gt;imx_hab_authenticate_image(fileaddr, filesize, ivt_offset);&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;fileaddr and&amp;nbsp;filesize is set on all load operations as far I can see.&lt;/P&gt;</description>
      <pubDate>Tue, 25 May 2021 10:28:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Patch-for-u-boot-imx-Using-FIT-and-HAB-in-bootm-command/m-p/1281763#M174501</guid>
      <dc:creator>tmuthmann</dc:creator>
      <dc:date>2021-05-25T10:28:53Z</dc:date>
    </item>
    <item>
      <title>Re: Patch for u-boot-imx: Using FIT and HAB in bootm command</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Patch-for-u-boot-imx-Using-FIT-and-HAB-in-bootm-command/m-p/1384814#M184259</link>
      <description>&lt;P&gt;The patch actually requires to read the image size with the function fit_get_size() from the image header, because the image headers of FIT images differ. For me the first patch only worked by chance and I could fix it by exchanging the function.&lt;/P&gt;&lt;P&gt;Here is the diff:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;diff --git a/cmd/bootm.c b/cmd/bootm.c
index bed84bd735..6fcd17eaf5 100644
--- a/cmd/bootm.c
+++ b/cmd/bootm.c
@@ -175,7 +175,7 @@ int do_bootm(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 #ifdef CONFIG_FIT
        case IMAGE_FORMAT_FIT:
                if (authenticate_image(load_addr,
-                       image_get_image_size((image_header_t *)load_addr)) != 0) {
+                       fit_get_size((void *)load_addr)) != 0) {
                        printf("Authenticate FIT image Fail, Please check\n");
                        return 1;
                }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jul 2022 13:13:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Patch-for-u-boot-imx-Using-FIT-and-HAB-in-bootm-command/m-p/1384814#M184259</guid>
      <dc:creator>jclsn</dc:creator>
      <dc:date>2022-07-07T13:13:43Z</dc:date>
    </item>
    <item>
      <title>Re: Patch for u-boot-imx: Using FIT and HAB in bootm command</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Patch-for-u-boot-imx-Using-FIT-and-HAB-in-bootm-command/m-p/1485282#M192236</link>
      <description>&lt;P&gt;Is there any way to get this patch upstream? I'm absolutely willing to send patches around on some mailing list or gitlabs if someone tells me how to contribute.&lt;/P&gt;&lt;P&gt;Cheers,&lt;BR /&gt;Sascha&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jul 2022 09:50:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Patch-for-u-boot-imx-Using-FIT-and-HAB-in-bootm-command/m-p/1485282#M192236</guid>
      <dc:creator>sascha1</dc:creator>
      <dc:date>2022-07-06T09:50:48Z</dc:date>
    </item>
    <item>
      <title>Re: Patch for u-boot-imx: Using FIT and HAB in bootm command</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Patch-for-u-boot-imx-Using-FIT-and-HAB-in-bootm-command/m-p/1486236#M192296</link>
      <description>&lt;P&gt;Probably yes. Maybe we should notify some NXP employee.&lt;/P&gt;&lt;P&gt;Like:&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/25009"&gt;@BiyongSUN&lt;/a&gt;&amp;nbsp;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/1941"&gt;@Yuri&lt;/a&gt;&amp;nbsp;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;Or you create a ticket yourself&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jul 2022 13:13:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Patch-for-u-boot-imx-Using-FIT-and-HAB-in-bootm-command/m-p/1486236#M192296</guid>
      <dc:creator>jclsn</dc:creator>
      <dc:date>2022-07-07T13:13:26Z</dc:date>
    </item>
    <item>
      <title>Re: Patch for u-boot-imx: Using FIT and HAB in bootm command</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Patch-for-u-boot-imx-Using-FIT-and-HAB-in-bootm-command/m-p/1560256#M198056</link>
      <description>&lt;P&gt;I'd like to ask you a question. Do we need special processing when adding digital signatures to fitimage, or is it the same as the official guidance (zimage/image)? Do we need to do something special with the.its file that generates fitimage?&lt;/P&gt;</description>
      <pubDate>Mon, 28 Nov 2022 03:03:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Patch-for-u-boot-imx-Using-FIT-and-HAB-in-bootm-command/m-p/1560256#M198056</guid>
      <dc:creator>chen-wust</dc:creator>
      <dc:date>2022-11-28T03:03:15Z</dc:date>
    </item>
    <item>
      <title>Re: Patch for u-boot-imx: Using FIT and HAB in bootm command</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Patch-for-u-boot-imx-Using-FIT-and-HAB-in-bootm-command/m-p/1560580#M198092</link>
      <description>No, you can sign any file with HAB actually&lt;BR /&gt;&lt;BR /&gt;You don’t need to do something to the .its file. You just create the blob FIT blob and sign it</description>
      <pubDate>Mon, 28 Nov 2022 11:31:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Patch-for-u-boot-imx-Using-FIT-and-HAB-in-bootm-command/m-p/1560580#M198092</guid>
      <dc:creator>jclsn</dc:creator>
      <dc:date>2022-11-28T11:31:05Z</dc:date>
    </item>
    <item>
      <title>Re: Patch for u-boot-imx: Using FIT and HAB in bootm command</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Patch-for-u-boot-imx-Using-FIT-and-HAB-in-bootm-command/m-p/1831271#M221475</link>
      <description>&lt;P&gt;Is this in the meantime already implemented somewhere by NXP?&lt;BR /&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Mar 2024 15:24:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Patch-for-u-boot-imx-Using-FIT-and-HAB-in-bootm-command/m-p/1831271#M221475</guid>
      <dc:creator>mprt42</dc:creator>
      <dc:date>2024-03-19T15:24:08Z</dc:date>
    </item>
  </channel>
</rss>

