<?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: i.MX8MP + HAB + encrypted storage using CAAM in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/i-MX8MP-HAB-encrypted-storage-using-CAAM/m-p/1637035#M204508</link>
    <description>&lt;P&gt;Thank you for explanation.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 20 Apr 2023 08:36:51 GMT</pubDate>
    <dc:creator>JiriCh</dc:creator>
    <dc:date>2023-04-20T08:36:51Z</dc:date>
    <item>
      <title>i.MX8MP + HAB + encrypted storage using CAAM</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/i-MX8MP-HAB-encrypted-storage-using-CAAM/m-p/1636214#M204444</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am using i.MX8MP processor with eMMC for persistent storage. I want to use secure boot (HAB) and create encrypted storage on eMMC using CAAM secure keys. eMMC is partitioned. I use one partition to store keys generated by caam-keygen and other partition (/dev/mmcblk2p7) is for the encrypted storage. I first created the encrypted storage on partition /dev/mmcblk2p7 using the steps descripted in AN12714. It works fine. I created a script that is called by Linux on my behalf at boot. The script imports key from blob, add it to the key retention service and mount the file system at /fsencrypted.&lt;/P&gt;&lt;P&gt;However, when I enabled HAB,&amp;nbsp; I got the following errors at Linux boot.&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;&amp;lt;13&amp;gt;Jan  1 00:00:00 rc: Mounting enrypted storage on /dev/mmcblk2p7
[    7.771096] caam_jr 30903000.jr: Failed to execute blob decap descriptor
[    7.779322] caam_jr 30903000.jr: Blob decapsulation failed: -74
&amp;lt;13&amp;gt;Jan  1 00:00:00 rc:
&amp;lt;13&amp;gt;Jan  1 00:00:00 rc: CAAM keygen usage: caam-keygen [options]
&amp;lt;13&amp;gt;Jan  1 00:00:00 rc: Options:
&amp;lt;13&amp;gt;Jan  1 00:00:00 rc: create &amp;lt;key_name&amp;gt; &amp;lt;key_enc&amp;gt; &amp;lt;key_mode&amp;gt; &amp;lt;key_val&amp;gt; &amp;lt;text_type&amp;gt;
&amp;lt;13&amp;gt;Jan  1 00:00:00 rc: &amp;lt;key_name&amp;gt; the name of the file that will contain the black key.
&amp;lt;13&amp;gt;Jan  1 00:00:00 rc: A file with the same name, but with .bb extension, will contain the black blob.
&amp;lt;13&amp;gt;Jan  1 00:00:00 rc: &amp;lt;key_enc&amp;gt; can be ecb or ccm
&amp;lt;13&amp;gt;Jan  1 00:00:00 rc: &amp;lt;key_mode&amp;gt; can be -s or -t.
&amp;lt;13&amp;gt;Jan  1 00:00:00 rc: -s generate a black key from random with the size given in the next argument
&amp;lt;13&amp;gt;Jan  1 00:00:00 rc: -t generate a black key from a plaintext given in the next argument
&amp;lt;13&amp;gt;Jan  1 00:00:00 rc: &amp;lt;key_val&amp;gt; the size or the plaintext based on the previous argument (&amp;lt;key_mode&amp;gt;)
&amp;lt;13&amp;gt;Jan  1 00:00:00 rc: &amp;lt;text_type&amp;gt; can be -h or -p (default argument is -p)
&amp;lt;13&amp;gt;Jan  1 00:00:00 rc: -h generate a black key from the hex text that is provided in previous argument
&amp;lt;13&amp;gt;Jan  1 00:00:00 rc: -p generate a black key from the plain text that is provided in previous argument
&amp;lt;13&amp;gt;Jan  1 00:00:00 rc: import &amp;lt;blob_name&amp;gt; &amp;lt;key_name&amp;gt;
&amp;lt;13&amp;gt;Jan  1 00:00:00 rc: &amp;lt;blob_name&amp;gt; the absolute path of the file that contains the blob
&amp;lt;13&amp;gt;Jan  1 00:00:00 rc: &amp;lt;key_name&amp;gt; the name of the file that will contain the black key.
[    7.915905] trusted_key: device-mapper: crypt: dm-0: INTEGRITY AEAD ERROR, sector 204672
[    7.924042] trusted_key: device-mapper: crypt: dm-0: INTEGRITY AEAD ERROR, sector 204673
[    7.932172] trusted_key: device-mapper: crypt: dm-0: INTEGRITY AEAD ERROR, sector 204674
[    7.940292] trusted_key: device-mapper: crypt: dm-0: INTEGRITY AEAD ERROR, sector 204675
[    7.948466] trusted_key: device-mapper: crypt: dm-0: INTEGRITY AEAD ERROR, sector 204676
[    7.956639] trusted_key: device-mapper: crypt: dm-0: INTEGRITY AEAD ERROR, sector 204677
[    7.964793] trusted_key: device-mapper: crypt: dm-0: INTEGRITY AEAD ERROR, sector 204678
[    7.972971] trusted_key: device-mapper: crypt: dm-0: INTEGRITY AEAD ERROR, sector 204679
[    7.982432] trusted_key: device-mapper: crypt: dm-0: INTEGRITY AEAD ERROR, sector 204672
[    7.990562] trusted_key: device-mapper: crypt: dm-0: INTEGRITY AEAD ERROR, sector 204673
[    7.998853] Buffer I/O error on dev dm-0, logical block 25584, async page read
[    8.026440] EXT4-fs (dm-0): unable to read superblock
&amp;lt;13&amp;gt;Jan  1 00:00:00 rc: mount: /fsencrypted: can't read superblock on /dev/mapper/encrypted.
&amp;lt;13&amp;gt;Jan  1 00:00:00 rc: error: exit code 32&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I figured out that I have to re-create the encrypted storage again (steps from AN12714) to get it working. However that removes my data stored on the partition.&amp;nbsp;&lt;/P&gt;&lt;P&gt;To avoid these issues, seems I first have to enable HAB and then create encrypted storage.&amp;nbsp;&lt;/P&gt;&lt;P&gt;My question is WHY? What happens with encrypted storage when I enable HAB? Do I do something wrong?&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Jiri&lt;/P&gt;</description>
      <pubDate>Wed, 19 Apr 2023 11:29:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/i-MX8MP-HAB-encrypted-storage-using-CAAM/m-p/1636214#M204444</guid>
      <dc:creator>JiriCh</dc:creator>
      <dc:date>2023-04-19T11:29:44Z</dc:date>
    </item>
    <item>
      <title>Re: i.MX8MP + HAB + encrypted storage using CAAM</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/i-MX8MP-HAB-encrypted-storage-using-CAAM/m-p/1636896#M204493</link>
      <description>&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;It's quite likely due to the fact that CAAM uses a "test key" while in open configuration (ie. before you close the device for fully enabling High Assurance Boot).&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;Once you close the device CAAM starts using the "real key" (ie. the OTPMK, a one time programmable master key, which is unique to each chip) and thus: anything encrypted with the test key becomes inaccessible.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;See: &lt;A href="https://community.nxp.com/t5/i-MX-Processors/i-MX-device-specific-black-key-blob/m-p/1380868/highlight/true#M183901" target="_blank"&gt;https://community.nxp.com/t5/i-MX-Processors/i-MX-device-specific-black-key-blob/m-p/1380868/highlight/true#M183901&lt;/A&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 20 Apr 2023 05:13:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/i-MX8MP-HAB-encrypted-storage-using-CAAM/m-p/1636896#M204493</guid>
      <dc:creator>jrantanen</dc:creator>
      <dc:date>2023-04-20T05:13:26Z</dc:date>
    </item>
    <item>
      <title>Re: i.MX8MP + HAB + encrypted storage using CAAM</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/i-MX8MP-HAB-encrypted-storage-using-CAAM/m-p/1637035#M204508</link>
      <description>&lt;P&gt;Thank you for explanation.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Apr 2023 08:36:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/i-MX8MP-HAB-encrypted-storage-using-CAAM/m-p/1637035#M204508</guid>
      <dc:creator>JiriCh</dc:creator>
      <dc:date>2023-04-20T08:36:51Z</dc:date>
    </item>
  </channel>
</rss>

