HABv4 Authenticity with Decrypt Command

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

HABv4 Authenticity with Decrypt Command

938 Views
jmmorenog
Contributor I

Hello, I need to encrypt and authenticate my Linux image to boot it on a iMX8M Plus board. My goal is to be sure nothing that does not provide from me is executed in the board. I already have SPL and U-boot signed with HABv4. The question is that I need to sign the Linux image to reach my goal but I also need to encrypt the content because of the sensitive data. Regarding to CSF User Guide:

This command (Decrypt Data) is applicable from HAB4.1 onwards. Each instance generates a CSF command to decrypt and authenticate a list of code/data blocks using secret key stored in the secret key store.
Code-Signing Tool User’s Guide, Rev. 3.4.0
A-49 NXP
CST will generate a corresponding AUT_DAT command. CST will encrypt the data blocks in-place in the given files using a secret key and generate MAC data which is appended to the CSF.

 

It is also explained in the HABv4 API Refence Manual that the Image is encrypted using AES-CCM, an algo that encrypts the content and uses the private key of the board with a MAC-CBC algo to authenticate the image. So the question is... Is it safe to authenticate the image that way or should I use public key signing better?

0 Kudos
Reply
2 Replies

887 Views
jmmorenog
Contributor I

As I understood, AES-CCM provides authenticity to the image booted so i thought it was fine if I just use this mechanism. My scheme is the following:

SPL -> signed

U-boot -> signed

Linux -> encrypted with AES-CCM

0 Kudos
Reply

894 Views
Harvey021
NXP TechSupport
NXP TechSupport

Hi,

There is no problem from the perspective of integrity, but if it is not signed, any image can be booted, and it will be easily replaced by other images. This is not very safe, and it does not refer to the problem of the encrypted image itself.

 

Regards

Harvey

0 Kudos
Reply