<?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: iMX6 secure boot HAB verification issue in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/iMX6-secure-boot-HAB-verification-issue/m-p/1889478#M225141</link>
    <description>&lt;P&gt;Looking to this HAB Event 2 I figured out that the problem is with key with index 2.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;--------- HAB Event 2 -----------------&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;event data:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;0xdb 0x00 0x24 0x42 0x33 0x18 0xc0 0x00&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;0xca 0x00 0x1c 0x00 &lt;STRONG&gt;0x02&lt;/STRONG&gt; 0xc5 0x00 0x00&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;0x00 0x00 0x13 0x40 0x17 0x7f 0xf4 0x00&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;0x00 0x06 0x7c 0x00 0x00 0x91 0x00 0x00&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;0x00 0x00 0x03 0x18&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Cause according to HAB4 RM the first byte of the 4-th word contains key index.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="afilippov_0-1718712708690.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/284665iD228E902B0B371D6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="afilippov_0-1718712708690.png" alt="afilippov_0-1718712708690.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;That's why I assume that here we have successfully passed SRK table verification, CSF key installation, IMG key installation, CSF verification and failed during [Authenticate Data] command.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;But I still can't understand where is the mistake:(&lt;BR /&gt;&lt;BR /&gt;P.S&lt;BR /&gt;Answering your question: I use uuu to uppload u-boot image&lt;/P&gt;</description>
    <pubDate>Tue, 18 Jun 2024 12:17:42 GMT</pubDate>
    <dc:creator>afilippov</dc:creator>
    <dc:date>2024-06-18T12:17:42Z</dc:date>
    <item>
      <title>iMX6 secure boot HAB verification issue</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/iMX6-secure-boot-HAB-verification-issue/m-p/1883690#M224706</link>
      <description>&lt;P&gt;Hi everyone!&lt;BR /&gt;&lt;BR /&gt;I faced with strange behavior of HAB and can't figure out where the mistake is.&lt;BR /&gt;&lt;BR /&gt;So, here I have an already pre-generated key infrastructure and a signed u-boot image (legacy) which is left from the previous development (lets call it &lt;STRONG&gt;IMAGE 1&lt;/STRONG&gt;). This image is designed to be uploaded via Serial Downloader (USB). After burning the fuses and checking the &lt;STRONG&gt;hab_status&lt;/STRONG&gt; function in u-boot &lt;STRONG&gt;IMAGE 1, &lt;/STRONG&gt;I&amp;nbsp;have only one hab event (a warning) which, I believe, don't relate to the problem.&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;Secure boot disabled&lt;/P&gt;&lt;P&gt;HAB Configuration: 0xf0, HAB State: 0x66&lt;/P&gt;&lt;P&gt;--------- HAB Event 1 -----------------&lt;BR /&gt;event data:&lt;BR /&gt;0xdb 0x00 0x24 0x42 0x69 0x30 0xe1 0x1d&lt;BR /&gt;0x00 0x04 0x00 0x02 0x40 0x00 0x36 0x06&lt;BR /&gt;0x55 0x55 0x00 0x03 0x00 0x00 0x00 0x00&lt;BR /&gt;0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00&lt;BR /&gt;0x00 0x00 0x00 0x01&lt;/P&gt;&lt;P&gt;STS = HAB_WARNING (0x69)&lt;BR /&gt;RSN = HAB_ENG_FAIL (0x30)&lt;BR /&gt;CTX = HAB_CTX_ENTRY (0xE1)&lt;BR /&gt;ENG = HAB_ENG_CAAM (0x1D)&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;So HAB verification seems to pass smoothly here with &lt;STRONG&gt;IMAGE 1&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;I don't know how exactly &lt;STRONG&gt;IMAGE 1&lt;/STRONG&gt; was signed, so I reversed this image with &lt;STRONG&gt;csf_parser &lt;/STRONG&gt;tool from &lt;STRONG&gt;cst 3.4.0&lt;/STRONG&gt;&amp;nbsp;packet.&amp;nbsp;&lt;BR /&gt;Based on parsed output from &lt;STRONG&gt;csf_parser&lt;/STRONG&gt; I've created a &lt;STRONG&gt;.csf&lt;/STRONG&gt; file and signed my own u-boot image using it (lets call it &lt;STRONG&gt;IMAGE 2&lt;/STRONG&gt;).&amp;nbsp;&lt;BR /&gt;The contents of .csf is below:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;[Header]&lt;BR /&gt;Version = 4.1&lt;BR /&gt;Hash Algorithm = sha256&lt;BR /&gt;Engine = ANY&lt;BR /&gt;Engine Configuration = 0&lt;BR /&gt;Certificate Format = X509&lt;BR /&gt;Signature Format = CMS&lt;/P&gt;&lt;P&gt;[Install SRK]&lt;BR /&gt;File = "/home/faa/Workspace/nxp/secure_boot/cst-dev/SRK_1_2_3_4_table.bin"&lt;BR /&gt;Source index = 0 # Index of the key location in the SRK table to be installed&lt;/P&gt;&lt;P&gt;[Install CSFK]&lt;BR /&gt;# Key used to authenticate the CSF data&lt;BR /&gt;File = "/home/faa/Workspace/nxp/secure_boot/cst-dev/crts/CSF1_1_sha256_4096_65537_v3_usr_crt.pem"&lt;/P&gt;&lt;P&gt;[Authenticate CSF]&lt;/P&gt;&lt;P&gt;[Install Key]&lt;BR /&gt;# Key slot index used to authenticate the key to be installed&lt;BR /&gt;Verification index = 0&lt;BR /&gt;# Target key slot in HAB key store where key will be installed&lt;BR /&gt;Target index = 2&lt;BR /&gt;# Key to install&lt;BR /&gt;File = "/home/faa/Workspace/nxp/secure_boot/cst-dev/crts/IMG1_1_sha256_4096_65537_v3_usr_crt.pem"&lt;/P&gt;&lt;P&gt;[Authenticate Data]&lt;BR /&gt;# Key slot index used to authenticate the image data&lt;BR /&gt;Verification index = 2&lt;BR /&gt;# Address Offset Length Data File Path&lt;BR /&gt;Blocks = 0x177ff400 0x000000 0x67c00 "/home/faa/Workspace/nxp/secure_boot/test_signing/u-boot.imx", \&lt;BR /&gt;0x910000 0x00002c 0x318 "/home/faa/Workspace/nxp/secure_boot/test_signing/u-boot.imx"&lt;/P&gt;&lt;P&gt;[Unlock]&lt;BR /&gt;Engine = CAAM&lt;BR /&gt;Features = RNG&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;After calling hab_status in u-boot &lt;STRONG&gt;IMAGE 2&lt;/STRONG&gt; I see a plenty of HAB_FAILUREs.&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;Secure boot disabled&lt;/P&gt;&lt;P&gt;HAB Configuration: 0xf0, HAB State: 0x66&lt;/P&gt;&lt;P&gt;--------- HAB Event 1 -----------------&lt;BR /&gt;event data:&lt;BR /&gt;0xdb 0x00 0x24 0x42 0x69 0x30 0xe1 0x1d&lt;BR /&gt;0x00 0x04 0x00 0x02 0x40 0x00 0x36 0x06&lt;BR /&gt;0x55 0x55 0x00 0x03 0x00 0x00 0x00 0x00&lt;BR /&gt;0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00&lt;BR /&gt;0x00 0x00 0x00 0x01&lt;/P&gt;&lt;P&gt;STS = HAB_WARNING (0x69)&lt;BR /&gt;RSN = HAB_ENG_FAIL (0x30)&lt;BR /&gt;CTX = HAB_CTX_ENTRY (0xE1)&lt;BR /&gt;ENG = HAB_ENG_CAAM (0x1D)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;--------- HAB Event 2 -----------------&lt;BR /&gt;event data:&lt;BR /&gt;0xdb 0x00 0x24 0x42 0x33 0x18 0xc0 0x00&lt;BR /&gt;0xca 0x00 0x1c 0x00 0x02 0xc5 0x00 0x00&lt;BR /&gt;0x00 0x00 0x13 0x40 0x17 0x7f 0xf4 0x00&lt;BR /&gt;0x00 0x06 0x7c 0x00 0x00 0x91 0x00 0x00&lt;BR /&gt;0x00 0x00 0x03 0x18&lt;/P&gt;&lt;P&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;/P&gt;&lt;P&gt;&lt;BR /&gt;--------- HAB Event 3 -----------------&lt;BR /&gt;event data:&lt;BR /&gt;0xdb 0x00 0x14 0x42 0x33 0x0c 0xa0 0x00&lt;BR /&gt;0x00 0x00 0x00 0x00 0x17 0x7f 0xf4 0x00&lt;BR /&gt;0x00 0x00 0x00 0x20&lt;/P&gt;&lt;P&gt;STS = HAB_FAILURE (0x33)&lt;BR /&gt;RSN = HAB_INV_ASSERTION (0x0C)&lt;BR /&gt;CTX = HAB_CTX_ASSERT (0xA0)&lt;BR /&gt;ENG = HAB_ENG_ANY (0x00)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;--------- HAB Event 4 -----------------&lt;BR /&gt;event data:&lt;BR /&gt;0xdb 0x00 0x14 0x42 0x33 0x0c 0xa0 0x00&lt;BR /&gt;0x00 0x00 0x00 0x00 0x17 0x7f 0xf4 0x20&lt;BR /&gt;0x00 0x00 0x00 0x01&lt;/P&gt;&lt;P&gt;STS = HAB_FAILURE (0x33)&lt;BR /&gt;RSN = HAB_INV_ASSERTION (0x0C)&lt;BR /&gt;CTX = HAB_CTX_ASSERT (0xA0)&lt;BR /&gt;ENG = HAB_ENG_ANY (0x00)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;--------- HAB Event 5 -----------------&lt;BR /&gt;event data:&lt;BR /&gt;0xdb 0x00 0x14 0x42 0x33 0x0c 0xa0 0x00&lt;BR /&gt;0x00 0x00 0x00 0x00 0x17 0x80 0x00 0x00&lt;BR /&gt;0x00 0x00 0x00 0x04&lt;/P&gt;&lt;P&gt;STS = HAB_FAILURE (0x33)&lt;BR /&gt;RSN = HAB_INV_ASSERTION (0x0C)&lt;BR /&gt;CTX = HAB_CTX_ASSERT (0xA0)&lt;BR /&gt;ENG = HAB_ENG_ANY (0x00)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;--------- HAB Event 6 -----------------&lt;BR /&gt;event data:&lt;BR /&gt;0xdb 0x00 0x14 0x42 0x33 0x0c 0xa0 0x00&lt;BR /&gt;0x00 0x00 0x00 0x00 0x00 0x91 0x00 0x00&lt;BR /&gt;0x00 0x00 0x03 0x18&lt;/P&gt;&lt;P&gt;STS = HAB_FAILURE (0x33)&lt;BR /&gt;RSN = HAB_INV_ASSERTION (0x0C)&lt;BR /&gt;CTX = HAB_CTX_ASSERT (0xA0)&lt;BR /&gt;ENG = HAB_ENG_ANY (0x00)&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;I reversed &lt;STRONG&gt;IMAGE 2&amp;nbsp;&lt;/STRONG&gt;using&amp;nbsp;&lt;STRONG&gt;csf_parser&amp;nbsp;&lt;/STRONG&gt;tool and compared &lt;EM&gt;cert0.der&lt;/EM&gt;, &lt;EM&gt;cert1.der&lt;/EM&gt; and &lt;EM&gt;SRKTable.bin&lt;/EM&gt; files with &lt;STRONG&gt;IMAGE 1&lt;/STRONG&gt; output. There are no differences.&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;BR /&gt;faa@anton:~/Workspace/nxp/secure_boot/csf_parser_dir$ diff ./work/SRKTable.bin ./not_work/SRKTable.bin&lt;BR /&gt;faa@anton:~/Workspace/nxp/secure_boot/csf_parser_dir$ diff ./work/cert0.der ./not_work/cert0.der&lt;BR /&gt;faa@anton:~/Workspace/nxp/secure_boot/csf_parser_dir$ diff ./work/cert1.der ./not_work/cert1.der&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;So I'm sure that I used exactly the same set of keys to sign &lt;STRONG&gt;IMAGE 2&lt;/STRONG&gt; that &lt;STRONG&gt;IMAGE 1&lt;/STRONG&gt; was signed.&lt;/P&gt;&lt;P&gt;In the &lt;EM&gt;debug_log.txt&lt;/EM&gt; file for both images the only difference is in the signatures itself, but it's OK for digital signatures, as far as I know.&lt;/P&gt;&lt;P&gt;I checked the Fuses table too after manually generating it via&amp;nbsp;&lt;STRONG&gt;srktool&amp;nbsp;&lt;/STRONG&gt;using SRK certificates and it matches to the fuses value.&lt;BR /&gt;&lt;BR /&gt;So my question is &lt;STRONG&gt;where did I go wrong and how is it possible?&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jun 2024 14:56:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/iMX6-secure-boot-HAB-verification-issue/m-p/1883690#M224706</guid>
      <dc:creator>afilippov</dc:creator>
      <dc:date>2024-06-07T14:56:34Z</dc:date>
    </item>
    <item>
      <title>Re: iMX6 secure boot HAB verification issue</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/iMX6-secure-boot-HAB-verification-issue/m-p/1883910#M224710</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Since it is your custom U-Boot, I guess binary size doesn't match size of your former U-Boot. As well size of DCD may be little different. Both size mismatches would break authentication. Make sure whole "Blocks = " record matches your image.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 08 Jun 2024 05:43:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/iMX6-secure-boot-HAB-verification-issue/m-p/1883910#M224710</guid>
      <dc:creator>kef2</dc:creator>
      <dc:date>2024-06-08T05:43:54Z</dc:date>
    </item>
    <item>
      <title>Re: iMX6 secure boot HAB verification issue</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/iMX6-secure-boot-HAB-verification-issue/m-p/1884172#M224725</link>
      <description>&lt;P&gt;I've already checked this and for my case binary size and DCD size are similar. And even more: DCDs are equal for IMAGE 1 and IMAGE 2 (they are running on the same board).&lt;BR /&gt;So this is not the key to this problem (&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jun 2024 10:48:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/iMX6-secure-boot-HAB-verification-issue/m-p/1884172#M224725</guid>
      <dc:creator>afilippov</dc:creator>
      <dc:date>2024-06-10T10:48:05Z</dc:date>
    </item>
    <item>
      <title>Re: iMX6 secure boot HAB verification issue</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/iMX6-secure-boot-HAB-verification-issue/m-p/1885032#M224783</link>
      <description>So certificates are the same, image IVT and Boot Data structs are the same, and still no go?&lt;BR /&gt;&lt;BR /&gt;Are you using uuu or imxusb to boot over USB? AFAIK uuu needs no other manipulations, just running cst with csf file containing additional Blocks= record for DCD in SRAM. imxusb additionally requires signing image with cleared DCD pointer in IVT. You HAB event 2 seems mentioning SRAM area @ 910000&lt;BR /&gt;&lt;BR /&gt;--------- HAB Event 2 -----------------&lt;BR /&gt;event data:&lt;BR /&gt;0xdb 0x00 0x24 0x42 0x33 0x18 0xc0 0x00&lt;BR /&gt;0xca 0x00 0x1c 0x00 0x02 0xc5 0x00 0x00&lt;BR /&gt;0x00 0x00 0x13 0x40 0x17 0x7f 0xf4 0x00&lt;BR /&gt;0x00 0x06 0x7c 0x00**0x00 0x91 0x00 0x00**&lt;BR /&gt;0x00 0x00 0x03 0x18&lt;BR /&gt;&lt;BR /&gt;Some iMX6's need programmed SRK fuses. Newer IC's allow testing HAB signing with blank SRK fuses.</description>
      <pubDate>Tue, 11 Jun 2024 09:35:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/iMX6-secure-boot-HAB-verification-issue/m-p/1885032#M224783</guid>
      <dc:creator>kef2</dc:creator>
      <dc:date>2024-06-11T09:35:58Z</dc:date>
    </item>
    <item>
      <title>Re: iMX6 secure boot HAB verification issue</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/iMX6-secure-boot-HAB-verification-issue/m-p/1889478#M225141</link>
      <description>&lt;P&gt;Looking to this HAB Event 2 I figured out that the problem is with key with index 2.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;--------- HAB Event 2 -----------------&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;event data:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;0xdb 0x00 0x24 0x42 0x33 0x18 0xc0 0x00&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;0xca 0x00 0x1c 0x00 &lt;STRONG&gt;0x02&lt;/STRONG&gt; 0xc5 0x00 0x00&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;0x00 0x00 0x13 0x40 0x17 0x7f 0xf4 0x00&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;0x00 0x06 0x7c 0x00 0x00 0x91 0x00 0x00&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;0x00 0x00 0x03 0x18&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Cause according to HAB4 RM the first byte of the 4-th word contains key index.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="afilippov_0-1718712708690.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/284665iD228E902B0B371D6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="afilippov_0-1718712708690.png" alt="afilippov_0-1718712708690.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;That's why I assume that here we have successfully passed SRK table verification, CSF key installation, IMG key installation, CSF verification and failed during [Authenticate Data] command.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;But I still can't understand where is the mistake:(&lt;BR /&gt;&lt;BR /&gt;P.S&lt;BR /&gt;Answering your question: I use uuu to uppload u-boot image&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jun 2024 12:17:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/iMX6-secure-boot-HAB-verification-issue/m-p/1889478#M225141</guid>
      <dc:creator>afilippov</dc:creator>
      <dc:date>2024-06-18T12:17:42Z</dc:date>
    </item>
  </channel>
</rss>

