佛山网站建设与设计公司,wordpress 淘宝模板,怎么给公司做免费网站,微信app小程序开发security boot
平台的东东#xff0c;oem 可定制的功能有限#xff0c;只能参考平台文档#xff0c;可以在高通的网站上搜索#xff1a;Secure Boot Enablement#xff0c;然后找对应平台的文档xxx-Secure Boot Enablement User Guide, step by step 操作即可
开机校验流…security boot
平台的东东oem 可定制的功能有限只能参考平台文档可以在高通的网站上搜索Secure Boot Enablement然后找对应平台的文档xxx-Secure Boot Enablement User Guide, step by step 操作即可
开机校验流程 生成key step
工具路径 Clarence.LA.2.0/common/sectoolsv2/ext/Linux_aarch64/
1、Clarence.LA.2.0/common/sectoolsv2/ext/Linux_aarch64/test_key/test_L400_key-secp384r1 生成v3.ext v3_attest.ext 拷贝opensslroot.cfg LA.QSSI.14.0.r1/LINUX/android/vendor/qcom/proprietary/common/scripts/gensecimage/qpsa/alt_resources/default/openssl/opensslroot.cfg 2、生成qpsa_rootca.key openssl ecparam -genkey -name secp384r1 -outform PEM -out qpsa_rootca.key 3、生成 rootca_pem.crt sudo openssl req -new -key qpsa_rootca.key -sha384 -out rootca_pem.crt -subj /CCN/STChinaGD/LChinaSZh/OUGeneral test Key/OUCDMA Technologies/Otest/CNtest Root CA 1 -config opensslroot.cfg -x509 -days 7300 -set_serial 1
4、生成qpsa_rootca.cer openssl x509 -in rootca_pem.crt -inform PEM -out qpsa_rootca.cer -outform DER 查看刚才生成的证书 openssl x509 -text -inform DER -in qpsa_rootca.cer 5、生成CA key和证书 openssl ecparam -genkey -name secp384r1 -outform PEM -out qpsa_ca.key sudo openssl req -new -key qpsa_ca.key -out ca.CSR -subj /CCN/STChinaGD/LChinaSZh/OUCDMA Technologies/Otest/CNtest Attestation CA -config opensslroot.cfg -sha384 openssl x509 -req -in ca.CSR -CA rootca_pem.crt -CAkey qpsa_rootca.key -out ca_pem.crt -set_serial 1 -days 7300 -extfile v3.ext -sha384 -CAcreateserial openssl x509 -inform PEM -in ca_pem.crt -outform DER -out qpsa_ca.cer 6.生成root key的hash值 openssl dgst -sha384 qpsa_rootca.cer sha384rootcert.txt
参考文档80-49880-42_REV_AA_SM4450_Secure_Boot_Enablement_User_Guide.pdf 给img签名 使用LOCAL 的方式签名命令 $./Linux/sectools\ secure-image \ --sign /path/to/tz.mbn \ --image-idTZ \ --security-profile /path/to/clarence_security_profile.xml \ --oem-id0x1234 \ --oem-product-id0x00 \ --anti-rollback-version0x00 \ --signing-modeLOCAL \ --root-certificate./OEM-KEYS/qpsa_rootca.cer \ --ca-certificate./OEM- KEYS/qpsa_attestca.cer \ --ca-key./OEM-KEYS/qpsa_attestca.key \ --outfile ./signed_images_out/tz.mbn
note oem-id、oem-product-id、root-certificate、ca-certificate、ca-key需要根据项目的时间情况填写。和生成sec.elf 一样
anti-rollback-verision是用于bp镜像防回滚的一般我们保持为0因为我们不会对BP 镜像定制。如果要定制升级为1或者其他值也是可以的但是需要慎重因为这里是更新到了efuse中。我们的项目暂时没动这部分所以我是一直写的0如果有需求可以参考《SM4450 Secure Boot Enablement User Guide》第七章进行深入了解。
image-id这个是高通定好了的bp的每个镜像都有对应的值这个和anti-rollbcak-verison 也是密切相关的要注意不要用错了。具体需参考《SM4450 Secure Boot Enablement User Guide》 中3.2.1 Software ID field的表。当然也可以查看contents.xml 中oem_imageid 字段。 参考《KBA-230410213415_REV_2_QCM4490_QCS4490_Enable_secure_boot_with_sectools_version2.0.pdf》 sec.elf 文件生成 作用用于烧写efuse的就是我们常说的熔断。所以刷这个文件需要慎重由于efuse的特殊性熔断是不可逆的。 时机刷入到secdata分区中设备启动时BROM会检测secdata分区如果有数据或者数据有变化并且签名校验通过那么就将其内容更新到efuseQFPROM中。 描述efuse后加载了TZ部分系统会初始化RPMB 的key。这里说的是加载了TZ 才初始化RPMB key在efuse 中有一位是表征是否要使能RPMB的所以我们会在日志中看到只有efuse的设备才会使用RPMB这属于软件部分的设置所以我们也可以配置TZ不进行某些操作。而TZ 是闭源的所以我们只能配置如何配置只能咨询高通或者查看高通TZ 相关的文档。
参考文档《QCM4490/QCS4490 Enable secure boot with sectools version 2.0》
FAQ
设备熔断后将签名镜像刷入要保证能正常启动、一些基本功能正常如果有异常需要获取日志一般是串口日志看看是否有镜像漏签或者错签。 一般会遇到的问题 1.还未进入kernel之前就挂掉BP 中某个镜像签名有问题。 2.进入kernel之后挂掉可能是某个子系统固件签名有问题。 3.指纹、人脸等功能无法使用可能是相关TA 签名有问题。 4.综测、校准等工厂问题可能是fsg 的签名问题。 5.firehose 无法刷入可能是firehose 签名有问题。 单独签名一个img文件 Run the following command to sign XBL: python sectools.py secimage -s -i path to xbl.elf -g xbl -p sm6150 --cfg_selected_cert_config OEM-KEYS note -s is to sign the image -i: is the path to the image file -g is the sign ID corresponding to the image_file provided -p is the ID of the chipset corresponding to the image_file --cfg_selected_cert_config is the OEM certificate configuration selection Check the secimage_log.txt output file of XBL for following prints in the metadata: | debug | 0x00000002 | | multi_serial_numbers | 0x12345678 |