This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hello,
I use the AM62X EVM and want to enable HS-SE with custom keys.
I was able to build the tiboot3.bin from the SDK and using the TI development keys. I have NOT run it on the board, so no eFuses are burnt yet.
Moving forward with custom keys, this are my steps:
# 1 Generate a new set of keys:
./gen_keywr_cert.sh -g
# 2 In the keys folder I get:
aes256.key bmek.key bmpk.pem smek.key smpk.pem
# 3 Make the One Shot certificate, specifying SMPK as the certificate for secure boot
./gen_keywr_cert.sh -t tifek/ti_fek_public.pem -a keys/aes256.key --msv 0xC0FFE --bmpk keys/bmpk.pem -b-wp --bmek keys/bmek.key --bmek-wp --smpk keys/smpk.pem --smek keys/smek.key --keycnt 2 --keyrev 1
# Output:
1668 secondary_cert.bin
5380 primary_cert.bin
7048 ../../x509cert/final_certificate.bin
# 4 Convert the bin, produce the keycert.h:
python3 ~/ti/mcu_plus_sdk_am62x_09_01_00_39/tools/bin2c/bin2c.py final_certificate.bin keycert.h KEYCERT
# 5 Build the tiboot3.bin
ti-arm-clang$ make -sj clean PROFILE=debug
ti-arm-clang$ make -sj PROFILE=debug
# Output:
ti-arm-clang/sbl_keywriter.debug.tiimage Done !!!
ti-arm-clang$ md5sum tiboot3.bin
db3eca1de8d2e0ccb811016691a265c8 tiboot3.bin
# 6 Install the custom signing key in the u-boot source tree, replacing the TI development key:
copy keys/smpk.pem to board/ti/keys/custMpk.pem
# 7 Rebuild u-boot, now signed with the new custom key.
# 8 The tiboot3.bin is loaded by dfu boot, it is executed and burning the eFuses.
# 9 After a board reset the CPU state is now HS-SE and only my new signed u-boot will execute.
Is this procedure complete and valid?
Additional questions:
Q1. Two sets of keys are loaded, my keyrev specifies 1 (SMPK). When is the BMPK used then?
Q2. Should I leave board/ti/keys/custMpk.crt and board/ti/keys/custMpk.key untouched?
Thanks and regards,
Lars
Your summarized steps for programming OTP efuse and signing u-boot looks good.
Some reference on your questions:
https://e2e.ti.com/e2eprivate/processors-security/processsors_security_support/f/processsors-security-support---forum/1202686/faq-am6442-how-to-use-the-tisci-apis-read_keycnt_keyrev-write_keyrev-to-activate-the-backup-key-set
https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1294191/am625-what-is-the-function-of-custmpk-crt-file-how-to-generate-this-file-using-customer-own-key
Fyi, I sent an invitation for you to join the special security e2e forum to discuss security related questions.
Best,
-Hong
After replacing the custMpk.key I rebuild u-boot.img and reset. The board still logs "Authentication passed":
U-Boot SPL 2023.04-g8e29cc8dec (Jan 24 2024 - 05:55:02 +0000)
SYSFW ABI: 3.1 (firmware rev 0x0009 '9.1.8--v09.01.08 (Kool Koala)')
Trying to boot from MMC1
Authentication passed
Authentication passed
Will it do that regardless of the signing used, until we change to HS-SE state?
Thanks.
Here is a summary on authentication flow on HS-SE (Security Enforced)
1a/. hash(SMPK) check against SMPK-H programmed in OTP eFUSE
1b/. the self-signed x.509 certificate is verified with the SMPK embedded in the x.509 certificate
2/. the hash(binary blob) is checked against the hash in the x.509 certificate
On HS-FS, 1a/ is skipped which makes the self-signed x.509 certificate verification pass on HS-FS as expected.
Best,
-Hong