ZHCABI4 January 2022 TDA4VM , TDA4VM-Q1
一旦 eFuse 由客户密钥进行了编程,此流程便不可逆转。为了确保操作和流程的正确性,在客户开始将客户密钥编程到 HS-FS 器件中之前,最好首先使用 TI 虚拟密钥或随机虚拟密钥作为测试密钥;然而,此步骤不是强制性的。
Keywriter 包提供一个可生成随机虚拟密钥来帮助客户进行测试的脚本。TI 虚拟密钥是公钥,而客户密钥应安全地保存在客户 HSM 中,以便客户可以选择在生产前使用此随机虚拟密钥进行测试。要生成随机虚拟密钥,请执行以下步骤:
# cd ${PSDKRA_PATH} /pdk/packages/ti/boot/sbl/example/k3MulticoreApp/keywriter/scripts
# ./gen_keywr_cert.sh -g
# cp ${PSDKRA_PATH} /pdk/packages/ti/boot/sbl/example/k3MulticoreApp/keywriter/scripts/ti_fek_public.pem
${PSDKRA_PATH} /pdk/packages/ti/boot/sbl/example/k3MulticoreApp/keywriter/scripts/keys/tifekpub.pem
# ls ${PSDKRA_PATH} /pdk/packages/ti/boot/sbl/example/k3MulticoreApp/keywriter/scripts/keys
aes256.key bmek.key bmpk.pem smek.key smpk.pem tifekpub.pem
此外,TI 虚拟密钥在 TI SDK 中发布。一旦客户使用 TI 虚拟密钥完成密钥编程,器件将转换为 HS-SE-TIDK 器件。因此,客户可以使用Topic Link Label2 中的方法对其系统映像签名和加密,然后验证由 TI 虚拟密钥编程的器件中的二进制。
# cd ${PSDKRA_PATH}/pdk/packages/ti/boot/sbl/example/k3MulticoreApp/keywriter/scripts
# ./gen_keywr_cert.sh -g
# rm ${PSDKRA_PATH}/pdk/packages/ti/boot/sbl/example/k3MulticoreApp/keywriter/scripts/keys/bmek.key bmpk.pem
smek.key smpk.pem
# cp ${PSDKRA_PATH}/pdk/packages/ti/build/makerules/k3_dev_mpk.pem
${PSDKRA_PATH}/pdk/packages/ti/boot/sbl/example/k3MulticoreApp/keywriter/scripts/keys/smpk.pem
# xxd -p -r ${PSDKRA_PATH}/pdk/packages/ti/build/makerules/k3_dev_mek.txt ${PSDKRA_PATH}/pdk
/packages/ti/boot/sbl/example/k3MulticoreApp/keywriter/scripts/keys/smek.key
# cp ${PSDKRA_PATH} /pdk/packages/ti/boot/sbl/example/k3MulticoreApp/keywriter/scripts/ti_fek_public.pem
${PSDKRA_PATH} /pdk/packages/ti/boot/sbl/example/k3MulticoreApp/keywriter/scripts/keys/tifekpub.pem
# ls ${PSDKRA_PATH} /pdk/packages/ti/boot/sbl/example/k3MulticoreApp/keywriter/scripts/keys
aes256.key smek.key smpk.pem tifekpub.pem
k3_dev_mek.txt 是 32 字节的数据文件,用于将二进制作为对称密钥进行加密,如Topic Link Label2 中所示。相应的解密密钥需要由 Keywriter 编程到 eFuse 中,但 Keywriter 要求文件采用二进制形式。用于转换格式的“xxd”命令如下所示。此外,k3_dev_mpk.pem 是用于对二进制签名的对称密钥的密钥,并且相应的公钥会计算哈希值并由 Keywriter 编程到 eFuse 中。
更加可靠的是使用以下命令检查 smek.key。执行下一步之前,确保这两个结果完全相同。# cat ${PSDKRA_PATH}/pdk/packages/ti/build/makerules/k3_dev_mek.txt
c143f03568798964d4a5769bd5a27d3adc0d6bdd8f3cc47b84229e50a54ab043
# xxd -p /home/wangli/ti-processor-sdk-rtos-j721e-evm-
07_01_00_11/pdk_jacinto_07_01_00_45/packages/ti/boot/sbl/example/k3MulticoreApp/keywriter/scripts/keys/smek.key
c143f03568798964d4a5769bd5a27d3adc0d6bdd8f3cc47b84229e50a54ab043
如果客户决定使用其客户密钥,他们还需要将其密钥复制到以下文件夹中:
${PSDKRA_PATH}/pdk/packages/ti/boot/sbl/example/k3MulticoreApp/keywriter/scripts/keys。