<?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>Other NXP ProductsのトピックKernel FitImage Signing Error</title>
    <link>https://community.nxp.com/t5/Other-NXP-Products/Kernel-FitImage-Signing-Error/m-p/1882825#M23002</link>
    <description>&lt;P&gt;&lt;SPAN&gt;I am working on signing fitimage in Kirkstone Branch. My u-boot version is 2022. I generated the key and crt using the following commands&lt;BR /&gt;&lt;BR /&gt;openssl genrsa -F4 -out dev.key 2048&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;openssl req -batch -new -x509 -key dev.key -out dev.crt&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Then I added the following configurations in yocto&lt;BR /&gt;&lt;BR /&gt;UBOOT_SIGN_KEYDIR = "${TMPDIR}/keys/"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;UBOOT_SIGN_KEYNAME = "dev"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;UBOOT_MKIMAGE_DTCOPTS = "-I dts -O dtb -p 2000"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;UBOOT_SIGN_ENABLE = "1"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I added the following things in uboot defconfig file&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;CONFIG_FIT_SIGNATURE=y&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;CONFIG_FIT_SIGNATURE_MAX_SIZE=0x10000000&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;CONFIG_LEGACY_IMAGE_FORMAT=y&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;CONFIG_RSA=y&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;CONFIG_OF_CONTROL=y&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But I am getting the error&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;## Loading kernel from FIT Image at 420000000 ...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Using 'imx8mm.dtb' configuration&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Verifying Hash Integrity ... sha256,rsa2048:dev- error!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Verification failed for '&amp;lt;NULL&amp;gt;' hash node in 'imx8mm.dtb' config node&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Failed to verify required signature 'key-dev'&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Bad Data Hash&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ERROR: can't get kernel image!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;on detail debugging, I found the error is coming from the following file rsa_verify.c&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Error in Modular exponentation&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have already checked the signatures through fit_check_sign utility and its showing fine results. But in u-boot its failing. Any recommendation would be helpful.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 06 Jun 2024 14:32:56 GMT</pubDate>
    <dc:creator>CrazyDeveloper</dc:creator>
    <dc:date>2024-06-06T14:32:56Z</dc:date>
    <item>
      <title>Kernel FitImage Signing Error</title>
      <link>https://community.nxp.com/t5/Other-NXP-Products/Kernel-FitImage-Signing-Error/m-p/1882825#M23002</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I am working on signing fitimage in Kirkstone Branch. My u-boot version is 2022. I generated the key and crt using the following commands&lt;BR /&gt;&lt;BR /&gt;openssl genrsa -F4 -out dev.key 2048&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;openssl req -batch -new -x509 -key dev.key -out dev.crt&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Then I added the following configurations in yocto&lt;BR /&gt;&lt;BR /&gt;UBOOT_SIGN_KEYDIR = "${TMPDIR}/keys/"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;UBOOT_SIGN_KEYNAME = "dev"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;UBOOT_MKIMAGE_DTCOPTS = "-I dts -O dtb -p 2000"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;UBOOT_SIGN_ENABLE = "1"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I added the following things in uboot defconfig file&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;CONFIG_FIT_SIGNATURE=y&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;CONFIG_FIT_SIGNATURE_MAX_SIZE=0x10000000&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;CONFIG_LEGACY_IMAGE_FORMAT=y&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;CONFIG_RSA=y&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;CONFIG_OF_CONTROL=y&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But I am getting the error&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;## Loading kernel from FIT Image at 420000000 ...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Using 'imx8mm.dtb' configuration&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Verifying Hash Integrity ... sha256,rsa2048:dev- error!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Verification failed for '&amp;lt;NULL&amp;gt;' hash node in 'imx8mm.dtb' config node&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Failed to verify required signature 'key-dev'&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Bad Data Hash&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ERROR: can't get kernel image!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;on detail debugging, I found the error is coming from the following file rsa_verify.c&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Error in Modular exponentation&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have already checked the signatures through fit_check_sign utility and its showing fine results. But in u-boot its failing. Any recommendation would be helpful.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jun 2024 14:32:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Other-NXP-Products/Kernel-FitImage-Signing-Error/m-p/1882825#M23002</guid>
      <dc:creator>CrazyDeveloper</dc:creator>
      <dc:date>2024-06-06T14:32:56Z</dc:date>
    </item>
    <item>
      <title>Re: Kernel FitImage Signing Error</title>
      <link>https://community.nxp.com/t5/Other-NXP-Products/Kernel-FitImage-Signing-Error/m-p/1883663#M23023</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;You have to modify the dtb since you are changing the parameters of sha.&lt;/P&gt;
&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jun 2024 14:22:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Other-NXP-Products/Kernel-FitImage-Signing-Error/m-p/1883663#M23023</guid>
      <dc:creator>Bio_TICFSL</dc:creator>
      <dc:date>2024-06-07T14:22:08Z</dc:date>
    </item>
    <item>
      <title>Re: Kernel FitImage Signing Error</title>
      <link>https://community.nxp.com/t5/Other-NXP-Products/Kernel-FitImage-Signing-Error/m-p/1883696#M23026</link>
      <description>&lt;P&gt;Hi! I have been able to solve the error. Actually, in my case, uboot was modifying and updating with signature keys. Actual error was happening at this stage of code in u-boot&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;rsa-verify.c&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;#if !defined(USE_HOSTCC)&lt;BR /&gt;ret = uclass_get_device(UCLASS_MOD_EXP, 0, &amp;amp;mod_exp_dev);&lt;BR /&gt;if (ret) {&lt;BR /&gt;printf("RSA: Can't find Modular Exp implementation\n");&lt;BR /&gt;return -EINVAL;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;ret = rsa_mod_exp(mod_exp_dev, sig, sig_len, prop, buf);&lt;BR /&gt;#else&lt;BR /&gt;ret = rsa_mod_exp_sw(sig, sig_len, prop, buf);&lt;BR /&gt;#endif&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;So, I went towards the software implementation of code this way&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;#if !defined(USE_HOSTCC)&lt;BR /&gt;ret = uclass_get_device(UCLASS_MOD_EXP, 0, &amp;amp;mod_exp_dev);&lt;BR /&gt;if (ret) {&lt;BR /&gt;printf("RSA: Can't find Modular Exp implementation\n");&lt;BR /&gt;return -EINVAL;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;ret = rsa_mod_exp(mod_exp_dev, sig, sig_len, prop, buf);&lt;BR /&gt;#else&lt;BR /&gt;ret = rsa_mod_exp_sw(sig, sig_len, prop, buf);&lt;BR /&gt;#endif&lt;BR /&gt;if (ret) {&lt;BR /&gt;debug("Error in Modular exponentation\n");&lt;BR /&gt;ret = rsa_mod_exp_sw(sig, sig_len, prop, buf);&lt;BR /&gt;if (ret) {&lt;BR /&gt;printf("%s: attempting rsa_mod_exp_sw instead \n", __func__);&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;and adding this additional configuration in u-boot&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;CONFIG_RSA_SOFTWARE_EXP=y&lt;BR /&gt;&lt;BR /&gt;Here the code for rsa_mod_exp_sw was little broken and giving the linking error &lt;STRONG&gt;undefined reference to 'rsa_mod_exp_sw'&lt;/STRONG&gt;, so I did the following change in the rsa-mod-exp.h file&lt;BR /&gt;&lt;BR /&gt;--- a/include/u-boot/rsa-mod-exp.h&lt;BR /&gt;+++ b/include/u-boot/rsa-mod-exp.h&lt;BR /&gt;@@ -1,3 +1,4 @@&lt;BR /&gt;+&lt;BR /&gt;/* SPDX-License-Identifier: GPL-2.0+ */&lt;BR /&gt;/*&lt;BR /&gt;* Copyright 2014 Freescale Semiconductor, Inc.&lt;BR /&gt;@@ -62,7 +63,7 @@ void rsa_free_key_prop(struct key_prop *prop);&lt;BR /&gt;* @out: Result in form of byte array of len equal to sig_len&lt;BR /&gt;*/&lt;BR /&gt;int rsa_mod_exp_sw(const uint8_t *sig, uint32_t sig_len,&lt;BR /&gt;- struct key_prop *node, uint8_t *out);&lt;BR /&gt;+ struct key_prop *prop, uint8_t *out);&lt;BR /&gt;&lt;BR /&gt;int rsa_mod_exp(struct udevice *dev, const uint8_t *sig, uint32_t sig_len,&lt;BR /&gt;struct key_prop *node, uint8_t *out);&lt;BR /&gt;&lt;BR /&gt;After that, it started working. However, I am still searching why '&lt;STRONG&gt;rsa_verify_key&lt;/STRONG&gt;' is not working fine in my iMX8MM board and&amp;nbsp;&lt;STRONG&gt;rsa_verify_key_sw &lt;/STRONG&gt;working&lt;BR /&gt;&lt;BR /&gt;Here are few references&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://u-boot.denx.narkive.com/BpvBKeLY/hangs-after-enabling-secured-boot-gumstix-overo" target="_blank" rel="noopener"&gt;https://u-boot.denx.narkive.com/BpvBKeLY/hangs-after-enabling-secured-boot-gumstix-overo&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://community.nxp.com/t5/i-MX-Processors/U-boot-FIT-image-verification-failed-when-HAB-is-enabled/m-p/1377890/thread-id/183622" target="_blank" rel="noopener"&gt;https://community.nxp.com/t5/i-MX-Processors/U-boot-FIT-image-verification-failed-when-HAB-is-enabled/m-p/1377890/thread-id/183622&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jun 2024 15:12:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Other-NXP-Products/Kernel-FitImage-Signing-Error/m-p/1883696#M23026</guid>
      <dc:creator>CrazyDeveloper</dc:creator>
      <dc:date>2024-06-07T15:12:56Z</dc:date>
    </item>
    <item>
      <title>Re: Kernel FitImage Signing Error</title>
      <link>https://community.nxp.com/t5/Other-NXP-Products/Kernel-FitImage-Signing-Error/m-p/1896678#M23345</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;were you able to resolve&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;Verification failed for '&amp;lt;NULL&amp;gt;' hash node in 'imx8mm.dtb' config node&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;problem?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Jul 2024 12:52:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Other-NXP-Products/Kernel-FitImage-Signing-Error/m-p/1896678#M23345</guid>
      <dc:creator>sbin</dc:creator>
      <dc:date>2024-07-01T12:52:00Z</dc:date>
    </item>
    <item>
      <title>Re: Kernel FitImage Signing Error</title>
      <link>https://community.nxp.com/t5/Other-NXP-Products/Kernel-FitImage-Signing-Error/m-p/1921696#M24615</link>
      <description>Sorry for the late reply, I resolved the issue and also commented the solution above</description>
      <pubDate>Wed, 31 Jul 2024 14:46:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Other-NXP-Products/Kernel-FitImage-Signing-Error/m-p/1921696#M24615</guid>
      <dc:creator>CrazyDeveloper</dc:creator>
      <dc:date>2024-07-31T14:46:02Z</dc:date>
    </item>
  </channel>
</rss>

