<?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 [iMX8] U-Boot FIT Image Signature in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/iMX8-U-Boot-FIT-Image-Signature/m-p/1429547#M188304</link>
    <description>&lt;P&gt;We have a custom board using the iM8MM SoC and we would like to enable the FIT Image Signing under Yocto build (&lt;EM&gt;&lt;STRONG&gt;hardknott&lt;/STRONG&gt;&lt;/EM&gt; branch).&lt;/P&gt;&lt;P&gt;We are already able to sign the FIT Image using these variables:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;# Add FIT Image to /boot partition
IMAGE_BOOT_FILES = "fitImage-${MACHINE}.bin;fitImage"

UBOOT_SIGN_KEYDIR = "${TMPDIR}/keys/"
UBOOT_SIGN_KEYNAME = "dev"
UBOOT_MKIMAGE_DTCOPTS = "-I dts -O dtb -p 2000"
UBOOT_SIGN_ENABLE = "1"
FIT_SIGN_INDIVIDUAL = "1"
FIT_GENERATE_KEYS = "1"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We were able to confirm that the FIT Image is signed by running:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;fit_check_sign -f &amp;lt;fit-image&amp;gt; -k &amp;lt;uboot-dtb&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;And during the boot we can see that the U-Boot sees the signature:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Verifying Hash Integrity ... sha256+ sha256,rsa2048:dev- OK&lt;/LI-CODE&gt;&lt;P&gt;But the U-Boot doesn't check the &lt;STRONG&gt;&lt;EM&gt;sha256,rsa2048:dev-&lt;/EM&gt;&lt;/STRONG&gt; signature, I suppose that's why we see a minus sign.&lt;/P&gt;&lt;P&gt;As far as I can see I have added the right U-Boot configuration as well:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;CONFIG_FIT_SIGNATURE=y
CONFIG_FIT_SIGNATURE_MAX_SIZE=0x10000000
CONFIG_LEGACY_IMAGE_FORMAT=y&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Checking the&amp;nbsp;u-boot.dtb seems that the key was installed:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;$ fdtget -p u-boot.dtb /signature/key-dev
required
algo
rsa,r-squared
rsa,modulus
rsa,exponent
rsa,n0-inverse
rsa,num-bits
key-name-hint&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What am I might be missing here?&lt;/P&gt;</description>
    <pubDate>Wed, 16 Mar 2022 19:47:16 GMT</pubDate>
    <dc:creator>caiotoledo-lunasystems</dc:creator>
    <dc:date>2022-03-16T19:47:16Z</dc:date>
    <item>
      <title>[iMX8] U-Boot FIT Image Signature</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/iMX8-U-Boot-FIT-Image-Signature/m-p/1429547#M188304</link>
      <description>&lt;P&gt;We have a custom board using the iM8MM SoC and we would like to enable the FIT Image Signing under Yocto build (&lt;EM&gt;&lt;STRONG&gt;hardknott&lt;/STRONG&gt;&lt;/EM&gt; branch).&lt;/P&gt;&lt;P&gt;We are already able to sign the FIT Image using these variables:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;# Add FIT Image to /boot partition
IMAGE_BOOT_FILES = "fitImage-${MACHINE}.bin;fitImage"

UBOOT_SIGN_KEYDIR = "${TMPDIR}/keys/"
UBOOT_SIGN_KEYNAME = "dev"
UBOOT_MKIMAGE_DTCOPTS = "-I dts -O dtb -p 2000"
UBOOT_SIGN_ENABLE = "1"
FIT_SIGN_INDIVIDUAL = "1"
FIT_GENERATE_KEYS = "1"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We were able to confirm that the FIT Image is signed by running:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;fit_check_sign -f &amp;lt;fit-image&amp;gt; -k &amp;lt;uboot-dtb&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;And during the boot we can see that the U-Boot sees the signature:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Verifying Hash Integrity ... sha256+ sha256,rsa2048:dev- OK&lt;/LI-CODE&gt;&lt;P&gt;But the U-Boot doesn't check the &lt;STRONG&gt;&lt;EM&gt;sha256,rsa2048:dev-&lt;/EM&gt;&lt;/STRONG&gt; signature, I suppose that's why we see a minus sign.&lt;/P&gt;&lt;P&gt;As far as I can see I have added the right U-Boot configuration as well:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;CONFIG_FIT_SIGNATURE=y
CONFIG_FIT_SIGNATURE_MAX_SIZE=0x10000000
CONFIG_LEGACY_IMAGE_FORMAT=y&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Checking the&amp;nbsp;u-boot.dtb seems that the key was installed:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;$ fdtget -p u-boot.dtb /signature/key-dev
required
algo
rsa,r-squared
rsa,modulus
rsa,exponent
rsa,n0-inverse
rsa,num-bits
key-name-hint&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What am I might be missing here?&lt;/P&gt;</description>
      <pubDate>Wed, 16 Mar 2022 19:47:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/iMX8-U-Boot-FIT-Image-Signature/m-p/1429547#M188304</guid>
      <dc:creator>caiotoledo-lunasystems</dc:creator>
      <dc:date>2022-03-16T19:47:16Z</dc:date>
    </item>
    <item>
      <title>Re: [iMX8] U-Boot FIT Image Signature</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/iMX8-U-Boot-FIT-Image-Signature/m-p/1434644#M188667</link>
      <description>&lt;P&gt;Do you have some error logs during your boot?&lt;/P&gt;</description>
      <pubDate>Mon, 28 Mar 2022 08:05:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/iMX8-U-Boot-FIT-Image-Signature/m-p/1434644#M188667</guid>
      <dc:creator>Zhiming_Liu</dc:creator>
      <dc:date>2022-03-28T08:05:40Z</dc:date>
    </item>
    <item>
      <title>Re: [iMX8] U-Boot FIT Image Signature</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/iMX8-U-Boot-FIT-Image-Signature/m-p/1444624#M189381</link>
      <description>&lt;P&gt;As far as I can see there's no error during boot, my device is able to boot as usual.&lt;/P&gt;&lt;P&gt;Check the full U-Boot log in attachment.&lt;/P&gt;&lt;P&gt;My guess is that U-Boot doesn't have the public key in its binary.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Apr 2022 14:36:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/iMX8-U-Boot-FIT-Image-Signature/m-p/1444624#M189381</guid>
      <dc:creator>caiotoledo-lunasystems</dc:creator>
      <dc:date>2022-04-15T14:36:09Z</dc:date>
    </item>
    <item>
      <title>Re: [iMX8] U-Boot FIT Image Signature</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/iMX8-U-Boot-FIT-Image-Signature/m-p/1447365#M189559</link>
      <description>&lt;P&gt;I've made some changes in imx-boot_1.0.bb (from meta-freescale) and&amp;nbsp;uboot-sign.bbclass (from poky), check&amp;nbsp;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;STRONG&gt;imx-boot_1.0.bb.patch&lt;/STRONG&gt; and&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN&gt;uboot-sign.bbclass.patch&amp;nbsp;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN&gt;(for now I'm patching the original recipe directly for prototyping purpose for the final implementation I will use bbappend instead)&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Now I'm getting the following error during boot:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;## Loading kernel from FIT Image at 90000000 ...
   Using 'conf-freescale_imx8mm-luna-pvt3.dtb' configuration
   Verifying Hash Integrity ... sha256,rsa2048:dev-  error!
Verification failed for '&amp;lt;NULL&amp;gt;' hash node in 'conf-freescale_imx8mm-luna-pvt3.dtb' config node
Failed to verify required signature 'key-dev'
Bad Data Hash
ERROR: can't get kernel image!
Failed to load 'boot.scr'
Failed to load 'Image'
Booting from net ...
No ethernet found.
No ethernet found.
WARN: Cannot load the DT&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For some reason, the u-boot isn't recognizing the RSA public key in its binary.&lt;/P&gt;&lt;P&gt;The u-boot.dtb contains the key (double checked using fdtget).&lt;/P&gt;</description>
      <pubDate>Thu, 21 Apr 2022 15:51:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/iMX8-U-Boot-FIT-Image-Signature/m-p/1447365#M189559</guid>
      <dc:creator>caiotoledo-lunasystems</dc:creator>
      <dc:date>2022-04-21T15:51:18Z</dc:date>
    </item>
    <item>
      <title>Re: [iMX8] U-Boot FIT Image Signature</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/iMX8-U-Boot-FIT-Image-Signature/m-p/1576016#M199375</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am having the same issue, do you have any updates on your side ?&lt;BR /&gt;could anyone from the NXP team confirm that verified boot is functional on imx8 platforms ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Mon, 02 Jan 2023 09:40:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/iMX8-U-Boot-FIT-Image-Signature/m-p/1576016#M199375</guid>
      <dc:creator>bluemonkeysrock</dc:creator>
      <dc:date>2023-01-02T09:40:30Z</dc:date>
    </item>
    <item>
      <title>Re: [iMX8] U-Boot FIT Image Signature</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/iMX8-U-Boot-FIT-Image-Signature/m-p/1882809#M224652</link>
      <description>Hi! if you were able to solve this problem? I added the configurations in yocto&lt;BR /&gt;&lt;BR /&gt;UBOOT_SIGN_KEYDIR = "${TMPDIR}/keys/"&lt;BR /&gt;UBOOT_SIGN_KEYNAME = "dev"&lt;BR /&gt;UBOOT_MKIMAGE_DTCOPTS = "-I dts -O dtb -p 2000"&lt;BR /&gt;UBOOT_SIGN_ENABLE = "1"&lt;BR /&gt;&lt;BR /&gt;I added the following things in uboot&lt;BR /&gt;CONFIG_FIT_SIGNATURE=y&lt;BR /&gt;CONFIG_FIT_SIGNATURE_MAX_SIZE=0x10000000&lt;BR /&gt;CONFIG_LEGACY_IMAGE_FORMAT=y&lt;BR /&gt;CONFIG_RSA=y&lt;BR /&gt;CONFIG_OF_CONTROL=y&lt;BR /&gt;&lt;BR /&gt;But I am getting the same error&lt;BR /&gt;&lt;BR /&gt;## Loading kernel from FIT Image at 420000000 ...&lt;BR /&gt;Using 'imx8mm.dtb' configuration&lt;BR /&gt;Verifying Hash Integrity ... sha256,rsa2048:dev- error!&lt;BR /&gt;Verification failed for '&amp;lt;NULL&amp;gt;' hash node in 'imx8mm.dtb' config node&lt;BR /&gt;Failed to verify required signature 'key-dev'&lt;BR /&gt;Bad Data Hash&lt;BR /&gt;ERROR: can't get kernel image!&lt;BR /&gt;&lt;BR /&gt;on detail debugging, I found the error is coming from the following file rsa_verify.c&lt;BR /&gt;&lt;BR /&gt;Error in Modular exponentation&lt;BR /&gt;&lt;BR /&gt;I have already checked the signatures through fit_check_sign and its showing fine results. But in u-boot its failing. Any recommendation would be helpful.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 06 Jun 2024 14:16:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/iMX8-U-Boot-FIT-Image-Signature/m-p/1882809#M224652</guid>
      <dc:creator>CrazyDeveloper</dc:creator>
      <dc:date>2024-06-06T14:16:57Z</dc:date>
    </item>
  </channel>
</rss>

