diff options
author | Jia Zhang <zhang.jia@linux.alibaba.com> | 2018-02-19 04:39:19 -0500 |
---|---|---|
committer | Jia Zhang <zhang.jia@linux.alibaba.com> | 2018-02-19 04:39:19 -0500 |
commit | 365a400ed9934977aa11a98cf8936d73a1bbd5ce (patch) | |
tree | 3a5493e4c15c73c344c5952034b52bd8278dd7f3 | |
parent | cf8ae9e69b50fb960fe82c7fccf8395270c904e1 (diff) | |
download | meta-secure-core-365a400ed9934977aa11a98cf8936d73a1bbd5ce.tar.gz |
meta-secure-core: update TSS 2.0 to the latest stable version
Signed-off-by: Jia Zhang <zhang.jia@linux.alibaba.com>
7 files changed, 80 insertions, 130 deletions
diff --git a/meta-encrypted-storage/recipes-tpm/cryptfs-tpm2/cryptfs-tpm2_git.bb b/meta-encrypted-storage/recipes-tpm/cryptfs-tpm2/cryptfs-tpm2_git.bb index 217cf65..43e87e4 100644 --- a/meta-encrypted-storage/recipes-tpm/cryptfs-tpm2/cryptfs-tpm2_git.bb +++ b/meta-encrypted-storage/recipes-tpm/cryptfs-tpm2/cryptfs-tpm2_git.bb | |||
@@ -17,12 +17,12 @@ LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=89c8ce1346a3dfe75379e84f3ba9d641" | |||
17 | 17 | ||
18 | DEPENDS += "tpm2.0-tss tpm2-abrmd pkgconfig-native" | 18 | DEPENDS += "tpm2.0-tss tpm2-abrmd pkgconfig-native" |
19 | 19 | ||
20 | PV = "0.6.0+git${SRCPV}" | 20 | PV = "0.6.2+git${SRCPV}" |
21 | 21 | ||
22 | SRC_URI = "\ | 22 | SRC_URI = "\ |
23 | git://github.com/WindRiver-OpenSourceLabs/cryptfs-tpm2.git \ | 23 | git://github.com/WindRiver-OpenSourceLabs/cryptfs-tpm2.git \ |
24 | " | 24 | " |
25 | SRCREV = "cf736b0fe06e8ce46232e9bc6f24817405f902b9" | 25 | SRCREV = "1a1fe2bd67b5c4a3ec0ad5dd6dbb168df38144a4" |
26 | 26 | ||
27 | S = "${WORKDIR}/git" | 27 | S = "${WORKDIR}/git" |
28 | 28 | ||
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" | |||
11 | 11 | ||
12 | DEPENDS += "autoconf-archive dbus glib-2.0 pkgconfig tpm2.0-tss glib-2.0-native" | 12 | DEPENDS += "autoconf-archive dbus glib-2.0 pkgconfig tpm2.0-tss glib-2.0-native" |
13 | 13 | ||
14 | PV = "1.1.0+git${SRCPV}" | 14 | PV = "1.2.0+git${SRCPV}" |
15 | 15 | ||
16 | SRC_URI = "\ | 16 | SRC_URI = "\ |
17 | git://github.com/01org/tpm2-abrmd.git \ | 17 | git://github.com/tpm2-software/tpm2-abrmd \ |
18 | file://tpm2-abrmd-init.sh \ | 18 | file://tpm2-abrmd-init.sh \ |
19 | file://tpm2-abrmd.default \ | 19 | file://tpm2-abrmd.default \ |
20 | " | 20 | " |
21 | SRCREV = "1003fcfaad39f5c27f75deb678f4fba253f38a82" | 21 | SRCREV = "59ce1008e5fa3bd5a143437b0f7390851fd25bd8" |
22 | 22 | ||
23 | S = "${WORKDIR}/git" | 23 | S = "${WORKDIR}/git" |
24 | 24 | ||
@@ -60,8 +60,12 @@ do_install_append() { | |||
60 | install -m 0644 "${WORKDIR}/tpm2-abrmd.default" "${D}${sysconfdir}/default/tpm2-abrmd" | 60 | install -m 0644 "${WORKDIR}/tpm2-abrmd.default" "${D}${sysconfdir}/default/tpm2-abrmd" |
61 | } | 61 | } |
62 | 62 | ||
63 | FILES_${PN} += "\ | ||
64 | ${libdir}/systemd \ | ||
65 | " | ||
66 | |||
63 | RDEPENDS_${PN} += "\ | 67 | RDEPENDS_${PN} += "\ |
64 | libgcc dbus-glib libtss2 libtctidevice libtctisocket libmarshal \ | 68 | libgcc dbus-glib libtss2 libtctidevice libtctisocket \ |
65 | " | 69 | " |
66 | 70 | ||
67 | BBCLASSEXTEND = "native" | 71 | 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 @@ | |||
1 | From 1f8d526bad6a0317bde32a0278fbabe2492e7c62 Mon Sep 17 00:00:00 2001 | ||
2 | From: Lans Zhang <jia.zhang@windriver.com> | ||
3 | Date: Thu, 20 Jul 2017 14:51:34 +0800 | ||
4 | Subject: [PATCH] Fix build failure with glib-2.0 | ||
5 | |||
6 | Signed-off-by: Lans Zhang <jia.zhang@windriver.com> | ||
7 | --- | ||
8 | Makefile.am | 2 +- | ||
9 | configure.ac | 1 + | ||
10 | 2 files changed, 2 insertions(+), 1 deletion(-) | ||
11 | |||
12 | diff --git a/Makefile.am b/Makefile.am | ||
13 | index c40c24b..2f4fa3e 100644 | ||
14 | --- a/Makefile.am | ||
15 | +++ b/Makefile.am | ||
16 | @@ -35,7 +35,7 @@ ACLOCAL_AMFLAGS = -I m4 | ||
17 | INCLUDE_DIRS = -I$(srcdir)/src -I$(srcdir)/lib | ||
18 | LIB_COMMON := lib/libcommon.a | ||
19 | |||
20 | -AM_CFLAGS := $(INCLUDE_DIRS) $(TPM20_TSS_CFLAGS) $(EXTRA_CFLAGS) $(TCTI_TABRMD_CFLAGS) $(CRYPTO_CFLAGS) | ||
21 | +AM_CFLAGS := $(INCLUDE_DIRS) $(GLIB_CFLAGS) $(TPM20_TSS_CFLAGS) $(EXTRA_CFLAGS) $(TCTI_TABRMD_CFLAGS) $(CRYPTO_CFLAGS) | ||
22 | AM_LDFLAGS := $(EXTRA_LDFLAGS) | ||
23 | |||
24 | LDADD = $(LIB_COMMON) $(TPM20_TSS_LIBS) $(TCTI_SOCK_LIBS) $(TCTI_DEV_LIBS) $(TCTI_TABRMD_LIBS) $(CRYPTO_LIBS) | ||
25 | diff --git a/configure.ac b/configure.ac | ||
26 | index 8ef3b17..8db6922 100644 | ||
27 | --- a/configure.ac | ||
28 | +++ b/configure.ac | ||
29 | @@ -6,6 +6,7 @@ LT_INIT | ||
30 | AM_INIT_AUTOMAKE([foreign | ||
31 | subdir-objects]) | ||
32 | AC_CONFIG_FILES([Makefile]) | ||
33 | +PKG_CHECK_MODULES([GLIB], [glib-2.0]) | ||
34 | PKG_CHECK_MODULES([SAPI],[sapi]) | ||
35 | # disable libtcti-device selectively (enabled by default) | ||
36 | AC_ARG_WITH( | ||
37 | -- | ||
38 | 2.7.5 | ||
39 | |||
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 @@ | |||
1 | From 1c29c5206be61edb9ebb165f5e4ae2f5eceb5608 Mon Sep 17 00:00:00 2001 | ||
2 | From: Jia Zhang <zhang.jia@linux.alibaba.com> | ||
3 | Date: Fri, 16 Feb 2018 20:31:58 -0500 | ||
4 | Subject: [PATCH] tpm2-tools: use dynamic linkage with tpm2-abrmd | ||
5 | |||
6 | tpm2-abrmd has huge dependencies and they are not necessary to be involved | ||
7 | in initramfs. | ||
8 | |||
9 | Signed-off-by: Jia Zhang <zhang.jia@linux.alibaba.com> | ||
10 | --- | ||
11 | lib/tcti/tpm2_tools_tcti_abrmd.c | 21 +++++++++++++++++++-- | ||
12 | 1 file changed, 19 insertions(+), 2 deletions(-) | ||
13 | |||
14 | diff --git a/lib/tcti/tpm2_tools_tcti_abrmd.c b/lib/tcti/tpm2_tools_tcti_abrmd.c | ||
15 | index 5e50288..48e0df6 100644 | ||
16 | --- a/lib/tcti/tpm2_tools_tcti_abrmd.c | ||
17 | +++ b/lib/tcti/tpm2_tools_tcti_abrmd.c | ||
18 | @@ -30,6 +30,7 @@ | ||
19 | //**********************************************************************; | ||
20 | #include <inttypes.h> | ||
21 | #include <stdlib.h> | ||
22 | +#include <dlfcn.h> | ||
23 | #include <tcti/tcti-tabrmd.h> | ||
24 | |||
25 | #include <sapi/tpm20.h> | ||
26 | @@ -42,8 +43,24 @@ TSS2_TCTI_CONTEXT *tpm2_tools_tcti_abrmd_init(char *opts) { | ||
27 | |||
28 | UNUSED(opts); | ||
29 | |||
30 | + /* | ||
31 | + * Intend to "forget" the handle in order to make sure libtcti-tabrmd | ||
32 | + * is unloaded along with the deconstructed functions. | ||
33 | + */ | ||
34 | + void *tabrmd_handle; | ||
35 | + tabrmd_handle = dlopen("libtcti-tabrmd.so.0", RTLD_LAZY); | ||
36 | + if (!tabrmd_handle) { | ||
37 | + LOG_ERR ("Unable to find out the tabrmd tcti library"); | ||
38 | + return NULL; | ||
39 | + } | ||
40 | + | ||
41 | + TSS2_RC (*init)(TSS2_TCTI_CONTEXT *, size_t *); | ||
42 | + init = dlsym(tabrmd_handle, "tss2_tcti_tabrmd_init"); | ||
43 | + if (!init) | ||
44 | + return NULL; | ||
45 | + | ||
46 | size_t size; | ||
47 | - TSS2_RC rc = tss2_tcti_tabrmd_init(NULL, &size); | ||
48 | + TSS2_RC rc = init(NULL, &size); | ||
49 | if (rc != TSS2_RC_SUCCESS) { | ||
50 | LOG_ERR("Failed to get size for TABRMD TCTI context: 0x%" PRIx32, rc); | ||
51 | return NULL; | ||
52 | @@ -55,7 +72,7 @@ TSS2_TCTI_CONTEXT *tpm2_tools_tcti_abrmd_init(char *opts) { | ||
53 | return NULL; | ||
54 | } | ||
55 | |||
56 | - rc = tss2_tcti_tabrmd_init(tcti_ctx, &size); | ||
57 | + rc = init(tcti_ctx, &size); | ||
58 | if (rc != TSS2_RC_SUCCESS) { | ||
59 | LOG_ERR ("Failed to initialize TABRMD TCTI context: 0x%" PRIx32, rc); | ||
60 | free(tcti_ctx); | ||
61 | -- | ||
62 | 2.14.1 | ||
63 | |||
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 @@ | |||
1 | From b328bb108cc926274ca20cc722d8d8ad91f19d60 Mon Sep 17 00:00:00 2001 | ||
2 | From: Lans Zhang <jia.zhang@windriver.com> | ||
3 | Date: Thu, 20 Jul 2017 15:19:51 +0800 | ||
4 | Subject: [PATCH] tpm2-tools: use dynamic linkage with tpm2-abrmd | ||
5 | |||
6 | tpm2-abrmd has huge dependencies and they are not necessary to be involved | ||
7 | in initramfs. | ||
8 | |||
9 | Signed-off-by: Lans Zhang <jia.zhang@windriver.com> | ||
10 | --- | ||
11 | lib/context-util.c | 21 +++++++++++++++++++-- | ||
12 | 1 file changed, 19 insertions(+), 2 deletions(-) | ||
13 | |||
14 | diff --git a/lib/context-util.c b/lib/context-util.c | ||
15 | index 7de22ac..9814548 100644 | ||
16 | --- a/lib/context-util.c | ||
17 | +++ b/lib/context-util.c | ||
18 | @@ -38,6 +38,7 @@ | ||
19 | #include <tcti/tcti_socket.h> | ||
20 | #endif | ||
21 | #ifdef HAVE_TCTI_TABRMD | ||
22 | +#include <dlfcn.h> | ||
23 | #include <tcti/tcti-tabrmd.h> | ||
24 | #endif | ||
25 | |||
26 | @@ -134,10 +135,26 @@ TSS2_TCTI_CONTEXT* | ||
27 | tcti_tabrmd_init (void) | ||
28 | { | ||
29 | TSS2_TCTI_CONTEXT *tcti_ctx; | ||
30 | + TSS2_RC (*init)(TSS2_TCTI_CONTEXT *, size_t *); | ||
31 | + /* | ||
32 | + * Intend to "forget" the handle in order to make sure libtcti-tabrmd | ||
33 | + * is unloaded along with the deconstructed functions. | ||
34 | + */ | ||
35 | + void *tabrmd_handle; | ||
36 | TSS2_RC rc; | ||
37 | size_t size; | ||
38 | |||
39 | - rc = tss2_tcti_tabrmd_init(NULL, &size); | ||
40 | + tabrmd_handle = dlopen("libtcti-tabrmd.so.0", RTLD_LAZY); | ||
41 | + if (!tabrmd_handle) { | ||
42 | + LOG_ERR ("Unable to find out the tabrmd tcti library"); | ||
43 | + return NULL; | ||
44 | + } | ||
45 | + | ||
46 | + init = dlsym(tabrmd_handle, "tss2_tcti_tabrmd_init"); | ||
47 | + if (!init) | ||
48 | + return NULL; | ||
49 | + | ||
50 | + rc = init(NULL, &size); | ||
51 | if (rc != TSS2_RC_SUCCESS) { | ||
52 | LOG_ERR ("Failed to get size for TABRMD TCTI context: 0x%" PRIx32, rc); | ||
53 | return NULL; | ||
54 | @@ -148,7 +165,7 @@ tcti_tabrmd_init (void) | ||
55 | strerror (errno)); | ||
56 | return NULL; | ||
57 | } | ||
58 | - rc = tss2_tcti_tabrmd_init (tcti_ctx, &size); | ||
59 | + rc = init (tcti_ctx, &size); | ||
60 | if (rc != TSS2_RC_SUCCESS) { | ||
61 | LOG_ERR ("Failed to initialize TABRMD TCTI context: 0x%" PRIx32, rc); | ||
62 | free (tcti_ctx); | ||
63 | -- | ||
64 | 2.7.5 | ||
65 | |||
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" | |||
7 | 7 | ||
8 | DEPENDS += "tpm2.0-tss tpm2-abrmd openssl curl autoconf-archive pkgconfig" | 8 | DEPENDS += "tpm2.0-tss tpm2-abrmd openssl curl autoconf-archive pkgconfig" |
9 | 9 | ||
10 | PV = "2.1.0+git${SRCPV}" | 10 | PV = "3.0.3+git${SRCPV}" |
11 | 11 | ||
12 | SRC_URI = "\ | 12 | SRC_URI = "\ |
13 | git://github.com/01org/tpm2.0-tools.git \ | 13 | git://github.com/tpm2-software/tpm2-tools.git;branch=3.X \ |
14 | file://0001-Fix-build-failure-with-glib-2.0.patch \ | 14 | file://0001-tpm2-tools-use-dynamic-linkage-with-tpm2-abrmd.patch \ |
15 | file://0002-tpm2-tools-use-dynamic-linkage-with-tpm2-abrmd.patch \ | ||
16 | " | 15 | " |
17 | SRCREV = "97306d6dc1fc5f3142c50efe3189bd46ff35b5a0" | 16 | SRCREV = "6b4385f098bd5d39e1cfc6cd2b038b68c960413f" |
18 | 17 | ||
19 | S = "${WORKDIR}/git" | 18 | S = "${WORKDIR}/git" |
20 | 19 | ||
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" | |||
7 | 7 | ||
8 | DEPENDS += "autoconf-archive pkgconfig" | 8 | DEPENDS += "autoconf-archive pkgconfig" |
9 | 9 | ||
10 | PV = "1.1.0+git${SRCPV}" | 10 | PV = "1.3.0+git${SRCPV}" |
11 | 11 | ||
12 | SRC_URI = "\ | 12 | SRC_URI = "\ |
13 | git://github.com/01org/TPM2.0-TSS.git \ | 13 | git://github.com/tpm2-software/tpm2-tss.git;branch=1.x \ |
14 | " | 14 | " |
15 | SRCREV = "3fb91634e61c97a0ae732bc5c298b188c23376cf" | 15 | SRCREV = "b1d9ece8c6bea2e3043943b2edfaebcdca330c38" |
16 | 16 | ||
17 | S = "${WORKDIR}/git" | 17 | S = "${WORKDIR}/git" |
18 | 18 | ||
@@ -39,9 +39,6 @@ PACKAGES = "\ | |||
39 | libtctisocket \ | 39 | libtctisocket \ |
40 | libtctisocket-dev \ | 40 | libtctisocket-dev \ |
41 | libtctisocket-staticdev \ | 41 | libtctisocket-staticdev \ |
42 | libmarshal \ | ||
43 | libmarshal-dev \ | ||
44 | libmarshal-staticdev \ | ||
45 | " | 42 | " |
46 | 43 | ||
47 | FILES_libtss2 = "${libdir}/libsapi.so.*" | 44 | FILES_libtss2 = "${libdir}/libsapi.so.*" |
@@ -78,15 +75,6 @@ FILES_libtctisocket-staticdev = "\ | |||
78 | ${libdir}/libtcti-socket.a \ | 75 | ${libdir}/libtcti-socket.a \ |
79 | ${libdir}/libtcti-socket.la \ | 76 | ${libdir}/libtcti-socket.la \ |
80 | " | 77 | " |
81 | FILES_libmarshal = "${libdir}/libmarshal.so.*" | ||
82 | FILES_libmarshal-dev = "${libdir}/libmarshal.so" | ||
83 | FILES_libmarshal-staticdev = "\ | ||
84 | ${libdir}/libmarshal.a \ | ||
85 | ${libdir}/libmarshal.la \ | ||
86 | " | ||
87 | |||
88 | RDEPENDS_libtss2 += "libmarshal" | ||
89 | RDEPENDS_libtctidevice += "libmarshal" | ||
90 | 78 | ||
91 | RRECOMMENDS_${PN} += "\ | 79 | RRECOMMENDS_${PN} += "\ |
92 | kernel-module-tpm-crb \ | 80 | kernel-module-tpm-crb \ |