summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Bar-Lev <alonbl@gentoo.org>2016-12-06 09:55:34 +0200
committerAlon Bar-Lev <alonbl@gentoo.org>2016-12-06 09:55:50 +0200
commitc36af760171e28c16a6c386b0fdebe81b68555a4 (patch)
tree53f080ff10fd6f7a7682a2709f6d118bfc0ba36b /app-crypt
parentmedia-gfx/darktable: version bump (diff)
downloadgentoo-c36af760171e28c16a6c386b0fdebe81b68555a4.tar.gz
gentoo-c36af760171e28c16a6c386b0fdebe81b68555a4.tar.bz2
gentoo-c36af760171e28c16a6c386b0fdebe81b68555a4.zip
app-crypt/tpm-tools: hopefully better gold support
Bug: 601776 Package-Manager: portage-2.3.0
Diffstat (limited to 'app-crypt')
-rw-r--r--app-crypt/tpm-tools/files/tpm-tools-1.3.9-gold.patch98
1 files changed, 96 insertions, 2 deletions
diff --git a/app-crypt/tpm-tools/files/tpm-tools-1.3.9-gold.patch b/app-crypt/tpm-tools/files/tpm-tools-1.3.9-gold.patch
index 1745c690e570..8f999a8486c0 100644
--- a/app-crypt/tpm-tools/files/tpm-tools-1.3.9-gold.patch
+++ b/app-crypt/tpm-tools/files/tpm-tools-1.3.9-gold.patch
@@ -1,5 +1,57 @@
+From 4cf41d367e3248fecee7620501d12449c374c055 Mon Sep 17 00:00:00 2001
+From: Alon Bar-Lev <alon.barlev@gmail.com>
+Date: Tue, 6 Dec 2016 09:38:06 +0200
+Subject: [PATCH] build: -lcrypto is required for tspi
+
+Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
+---
+ configure.ac | 13 +++++++++----
+ lib/Makefile.am | 2 +-
+ src/cmds/Makefile.am | 2 +-
+ src/data_mgmt/Makefile.am | 2 +-
+ src/tpm_mgmt/Makefile.am | 2 +-
+ 5 files changed, 13 insertions(+), 8 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 279954a..99f9c4b 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -90,14 +90,22 @@ AC_ARG_WITH(openssl,
+ AC_MSG_ERROR([$OPENSSL_INCLUDE_DIR or $OPENSSL_LIB_DIR doen't exist!])
+ else
+ AC_MSG_RESULT([yes])
+- CFLAGS="$CFLAGS -L$OPENSSL_LIB_DIR -I$OPENSSL_INCLUDE_DIR"
++ CFLAGS="$CFLAGS -I$OPENSSL_INCLUDE_DIR"
++ LDFLAGS="$LDFLAGS -L$OPENSSL_LIB_DIR"
+ AC_SUBST([OPENSSL_LIB_DIR])
+ fi],
+ [AC_MSG_RESULT([no])
+ AC_SUBST([OPENSSL_LIB_DIR], []) ] )
+
++AC_CHECK_LIB(crypto, PEM_read_X509, [OPENSSL_LIB="1"], [AC_MSG_ERROR([openssl lib not found: libcrypto.so])])
++AC_CHECK_HEADER(openssl/evp.h, [OPENSSL_INC="1"], [AC_MSG_ERROR([openssl header not found: openssl/evp.h])])
++
++OLD_LIBS="$LIBS"
++LIBS="$LIBS -lcrypto"
+ AC_CHECK_LIB(tspi, Tspi_Context_Create, [TSS_LIB="1"], [AC_MSG_ERROR([tss lib not found: libtspi.so])])
+ AC_CHECK_LIB(tspi, Tspi_TPM_SetOperatorAuth, [TSS_12="1"], [TSS_12="0"])
++AC_SUBST([TSPI_LIBS], ["-ltspi -lcrypto"])
++LIBS="$OLD_LIBS"
+ if test "$TSS_12" = "1"; then
+ AM_CONDITIONAL(TSS_LIB_IS_12, true)
+ AC_MSG_NOTICE([Configuring tpm-tools for TSS 1.2])
+@@ -107,9 +115,6 @@ else
+ fi
+ AC_CHECK_HEADER(trousers/tss.h, [TSS_INC="1"], [AC_MSG_ERROR([tss header not found: trousers/tss.h])])
+
+-AC_CHECK_LIB(crypto, PEM_read_X509, [OPENSSL_LIB="1"], [AC_MSG_ERROR([openssl lib not found: libcrypto.so])])
+-AC_CHECK_HEADER(openssl/evp.h, [OPENSSL_INC="1"], [AC_MSG_ERROR([openssl header not found: openssl/evp.h])])
+-
+ OPENCRYPTOKI="0"
+ AC_ARG_ENABLE(pkcs11_support,
+ AC_HELP_STRING([--disable-pkcs11-support], [don't build data_mgmt commands [[default=no]]]),
diff --git a/lib/Makefile.am b/lib/Makefile.am
-index cef6a2f..d7092a7 100644
+index c1d7009..af9bc49 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -80,4 +80,4 @@ endif
@@ -7,4 +59,46 @@ index cef6a2f..d7092a7 100644
libtpm_unseal_la_SOURCES = tpm_unseal.c
libtpm_unseal_la_LDFLAGS = -shared -version-info 1:0:0
-libtpm_unseal_la_LIBADD = -ltspi libtpm_tspi.la @INTLLIBS@
-+libtpm_unseal_la_LIBADD = -ltspi libtpm_tspi.la -lcrypto @INTLLIBS@
++libtpm_unseal_la_LIBADD = libtpm_tspi.la -lcrypto @TSPI_LIBS@ @INTLLIBS@
+diff --git a/src/cmds/Makefile.am b/src/cmds/Makefile.am
+index 27fc9ef..d7508bf 100644
+--- a/src/cmds/Makefile.am
++++ b/src/cmds/Makefile.am
+@@ -30,7 +30,7 @@ else
+ AM_CPPFLAGS = -I$(top_srcdir)/include -D_LINUX
+ endif
+
+-LDADD = $(top_builddir)/lib/libtpm_tspi.la -ltspi $(top_builddir)/lib/libtpm_unseal.la -ltpm_unseal -lcrypto @INTLLIBS@
++LDADD = $(top_builddir)/lib/libtpm_tspi.la $(top_builddir)/lib/libtpm_unseal.la -ltpm_unseal -lcrypto @TSPI_LIBS@ @INTLLIBS@
+
+ tpm_sealdata_SOURCES = tpm_sealdata.c
+ tpm_unsealdata_SOURCES = tpm_unsealdata.c
+diff --git a/src/data_mgmt/Makefile.am b/src/data_mgmt/Makefile.am
+index de505e4..765a2fa 100644
+--- a/src/data_mgmt/Makefile.am
++++ b/src/data_mgmt/Makefile.am
+@@ -38,7 +38,7 @@ noinst_HEADERS = data_common.h \
+ # Common build flags
+ AM_CPPFLAGS = -I$(top_srcdir)/include -D_LINUX
+
+-LDADD = $(top_builddir)/lib/libtpm_pkcs11.la -ltspi -ldl @INTLLIBS@
++LDADD = $(top_builddir)/lib/libtpm_pkcs11.la @TSPI_LIBS@ -ldl @INTLLIBS@
+
+
+ #
+diff --git a/src/tpm_mgmt/Makefile.am b/src/tpm_mgmt/Makefile.am
+index 7ca47c9..6205b64 100644
+--- a/src/tpm_mgmt/Makefile.am
++++ b/src/tpm_mgmt/Makefile.am
+@@ -55,7 +55,7 @@ else
+ AM_CPPFLAGS = -I$(top_srcdir)/include -D_LINUX
+ endif
+
+-LDADD = $(top_builddir)/lib/libtpm_tspi.la -ltspi @INTLLIBS@
++LDADD = $(top_builddir)/lib/libtpm_tspi.la @TSPI_LIBS@ @INTLLIBS@
+
+ tpm_startup_SOURCES = tpm_startup.c
+ tpm_reset_SOURCES = tpm_reset.c
+--
+2.7.3
+