Part Number: LP-AM261
Hi,
I want to implement the secure boot functionality (device should boot only with valid signed application firmware image).
For this I have generated the public-private key pair as follows:
# Generate RSA-2048 signing key (store in secure location)
openssl genrsa -out /secure/keys/prod_signing_key.pem 2048
# Generate AES-256 encryption key (optional)
openssl rand -hex 32 > /secure/keys/prod_encryption_key.pem
#Extract public key from the private key
openssl rsa -in prod_signing_key.pem -pubout -out publickey.pem
Added the private key paths and secure boot related configurations as follows in the makefile_ccs_bootimage_gen file:
# Default secure boot/signing settings (can be overridden through command line)
DEVICE_TYPE ?= HS
ENC_ENABLED ?= no
RSASSAPSS_ENABLED ?= no
APP_SIGNING_KEY ?= $(abspath keys/private_key.pem)
APP_SIGNING_KEY_KEYRING_ID ?= 0
APP_SIGNING_HASH_ALGO ?= sha256
APP_ENCRYPTION_KEY ?= $(abspath keys/private_encryption_key.pem)
APP_ENCRYPTION_KEY_KEYRING_ID ?= 0
KD_SALT ?= 0x12345678
And build the firmware using the following commad
make -f makefile_ccs_bootimage_gen OUTNAME=gpio_input_interrupt PROFILE=Release MCU_PLUS_SDK_PATH=C:/ti/mcu_plus_sdk_am261x_26_00_00_01 CG_TOOL_ROOT=C:/ti/ccs2050/ccs/tools/compiler/ti-cgt-armllvm_4.0.4.LTS CCS_INSTALL_DIR=C:\ti\ccs2050\ccs\ CCS_IDE_MODE=desktop DEVICE=am261x DEVICE_TYPE=HS
These steps generated the secure .mcelf.hs image.
Are the above mentioned stepts correct for secure application image generation? If no, provide me with the correct way. If yes, I want to flash this firmware on the device. But my question is how the device will know the public key for validating the firmware?
Do I need to provide the public key in SBL? If yes, please explain, how? If no, provide the correct way for this.
Because what I understood from the documentation is,
1. On AM261x, the SBL does NOT store the public key and does NOT perform signature verification of the application image.
2. Verification is done by the HSM ROM. It validates the SBL itself, not the application. The ROM verifies:
The X.509 certificate
The RSA‑4096 signature
The SHA‑512 integrity hash
Optional AES‑256 encryption
3. Public key is stored inside the X.509 certificate. But, "How to store Public key inside the X.509 certificate?"
4. Only after SBL authentication, execution proceed
5. After boot, SBL may optionally validate the application, but this is not part of TI’s secure boot ROM flow.
6. If I want application-level authentication, I have to
1. Embedding your own public key into SBL
2. Signing the application image (similar to SBL)
3. Having SBL verify the signature before loading the app
Is my understanding correct? If no, please correct me. If yes, kindly clarify my doubts listed below.
1. For application-level authentication, how to embedd the public key into SBL?
2. What changed I shall need to do for having SBL to verify the secure application image before loading?