mirror of
https://git.yoctoproject.org/meta-arm
synced 2026-06-05 02:20:30 +00:00
optee-ftpm: Use the latest fTPM sources
The recipe right now is using https://github.com/microsoft/MSRSec. However this is the initial reference implementation from Microsoft and things have been moved into https://github.com/microsoft/ms-tpm-20-ref/ (in the directory Samples). Switch to new and currently maintained branch Testing against real hardware (the SynQuacer DeveloperBox and a rockpi4) didn't sound any alarms Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Signed-off-by: Jon Mason <jon.mason@arm.com>
This commit is contained in:
committed by
Jon Mason
parent
5063ad85c3
commit
3ee7d01989
@@ -1,23 +0,0 @@
|
||||
fix gcc compilation
|
||||
|
||||
just fix compilation under gcc.
|
||||
Upstream-Status: Submitted [https://github.com/microsoft/MSRSec/pull/35]
|
||||
Compilation issue already fixed in wolfcrypt and submodule
|
||||
needs to be updated. I sent PR for for update with the link
|
||||
above.
|
||||
|
||||
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
|
||||
|
||||
diff --git a/wolfssl/wolfcrypt/types.h b/wolfssl/wolfcrypt/types.h
|
||||
index 7b3a953aebda..e156ae5c7909 100755
|
||||
--- a/external/wolfssl/wolfssl/wolfcrypt/types.h
|
||||
+++ b/external/wolfssl/wolfssl/wolfcrypt/types.h
|
||||
@@ -181,7 +181,7 @@
|
||||
/* GCC 7 has new switch() fall-through detection */
|
||||
#if defined(__GNUC__)
|
||||
#if ((__GNUC__ > 7) || ((__GNUC__ == 7) && (__GNUC_MINOR__ >= 1)))
|
||||
- #define FALL_THROUGH __attribute__ ((fallthrough));
|
||||
+ #define FALL_THROUGH __attribute__ ((__fallthrough__));
|
||||
#endif
|
||||
#endif
|
||||
#ifndef FALL_THROUGH
|
||||
@@ -12,19 +12,19 @@ Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
|
||||
TAs/optee_ta/fTPM/user_ta_header_defines.h | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/TAs/optee_ta/fTPM/user_ta_header_defines.h b/TAs/optee_ta/fTPM/user_ta_header_defines.h
|
||||
index 6ff62d1..685b54a 100644
|
||||
--- a/TAs/optee_ta/fTPM/user_ta_header_defines.h
|
||||
+++ b/TAs/optee_ta/fTPM/user_ta_header_defines.h
|
||||
diff --git a/Samples/ARM32-FirmwareTPM/optee_ta/fTPM/user_ta_header_defines.h b/Samples/ARM32-FirmwareTPM/optee_ta/fTPM/user_ta_header_defines.h
|
||||
index 72ecbf0cf1c7..e83619d55d3c 100644
|
||||
--- a/Samples/ARM32-FirmwareTPM/optee_ta/fTPM/user_ta_header_defines.h
|
||||
+++ b/Samples/ARM32-FirmwareTPM/optee_ta/fTPM/user_ta_header_defines.h
|
||||
@@ -44,7 +44,7 @@
|
||||
|
||||
#define TA_UUID TA_FTPM_UUID
|
||||
|
||||
-#define TA_FLAGS (TA_FLAG_SINGLE_INSTANCE | TA_FLAG_INSTANCE_KEEP_ALIVE )
|
||||
-#define TA_FLAGS (TA_FLAG_SINGLE_INSTANCE | TA_FLAG_INSTANCE_KEEP_ALIVE)
|
||||
+#define TA_FLAGS (TA_FLAG_SINGLE_INSTANCE | TA_FLAG_INSTANCE_KEEP_ALIVE | TA_FLAG_DEVICE_ENUM_SUPP)
|
||||
#define TA_STACK_SIZE (64 * 1024)
|
||||
#define TA_DATA_SIZE (64 * 1024)
|
||||
|
||||
#define TA_DATA_SIZE (32 * 1024)
|
||||
|
||||
--
|
||||
2.17.1
|
||||
|
||||
|
||||
@@ -13,23 +13,16 @@ TOOLCHAIN = "gcc"
|
||||
inherit deploy python3native
|
||||
|
||||
LICENSE = "MIT"
|
||||
LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=27e94c0280987ab296b0b8dd02ab9fe5"
|
||||
LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=5a3925ece0806073ae9ebbb08ff6f11e"
|
||||
|
||||
DEPENDS = "python3-pyelftools-native optee-os-tadevkit python3-cryptography-native "
|
||||
|
||||
FTPM_UUID="bc50d971-d4c9-42c4-82cb-343fb7f37896"
|
||||
|
||||
# SRC_URI = "git://github.com/Microsoft/ms-tpm-20-ref;branch=master"
|
||||
# Since this is not built as a pseudo TA, we can only use it as a kernel module and not built in.
|
||||
# The TEE supplicant is also needed to provide access to secure storage.
|
||||
# Secure storage access required by OP-TEE fTPM TA
|
||||
# is provided via OP-TEE supplicant that's not available during boot.
|
||||
# Fix this once we replace this with the MS implementation
|
||||
SRC_URI = "gitsm://github.com/microsoft/MSRSec;protocol=https;branch=master \
|
||||
file://0000-fix-ssl-fallthrough.patch \
|
||||
SRC_URI = "gitsm://github.com/Microsoft/ms-tpm-20-ref;branch=master;protocol=https \
|
||||
file://0001-add-enum-to-ta-flags.patch"
|
||||
|
||||
SRCREV = "81abeb9fa968340438b4b0c08aa6685833f0bfa1"
|
||||
SRCREV = "d638536d0fe01acd5e39ffa1bd100b3da82d92c7"
|
||||
|
||||
S = "${WORKDIR}/git"
|
||||
|
||||
@@ -55,21 +48,22 @@ export OPENSSL_MODULES="${STAGING_LIBDIR_NATIVE}/ossl-modules"
|
||||
PARALLEL_MAKE = ""
|
||||
|
||||
do_compile() {
|
||||
sed -i 's/-mcpu=$(TA_CPU)//' TAs/optee_ta/fTPM/sub.mk
|
||||
# The internal ${CC} includes the correct -mcpu option
|
||||
sed -i 's/-mcpu=$(TA_CPU)//' Samples/ARM32-FirmwareTPM/optee_ta/fTPM/sub.mk
|
||||
# there's also a secure variable storage TA called authvars
|
||||
cd ${S}/TAs/optee_ta
|
||||
oe_runmake ftpm
|
||||
cd ${S}/Samples/ARM32-FirmwareTPM/optee_ta
|
||||
oe_runmake
|
||||
}
|
||||
|
||||
do_install () {
|
||||
mkdir -p ${D}/lib/optee_armtz
|
||||
install -D -p -m 0644 ${S}/TAs/optee_ta/out/fTPM/${FTPM_UUID}.ta ${D}/lib/optee_armtz/
|
||||
install -D -p -m 0644 ${S}/TAs/optee_ta/out/fTPM/${FTPM_UUID}.stripped.elf ${D}/lib/optee_armtz/
|
||||
install -D -p -m 0644 ${S}/Samples/ARM32-FirmwareTPM/optee_ta/out/fTPM/${FTPM_UUID}.ta ${D}/lib/optee_armtz/
|
||||
install -D -p -m 0644 ${S}/Samples/ARM32-FirmwareTPM/optee_ta/out/fTPM/${FTPM_UUID}.stripped.elf ${D}/lib/optee_armtz/
|
||||
}
|
||||
|
||||
do_deploy () {
|
||||
install -d ${DEPLOYDIR}/optee
|
||||
install -D -p -m 0644 ${S}/TAs/optee_ta/out/fTPM/${FTPM_UUID}.stripped.elf ${DEPLOYDIR}/optee/
|
||||
install -D -p -m 0644 ${S}/Samples/ARM32-FirmwareTPM/optee_ta/out/fTPM/${FTPM_UUID}.stripped.elf ${DEPLOYDIR}/optee/
|
||||
}
|
||||
|
||||
addtask deploy before do_build after do_install
|
||||
|
||||
Reference in New Issue
Block a user