I'm trying to enable high assurance boot on i.MX6Q rev1.6.
I'm using U-Boot 2017.03
The following settings are enabled in u-boot:
CONFIG_SECURE_BOOT=y
CONFIG_SYS_FSL_SEC_LE
CONFIG_SYS_FSL_SEC_COMPAT 4
CONFIG_FSL_CAAM
CONFIG_CMD_RNG_SELF_TEST=y
The u-boot build output:
...
Image Type: Freescale IMX Boot Image
Image Ver: 2 (i.MX53/6/7 compatible)
Mode: DCD
Data Size: 618496 Bytes = 604.00 KiB = 0.59 MiB
Load Address: 177ff420
Entry Point: 17800000
HAB Blocks: 177ff400 00000000 00092c00
DCD Blocks: 00910000 0000002c 000002f8
I generated keys with cts-3.3-1, using the following setting:
Do you want to use an existing CA key (y/n)?: n
Do you want to use Elliptic Curve Cryptography (y/n)?: n
Enter key length in bits for PKI tree: 2048
Enter PKI tree duration (years): 30
How many Super Root Keys should be generated? 4
Do you want the SRK certificates to have the CA flag set? (y/n)?: y
I flashed the fuses. The values read from fuses match the output of
hexdump -e '/4 "0x"' -e '/4 "%X""\n"' SRK_1_2_3_4_fuse.bin
command.
u-boot.csf used for signing:
[Header]
Version = 4.2
Hash Algorithm = sha256
Engine = CAAM
Engine Configuration = 0
Certificate Format = X509
Signature Format = CMS
[Install SRK]
File = "../cst-3.3.1/crts/SRK_1_2_3_4_table.bin"
Source index = 0
[Install CSFK]
File = "../cst-3.3.1/crts/CSF1_1_sha256_2048_65537_v3_usr_crt.pem"
[Authenticate CSF]
[Unlock]
Engine = CAAM
Features = RNG
[Install Key]
Verification index = 0
Target index = 2
File = "../cst-3.3.1/crts/IMG1_1_sha256_2048_65537_v3_usr_crt.pem"
[Authenticate Data]
Verification index = 2
Blocks = 0x177FF400 0x0 0x00092c00 "u-boot-dtb.imx"
To sign the u-boot I used the following commands:
../cst-3.3.1/linux64/bin/cst --o u-boot_csf.bin --i u-boot.csf
Output:
Install SRK
Install CSFK
Authenticate CSF
Install key
Authenticate data
CSF Processed successfully and signed data available in u-boot_csf.bin
cat u-boot-dtb.imx u-boot_csf.bin > u-boot-signed.imx
objcopy -I binary -O binary --pad-to 0x0094c00 --gap-fill=0x00 u-boot-signed.imx u-boot-signed-pad.imx
The signed u-boot image was flashed to e-MMC.
After reboot I used hab_status to verify signed u-boot
hab_status
Secure boot disabled
HAB Configuration: 0xf0, HAB State: 0x66
The hab_status output doesn't show "No HAB Events Found!" message. No any other errors/events are displayed.
The same keys and signing procedure works fine on board with iMX6QP rev1.0.
The "No HAB Events Found!" message is present when running hab_status command.
Any ideas why No HAB Events Found! is missing when running hab_status on iMX6Q rev1.6?
Can anyone provide more information about how to fix this?