Skip to content

Commit ece177e

Browse files
committed
tf-a: switch signing to native C++ tool
1 parent 4fa2646 commit ece177e

File tree

2 files changed

+24
-7
lines changed

2 files changed

+24
-7
lines changed

classes/stm32mp15x-sign.bbclass

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99
#
1010
#####################################################################################
1111

12-
DEPENDS += "openssl-native util-linux-native tf-a-stm32mp-tools-native stm32mp-keygen-native"
12+
DEPENDS += "openssl-native util-linux-native tf-a-stm32mp-tools-native stm32mp-sign-tool-native"
1313

1414
do_tfa_sign() {
1515

16-
stm32-sign -k "${SECBOOT_SIGN_KEY}" \
17-
-s ${B}/build/stm32mp1/${TFA_BUILD_TYPE}/${TF_A_BASENAME}-${TFA_DEVICETREE}.${TF_A_SUFFIX} \
16+
stm32mp-sign-tool -k "${SECBOOT_SIGN_KEY}" \
17+
-i ${B}/build/stm32mp1/${TFA_BUILD_TYPE}/${TF_A_BASENAME}-${TFA_DEVICETREE}.${TF_A_SUFFIX} \
1818
-o ${B}/build/stm32mp1/${TFA_BUILD_TYPE}/${TF_A_BASENAME}-${TFA_DEVICETREE}.${TF_A_SUFFIX}
1919
}
2020

@@ -56,10 +56,8 @@ do_fip_sign() {
5656

5757
do_deploy:append() {
5858

59-
openssl ec -in ${SECBOOT_SIGN_KEY} -outform PEM -out ${DEPLOYDIR}/secureboot-pubkey.pem -pubout
60-
ecdsa-sha256 --public-key=${DEPLOYDIR}/secureboot-pubkey.pem \
61-
--binhash-file=${DEPLOYDIR}/secureboot-pubkey-hash.bin
62-
59+
stm32mp-sign-tool -k ${SECBOOT_SIGN_KEY} -h ${DEPLOYDIR}/secureboot-pubkey-hash.bin
60+
6361
# Generate u-boot cmd to fuse public key hashes into OTP
6462
echo fuse prog -y 0 0x18 $(hexdump -e '/4 "0x"' -e '/1 "%x"' -e '" "'\
6563
${DEPLOYDIR}/secureboot-pubkey-hash.bin) > ${DEPLOYDIR}/u-boot-fuse-prog.txt
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
SUMMARY = "STM32MP Sign Tool is a utility"
2+
DESCRIPTION = "The STM32MP Sign Tool is a utility for \
3+
signing and verifying firmware images for STM32MP MPUs. \
4+
It uses ECDSA (Elliptic Curve Digital Signature Algorithm) to ensure the integrity and authenticity of the firmware."
5+
HOMEPAGE = "https://github.com/embetrix/stm32mp-sign-tool"
6+
SECTION = "console/utils"
7+
LICENSE = "GPL-3.0-only"
8+
LIC_FILES_CHKSUM = "file://LICENSE;md5=e49f4652534af377a713df3d9dec60cb"
9+
10+
SRC_URI = "git://github.com/embetrix/${BPN};branch=master;protocol=https"
11+
SRCREV = "9ba913b8ec4a6aab6cd2c15bb7e1fd6a3591d71e"
12+
S = "${WORKDIR}/git"
13+
14+
DEPENDS += "openssl"
15+
inherit cmake
16+
17+
FILES:${PN} = "${bindir}/stm32mp-sign-tool"
18+
19+
BBCLASSEXTEND = "native nativesdk"

0 commit comments

Comments
 (0)