<?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>i.MX ProcessorsのトピックRe: Secure boot problem on i.MX6</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/Secure-boot-problem-on-i-MX6/m-p/366335#M51966</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Answer to myself, I needed the tools/mkimage utility from the freescale git (I used the one from imx_v2013.04_3.10.17_1.0.0_ga), I had the one from boundary git...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now it works, closed mode, secure boot enabled!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 31 Oct 2014 14:31:09 GMT</pubDate>
    <dc:creator>frédéric</dc:creator>
    <dc:date>2014-10-31T14:31:09Z</dc:date>
    <item>
      <title>Secure boot problem on i.MX6</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Secure-boot-problem-on-i-MX6/m-p/366334#M51965</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am using u-boot 2014.04 on a i.MX6 board (based on a nitrogen6x), I read documentation and posts here on the forum, I took multiple guides&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i.MX_6_Linux_High_Assurance_Boot_(HAB)_User's_Guide.pdf, How-to enable HAB in i.MX6.pdf, AN4581.pdf, secure_boot_on_imx6.pdf, HAB4_API.pdf, HABCST_UG.pdf, etc&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then the BLN_CST_MAIN_02.01.01.tar.gz package, I was not able to find the secureboot_scripts.tar.gz package, according to the doc I need it because my uboot is bigger than 0x2F000 so I cannot statically allocate HAB data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I found the secure script utilities in imx-linux-test.git in /test/mxc_secureboot/V2012, there is no 2014 version but after looking at the script they look ok and automatize the job instead of doing it by hand.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I followed the guide from i.MX_6_Linux_High_Assurance_Boot_(HAB)_User's_Guide.pdf and installed the script according to the README from test/mxc_secureboot/V2012/README.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I generated the keys with hab4_pki_tree.sh then the SRK file with srktool utility, it created a SRK_1_2_3_4_fuse.bin (32 bytes) and SRK_1_2_3_4_table.bin file (1088 bytes).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I enabled CONFIG_SECURE_BOOT in u-boot and compiled it, it complained about a missing authenticate_image() but I ported a patch from&lt;/P&gt;&lt;P&gt;&lt;A href="http://git.denx.de/cgi-bin/gitweb.cgi?p=u-boot/u-boot-imx.git;a=commit;h=36c1ca4d46ef11ac7b3c0afb5c42dadb4e8773f3" style="font-size: 10pt; line-height: 1.5em;" title="http://git.denx.de/cgi-bin/gitweb.cgi?p=u-boot/u-boot-imx.git;a=commit;h=36c1ca4d46ef11ac7b3c0afb5c42dadb4e8773f3"&gt;http://git.denx.de/cgi-bin/gitweb.cgi?p=u-boot/u-boot-imx.git;a=commit;h=36c1ca4d46ef11ac7b3c0afb5c42dadb4e8773f3&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I then followed the README, copied u-boot.imx in BLN/u-boot, run ./mk_secure_uboot, it generated this u-boot.csf&lt;/P&gt;&lt;BLOCKQUOTE&gt;
&lt;P&gt;[Header]&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Version = 4.0&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Security Configuration = Open&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Hash Algorithm = sha256&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Engine Configuration = 0&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Certificate Format = X509&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Signature Format = CMS&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;[Install SRK]&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; File = "../crts/SRK_1_2_3_4_table.bin"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Source index = 0&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;[Install CSFK]&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; File = "../crts/CSF1_1_sha256_2048_65537_v3_usr_crt.pem"&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;[Authenticate CSF]&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;[Install Key]&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Verification index = 0&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Target index = 2&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; File = "../crts/IMG1_1_sha256_2048_65537_v3_usr_crt.pem"&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;# Sign padded u-boot starting at the IVT through to the end with&lt;/P&gt;
&lt;P&gt;# length = 0x5B000&lt;/P&gt;
&lt;P&gt;# This covers the essential parts: IVT, boot data and DCD.&lt;/P&gt;
&lt;P&gt;# Blocks have the following definition:&lt;/P&gt;
&lt;P&gt;#&amp;nbsp;&amp;nbsp;&amp;nbsp; Image block start address on i.MX, Offset from start of image file,&lt;/P&gt;
&lt;P&gt;#&amp;nbsp;&amp;nbsp;&amp;nbsp; Length of block in bytes, image data file&lt;/P&gt;
&lt;P&gt;[Authenticate Data]&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Verification index = 2&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Blocks = 0x177FF400 0x0 0x5B000 "u-boot-pad.imx"&lt;/P&gt;




&lt;/BLOCKQUOTE&gt;&lt;P&gt;The script generated a u-boot_csf.bin which is 3896 bytes long, doing a hexdump on it I can see it contain various strings like "OpenSSL Generated Certificate" or "SRK1_sha256_2048_65537_v3_ca"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It also generated the habimagegen script as follow:&lt;/P&gt;&lt;BLOCKQUOTE&gt;
&lt;P&gt;#! /bin/bash&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;echo "extend u-boot to 0x5B000..."&lt;/P&gt;
&lt;P&gt;objcopy -I binary -O binary --pad-to 0x5B000 --gap-fill=0x5A u-boot.imx u-boot-pad.imx&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;echo "generate csf data..."&lt;/P&gt;
&lt;P&gt;../linux/cst --o u-boot_csf.bin &amp;lt; u-boot.csf&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;echo "merge image and csf data..."&lt;/P&gt;
&lt;P&gt;cat u-boot-pad.imx u-boot_csf.bin &amp;gt; u-boot-signed.imx&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;echo "extend final image to 0x5D000..."&lt;/P&gt;
&lt;P&gt;objcopy -I binary -O binary --pad-to 0x5D000 --gap-fill=0x5A u-boot-signed.imx u-boot-signed-pad.imx&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;echo "u-boot-signed-pad.imx is ready"&lt;/P&gt;




&lt;/BLOCKQUOTE&gt;&lt;P&gt;When I boot my u-boot, I have an event for invalid address&lt;/P&gt;&lt;BLOCKQUOTE&gt;
&lt;P&gt;U-Boot &amp;gt; hab_status&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Secure boot disabled&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;HAB Configuration: 0xf0, HAB State: 0x66&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;--------- HAB Event 1 -----------------&lt;/P&gt;
&lt;P&gt;event data:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0xdb 0x00 0x08 0x41 0x33 0x22 0x0a 0x00&lt;/P&gt;




&lt;/BLOCKQUOTE&gt;&lt;P&gt;If I understand the IVT, it seems the CSF/hab_data is populated&lt;/P&gt;&lt;BLOCKQUOTE&gt;
&lt;P&gt;00000000&amp;nbsp; d1 00 20 40 00 00 80 17&amp;nbsp; 00 00 00 00 2c f4 7f 17&amp;nbsp; |.. @........,...|&lt;/P&gt;
&lt;P&gt;00000010&amp;nbsp; 20 f4 7f 17 00 f4 7f 17&amp;nbsp; &lt;STRONG&gt;00 a0 85 17&lt;/STRONG&gt; 00 00 00 00&amp;nbsp; | ...............|&lt;/P&gt;
&lt;P&gt;00000020&amp;nbsp; 00 f0 7f 17 00 d0 05 00&amp;nbsp; 00 00 00 00 d2 03 18 40&amp;nbsp; |...............@|&lt;/P&gt;
&lt;P&gt;00000030&amp;nbsp; cc 03 14 04 02 0e 05 a8&amp;nbsp; 00 00 00 30 02 0e 05 b0&amp;nbsp; |...........0....|&lt;/P&gt;




&lt;/BLOCKQUOTE&gt;&lt;P&gt;Also mkimage shows the same as before, I thought it would show "HAB Blocks: XXXXXXX" at the end&lt;/P&gt;&lt;BLOCKQUOTE&gt;
&lt;P&gt;./mkimage -l u-boot-signed-pad.imx&lt;/P&gt;
&lt;P&gt;Image Type:&amp;nbsp;&amp;nbsp; Freescale IMX Boot Image&lt;/P&gt;
&lt;P&gt;Image Ver:&amp;nbsp;&amp;nbsp;&amp;nbsp; 2 (i.MX53/6 compatible)&lt;/P&gt;
&lt;P&gt;Data Size:&amp;nbsp;&amp;nbsp;&amp;nbsp; 372736 Bytes = 364.00 kB = 0.36 MB&lt;/P&gt;
&lt;P&gt;Load Address: 177ff420&lt;/P&gt;
&lt;P&gt;Entry Point:&amp;nbsp; 1780000&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;0&lt;/SPAN&gt;&lt;/P&gt;




&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In a lot of doc there is change to be made to either flash_header.S or to u-boot.lds to insert the CSF or hab_data, I cannot find any info about __hab_data in my u-boot sources, nor changes in lds script.&lt;/P&gt;&lt;P&gt;I checked the u-boot sources from u-boot-fslc.git and u-boot-imx.git and there is no reference to hab_data anywhere.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;EDIT : just saw that the CSF pointer is at 1785a000 but I think it should be at 1785b000&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;If I change the CSF pointer to 1785b000 however, the HAB event report 0x11 invalid CSF, so not sure if value is right or not...&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help would be appreciated!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Oct 2014 14:48:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Secure-boot-problem-on-i-MX6/m-p/366334#M51965</guid>
      <dc:creator>frédéric</dc:creator>
      <dc:date>2014-10-30T14:48:23Z</dc:date>
    </item>
    <item>
      <title>Re: Secure boot problem on i.MX6</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Secure-boot-problem-on-i-MX6/m-p/366335#M51966</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Answer to myself, I needed the tools/mkimage utility from the freescale git (I used the one from imx_v2013.04_3.10.17_1.0.0_ga), I had the one from boundary git...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now it works, closed mode, secure boot enabled!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Oct 2014 14:31:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Secure-boot-problem-on-i-MX6/m-p/366335#M51966</guid>
      <dc:creator>frédéric</dc:creator>
      <dc:date>2014-10-31T14:31:09Z</dc:date>
    </item>
    <item>
      <title>Re: Secure boot problem on i.MX6</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Secure-boot-problem-on-i-MX6/m-p/366336#M51967</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Am trying secure boot on SabreSD (Uboot-2015.07). Even am getting the same issue as yours.&lt;/P&gt;&lt;P&gt;Could you please be more specific on how to use mkimage utility for getting "secure boot enabled"?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=&amp;gt; hab_status &lt;/P&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;/P&gt;&lt;P&gt;event data:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0xdb 0x00 0x08 0x41 0x33 0x22 0x0a 0x00&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you in advance&lt;/P&gt;&lt;P&gt;-Supriya&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Mar 2016 10:20:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Secure-boot-problem-on-i-MX6/m-p/366336#M51967</guid>
      <dc:creator>supriyac</dc:creator>
      <dc:date>2016-03-21T10:20:48Z</dc:date>
    </item>
  </channel>
</rss>

