From 365a400ed9934977aa11a98cf8936d73a1bbd5ce Mon Sep 17 00:00:00 2001 From: Jia Zhang Date: Mon, 19 Feb 2018 04:39:19 -0500 Subject: meta-secure-core: update TSS 2.0 to the latest stable version Signed-off-by: Jia Zhang --- meta-tpm2/recipes-tpm/tpm2-abrmd/tpm2-abrmd_git.bb | 12 ++-- .../0001-Fix-build-failure-with-glib-2.0.patch | 39 ------------- ...tools-use-dynamic-linkage-with-tpm2-abrmd.patch | 63 +++++++++++++++++++++ ...tools-use-dynamic-linkage-with-tpm2-abrmd.patch | 65 ---------------------- .../recipes-tpm/tpm2.0-tools/tpm2.0-tools_git.bb | 9 ++- meta-tpm2/recipes-tpm/tpm2.0-tss/tpm2.0-tss_git.bb | 18 +----- 6 files changed, 78 insertions(+), 128 deletions(-) delete mode 100644 meta-tpm2/recipes-tpm/tpm2.0-tools/tpm2.0-tools/0001-Fix-build-failure-with-glib-2.0.patch create mode 100644 meta-tpm2/recipes-tpm/tpm2.0-tools/tpm2.0-tools/0001-tpm2-tools-use-dynamic-linkage-with-tpm2-abrmd.patch delete mode 100644 meta-tpm2/recipes-tpm/tpm2.0-tools/tpm2.0-tools/0002-tpm2-tools-use-dynamic-linkage-with-tpm2-abrmd.patch (limited to 'meta-tpm2') diff --git a/meta-tpm2/recipes-tpm/tpm2-abrmd/tpm2-abrmd_git.bb b/meta-tpm2/recipes-tpm/tpm2-abrmd/tpm2-abrmd_git.bb index 688f26e..3a60863 100644 --- a/meta-tpm2/recipes-tpm/tpm2-abrmd/tpm2-abrmd_git.bb +++ b/meta-tpm2/recipes-tpm/tpm2-abrmd/tpm2-abrmd_git.bb @@ -11,14 +11,14 @@ LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=500b2e742befc3da00684d8a1d5fd9da" DEPENDS += "autoconf-archive dbus glib-2.0 pkgconfig tpm2.0-tss glib-2.0-native" -PV = "1.1.0+git${SRCPV}" +PV = "1.2.0+git${SRCPV}" SRC_URI = "\ - git://github.com/01org/tpm2-abrmd.git \ + git://github.com/tpm2-software/tpm2-abrmd \ file://tpm2-abrmd-init.sh \ file://tpm2-abrmd.default \ " -SRCREV = "1003fcfaad39f5c27f75deb678f4fba253f38a82" +SRCREV = "59ce1008e5fa3bd5a143437b0f7390851fd25bd8" S = "${WORKDIR}/git" @@ -60,8 +60,12 @@ do_install_append() { install -m 0644 "${WORKDIR}/tpm2-abrmd.default" "${D}${sysconfdir}/default/tpm2-abrmd" } +FILES_${PN} += "\ + ${libdir}/systemd \ +" + RDEPENDS_${PN} += "\ - libgcc dbus-glib libtss2 libtctidevice libtctisocket libmarshal \ + libgcc dbus-glib libtss2 libtctidevice libtctisocket \ " BBCLASSEXTEND = "native" diff --git a/meta-tpm2/recipes-tpm/tpm2.0-tools/tpm2.0-tools/0001-Fix-build-failure-with-glib-2.0.patch b/meta-tpm2/recipes-tpm/tpm2.0-tools/tpm2.0-tools/0001-Fix-build-failure-with-glib-2.0.patch deleted file mode 100644 index 80aaa0d..0000000 --- a/meta-tpm2/recipes-tpm/tpm2.0-tools/tpm2.0-tools/0001-Fix-build-failure-with-glib-2.0.patch +++ /dev/null @@ -1,39 +0,0 @@ -From 1f8d526bad6a0317bde32a0278fbabe2492e7c62 Mon Sep 17 00:00:00 2001 -From: Lans Zhang -Date: Thu, 20 Jul 2017 14:51:34 +0800 -Subject: [PATCH] Fix build failure with glib-2.0 - -Signed-off-by: Lans Zhang ---- - Makefile.am | 2 +- - configure.ac | 1 + - 2 files changed, 2 insertions(+), 1 deletion(-) - -diff --git a/Makefile.am b/Makefile.am -index c40c24b..2f4fa3e 100644 ---- a/Makefile.am -+++ b/Makefile.am -@@ -35,7 +35,7 @@ ACLOCAL_AMFLAGS = -I m4 - INCLUDE_DIRS = -I$(srcdir)/src -I$(srcdir)/lib - LIB_COMMON := lib/libcommon.a - --AM_CFLAGS := $(INCLUDE_DIRS) $(TPM20_TSS_CFLAGS) $(EXTRA_CFLAGS) $(TCTI_TABRMD_CFLAGS) $(CRYPTO_CFLAGS) -+AM_CFLAGS := $(INCLUDE_DIRS) $(GLIB_CFLAGS) $(TPM20_TSS_CFLAGS) $(EXTRA_CFLAGS) $(TCTI_TABRMD_CFLAGS) $(CRYPTO_CFLAGS) - AM_LDFLAGS := $(EXTRA_LDFLAGS) - - LDADD = $(LIB_COMMON) $(TPM20_TSS_LIBS) $(TCTI_SOCK_LIBS) $(TCTI_DEV_LIBS) $(TCTI_TABRMD_LIBS) $(CRYPTO_LIBS) -diff --git a/configure.ac b/configure.ac -index 8ef3b17..8db6922 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -6,6 +6,7 @@ LT_INIT - AM_INIT_AUTOMAKE([foreign - subdir-objects]) - AC_CONFIG_FILES([Makefile]) -+PKG_CHECK_MODULES([GLIB], [glib-2.0]) - PKG_CHECK_MODULES([SAPI],[sapi]) - # disable libtcti-device selectively (enabled by default) - AC_ARG_WITH( --- -2.7.5 - diff --git a/meta-tpm2/recipes-tpm/tpm2.0-tools/tpm2.0-tools/0001-tpm2-tools-use-dynamic-linkage-with-tpm2-abrmd.patch b/meta-tpm2/recipes-tpm/tpm2.0-tools/tpm2.0-tools/0001-tpm2-tools-use-dynamic-linkage-with-tpm2-abrmd.patch new file mode 100644 index 0000000..0333089 --- /dev/null +++ b/meta-tpm2/recipes-tpm/tpm2.0-tools/tpm2.0-tools/0001-tpm2-tools-use-dynamic-linkage-with-tpm2-abrmd.patch @@ -0,0 +1,63 @@ +From 1c29c5206be61edb9ebb165f5e4ae2f5eceb5608 Mon Sep 17 00:00:00 2001 +From: Jia Zhang +Date: Fri, 16 Feb 2018 20:31:58 -0500 +Subject: [PATCH] tpm2-tools: use dynamic linkage with tpm2-abrmd + +tpm2-abrmd has huge dependencies and they are not necessary to be involved +in initramfs. + +Signed-off-by: Jia Zhang +--- + lib/tcti/tpm2_tools_tcti_abrmd.c | 21 +++++++++++++++++++-- + 1 file changed, 19 insertions(+), 2 deletions(-) + +diff --git a/lib/tcti/tpm2_tools_tcti_abrmd.c b/lib/tcti/tpm2_tools_tcti_abrmd.c +index 5e50288..48e0df6 100644 +--- a/lib/tcti/tpm2_tools_tcti_abrmd.c ++++ b/lib/tcti/tpm2_tools_tcti_abrmd.c +@@ -30,6 +30,7 @@ + //**********************************************************************; + #include + #include ++#include + #include + + #include +@@ -42,8 +43,24 @@ TSS2_TCTI_CONTEXT *tpm2_tools_tcti_abrmd_init(char *opts) { + + UNUSED(opts); + ++ /* ++ * Intend to "forget" the handle in order to make sure libtcti-tabrmd ++ * is unloaded along with the deconstructed functions. ++ */ ++ void *tabrmd_handle; ++ tabrmd_handle = dlopen("libtcti-tabrmd.so.0", RTLD_LAZY); ++ if (!tabrmd_handle) { ++ LOG_ERR ("Unable to find out the tabrmd tcti library"); ++ return NULL; ++ } ++ ++ TSS2_RC (*init)(TSS2_TCTI_CONTEXT *, size_t *); ++ init = dlsym(tabrmd_handle, "tss2_tcti_tabrmd_init"); ++ if (!init) ++ return NULL; ++ + size_t size; +- TSS2_RC rc = tss2_tcti_tabrmd_init(NULL, &size); ++ TSS2_RC rc = init(NULL, &size); + if (rc != TSS2_RC_SUCCESS) { + LOG_ERR("Failed to get size for TABRMD TCTI context: 0x%" PRIx32, rc); + return NULL; +@@ -55,7 +72,7 @@ TSS2_TCTI_CONTEXT *tpm2_tools_tcti_abrmd_init(char *opts) { + return NULL; + } + +- rc = tss2_tcti_tabrmd_init(tcti_ctx, &size); ++ rc = init(tcti_ctx, &size); + if (rc != TSS2_RC_SUCCESS) { + LOG_ERR ("Failed to initialize TABRMD TCTI context: 0x%" PRIx32, rc); + free(tcti_ctx); +-- +2.14.1 + diff --git a/meta-tpm2/recipes-tpm/tpm2.0-tools/tpm2.0-tools/0002-tpm2-tools-use-dynamic-linkage-with-tpm2-abrmd.patch b/meta-tpm2/recipes-tpm/tpm2.0-tools/tpm2.0-tools/0002-tpm2-tools-use-dynamic-linkage-with-tpm2-abrmd.patch deleted file mode 100644 index 994a25a..0000000 --- a/meta-tpm2/recipes-tpm/tpm2.0-tools/tpm2.0-tools/0002-tpm2-tools-use-dynamic-linkage-with-tpm2-abrmd.patch +++ /dev/null @@ -1,65 +0,0 @@ -From b328bb108cc926274ca20cc722d8d8ad91f19d60 Mon Sep 17 00:00:00 2001 -From: Lans Zhang -Date: Thu, 20 Jul 2017 15:19:51 +0800 -Subject: [PATCH] tpm2-tools: use dynamic linkage with tpm2-abrmd - -tpm2-abrmd has huge dependencies and they are not necessary to be involved -in initramfs. - -Signed-off-by: Lans Zhang ---- - lib/context-util.c | 21 +++++++++++++++++++-- - 1 file changed, 19 insertions(+), 2 deletions(-) - -diff --git a/lib/context-util.c b/lib/context-util.c -index 7de22ac..9814548 100644 ---- a/lib/context-util.c -+++ b/lib/context-util.c -@@ -38,6 +38,7 @@ - #include - #endif - #ifdef HAVE_TCTI_TABRMD -+#include - #include - #endif - -@@ -134,10 +135,26 @@ TSS2_TCTI_CONTEXT* - tcti_tabrmd_init (void) - { - TSS2_TCTI_CONTEXT *tcti_ctx; -+ TSS2_RC (*init)(TSS2_TCTI_CONTEXT *, size_t *); -+ /* -+ * Intend to "forget" the handle in order to make sure libtcti-tabrmd -+ * is unloaded along with the deconstructed functions. -+ */ -+ void *tabrmd_handle; - TSS2_RC rc; - size_t size; - -- rc = tss2_tcti_tabrmd_init(NULL, &size); -+ tabrmd_handle = dlopen("libtcti-tabrmd.so.0", RTLD_LAZY); -+ if (!tabrmd_handle) { -+ LOG_ERR ("Unable to find out the tabrmd tcti library"); -+ return NULL; -+ } -+ -+ init = dlsym(tabrmd_handle, "tss2_tcti_tabrmd_init"); -+ if (!init) -+ return NULL; -+ -+ rc = init(NULL, &size); - if (rc != TSS2_RC_SUCCESS) { - LOG_ERR ("Failed to get size for TABRMD TCTI context: 0x%" PRIx32, rc); - return NULL; -@@ -148,7 +165,7 @@ tcti_tabrmd_init (void) - strerror (errno)); - return NULL; - } -- rc = tss2_tcti_tabrmd_init (tcti_ctx, &size); -+ rc = init (tcti_ctx, &size); - if (rc != TSS2_RC_SUCCESS) { - LOG_ERR ("Failed to initialize TABRMD TCTI context: 0x%" PRIx32, rc); - free (tcti_ctx); --- -2.7.5 - diff --git a/meta-tpm2/recipes-tpm/tpm2.0-tools/tpm2.0-tools_git.bb b/meta-tpm2/recipes-tpm/tpm2.0-tools/tpm2.0-tools_git.bb index 55fb596..e832214 100644 --- a/meta-tpm2/recipes-tpm/tpm2.0-tools/tpm2.0-tools_git.bb +++ b/meta-tpm2/recipes-tpm/tpm2.0-tools/tpm2.0-tools_git.bb @@ -7,14 +7,13 @@ LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=91b7c548d73ea16537799e8060cea819" DEPENDS += "tpm2.0-tss tpm2-abrmd openssl curl autoconf-archive pkgconfig" -PV = "2.1.0+git${SRCPV}" +PV = "3.0.3+git${SRCPV}" SRC_URI = "\ - git://github.com/01org/tpm2.0-tools.git \ - file://0001-Fix-build-failure-with-glib-2.0.patch \ - file://0002-tpm2-tools-use-dynamic-linkage-with-tpm2-abrmd.patch \ + git://github.com/tpm2-software/tpm2-tools.git;branch=3.X \ + file://0001-tpm2-tools-use-dynamic-linkage-with-tpm2-abrmd.patch \ " -SRCREV = "97306d6dc1fc5f3142c50efe3189bd46ff35b5a0" +SRCREV = "6b4385f098bd5d39e1cfc6cd2b038b68c960413f" S = "${WORKDIR}/git" diff --git a/meta-tpm2/recipes-tpm/tpm2.0-tss/tpm2.0-tss_git.bb b/meta-tpm2/recipes-tpm/tpm2.0-tss/tpm2.0-tss_git.bb index cbd09c0..37b2ab6 100644 --- a/meta-tpm2/recipes-tpm/tpm2.0-tss/tpm2.0-tss_git.bb +++ b/meta-tpm2/recipes-tpm/tpm2.0-tss/tpm2.0-tss_git.bb @@ -7,12 +7,12 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=500b2e742befc3da00684d8a1d5fd9da" DEPENDS += "autoconf-archive pkgconfig" -PV = "1.1.0+git${SRCPV}" +PV = "1.3.0+git${SRCPV}" SRC_URI = "\ - git://github.com/01org/TPM2.0-TSS.git \ + git://github.com/tpm2-software/tpm2-tss.git;branch=1.x \ " -SRCREV = "3fb91634e61c97a0ae732bc5c298b188c23376cf" +SRCREV = "b1d9ece8c6bea2e3043943b2edfaebcdca330c38" S = "${WORKDIR}/git" @@ -39,9 +39,6 @@ PACKAGES = "\ libtctisocket \ libtctisocket-dev \ libtctisocket-staticdev \ - libmarshal \ - libmarshal-dev \ - libmarshal-staticdev \ " FILES_libtss2 = "${libdir}/libsapi.so.*" @@ -78,15 +75,6 @@ FILES_libtctisocket-staticdev = "\ ${libdir}/libtcti-socket.a \ ${libdir}/libtcti-socket.la \ " -FILES_libmarshal = "${libdir}/libmarshal.so.*" -FILES_libmarshal-dev = "${libdir}/libmarshal.so" -FILES_libmarshal-staticdev = "\ - ${libdir}/libmarshal.a \ - ${libdir}/libmarshal.la \ -" - -RDEPENDS_libtss2 += "libmarshal" -RDEPENDS_libtctidevice += "libmarshal" RRECOMMENDS_${PN} += "\ kernel-module-tpm-crb \ -- cgit v1.2.3-54-g00ecf