diff options
Diffstat (limited to 'recipes-security')
22 files changed, 139 insertions, 1140 deletions
diff --git a/recipes-security/optee-imx/optee-client/0001-flags-do-not-override-CFLAGS-from-host.patch b/recipes-security/optee-imx/optee-client/0001-flags-do-not-override-CFLAGS-from-host.patch deleted file mode 100644 index 9c6b1069..00000000 --- a/recipes-security/optee-imx/optee-client/0001-flags-do-not-override-CFLAGS-from-host.patch +++ /dev/null @@ -1,57 +0,0 @@ -From 591461d6efe51989b4a7f4e875cdf37505eba360 Mon Sep 17 00:00:00 2001 -From: Andrey Zhizhikin <andrey.z@gmail.com> -Date: Thu, 4 Jun 2020 19:24:05 +0000 -Subject: [PATCH] flags: do not override CFLAGS from host - -Some build systems set CFLAGS in environment before the build, but they -got overridden by CFLAGS immediate assignment operator. - -Replace immediate assignment with append directive and use override -directive, so the former definition of CFLAGS gets passed either from -command line or via environment is completely expanded (see [1] for -detailed explanation of override directive and variable append). - -Link: [1] https://www.gnu.org/software/make/manual/html_node/Override-Directive.html - -Upstream-Status: Backport [https://github.com/OP-TEE/optee_client/pull/211] - -Signed-off-by: Andrey Zhizhikin <andrey.z@gmail.com> -Reviewed-by: Jerome Forissier <jerome@forissier.org> -Reviewed-by: Joakim Bech <joakim.bech@linaro.org> ---- - flags.mk | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - -diff --git a/flags.mk b/flags.mk -index c2f0e1c..65192bc 100644 ---- a/flags.mk -+++ b/flags.mk -@@ -6,7 +6,7 @@ CROSS_COMPILE ?= arm-linux-gnueabihf- - CC ?= $(CROSS_COMPILE)gcc - AR ?= $(CROSS_COMPILE)ar - --CFLAGS := -Wall -Wbad-function-cast -Wcast-align \ -+override CFLAGS += -Wall -Wbad-function-cast -Wcast-align \ - -Werror-implicit-function-declaration -Wextra \ - -Wfloat-equal -Wformat-nonliteral -Wformat-security \ - -Wformat=2 -Winit-self -Wmissing-declarations \ -@@ -16,13 +16,13 @@ CFLAGS := -Wall -Wbad-function-cast -Wcast-align \ - -Wswitch-default -Wunsafe-loop-optimizations \ - -Wwrite-strings -D_FILE_OFFSET_BITS=64 - ifeq ($(CFG_WERROR),y) --CFLAGS += -Werror -+override CFLAGS += -Werror - endif --CFLAGS += -c -fPIC -+override CFLAGS += -c -fPIC - - DEBUG ?= 0 - ifeq ($(DEBUG), 1) --CFLAGS += -DDEBUG -O0 -g -+override CFLAGS += -DDEBUG -O0 -g - endif - - RM := rm -f --- -2.17.1 - diff --git a/recipes-security/optee-imx/optee-client_3.7.0.imx.bb b/recipes-security/optee-imx/optee-client_3.10.0.imx.bb index d83f8a9c..58b6b8a4 100644 --- a/recipes-security/optee-imx/optee-client_3.7.0.imx.bb +++ b/recipes-security/optee-imx/optee-client_3.10.0.imx.bb @@ -1,23 +1,23 @@ -# Copyright (C) 2017-2018 NXP +# Copyright (C) 2017-2020 NXP SUMMARY = "OPTEE Client libs" HOMEPAGE = "http://www.optee.org/" LICENSE = "BSD" LIC_FILES_CHKSUM = "file://LICENSE;md5=69663ab153298557a59c67a60a743e5b" -inherit python3native systemd - -SRCBRANCH = "imx_5.4.24_2.1.0" -SRC_URI = "git://source.codeaurora.org/external/imx/imx-optee-client.git;protocol=https;branch=${SRCBRANCH}" - -SRCREV = "bc0ec8ce1e4dc5ae23f4737ef659338b7cd408fe" - -SRC_URI += "file://tee-supplicant.service \ - file://0001-flags-do-not-override-CFLAGS-from-host.patch \ +SRCBRANCH = "imx_5.4.70_2.3.0" +SRC_URI = " \ + git://source.codeaurora.org/external/imx/imx-optee-client.git;protocol=https;branch=${SRCBRANCH} \ + file://tee-supplicant.service \ " +SRCREV = "2a77cf88d956c34cb4a1c191bea6113e327f5fe0" + S = "${WORKDIR}/git" B = "${WORKDIR}/build" + +inherit python3native systemd + SYSTEMD_SERVICE_${PN} = "tee-supplicant.service" OPTEE_ARCH ?= "arm32" diff --git a/recipes-security/optee-imx/optee-os/0001-optee-os-fix-gcc10-compilation-issue-and-missing-cc-.patch b/recipes-security/optee-imx/optee-os/0001-optee-os-fix-gcc10-compilation-issue-and-missing-cc-.patch deleted file mode 100644 index ab42d340..00000000 --- a/recipes-security/optee-imx/optee-os/0001-optee-os-fix-gcc10-compilation-issue-and-missing-cc-.patch +++ /dev/null @@ -1,162 +0,0 @@ -From 109ed8d9a5351c7bb0fdc0953c7e7fb6cedcad9c Mon Sep 17 00:00:00 2001 -From: Andrey Zhizhikin <andrey.z@gmail.com> -Date: Sat, 30 May 2020 22:00:59 +0000 -Subject: [PATCH] optee-os: fix gcc10 compilation issue and missing cc-options - -Backport PR 3891 from upstream to imx fork, which addressed compilation -failure when GCC10 is used. - -Additional changes ported fixed cc-options macro, which allows to query -compiler used if the desired option exists before it could be set. This -solves also the build issues when GCC9 is used to build this component. - -Upstream-Status: Backport [https://github.com/OP-TEE/optee_os/pull/3891] - -Signed-off-by: Andrey Zhizhikin <andrey.z@gmail.com> ---- - core/arch/arm/arm.mk | 22 +++++++++++++++++----- - core/core.mk | 5 +---- - mk/cc-option.mk | 9 +++++++++ - mk/gcc.mk | 2 +- - ta/mk/ta_dev_kit.mk | 3 +++ - ta/ta.mk | 1 + - 6 files changed, 32 insertions(+), 10 deletions(-) - create mode 100644 mk/cc-option.mk - -diff --git a/core/arch/arm/arm.mk b/core/arch/arm/arm.mk -index 5defb327..fffa491a 100644 ---- a/core/arch/arm/arm.mk -+++ b/core/arch/arm/arm.mk -@@ -1,3 +1,16 @@ -+# Setup compiler for the core module -+ifeq ($(CFG_ARM64_core),y) -+arch-bits-core := 64 -+else -+arch-bits-core := 32 -+endif -+CROSS_COMPILE_core := $(CROSS_COMPILE$(arch-bits-core)) -+COMPILER_core := $(COMPILER) -+include mk/$(COMPILER_core).mk -+ -+# Defines the cc-option macro using the compiler set for the core module -+include mk/cc-option.mk -+ - CFG_LTC_OPTEE_THREAD ?= y - # Size of emulated TrustZone protected SRAM, 448 kB. - # Only applicable when paging is enabled. -@@ -106,7 +119,7 @@ arm32-platform-aflags-no-hard-float ?= - - arm64-platform-cflags-no-hard-float ?= -mgeneral-regs-only - arm64-platform-cflags-hard-float ?= --arm64-platform-cflags-generic ?= -mstrict-align -+arm64-platform-cflags-generic := -mstrict-align $(call cc-option,-mno-outline-atomics,) - - ifeq ($(DEBUG),1) - # For backwards compatibility -@@ -135,14 +148,12 @@ core-platform-aflags += $(platform-aflags-generic) - core-platform-aflags += $(platform-aflags-debug-info) - - ifeq ($(CFG_ARM64_core),y) --arch-bits-core := 64 - core-platform-cppflags += $(arm64-platform-cppflags) - core-platform-cflags += $(arm64-platform-cflags) - core-platform-cflags += $(arm64-platform-cflags-generic) - core-platform-cflags += $(arm64-platform-cflags-no-hard-float) - core-platform-aflags += $(arm64-platform-aflags) - else --arch-bits-core := 32 - core-platform-cppflags += $(arm32-platform-cppflags) - core-platform-cflags += $(arm32-platform-cflags) - core-platform-cflags += $(arm32-platform-cflags-no-hard-float) -@@ -241,8 +252,9 @@ ta-mk-file-export-add-ta_arm64 += COMPILER ?= gcc_nl_ - ta-mk-file-export-add-ta_arm64 += COMPILER_ta_arm64 ?= $$(COMPILER)_nl_ - endif - --# Set cross compiler prefix for each submodule --$(foreach sm, core $(ta-targets), $(eval CROSS_COMPILE_$(sm) ?= $(CROSS_COMPILE$(arch-bits-$(sm))))) -+# Set cross compiler prefix for each TA target -+$(foreach sm, $(ta-targets), $(eval CROSS_COMPILE_$(sm) ?= $(CROSS_COMPILE$(arch-bits-$(sm))))) -+ - - arm32-sysreg-txt = core/arch/arm/kernel/arm32_sysreg.txt - arm32-sysregs-$(arm32-sysreg-txt)-h := arm32_sysreg.h -diff --git a/core/core.mk b/core/core.mk -index a51cf847..28c7235c 100644 ---- a/core/core.mk -+++ b/core/core.mk -@@ -8,6 +8,7 @@ arch-dir := core/arch/$(ARCH) - platform-dir := $(arch-dir)/plat-$(PLATFORM) - include $(platform-dir)/conf.mk - include mk/config.mk -+# $(ARCH).mk also sets the compiler for the core module - include core/arch/$(ARCH)/$(ARCH).mk - - PLATFORM_$(PLATFORM) := y -@@ -16,10 +17,6 @@ PLATFORM_FLAVOR_$(PLATFORM_FLAVOR) := y - $(eval $(call cfg-depends-all,CFG_PAGED_USER_TA,CFG_WITH_PAGER CFG_WITH_USER_TA)) - include core/crypto.mk - --# Setup compiler for this sub module --COMPILER_$(sm) ?= $(COMPILER) --include mk/$(COMPILER_$(sm)).mk -- - cppflags$(sm) += -D__KERNEL__ - - cppflags$(sm) += -Icore/include -diff --git a/mk/cc-option.mk b/mk/cc-option.mk -new file mode 100644 -index 00000000..4699fbcc ---- /dev/null -+++ b/mk/cc-option.mk -@@ -0,0 +1,9 @@ -+_cc-option-supported = $(if $(shell $(CC$(sm)) $(1) -c -x c /dev/null -o /dev/null 2>/dev/null >/dev/null || echo "Not supported"),,1) -+_cc-opt-cached-var-name = $(subst =,~,$(strip cached-cc-option-$(1)-$(subst $(empty) $(empty),,$(CC$(sm))))) -+define _cc-option -+$(eval _var_name := $(call _cc-opt-cached-var-name,$(1))) -+$(eval $(_var_name) := $(if $(filter $(origin $(_var_name)),undefined),$(call _cc-option-supported,$(1)),$($(_var_name)))) -+$(if $($(_var_name)),$(1),$(2)) -+endef -+cc-option = $(strip $(call _cc-option,$(1),$(2))) -+ -diff --git a/mk/gcc.mk b/mk/gcc.mk -index 1f2c5990..c53a23b1 100644 ---- a/mk/gcc.mk -+++ b/mk/gcc.mk -@@ -12,7 +12,7 @@ nostdinc$(sm) := -nostdinc -isystem $(shell $(CC$(sm)) \ - -print-file-name=include 2> /dev/null) - - # Get location of libgcc from gcc --libgcc$(sm) := $(shell $(CC$(sm)) $(CFLAGS$(arch-bits-$(sm))) $(comp-cflags$(sm)) \ -+libgcc$(sm) := $(shell $(CC$(sm)) $(CFLAGS$(arch-bits-$(sm))) \ - -print-libgcc-file-name 2> /dev/null) - - # Define these to something to discover accidental use -diff --git a/ta/mk/ta_dev_kit.mk b/ta/mk/ta_dev_kit.mk -index 04a4f94b..e4b02ea7 100644 ---- a/ta/mk/ta_dev_kit.mk -+++ b/ta/mk/ta_dev_kit.mk -@@ -92,6 +92,9 @@ clean: - @$(cmd-echo-silent) ' CLEAN $(O)' - ${q}if [ -d "$(O)" ]; then $(RMDIR) $(O); fi - -+include $(ta-dev-kit-dir$(sm))/mk/$(COMPILER_$(sm)).mk -+include $(ta-dev-kit-dir$(sm))/mk/cc-option.mk -+ - subdirs = . - include $(ta-dev-kit-dir$(sm))/mk/subdir.mk - -diff --git a/ta/ta.mk b/ta/ta.mk -index dde7be67..ca17054a 100644 ---- a/ta/ta.mk -+++ b/ta/ta.mk -@@ -157,6 +157,7 @@ $(foreach f, $(libfiles), \ - - # Copy .mk files - ta-mkfiles = mk/compile.mk mk/subdir.mk mk/gcc.mk mk/clang.mk mk/cleandirs.mk \ -+ mk/cc-option.mk \ - ta/arch/$(ARCH)/link.mk ta/arch/$(ARCH)/link_shlib.mk \ - ta/mk/ta_dev_kit.mk - --- -2.17.1 - diff --git a/recipes-security/optee-imx/optee-os_3.7.0.imx.bb b/recipes-security/optee-imx/optee-os_3.10.0.imx.bb index 1bef749b..712b1aa6 100644 --- a/recipes-security/optee-imx/optee-os_3.7.0.imx.bb +++ b/recipes-security/optee-imx/optee-os_3.10.0.imx.bb @@ -6,35 +6,35 @@ HOMEPAGE = "http://www.optee.org/" LICENSE = "BSD" LIC_FILES_CHKSUM = "file://LICENSE;md5=c1f21c4f72f372ef38a5a4aee55ec173" -inherit deploy python3native autotools -DEPENDS = "python3-pycrypto-native python3-pyelftools-native u-boot-mkimage-native" +DEPENDS = "python3-pycryptodomex-native python3-pyelftools-native u-boot-mkimage-native" -SRCBRANCH = "imx_5.4.24_2.1.0" +SRCBRANCH = "imx_5.4.70_2.3.0" SRC_URI = "\ git://source.codeaurora.org/external/imx/imx-optee-os.git;protocol=https;branch=${SRCBRANCH} \ - file://0001-optee-os-fix-gcc10-compilation-issue-and-missing-cc-.patch \ " -SRCREV = "7a49776de59265500f10a247125429fde1555ac1" +SRCREV = "a991c90475bb1c715651e5fe27f7f32cbe61aef9" S = "${WORKDIR}/git" -B = "${WORKDIR}/build.${PLATFORM_FLAVOR}" + +inherit deploy python3native autotools # The platform flavor corresponds to the Yocto machine without the leading 'i'. -PLATFORM_FLAVOR = "${@d.getVar('MACHINE')[1:]}" -PLATFORM_FLAVOR_imx6qpdlsolox = "mx6qsabresd" -PLATFORM_FLAVOR_imx6ul7d = "mx6ulevk" -PLATFORM_FLAVOR_imx6ull14x14evk = "mx6ullevk" -PLATFORM_FLAVOR_imx6ull9x9evk = "mx6ullevk" -PLATFORM_FLAVOR_imx6ulz14x14evk = "mx6ulzevk" -PLATFORM_FLAVOR_mx8mm = "mx8mmevk" -PLATFORM_FLAVOR_mx8mn = "mx8mnevk" -PLATFORM_FLAVOR_mx8qxp = "mx8qxpmek" -PLATFORM_FLAVOR_mx8mp = "mx8mpevk" -PLATFORM_FLAVOR_mx8dx = "mx8dxmek" -PLATFORM_FLAVOR_mx8dxl = "mx8dxlevk" -PLATFORM_FLAVOR_mx8phantomdxl = "mx8qxpmek" +PLATFORM_FLAVOR = "${@d.getVar('MACHINE')[1:]}" +PLATFORM_FLAVOR_imx6qpdlsolox = "mx6qsabresd" +PLATFORM_FLAVOR_imx6ul7d = "mx6ulevk" +PLATFORM_FLAVOR_imx6ull14x14evk = "mx6ullevk" +PLATFORM_FLAVOR_imx6ull9x9evk = "mx6ullevk" +PLATFORM_FLAVOR_imx6ulz-14x14-evk = "mx6ulzevk" +PLATFORM_FLAVOR_mx8mq = "mx8mqevk" +PLATFORM_FLAVOR_mx8mm = "mx8mmevk" +PLATFORM_FLAVOR_mx8mn = "mx8mnevk" +PLATFORM_FLAVOR_mx8mp = "mx8mpevk" +PLATFORM_FLAVOR_mx8qm = "mx8qmmek" +PLATFORM_FLAVOR_mx8qxp = "mx8qxpmek" +PLATFORM_FLAVOR_mx8dx = "mx8dxmek" +PLATFORM_FLAVOR_mx8dxl = "mx8dxlevk" OPTEE_ARCH ?= "arm32" OPTEE_ARCH_armv7a = "arm32" @@ -50,31 +50,25 @@ EXTRA_OEMAKE = " \ PLATFORM_FLAVOR=${PLATFORM_FLAVOR} \ CROSS_COMPILE=${HOST_PREFIX} \ CROSS_COMPILE64=${HOST_PREFIX} \ - NOWERROR=1 \ - LDFLAGS= \ - O=${B} \ + CFG_TEE_TA_LOG_LEVEL=0 \ + CFG_TEE_CORE_LOG_LEVEL=0 \ + -C ${S} O=${B}\ " -do_compile () { - unset LDFLAGS - export CFLAGS="${CFLAGS} --sysroot=${STAGING_DIR_HOST}" - oe_runmake -C ${S} all CFG_TEE_TA_LOG_LEVEL=0 CFG_TEE_CORE_LOG_LEVEL=0 -} - +LDFLAGS = "" +CFLAGS += "--sysroot=${STAGING_DIR_HOST}" +CXXFLAGS += "--sysroot=${STAGING_DIR_HOST}" do_deploy () { install -d ${DEPLOYDIR} ${TARGET_PREFIX}objcopy -O binary ${B}/core/tee.elf ${DEPLOYDIR}/tee.${PLATFORM_FLAVOR}.bin + ln -sf tee.${PLATFORM_FLAVOR}.bin ${DEPLOYDIR}/tee.bin if [ "${OPTEE_ARCH}" != "arm64" ]; then - IMX_LOAD_ADDR=`cat ${B}/core/tee-init_load_addr.txt` && \ + IMX_LOAD_ADDR=`${TARGET_PREFIX}readelf -h ${B}/core/tee.elf | grep "Entry point address" | awk '{print $4}'` uboot-mkimage -A arm -O linux -C none -a ${IMX_LOAD_ADDR} -e ${IMX_LOAD_ADDR} \ -d ${DEPLOYDIR}/tee.${PLATFORM_FLAVOR}.bin ${DEPLOYDIR}/uTee-${OPTEE_BIN_EXT} fi - - cd ${DEPLOYDIR} - ln -sf tee.${PLATFORM_FLAVOR}.bin tee.bin - cd - } do_install () { @@ -97,4 +91,4 @@ FILES_${PN}-staticdev = "/usr/include/optee/" RDEPENDS_${PN}-dev += "${PN}-staticdev" PACKAGE_ARCH = "${MACHINE_ARCH}" -COMPATIBLE_MACHINE = "(imx)" +COMPATIBLE_MACHINE = "(imx|imx-boot-container)" diff --git a/recipes-security/optee-imx/optee-test/0001-use-python3-instead-of-python.patch b/recipes-security/optee-imx/optee-test/0001-use-python3-instead-of-python.patch deleted file mode 100644 index 20f190af..00000000 --- a/recipes-security/optee-imx/optee-test/0001-use-python3-instead-of-python.patch +++ /dev/null @@ -1,48 +0,0 @@ -From 6271160639002a2580d80b75b5397a96d56329f2 Mon Sep 17 00:00:00 2001 -From: Scott Branden <scott.branden@broadcom.com> -Date: Fri, 27 Dec 2019 12:54:28 -0800 -Subject: [PATCH] use python3 instead of python - -use python3 instead of python as python2 is EOL January 2020. - -Signed-off-by: Scott Branden <scott.branden@broadcom.com> -Reviewed-by: Jerome Forissier <jerome@forissier.org> -Tested-by: Jerome Forissier <jerome@forissier.org> (QEMU, CFG_GCM_NIST_VECTORS=y) -Upstream-Status: Backport from v3.8.0 ---- - scripts/file_to_c.py | 4 ++-- - scripts/rsp_to_gcm_test.py | 2 +- - 2 files changed, 3 insertions(+), 3 deletions(-) - -diff --git a/scripts/file_to_c.py b/scripts/file_to_c.py -index ae16f52..b4ce2a2 100755 ---- a/scripts/file_to_c.py -+++ b/scripts/file_to_c.py -@@ -1,4 +1,4 @@ --#!/usr/bin/env python -+#!/usr/bin/env python3 - # SPDX-License-Identifier: BSD-2-Clause - # - # Copyright (c) 2018, Linaro Limited -@@ -29,7 +29,7 @@ def main(): - - f.write("const uint8_t " + args.name + "[] = {\n") - i = 0 -- for x in array.array("B", inf.read()): -+ for x in array.array("B", map(ord, (inf.read()))): - f.write("0x" + '{0:02x}'.format(x) + ",") - i = i + 1 - if i % 8 == 0: -diff --git a/scripts/rsp_to_gcm_test.py b/scripts/rsp_to_gcm_test.py -index 0543541..e4418be 100755 ---- a/scripts/rsp_to_gcm_test.py -+++ b/scripts/rsp_to_gcm_test.py -@@ -1,4 +1,4 @@ --#!/usr/bin/env python -+#!/usr/bin/env python3 - - modes = {'encrypt': 0, 'decrypt': 1} - --- -2.7.4 - diff --git a/recipes-security/optee-imx/optee-test/0003-sock_server-fix-compilation-against-musl-sys-errno.h.patch b/recipes-security/optee-imx/optee-test/0003-sock_server-fix-compilation-against-musl-sys-errno.h.patch deleted file mode 100644 index d32a8eb7..00000000 --- a/recipes-security/optee-imx/optee-test/0003-sock_server-fix-compilation-against-musl-sys-errno.h.patch +++ /dev/null @@ -1,41 +0,0 @@ -From dc8cd1c43edeedb9f7335020537c4ffdddd683f8 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Andr=C3=A9=20Draszik?= <andre.draszik@jci.com> -Date: Thu, 7 Feb 2019 01:26:53 +0000 -Subject: [PATCH 1/3] sock_server: fix compilation against musl (sys/errno.h) -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Compiling against musl-libc fails with the following error: - -| In file included from .../host/xtest/sock_server.c:24: -| .../usr/include/sys/errno.h:1:2: error: #warning redirecting incorrect #include <sys/errno.h> to <errno.h> [-Werror=cpp] -| #warning redirecting incorrect #include <sys/errno.h> to <errno.h> -| ^~~~~~~ - -Just remove the needless include. - -Signed-off-by: André Draszik <andre.draszik@jci.com> -Acked-by: Jens Wiklander <jens.wiklander@linaro.org> -Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> ---- -Signed-off-by: André Draszik <andre.draszik@jci.com> -Upstream-Status: Backport [3.5.0] - host/xtest/sock_server.c | 1 - - 1 file changed, 1 deletion(-) - -diff --git a/host/xtest/sock_server.c b/host/xtest/sock_server.c -index 0d2ff06..1ba73d6 100644 ---- a/host/xtest/sock_server.c -+++ b/host/xtest/sock_server.c -@@ -21,7 +21,6 @@ - #include <netdb.h> - #include <netinet/in.h> - #include <poll.h> --#include <sys/errno.h> - #include <sys/socket.h> - #include <unistd.h> - --- -2.23.0.rc1 - diff --git a/recipes-security/optee-imx/optee-test/0004-build-ignore-declaration-after-statement-warnings.patch b/recipes-security/optee-imx/optee-test/0004-build-ignore-declaration-after-statement-warnings.patch deleted file mode 100644 index ed45df60..00000000 --- a/recipes-security/optee-imx/optee-test/0004-build-ignore-declaration-after-statement-warnings.patch +++ /dev/null @@ -1,62 +0,0 @@ -From 1401b89684ee81bf0b3d3dea06e2926b24ba3f97 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Andr=C3=A9=20Draszik?= <andre.draszik@jci.com> -Date: Thu, 7 Feb 2019 01:29:08 +0000 -Subject: [PATCH 2/3] build: ignore declaration-after-statement warnings -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -| Makefile:37: recipe for target 'xtest' failed -| make: *** [xtest] Error 2 -| make: *** Waiting for unfinished jobs.... -| arith_taf.c: In function 'get_handle': -| arith_taf.c:56:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement] -| int h = handle_get(&hdb, ptr); -| ^~~ -| arith_taf.c: In function 'ta_entry_arith_new_var': -| arith_taf.c:82:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement] -| size_t len = TEE_BigIntSizeInU32(params[0].value.a); -| ^~~~~~ -| arith_taf.c: In function 'ta_entry_arith_new_fmm_var': -| arith_taf.c:129:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement] -| size_t len = TEE_BigIntFMMSizeInU32(params[0].value.a); -| ^~~~~~ -| arith_taf.c: In function 'ta_entry_arith_free_handle': -| arith_taf.c:150:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement] -| void *ptr = put_handle(params[0].value.a & ~HT_MASK); -| ^~~~ -| arith_taf.c: In function 'ta_entry_arith_from_octet_string': -| arith_taf.c:165:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement] -| TEE_BigInt *big_int = lookup_handle(HT_BIGINT, params[0].value.a); -| ^~~~~~~~~~ -| arith_taf.c: In function 'ta_entry_arith_from_s32': -| arith_taf.c:181:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement] -| TEE_BigInt *big_int = lookup_handle(HT_BIGINT, params[0].value.a); -| ^~~~~~~~~~ - -etc. - -Signed-off-by: André Draszik <andre.draszik@jci.com> -Acked-by: Jens Wiklander <jens.wiklander@linaro.org> -Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> ---- -Signed-off-by: André Draszik <andre.draszik@jci.com> -Upstream-Status: Backport [3.5.0] - host/xtest/Makefile | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/host/xtest/Makefile b/host/xtest/Makefile -index f4291e0..e97e555 100644 ---- a/host/xtest/Makefile -+++ b/host/xtest/Makefile -@@ -154,6 +154,7 @@ CFLAGS += -Wall -Wcast-align -Werror \ - -Wmissing-prototypes -Wnested-externs -Wpointer-arith \ - -Wshadow -Wstrict-prototypes -Wswitch-default \ - -Wwrite-strings \ -+ -Wno-declaration-after-statement \ - -Wno-missing-field-initializers -Wno-format-zero-length - endif - --- -2.23.0.rc1 - diff --git a/recipes-security/optee-imx/optee-test/0005-benchmark_1000-fix-compilation-against-musl-uint.patch b/recipes-security/optee-imx/optee-test/0005-benchmark_1000-fix-compilation-against-musl-uint.patch deleted file mode 100644 index 58734aa4..00000000 --- a/recipes-security/optee-imx/optee-test/0005-benchmark_1000-fix-compilation-against-musl-uint.patch +++ /dev/null @@ -1,57 +0,0 @@ -From f74e9f339a8e8cb97fc8ea03bef51d7e3862a60a Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Andr=C3=A9=20Draszik?= <andre.draszik@jci.com> -Date: Thu, 7 Feb 2019 01:31:27 +0000 -Subject: [PATCH 3/3] benchmark_1000: fix compilation against musl (uint) -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Compiling against musl-libc fails with the following error: - -| .../host/xtest/benchmark_1000.c: In function 'show_test_result': -| .../host/xtest/benchmark_1000.c:102:2: error: unknown type name 'uint'; did you mean 'int'? -| uint i; -| ^~~~ -| int -| ...host/xtest/benchmark_1000.c:108:16: error: comparison of integer expressions of different signedness: 'int' and 'size_t' {aka 'unsigned int'} [-Werror=sign-compare] -| for (i = 0; i < size; i++) { -| ^ - -etc. - -Convert to using more standard size_t - -Signed-off-by: André Draszik <andre.draszik@jci.com> -Acked-by: Jens Wiklander <jens.wiklander@linaro.org> -Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> ---- -Signed-off-by: André Draszik <andre.draszik@jci.com> -Upstream-Status: Backport [3.5.0] - host/xtest/benchmark_1000.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/host/xtest/benchmark_1000.c b/host/xtest/benchmark_1000.c -index bf92fa0..1caf420 100644 ---- a/host/xtest/benchmark_1000.c -+++ b/host/xtest/benchmark_1000.c -@@ -99,7 +99,7 @@ static TEEC_Result run_chunk_access_test(enum storage_benchmark_cmd cmd, - - static void show_test_result(struct test_record records[], size_t size) - { -- uint i; -+ size_t i; - - printf("-----------------+---------------+----------------\n"); - printf(" Data Size (B) \t | Time (s)\t | Speed (kB/s)\t \n"); -@@ -119,7 +119,7 @@ static void chunk_test(ADBG_Case_t *c, enum storage_benchmark_cmd cmd) - { - uint32_t chunk_size = DEFAULT_CHUNK_SIZE; - struct test_record records[ARRAY_SIZE(data_size_table) - 1]; -- uint i; -+ size_t i; - - for (i = 0; data_size_table[i]; i++) { - ADBG_EXPECT_TEEC_SUCCESS(c, --- -2.23.0.rc1 - diff --git a/recipes-security/optee-imx/optee-test/0006-regression_8100-use-null-terminated-strings-with-fil.patch b/recipes-security/optee-imx/optee-test/0006-regression_8100-use-null-terminated-strings-with-fil.patch deleted file mode 100644 index 1a5c4044..00000000 --- a/recipes-security/optee-imx/optee-test/0006-regression_8100-use-null-terminated-strings-with-fil.patch +++ /dev/null @@ -1,88 +0,0 @@ -From 7d566ed585d1e13f444d48fde5705b5be54de4af Mon Sep 17 00:00:00 2001 -From: Ricardo Salveti <ricardo@foundries.io> -Date: Wed, 26 Jun 2019 17:32:11 -0300 -Subject: [PATCH] regression_8100: use null terminated strings with file_to_c - -GCC 9 is more strict with string manipulation, causing the build to -fail as the string data converted via file_to_c is not null terminated, -as described by the following build error: - -regression_8100.c:100:29: error: '%*s' directive argument is not a -nul-terminated string [-Werror=format-overflow=] -tlen = myasprintf(&trust, "%*s", (int)sizeof(regression_8100_ca_crt), - ^~~ - regression_8100_ca_crt); - ~~~~~~~~~~~~~~~~~~~~~~ - -Change file_to_c to terminate the string after conversion and update the -string size to remove the null terminated byte. Also update -regression_8100 to use the size variable defined via file_to_c instead -of manually calling sizeof. - -Signed-off-by: Ricardo Salveti <ricardo@foundries.io> -Acked-by: Jens Wiklander <jens.wiklander@linaro.org> ---- -Signed-off-by: André Draszik <andre.draszik@jci.com> -Upstream-Status: Backport [3.6.0] - host/xtest/regression_8100.c | 10 +++++----- - scripts/file_to_c.py | 4 ++-- - 2 files changed, 7 insertions(+), 7 deletions(-) - -diff --git a/host/xtest/regression_8100.c b/host/xtest/regression_8100.c -index 04d62d9..13780e1 100644 ---- a/host/xtest/regression_8100.c -+++ b/host/xtest/regression_8100.c -@@ -91,13 +91,13 @@ static void test_8102(ADBG_Case_t *c) - return; - - clen = myasprintf(&chain, "%*s\n%*s", -- (int)sizeof(regression_8100_my_crt), -+ (int)regression_8100_my_crt_size, - regression_8100_my_crt, -- (int)sizeof(regression_8100_mid_crt), -+ (int)regression_8100_mid_crt_size, - regression_8100_mid_crt); - if (!ADBG_EXPECT_COMPARE_SIGNED(c, clen, !=, -1)) - goto out; -- tlen = myasprintf(&trust, "%*s", (int)sizeof(regression_8100_ca_crt), -+ tlen = myasprintf(&trust, "%*s", (int)regression_8100_ca_crt_size, - regression_8100_ca_crt); - if (!ADBG_EXPECT_COMPARE_SIGNED(c, tlen, !=, -1)) - goto out; -@@ -282,7 +282,7 @@ static void test_8103(ADBG_Case_t *c) - NULL, &ret_orig))) - return; - -- clen = myasprintf(&csr, "%*s", (int)sizeof(regression_8100_my_csr), -+ clen = myasprintf(&csr, "%*s", (int)regression_8100_my_csr_size, - regression_8100_my_csr); - if (!ADBG_EXPECT_COMPARE_SIGNED(c, clen, >=, 0)) - goto out; -@@ -300,7 +300,7 @@ static void test_8103(ADBG_Case_t *c) - if (!ADBG_EXPECT_TEEC_SUCCESS(c, res)) - goto out; - -- myasprintf(&ca, "%*s", (int)sizeof(regression_8100_ca_crt), -+ myasprintf(&ca, "%*s", (int)regression_8100_ca_crt_size, - regression_8100_ca_crt); - if (!ADBG_EXPECT_NOT_NULL(c, ca)) - goto out; -diff --git a/scripts/file_to_c.py b/scripts/file_to_c.py -index 83a9832..ae16f52 100755 ---- a/scripts/file_to_c.py -+++ b/scripts/file_to_c.py -@@ -37,9 +37,9 @@ def main(): - else: - f.write(" ") - -- f.write("};\n") -+ f.write("'\\0'};\n") - f.write("const size_t " + args.name + "_size = sizeof(" + -- args.name + ");\n") -+ args.name + ") - 1;\n") - - f.close() - inf.close() --- -2.23.0.rc1 - diff --git a/recipes-security/optee-imx/optee-test_3.7.0.imx.bb b/recipes-security/optee-imx/optee-test_3.10.0.imx.bb index 04240ff0..a8a1b245 100644 --- a/recipes-security/optee-imx/optee-test_3.7.0.imx.bb +++ b/recipes-security/optee-imx/optee-test_3.10.0.imx.bb @@ -1,4 +1,4 @@ -# Copyright (C) 2017-2018 NXP +# Copyright (C) 2017-2020 NXP SUMMARY = "OPTEE test" HOMEPAGE = "http://www.optee.org/" @@ -6,21 +6,18 @@ HOMEPAGE = "http://www.optee.org/" LICENSE = "BSD" LIC_FILES_CHKSUM = "file://LICENSE.md;md5=daa2bcccc666345ab8940aab1315a4fa" -DEPENDS = "optee-os optee-client python3-pycrypto-native openssl" -inherit python3native - -FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" +DEPENDS = "python3-pycrypto-native python3-pycryptodomex-native optee-os optee-client openssl" -SRCBRANCH = "imx_5.4.24_2.1.0" +SRCBRANCH = "imx_5.4.70_2.3.0" -SRC_URI = "git://source.codeaurora.org/external/imx/imx-optee-test.git;protocol=https;branch=${SRCBRANCH} \ - file://0001-use-python3-instead-of-python.patch \ -" +SRC_URI = "git://source.codeaurora.org/external/imx/imx-optee-test.git;protocol=https;branch=${SRCBRANCH}" S = "${WORKDIR}/git" B = "${WORKDIR}/build" -SRCREV = "227d6f4c40eaa6f84fe049b9e48c7b27ad7fab08" +SRCREV = "0c998f42a3fb87b9f2929955cf4b0116cc515091" + +inherit python3native OPTEE_ARCH ?= "arm32" OPTEE_ARCH_armv7a = "arm32" @@ -29,6 +26,9 @@ OPTEE_ARCH_aarch64 = "arm64" TA_DEV_KIT_DIR_arm = "${STAGING_INCDIR}/optee/export-user_ta_arm32/" TA_DEV_KIT_DIR_aarch64 = "${STAGING_INCDIR}/optee/export-user_ta_arm64/" +CFLAGS += "--sysroot=${STAGING_DIR_HOST}" +CXXFLAGS += "--sysroot=${STAGING_DIR_HOST}" + EXTRA_OEMAKE = " \ TA_DEV_KIT_DIR=${TA_DEV_KIT_DIR} \ ARCH=${OPTEE_ARCH} \ @@ -40,6 +40,14 @@ EXTRA_OEMAKE = " \ -C ${S} O=${B} \ " +do_compile() { + cd ${S} + # Top level makefile doesn't seem to handle parallel make gracefully + oe_runmake xtest + oe_runmake ta +} +do_compile[cleandirs] = "${B}" + do_install () { install -d ${D}/usr/bin install ${B}/xtest/xtest ${D}/usr/bin/ diff --git a/recipes-security/optee/optee-client-qoriq.bb b/recipes-security/optee/optee-client-qoriq.bb deleted file mode 100644 index af5fc095..00000000 --- a/recipes-security/optee/optee-client-qoriq.bb +++ /dev/null @@ -1,29 +0,0 @@ -SUMMARY = "OPTEE Client" -HOMEPAGE = "https://github.com/qoriq-open-source/optee_client" - -LICENSE = "BSD" -LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=69663ab153298557a59c67a60a743e5b" - -inherit python3native systemd - -SRC_URI = "git://source.codeaurora.org/external/qoriq/qoriq-components/optee_client;nobranch=1 \ -" -S = "${WORKDIR}/git" - -SRCREV = "08428734c67fb559e420d87fa52fd74a955ea1bd" - -EXTRA_OEMAKE = "ARCH=arm64" - -do_install() { - oe_runmake install - - install -D -p -m0755 ${S}/out/export/bin/tee-supplicant ${D}${bindir}/tee-supplicant - - install -D -p -m0644 ${S}/out/export/lib/libteec.so.1.0 ${D}${libdir}/libteec.so.1.0 - ln -sf libteec.so.1.0 ${D}${libdir}/libteec.so - ln -sf libteec.so.1.0 ${D}${libdir}/libteec.so.1 - - cp -a ${S}/out/export/include ${D}/usr/ -} - -COMPATIBLE_MACHINE = "(qoriq)" diff --git a/recipes-security/optee/optee-client-qoriq/0001-GCC-8-format-truncation-error.patch b/recipes-security/optee/optee-client-qoriq/0001-GCC-8-format-truncation-error.patch deleted file mode 100644 index f58590c3..00000000 --- a/recipes-security/optee/optee-client-qoriq/0001-GCC-8-format-truncation-error.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 05f741c1e6263bec2977901abe61463b7f8175ad Mon Sep 17 00:00:00 2001 -From: Chunrong Guo <chunrong.guo@nxp.com> -Date: Fri, 22 Jun 2018 11:58:09 +0800 -Subject: [PATCH] GCC 8 format-truncation error - -Signed-off-by: BJ DevOps Team <bjdevops@NXP1.onmicrosoft.com> ---- - libteec/src/teec_trace.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/libteec/src/teec_trace.c b/libteec/src/teec_trace.c -index 78b79d6..7901deb 100644 ---- a/libteec/src/teec_trace.c -+++ b/libteec/src/teec_trace.c -@@ -73,7 +73,7 @@ int _dprintf(const char *function, int flen, int line, int level, - const char *prefix, const char *fmt, ...) - { - char raw[MAX_PRINT_SIZE]; -- char prefixed[MAX_PRINT_SIZE]; -+ char prefixed[MAX_PRINT_SIZE + 10]; - char *to_print = NULL; - const char *func; - int err; -@@ -106,7 +106,7 @@ int _dprintf(const char *function, int flen, int line, int level, - */ - int thread_id = syscall(SYS_gettid); /* perf issue ? */ - -- snprintf(prefixed, MAX_PRINT_SIZE, -+ snprintf(prefixed, MAX_PRINT_SIZE + 10, - "%s [%d] %s:%s:%d: %s", - trace_level_strings[level], thread_id, prefix, func, - line, raw); --- -1.8.3.1 - diff --git a/recipes-security/optee/optee-client-qoriq/0001-flags-CFLAGS-add-Wno-cpp.patch b/recipes-security/optee/optee-client-qoriq/0001-flags-CFLAGS-add-Wno-cpp.patch deleted file mode 100644 index 09e4490d..00000000 --- a/recipes-security/optee/optee-client-qoriq/0001-flags-CFLAGS-add-Wno-cpp.patch +++ /dev/null @@ -1,28 +0,0 @@ -From f2ebda1d85b10fd008c21974a0f7aa4e805d0e5c Mon Sep 17 00:00:00 2001 -From: Chunrong Guo <chunrong.guo@nxp.com> -Date: Tue, 11 Sep 2018 11:40:55 +0800 -Subject: [PATCH] flags: CFLAGS add -Wno-cpp - -*fix build with FORTIFY_SOURCES - -Signed-off-by: BJ DevOps Team <bjdevops@NXP1.onmicrosoft.com> ---- - flags.mk | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/flags.mk b/flags.mk -index 71f3d18..43c18f0 100644 ---- a/flags.mk -+++ b/flags.mk -@@ -14,7 +14,7 @@ CFLAGS := -Wall -Wbad-function-cast -Wcast-align \ - -Wmissing-noreturn -Wmissing-prototypes -Wnested-externs \ - -Wpointer-arith -Wshadow -Wstrict-prototypes \ - -Wswitch-default -Wunsafe-loop-optimizations \ -- -Wwrite-strings -Werror -+ -Wwrite-strings -Werror -Wno-cpp - CFLAGS += -c -fPIC - - DEBUG ?= 0 --- -2.7.4 - diff --git a/recipes-security/optee/optee-client-qoriq_3.8.0.bb b/recipes-security/optee/optee-client-qoriq_3.8.0.bb new file mode 100644 index 00000000..0cd9eeab --- /dev/null +++ b/recipes-security/optee/optee-client-qoriq_3.8.0.bb @@ -0,0 +1,28 @@ +SUMMARY = "OPTEE Client" +HOMEPAGE = "https://github.com/OP-TEE/optee_client" + +LICENSE = "BSD" +LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=69663ab153298557a59c67a60a743e5b" + +inherit python3native systemd + +SRC_URI = "git://github.com/OP-TEE/optee_client;nobranch=1" +SRCREV = "be4fa2e36f717f03ca46e574aa66f697a897d090" + +S = "${WORKDIR}/git" + +EXTRA_OEMAKE = "ARCH=arm64" + +do_install() { + oe_runmake install + + install -D -p -m0755 ${S}/out/export/usr/sbin/tee-supplicant ${D}${bindir}/tee-supplicant + install -D -p -m0755 ${S}/out/export/usr/lib/libteec.so.1.0.0 ${D}${libdir}/libteec.so.1.0.0 + ln -sf libteec.so.1.0.0 ${D}${libdir}/libteec.so.1.0 + ln -sf libteec.so.1.0.0 ${D}${libdir}/libteec.so.1 + ln -sf libteec.so.1 ${D}${libdir}/libteec.so + + cp -a ${S}/out/export/usr/include ${D}/usr/ +} + +COMPATIBLE_MACHINE = "(qoriq-arm64)" diff --git a/recipes-security/optee/optee-os-qoriq/0001-Fix-alignment-of-data-for-mempool_alloc_pool.patch b/recipes-security/optee/optee-os-qoriq/0001-Fix-alignment-of-data-for-mempool_alloc_pool.patch deleted file mode 100644 index e22bd6c0..00000000 --- a/recipes-security/optee/optee-os-qoriq/0001-Fix-alignment-of-data-for-mempool_alloc_pool.patch +++ /dev/null @@ -1,148 +0,0 @@ -From b2dd8747125be413f9b8b7fd7e52f457cabd709c Mon Sep 17 00:00:00 2001 -From: Jens Wiklander <jens.wiklander@linaro.org> -Date: Tue, 5 Feb 2019 13:05:29 +0100 -Subject: [PATCH] Fix alignment of data for mempool_alloc_pool() - -Upstream-Status: Submitted - -Prior to this patch was _TEE_MathAPI_Init() in -lib/libutee/tee_api_arith_mpi.c supplying a data buffer which was only 4 -byte aligned while mempool_alloc_pool() requires the alignment of long. -This will work in 32-bit mode, but could lead to alignment problem in -64-bit mode. The same problem can happen with -lib/libutee/tee_api_arith_mpa.c, but so far it has remained hidden. - -Incorrect alignment can result in errors like: -E/TA: assertion '!((vaddr_t)data & (POOL_ALIGN - 1))' failed at lib/libutils/ext/mempool.c:134 in mempool_alloc_pool() - -This fix introduces MEMPOOL_ALIGN which specifies required alignment of -data supplied to mempool_alloc_pool(). - -Fixes: 062e3d01c039 ("ta: switch to to mbedtls for bignum") -Reviewed-by: Joakim Bech <joakim.bech@linaro.org> -Tested-by: Joakim Bech <joakim.bech@linaro.org> (QEMU v8) -Acked-by: Jerome Forissier <jerome.forissier@linaro.org> -Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> ---- - core/lib/libtomcrypt/src/mpa_desc.c | 2 +- - core/lib/libtomcrypt/src/mpi_desc.c | 2 +- - lib/libutee/tee_api_arith_mpa.c | 3 ++- - lib/libutee/tee_api_arith_mpi.c | 3 +-- - lib/libutils/ext/include/mempool.h | 5 ++++- - lib/libutils/ext/mempool.c | 9 ++++----- - 6 files changed, 13 insertions(+), 11 deletions(-) - -diff --git a/core/lib/libtomcrypt/src/mpa_desc.c b/core/lib/libtomcrypt/src/mpa_desc.c -index b407f54..58aa242 100644 ---- a/core/lib/libtomcrypt/src/mpa_desc.c -+++ b/core/lib/libtomcrypt/src/mpa_desc.c -@@ -40,7 +40,7 @@ static struct mempool *get_mpa_scratch_memory_pool(void) - #else /* CFG_WITH_PAGER */ - static struct mempool *get_mpa_scratch_memory_pool(void) - { -- static uint32_t data[LTC_MEMPOOL_U32_SIZE] __aligned(__alignof__(long)); -+ static uint32_t data[LTC_MEMPOOL_U32_SIZE] __aligned(MEMPOOL_ALIGN); - - return mempool_alloc_pool(data, sizeof(data), NULL); - } -diff --git a/core/lib/libtomcrypt/src/mpi_desc.c b/core/lib/libtomcrypt/src/mpi_desc.c -index a43fbb4..67bc3a7 100644 ---- a/core/lib/libtomcrypt/src/mpi_desc.c -+++ b/core/lib/libtomcrypt/src/mpi_desc.c -@@ -38,7 +38,7 @@ static struct mempool *get_mp_scratch_memory_pool(void) - #else /* CFG_WITH_PAGER */ - static struct mempool *get_mp_scratch_memory_pool(void) - { -- static uint8_t data[MPI_MEMPOOL_SIZE] __aligned(__alignof__(long)); -+ static uint8_t data[MPI_MEMPOOL_SIZE] __aligned(MEMPOOL_ALIGN); - - return mempool_alloc_pool(data, sizeof(data), NULL); - } -diff --git a/lib/libutee/tee_api_arith_mpa.c b/lib/libutee/tee_api_arith_mpa.c -index 0f6c7f1..a8ca6aa 100644 ---- a/lib/libutee/tee_api_arith_mpa.c -+++ b/lib/libutee/tee_api_arith_mpa.c -@@ -19,7 +19,8 @@ - - static uint32_t mempool_u32[mpa_scratch_mem_size_in_U32( - MPA_INTERNAL_MEM_POOL_SIZE, -- CFG_TA_BIGNUM_MAX_BITS)]; -+ CFG_TA_BIGNUM_MAX_BITS)] -+ __aligned(MEMPOOL_ALIGN); - static mpa_scratch_mem mempool; - - /************************************************************* -diff --git a/lib/libutee/tee_api_arith_mpi.c b/lib/libutee/tee_api_arith_mpi.c -index 8e2751b..6b074e1 100644 ---- a/lib/libutee/tee_api_arith_mpi.c -+++ b/lib/libutee/tee_api_arith_mpi.c -@@ -42,8 +42,7 @@ static void __noreturn mpi_panic(const char *func, int line, int rc) - - void _TEE_MathAPI_Init(void) - { -- static uint8_t data[MPI_MEMPOOL_SIZE] -- __aligned(__alignof__(mbedtls_mpi_uint)); -+ static uint8_t data[MPI_MEMPOOL_SIZE] __aligned(MEMPOOL_ALIGN); - - mbedtls_mpi_mempool = mempool_alloc_pool(data, sizeof(data), NULL); - if (!mbedtls_mpi_mempool) -diff --git a/lib/libutils/ext/include/mempool.h b/lib/libutils/ext/include/mempool.h -index 62377df..2a60800 100644 ---- a/lib/libutils/ext/include/mempool.h -+++ b/lib/libutils/ext/include/mempool.h -@@ -19,9 +19,12 @@ struct mempool_item { - - struct mempool; - -+#define MEMPOOL_ALIGN __alignof__(long) -+ - /* - * mempool_alloc_pool() - Allocate a new memory pool -- * @data: a block of memory to carve out items from -+ * @data: a block of memory to carve out items from, must -+ * have an alignment of MEMPOOL_ALIGN. - * @size: size fo the block of memory - * @release_mem: function to call when the pool has been emptied, - * ignored if NULL. -diff --git a/lib/libutils/ext/mempool.c b/lib/libutils/ext/mempool.c -index f977699..6d38590 100644 ---- a/lib/libutils/ext/mempool.c -+++ b/lib/libutils/ext/mempool.c -@@ -53,7 +53,6 @@ - * So the potential fragmentation is mitigated. - */ - --#define POOL_ALIGN __alignof__(long) - - struct mempool { - size_t size; /* size of the memory pool, in bytes */ -@@ -130,8 +129,8 @@ mempool_alloc_pool(void *data, size_t size, - { - struct mempool *pool = calloc(1, sizeof(*pool)); - -- COMPILE_TIME_ASSERT(POOL_ALIGN >= __alignof__(struct mempool_item)); -- assert(!((vaddr_t)data & (POOL_ALIGN - 1))); -+ COMPILE_TIME_ASSERT(MEMPOOL_ALIGN >= __alignof__(struct mempool_item)); -+ assert(!((vaddr_t)data & (MEMPOOL_ALIGN - 1))); - - if (pool) { - pool->size = size; -@@ -163,13 +162,13 @@ void *mempool_alloc(struct mempool *pool, size_t size) - pool->last_offset); - offset = pool->last_offset + last_item->size; - -- offset = ROUNDUP(offset, POOL_ALIGN); -+ offset = ROUNDUP(offset, MEMPOOL_ALIGN); - if (offset > pool->size) - goto error; - } - - size = sizeof(struct mempool_item) + size; -- size = ROUNDUP(size, POOL_ALIGN); -+ size = ROUNDUP(size, MEMPOOL_ALIGN); - if (offset + size > pool->size) - goto error; - --- -2.7.4 - diff --git a/recipes-security/optee/optee-os-qoriq/0001-arm64-Disable-outline-atomics-when-compiling.patch b/recipes-security/optee/optee-os-qoriq/0001-arm64-Disable-outline-atomics-when-compiling.patch new file mode 100644 index 00000000..086d4333 --- /dev/null +++ b/recipes-security/optee/optee-os-qoriq/0001-arm64-Disable-outline-atomics-when-compiling.patch @@ -0,0 +1,41 @@ +From f94d9558d9eae48e92ce8d651539b6cf69eb4394 Mon Sep 17 00:00:00 2001 +From: Joshua Watt <JPEWhacker@gmail.com> +Date: Mon, 18 May 2020 20:00:00 -0500 +Subject: [PATCH] arm64: Disable outline-atomics when compiling + +Disables the automatic detection of LSE (Large System Extension) +instructions when compiling AArch64 code. GCC 10 implements this +detection in libgcc using __getauxval(), which optee doesn't implement. +This requires that the proper -mcpu is passed to GCC so that the code +can be correctly compiled to use either LSE or load-store-exclusive. + +Fixes linker errors like the following when compiling with GCC 10: + + aarch64-linux-ld.bfd: libgcc.a(lse-init.o): + in function `init_have_lse_atomics': + lse-init.c:44: undefined reference to `__getauxval' + core/arch/arm/kernel/link.mk:38: + recipe for target 'build/core/all_objs.o' failed + +Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> +Upstream-Status: Submitted [https://github.com/OP-TEE/optee_os/pull/3874] +--- + core/arch/arm/arm.mk | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/core/arch/arm/arm.mk b/core/arch/arm/arm.mk +index a18eda3b..07069c66 100644 +--- a/core/arch/arm/arm.mk ++++ b/core/arch/arm/arm.mk +@@ -115,7 +115,7 @@ arm32-platform-aflags-no-hard-float ?= + + arm64-platform-cflags-no-hard-float ?= -mgeneral-regs-only + arm64-platform-cflags-hard-float ?= +-arm64-platform-cflags-generic ?= -mstrict-align ++arm64-platform-cflags-generic ?= -mstrict-align $(call cc-option,-mno-outline-atomics,) + + ifeq ($(DEBUG),1) + # For backwards compatibility +-- +2.17.1 + diff --git a/recipes-security/optee/optee-os-qoriq/0001-optee-os-fix-gcc10-compilation-issue-and-missing-cc-.patch b/recipes-security/optee/optee-os-qoriq/0001-optee-os-fix-gcc10-compilation-issue-and-missing-cc-.patch deleted file mode 100644 index f9c71d0d..00000000 --- a/recipes-security/optee/optee-os-qoriq/0001-optee-os-fix-gcc10-compilation-issue-and-missing-cc-.patch +++ /dev/null @@ -1,161 +0,0 @@ -From 027a3b9a33fbb23e1d1d7ed6411d4d112d2a55a1 Mon Sep 17 00:00:00 2001 -From: Andrey Zhizhikin <andrey.z@gmail.com> -Date: Sat, 30 May 2020 22:00:59 +0000 -Subject: [PATCH] optee-os: fix gcc10 compilation issue and missing cc-options - -Backport PR 3891 from upstream to imx fork, which addressed compilation -failure when GCC10 is used. - -Additional changes ported fixed cc-options macro, which allows to query -compiler used if the desired option exists before it could be set. This -solves also the build issues when GCC9 is used to build this component. - -Upstream-Status: Backport [https://github.com/OP-TEE/optee_os/pull/3891] - -Signed-off-by: Andrey Zhizhikin <andrey.z@gmail.com> ---- - core/arch/arm/arm.mk | 21 ++++++++++++++++----- - core/core.mk | 5 +---- - mk/cc-option.mk | 9 +++++++++ - mk/gcc.mk | 2 +- - ta/mk/ta_dev_kit.mk | 3 +++ - ta/ta.mk | 1 + - 6 files changed, 31 insertions(+), 10 deletions(-) - create mode 100644 mk/cc-option.mk - -diff --git a/core/arch/arm/arm.mk b/core/arch/arm/arm.mk -index 0a95b1ec..bfcbe896 100644 ---- a/core/arch/arm/arm.mk -+++ b/core/arch/arm/arm.mk -@@ -1,3 +1,16 @@ -+# Setup compiler for the core module -+ifeq ($(CFG_ARM64_core),y) -+arch-bits-core := 64 -+else -+arch-bits-core := 32 -+endif -+CROSS_COMPILE_core := $(CROSS_COMPILE$(arch-bits-core)) -+COMPILER_core := $(COMPILER) -+include mk/$(COMPILER_core).mk -+ -+# Defines the cc-option macro using the compiler set for the core module -+include mk/cc-option.mk -+ - CFG_LTC_OPTEE_THREAD ?= y - # Size of emulated TrustZone protected SRAM, 448 kB. - # Only applicable when paging is enabled. -@@ -95,7 +108,7 @@ arm32-platform-aflags-no-hard-float ?= - - arm64-platform-cflags-no-hard-float ?= -mgeneral-regs-only - arm64-platform-cflags-hard-float ?= --arm64-platform-cflags-generic ?= -mstrict-align -+arm64-platform-cflags-generic := -mstrict-align $(call cc-option,-mno-outline-atomics,) - - ifeq ($(DEBUG),1) - # For backwards compatibility -@@ -124,14 +137,12 @@ core-platform-aflags += $(platform-aflags-generic) - core-platform-aflags += $(platform-aflags-debug-info) - - ifeq ($(CFG_ARM64_core),y) --arch-bits-core := 64 - core-platform-cppflags += $(arm64-platform-cppflags) - core-platform-cflags += $(arm64-platform-cflags) - core-platform-cflags += $(arm64-platform-cflags-generic) - core-platform-cflags += $(arm64-platform-cflags-no-hard-float) - core-platform-aflags += $(arm64-platform-aflags) - else --arch-bits-core := 32 - core-platform-cppflags += $(arm32-platform-cppflags) - core-platform-cflags += $(arm32-platform-cflags) - core-platform-cflags += $(arm32-platform-cflags-no-hard-float) -@@ -217,8 +228,8 @@ ta-mk-file-export-add-ta_arm64 += CROSS_COMPILE64 ?= $$(CROSS_COMPILE)_nl_ - ta-mk-file-export-add-ta_arm64 += CROSS_COMPILE_ta_arm64 ?= $$(CROSS_COMPILE64)_nl_ - endif - --# Set cross compiler prefix for each submodule --$(foreach sm, core $(ta-targets), $(eval CROSS_COMPILE_$(sm) ?= $(CROSS_COMPILE$(arch-bits-$(sm))))) -+# Set cross compiler prefix for each TA target -+$(foreach sm, $(ta-targets), $(eval CROSS_COMPILE_$(sm) ?= $(CROSS_COMPILE$(arch-bits-$(sm))))) - - arm32-sysreg-txt = core/arch/arm/kernel/arm32_sysreg.txt - arm32-sysregs-$(arm32-sysreg-txt)-h := arm32_sysreg.h -diff --git a/core/core.mk b/core/core.mk -index 37906792..4eec217a 100644 ---- a/core/core.mk -+++ b/core/core.mk -@@ -8,6 +8,7 @@ arch-dir := core/arch/$(ARCH) - platform-dir := $(arch-dir)/plat-$(PLATFORM) - include $(platform-dir)/conf.mk - include mk/config.mk -+# $(ARCH).mk also sets the compiler for the core module - include core/arch/$(ARCH)/$(ARCH).mk - - PLATFORM_$(PLATFORM) := y -@@ -16,10 +17,6 @@ PLATFORM_FLAVOR_$(PLATFORM_FLAVOR) := y - $(call cfg-depends-all,CFG_PAGED_USER_TA,CFG_WITH_PAGER CFG_WITH_USER_TA) - include core/crypto.mk - --# Setup compiler for this sub module --COMPILER_$(sm) ?= $(COMPILER) --include mk/$(COMPILER_$(sm)).mk -- - cppflags$(sm) += -D__KERNEL__ - - cppflags$(sm) += -Icore/include -diff --git a/mk/cc-option.mk b/mk/cc-option.mk -new file mode 100644 -index 00000000..4699fbcc ---- /dev/null -+++ b/mk/cc-option.mk -@@ -0,0 +1,9 @@ -+_cc-option-supported = $(if $(shell $(CC$(sm)) $(1) -c -x c /dev/null -o /dev/null 2>/dev/null >/dev/null || echo "Not supported"),,1) -+_cc-opt-cached-var-name = $(subst =,~,$(strip cached-cc-option-$(1)-$(subst $(empty) $(empty),,$(CC$(sm))))) -+define _cc-option -+$(eval _var_name := $(call _cc-opt-cached-var-name,$(1))) -+$(eval $(_var_name) := $(if $(filter $(origin $(_var_name)),undefined),$(call _cc-option-supported,$(1)),$($(_var_name)))) -+$(if $($(_var_name)),$(1),$(2)) -+endef -+cc-option = $(strip $(call _cc-option,$(1),$(2))) -+ -diff --git a/mk/gcc.mk b/mk/gcc.mk -index c516c731..330b200a 100644 ---- a/mk/gcc.mk -+++ b/mk/gcc.mk -@@ -12,7 +12,7 @@ nostdinc$(sm) := -nostdinc -isystem $(shell $(CC$(sm)) \ - -print-file-name=include 2> /dev/null) - - # Get location of libgcc from gcc --libgcc$(sm) := $(shell $(CC$(sm)) $(LIBGCC_LOCATE_CFLAGS) $(CFLAGS$(arch-bits-$(sm))) $(comp-cflags$(sm)) \ -+libgcc$(sm) := $(shell $(CC$(sm)) $(LIBGCC_LOCATE_CFLAGS) $(CFLAGS$(arch-bits-$(sm))) \ - -print-libgcc-file-name 2> /dev/null) - - # Define these to something to discover accidental use -diff --git a/ta/mk/ta_dev_kit.mk b/ta/mk/ta_dev_kit.mk -index 8473c6df..40e77c3e 100644 ---- a/ta/mk/ta_dev_kit.mk -+++ b/ta/mk/ta_dev_kit.mk -@@ -86,6 +86,9 @@ clean: - @$(cmd-echo-silent) ' CLEAN $(O)' - ${q}if [ -d "$(O)" ]; then $(RMDIR) $(O); fi - -+include $(ta-dev-kit-dir$(sm))/mk/$(COMPILER_$(sm)).mk -+include $(ta-dev-kit-dir$(sm))/mk/cc-option.mk -+ - subdirs = . - include $(ta-dev-kit-dir$(sm))/mk/subdir.mk - -diff --git a/ta/ta.mk b/ta/ta.mk -index 1b7e999d..e0915d18 100644 ---- a/ta/ta.mk -+++ b/ta/ta.mk -@@ -105,6 +105,7 @@ $(foreach f, $(libfiles), \ - - # Copy .mk files - ta-mkfiles = mk/compile.mk mk/subdir.mk mk/gcc.mk mk/cleandirs.mk \ -+ mk/cc-option.mk \ - ta/arch/$(ARCH)/link.mk ta/arch/$(ARCH)/link_shlib.mk \ - ta/mk/ta_dev_kit.mk - --- -2.17.1 - diff --git a/recipes-security/optee/optee-os-qoriq/0001-use-python3-instead-of-python.patch b/recipes-security/optee/optee-os-qoriq/0001-use-python3-instead-of-python.patch deleted file mode 100644 index 6ecc6152..00000000 --- a/recipes-security/optee/optee-os-qoriq/0001-use-python3-instead-of-python.patch +++ /dev/null @@ -1,80 +0,0 @@ -diff --git a/scripts/arm32_sysreg.py b/scripts/arm32_sysreg.py -index bd0c619e..530b0f44 100755 ---- a/scripts/arm32_sysreg.py -+++ b/scripts/arm32_sysreg.py -@@ -1,4 +1,4 @@ --#!/usr/bin/env python -+#!/usr/bin/env python3 - # SPDX-License-Identifier: BSD-2-Clause - # - # Copyright (c) 2018, Linaro Limited -diff --git a/scripts/gen_hashed_bin.py b/scripts/gen_hashed_bin.py -index 67b2b049..619cf26e 100755 ---- a/scripts/gen_hashed_bin.py -+++ b/scripts/gen_hashed_bin.py -@@ -1,4 +1,4 @@ --#!/usr/bin/env python -+#!/usr/bin/env python3 - # SPDX-License-Identifier: BSD-2-Clause - # - # Copyright (c) 2014-2017, Linaro Limited -diff --git a/scripts/gen_ld_sects.py b/scripts/gen_ld_sects.py -index 43e812b5..bc82dd8b 100755 ---- a/scripts/gen_ld_sects.py -+++ b/scripts/gen_ld_sects.py -@@ -1,4 +1,4 @@ --#!/usr/bin/env python -+#!/usr/bin/env python3 - # SPDX-License-Identifier: BSD-2-Clause - # - # Copyright (c) 2017, Linaro Limited -diff --git a/scripts/pem_to_pub_c.py b/scripts/pem_to_pub_c.py -index ddc17c18..69a4355c 100755 ---- a/scripts/pem_to_pub_c.py -+++ b/scripts/pem_to_pub_c.py -@@ -1,4 +1,4 @@ --#!/usr/bin/env python -+#!/usr/bin/env python3 - # SPDX-License-Identifier: BSD-2-Clause - # - # Copyright (c) 2015, Linaro Limited -diff --git a/scripts/sign.py b/scripts/sign.py -index 84fd7714..f6e6b667 100755 ---- a/scripts/sign.py -+++ b/scripts/sign.py -@@ -1,4 +1,4 @@ --#!/usr/bin/env python -+#!/usr/bin/env python3 - # - # Copyright (c) 2015, 2017, Linaro Limited - # -diff --git a/scripts/symbolize.py b/scripts/symbolize.py -index 99a48c70..cbd9884a 100755 ---- a/scripts/symbolize.py -+++ b/scripts/symbolize.py -@@ -1,4 +1,4 @@ --#!/usr/bin/env python -+#!/usr/bin/env python3 - # SPDX-License-Identifier: BSD-2-Clause - # - # Copyright (c) 2017, Linaro Limited -diff --git a/scripts/ta_bin_to_c.py b/scripts/ta_bin_to_c.py -index 1496f816..a01e7f9b 100755 ---- a/scripts/ta_bin_to_c.py -+++ b/scripts/ta_bin_to_c.py -@@ -1,4 +1,4 @@ --#!/usr/bin/env python -+#!/usr/bin/env python3 - # SPDX-License-Identifier: BSD-2-Clause - # - # Copyright (c) 2017, Linaro Limited -diff --git a/scripts/tee_bin_parser.py b/scripts/tee_bin_parser.py -index 8356ad5d..4409074b 100755 ---- a/scripts/tee_bin_parser.py -+++ b/scripts/tee_bin_parser.py -@@ -1,4 +1,4 @@ --#!/usr/bin/env python -+#!/usr/bin/env python3 - # SPDX-License-Identifier: BSD-2-Clause - # - # Copyright (c) 2016, Linaro Limited diff --git a/recipes-security/optee/optee-os-qoriq_git.bb b/recipes-security/optee/optee-os-qoriq_3.8.0.bb index d7b28278..b8d764ff 100644 --- a/recipes-security/optee/optee-os-qoriq_git.bb +++ b/recipes-security/optee/optee-os-qoriq_3.8.0.bb @@ -2,24 +2,26 @@ SUMMARY = "OP-TEE Trusted OS" DESCRIPTION = "OPTEE OS" LICENSE = "BSD" -LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=69663ab153298557a59c67a60a743e5b" +LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=c1f21c4f72f372ef38a5a4aee55ec173" -DEPENDS = "python3-pycrypto-native" +PV = "3.8+git${SRCPV}" + +DEPENDS += "python3-pyelftools-native python3-pycryptodome-native python3-pycryptodomex-native dtc-native" inherit deploy python3native -SRCREV = "4e8d2e5307b99a91a0cac3ea3560ecb7d62898d6" SRC_URI = "git://source.codeaurora.org/external/qoriq/qoriq-components/optee_os;nobranch=1 \ file://0001-allow-setting-sysroot-for-libgcc-lookup.patch \ - file://0001-Fix-alignment-of-data-for-mempool_alloc_pool.patch \ - file://0001-use-python3-instead-of-python.patch \ - file://0001-optee-os-fix-gcc10-compilation-issue-and-missing-cc-.patch \ + file://0001-arm64-Disable-outline-atomics-when-compiling.patch \ " +SRCREV = "0cb01f7f6aee552ead49990c06f69f73f459cc65" + S = "${WORKDIR}/git" OPTEEMACHINE ?= "${MACHINE}" OPTEEMACHINE_ls1088ardb-pb = "ls1088ardb" OPTEEMACHINE_ls1046afrwy = "ls1046ardb" +OPTEEMACHINE_lx2162aqds = "lx2160aqds" EXTRA_OEMAKE = "PLATFORM=ls-${OPTEEMACHINE} CFG_ARM64_core=y \ ARCH=arm \ @@ -29,6 +31,7 @@ EXTRA_OEMAKE = "PLATFORM=ls-${OPTEEMACHINE} CFG_ARM64_core=y \ LDFLAGS= \ LIBGCC_LOCATE_CFLAGS=--sysroot=${STAGING_DIR_HOST} \ " +EXTRA_OEMAKE_append_lx2162aqds = " CFG_EMBED_DTB_SOURCE_FILE=fsl-lx2160a-qds.dts CFG_EMBED_DT=y" OPTEE_ARCH_armv7a = "arm32" OPTEE_ARCH_aarch64 = "arm64" diff --git a/recipes-security/optee/optee-test-qoriq/0001-fix-build-failure-with-GCC-9.patch b/recipes-security/optee/optee-test-qoriq/0001-fix-build-failure-with-GCC-9.patch deleted file mode 100644 index 9b912777..00000000 --- a/recipes-security/optee/optee-test-qoriq/0001-fix-build-failure-with-GCC-9.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 79330c8383e02e91a355964a3cc7b932d03c2517 Mon Sep 17 00:00:00 2001 -From: Chunrong Guo <chunrong.guo@nxp.com> -Date: Wed, 10 Jul 2019 11:09:01 +0200 -Subject: [PATCH] fix build failure with GCC 9 - -Upstream-Status: Inappropriate [embedded specific] - -Signed-off-by: C.r. Guo <nxa13725@lsv07004.swis.us-cdc01.nxp.com> ---- - host/xtest/Makefile | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/host/xtest/Makefile b/host/xtest/Makefile -index e4e2881..e86e056 100644 ---- a/host/xtest/Makefile -+++ b/host/xtest/Makefile -@@ -152,7 +152,7 @@ CFLAGS += -Wall -Wcast-align -Werror \ - -Wmissing-include-dirs -Wmissing-noreturn \ - -Wmissing-prototypes -Wnested-externs -Wpointer-arith \ - -Wshadow -Wstrict-prototypes -Wswitch-default \ -- -Wwrite-strings \ -+ -Wwrite-strings -Wno-format-overflow \ - -Wno-missing-field-initializers -Wno-format-zero-length - endif - --- -2.7.4 - diff --git a/recipes-security/optee/optee-test-qoriq/0001-use-python3-instead-of-python.patch b/recipes-security/optee/optee-test-qoriq/0001-use-python3-instead-of-python.patch deleted file mode 100644 index 20f190af..00000000 --- a/recipes-security/optee/optee-test-qoriq/0001-use-python3-instead-of-python.patch +++ /dev/null @@ -1,48 +0,0 @@ -From 6271160639002a2580d80b75b5397a96d56329f2 Mon Sep 17 00:00:00 2001 -From: Scott Branden <scott.branden@broadcom.com> -Date: Fri, 27 Dec 2019 12:54:28 -0800 -Subject: [PATCH] use python3 instead of python - -use python3 instead of python as python2 is EOL January 2020. - -Signed-off-by: Scott Branden <scott.branden@broadcom.com> -Reviewed-by: Jerome Forissier <jerome@forissier.org> -Tested-by: Jerome Forissier <jerome@forissier.org> (QEMU, CFG_GCM_NIST_VECTORS=y) -Upstream-Status: Backport from v3.8.0 ---- - scripts/file_to_c.py | 4 ++-- - scripts/rsp_to_gcm_test.py | 2 +- - 2 files changed, 3 insertions(+), 3 deletions(-) - -diff --git a/scripts/file_to_c.py b/scripts/file_to_c.py -index ae16f52..b4ce2a2 100755 ---- a/scripts/file_to_c.py -+++ b/scripts/file_to_c.py -@@ -1,4 +1,4 @@ --#!/usr/bin/env python -+#!/usr/bin/env python3 - # SPDX-License-Identifier: BSD-2-Clause - # - # Copyright (c) 2018, Linaro Limited -@@ -29,7 +29,7 @@ def main(): - - f.write("const uint8_t " + args.name + "[] = {\n") - i = 0 -- for x in array.array("B", inf.read()): -+ for x in array.array("B", map(ord, (inf.read()))): - f.write("0x" + '{0:02x}'.format(x) + ",") - i = i + 1 - if i % 8 == 0: -diff --git a/scripts/rsp_to_gcm_test.py b/scripts/rsp_to_gcm_test.py -index 0543541..e4418be 100755 ---- a/scripts/rsp_to_gcm_test.py -+++ b/scripts/rsp_to_gcm_test.py -@@ -1,4 +1,4 @@ --#!/usr/bin/env python -+#!/usr/bin/env python3 - - modes = {'encrypt': 0, 'decrypt': 1} - --- -2.7.4 - diff --git a/recipes-security/optee/optee-test-qoriq_git.bb b/recipes-security/optee/optee-test-qoriq_3.8.0.bb index b66725c7..94cd00c2 100644 --- a/recipes-security/optee/optee-test-qoriq_git.bb +++ b/recipes-security/optee/optee-test-qoriq_3.8.0.bb @@ -1,20 +1,17 @@ SUMMARY = "OP-TEE sanity testsuite" -HOMEPAGE = "https://github.com/qoriq-open-source/optee_test" +HOMEPAGE = "https://github.com/OP-TEE/optee_test" LICENSE = "BSD & GPLv2" LIC_FILES_CHKSUM = "file://${S}/LICENSE.md;md5=daa2bcccc666345ab8940aab1315a4fa" -DEPENDS = "optee-client-qoriq optee-os-qoriq python3-pycrypto-native" +DEPENDS = "optee-client-qoriq optee-os-qoriq python3-pycryptodome-native python3-pycryptodomex-native" inherit python3native -SRC_URI = "git://source.codeaurora.org/external/qoriq/qoriq-components/optee_test;nobranch=1 \ - file://0001-fix-build-failure-with-GCC-9.patch \ - file://0001-use-python3-instead-of-python.patch \ -" -S = "${WORKDIR}/git" +SRC_URI = "git://github.com/OP-TEE/optee_test;nobranch=1" +SRCREV = "30481e381cb4285706e7516853495a7699c93b2c" -SRCREV = "669058459e4a544be12f37dab103ee4c2b32e31d" +S = "${WORKDIR}/git" OPTEE_CLIENT_EXPORT = "${STAGING_DIR_HOST}${prefix}" TEEC_EXPORT = "${STAGING_DIR_HOST}${prefix}" |