From 3cf7c3ef441822c889356fd1812ebf2944a59851 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Tue, 25 Aug 2020 10:45:55 +0100 Subject: gentoo resync : 25.08.2020 --- app-crypt/swtpm/Manifest | 6 +- ...xplicitly-link-libswtpm_libtpms-with-lcry.patch | 49 +++++++++++++ ...se-AC_COMPILE_IFELSE-to-check-for-unused-.patch | 56 +++++++++++++++ app-crypt/swtpm/swtpm-0.3.1-r1.ebuild | 77 -------------------- app-crypt/swtpm/swtpm-0.3.2.ebuild | 82 ++++++++++++++++++++++ 5 files changed, 191 insertions(+), 79 deletions(-) create mode 100644 app-crypt/swtpm/files/swtpm-build-sys-Explicitly-link-libswtpm_libtpms-with-lcry.patch create mode 100644 app-crypt/swtpm/files/swtpm-build-sys-Use-AC_COMPILE_IFELSE-to-check-for-unused-.patch delete mode 100644 app-crypt/swtpm/swtpm-0.3.1-r1.ebuild create mode 100644 app-crypt/swtpm/swtpm-0.3.2.ebuild (limited to 'app-crypt/swtpm') diff --git a/app-crypt/swtpm/Manifest b/app-crypt/swtpm/Manifest index b67c4171ae7b..8c194d61c3e0 100644 --- a/app-crypt/swtpm/Manifest +++ b/app-crypt/swtpm/Manifest @@ -1,5 +1,7 @@ +AUX swtpm-build-sys-Explicitly-link-libswtpm_libtpms-with-lcry.patch 1680 BLAKE2B ef4b57c14ee6124fea5643cc868bbf1f5426990f58dd892309a223b828deedc62f100c13b2065a850f9053682bb58e61d877e62c05fe05abba905c9f98c74d2b SHA512 a59b45a2d7c99e439de64b042549f07fd2e12cc1330e68df72f2a77a55579b851ee321a3d95fc2595bb68090b63062cd82ccb161201a78031c96e473bcebc3f8 +AUX swtpm-build-sys-Use-AC_COMPILE_IFELSE-to-check-for-unused-.patch 1793 BLAKE2B ab67a59a2f40a31f72b25f1ea0fc27bfd908a25929b7e40224c91bc08949c31abb7fbcd1092f1f12c774dfa0bda8ce8f04bbca7785124dadd2839a971526b835 SHA512 068c83a69a13bfffbade03bfd45e032ecda014fee9bfe2462abed55c500f6f4fb98391a525350580c06e5d59bb560c6f96a945429624f30d2b0e593de54c86df AUX swtpm-disable-test-dependencies.patch 774 BLAKE2B 8089885d5b21cea09fb5ec59d69640754671ba27763d57bdb45345768722166d4cd5fa0d890542aa79a90c2b8e609f611ac4ccd58be71ec13128d81daccb50bd SHA512 d803222c8fb04a7909f8a60563dfd23327c842f12138309f3b901309651857d6c545ca8e46c68c9b60b97f0e03ab79575784e242409d41b3d69e6ad8516428e5 AUX swtpm-fix-localca-path.patch 1197 BLAKE2B fb94a734303e1c71158ffda2958275a377d9c75b98262061b06bb22d2dce6efd3b5d126758b65cbab8141a78549c4ab99d3aa2c241c4870de67f871706840b5d SHA512 c9a0e6ee27f0b38b65f2cad65a48622c3b9e9e8913bba002f0c82168f22162dbc62ed2b104942ed8141889625f225f29516ecbd20ba6ffb5091eb2201df0f107 -DIST swtpm-0.3.1.tar.gz 308576 BLAKE2B 96c44654b92d453d91594aed6fdd4cb56853973c1215bfb131e750d38a3ed1e64e3283647e54ad9ad84747406f53d7ac4f221fc5b319d7fa80bab758fed04062 SHA512 4b3e58048336ee82a87d17905a7d0dc5fbe13160ebb8f072b91410e782dae7fafc72e572a2f6aa2b1d9f4377074c01afd30505b9e71d92b8d7066365811d3e3f -EBUILD swtpm-0.3.1-r1.ebuild 1474 BLAKE2B dcabf7367cb4aacfceebe8c79465c211d29ab3e9ae8dd53407b2cd2ac5b7400397ff89093428f034b2976fc0a95eea192b60bc6ff6a58c583616e5fec5ddf44e SHA512 b50cd8257a7edf4e48a755d83b2e396b05fbefdcf0c0959defbc23e5c96a3458ccb5ed3b7052fc670f4a81a448d7d6690f4d588d5ceb73ee303802ab3af12dd2 +DIST swtpm-0.3.2.tar.gz 308843 BLAKE2B 501c600e36a437fc99f662f1c217169cab15b0d4ec4a4551a29dd83541c9718e182c7eb13a43e541da453fc28c48232354b617525e32d9721e697744eaa5a17a SHA512 5da668cd8091f0db70bec52cd8d26bacf7b18e4c27c83c1cba25e59c69bb2ba7a1d011d9bf4bafa44e1a49065538445eb56683806be6f1875cba383f8edb6a4f +EBUILD swtpm-0.3.2.ebuild 1641 BLAKE2B 08e229f1e6cdd4a17f9d92d02bbe4897f44bd0a5c0a4c38677cc4a7f84c513ced4d84c22d04ae496f92245b5907a02ff1eab9da7f5d598bffb5b4260e08a5602 SHA512 fcf43e868cd834c201b5bea591bae646e114fcbdcb77ebdb6f3477c71a48859bd11b2919937f73ba604b2d909440614744c0214325044e0c83cabf52dcc9ba1c MISC metadata.xml 457 BLAKE2B defc06c2642823aa760cafc22e90f891f9337358bfaa446778e1f4107f6e295ec21b5987f49bdcee3fd7b68084be1b864d7569e74bd729345e4886b08c617a06 SHA512 c80e24dc4ec41e5aae1e7fe67208c945e62c02f469164d0a76445269e3e0204674cd593956f99fa1539505e1a70a15bbf6c02afcf6b38592f04f3c4d3f275e08 diff --git a/app-crypt/swtpm/files/swtpm-build-sys-Explicitly-link-libswtpm_libtpms-with-lcry.patch b/app-crypt/swtpm/files/swtpm-build-sys-Explicitly-link-libswtpm_libtpms-with-lcry.patch new file mode 100644 index 000000000000..d4ad9cda0c2d --- /dev/null +++ b/app-crypt/swtpm/files/swtpm-build-sys-Explicitly-link-libswtpm_libtpms-with-lcry.patch @@ -0,0 +1,49 @@ +From d9bc718871810d18c70ba9d4e9ee23071bd6db36 Mon Sep 17 00:00:00 2001 +From: Stefan Berger +Date: Tue, 21 Jul 2020 18:39:07 -0400 +Subject: [PATCH 2/2] build-sys: Explicitly link libswtpm_libtpms with -lcrypto + (Gentoo) + +This patch fixes the following linker issue reported for Gentoo in +issue #280. + +ld.lld: error: /var/tmp/portage/app-crypt/swtpm-0.3.1-r1/work/swtpm-0.3.1/src/swtpm/.libs/libswtpm_libtpms.so: undefined reference to EVP_sha512 +ld.lld: error: /var/tmp/portage/app-crypt/swtpm-0.3.1-r1/work/swtpm-0.3.1/src/swtpm/.libs/libswtpm_libtpms.so: undefined reference to PKCS5_PBKDF2_HMAC +ld.lld: error: /var/tmp/portage/app-crypt/swtpm-0.3.1-r1/work/swtpm-0.3.1/src/swtpm/.libs/libswtpm_libtpms.so: undefined reference to SHA512 + +Signed-off-by: Stefan Berger +--- + configure.ac | 2 ++ + src/swtpm/Makefile.am | 3 ++- + 2 files changed, 4 insertions(+), 1 deletion(-) + +diff --git a/configure.ac b/configure.ac +index 56d3f09..7aaa201 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -150,6 +150,8 @@ openssl) + AC_CHECK_HEADERS([openssl/aes.h],[], + AC_MSG_ERROR(Is openssl-devel/libssl-dev installed?)) + AC_MSG_RESULT([Building with openssl crypto library]) ++ LIBCRYPTO_LIBS=$(pkg-config --libs libcrypto) ++ AC_SUBST([LIBCRYPTO_LIBS]) + ;; + esac + +diff --git a/src/swtpm/Makefile.am b/src/swtpm/Makefile.am +index dd2a63a..b5f15e3 100644 +--- a/src/swtpm/Makefile.am ++++ b/src/swtpm/Makefile.am +@@ -69,7 +69,8 @@ libswtpm_libtpms_la_LIBADD = \ + $(LIBTPMS_LIBS) \ + $(GLIB_LIBS) \ + $(LIBRT_LIBS) \ +- $(LIBSECCOMP_LIBS) ++ $(LIBSECCOMP_LIBS) \ ++ $(LIBCRYPTO_LIBS) + + bin_PROGRAMS = swtpm + if WITH_CUSE +-- +2.26.2 + diff --git a/app-crypt/swtpm/files/swtpm-build-sys-Use-AC_COMPILE_IFELSE-to-check-for-unused-.patch b/app-crypt/swtpm/files/swtpm-build-sys-Use-AC_COMPILE_IFELSE-to-check-for-unused-.patch new file mode 100644 index 000000000000..582199708057 --- /dev/null +++ b/app-crypt/swtpm/files/swtpm-build-sys-Use-AC_COMPILE_IFELSE-to-check-for-unused-.patch @@ -0,0 +1,56 @@ +From b6d16129a525f572ef37d20ba1cd70d59ca4f079 Mon Sep 17 00:00:00 2001 +From: Stefan Berger +Date: Tue, 21 Jul 2020 17:38:10 -0400 +Subject: [PATCH 1/2] build-sys: Use AC_COMPILE_IFELSE to check for unused + linker flags (clang) + +This patch fixes a clang issue report in issue #280. + +clang does not use ld, so we cannot grep for support of certain linker +flags but have to test-compile. + +Signed-off-by: Stefan Berger +--- + configure.ac | 26 +++++++++++++++++++------- + 1 file changed, 19 insertions(+), 7 deletions(-) + +diff --git a/configure.ac b/configure.ac +index b4d4258..56d3f09 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -357,13 +357,25 @@ if test "x$enable_hardening" != "xno"; then + if test -z "$TMP1" && test -n "$TPM2"; then + HARDENING_CFLAGS="$HARDENING_CFLAGS -D_FORTIFY_SOURCE=2 " + fi +- dnl Check ld for 'relro' and 'now' +- if $LD --help 2>&1 | $GREP '\-z relro ' > /dev/null; then +- HARDENING_CFLAGS="$HARDENING_CFLAGS -Wl,-z,relro " +- fi +- if $LD --help 2>&1 | $GREP '\-z now ' > /dev/null; then +- HARDENING_CFLAGS="$HARDENING_CFLAGS -Wl,-z,now " +- fi ++ dnl Check linker for 'relro' and 'now' ++ save_CFLAGS="$CFLAGS" ++ CFLAGS="-Wl,-z,relro -Werror" ++ AC_MSG_CHECKING([whether linker supports -Wl,-z,relro]) ++ AC_COMPILE_IFELSE( ++ [AC_LANG_SOURCE([[int main() { return 0; }]])], ++ [HARDENING_CFLAGS="$HARDENING_CFLAGS -Wl,-z,relro" ++ AC_MSG_RESULT(yes)], ++ [AC_MSG_RESULT(no)] ++ ) ++ CFLAGS="-Wl,-z,now -Werror" ++ AC_MSG_CHECKING([whether linker supports -Wl,-z,now]) ++ AC_COMPILE_IFELSE( ++ [AC_LANG_SOURCE([[int main() { return 0; }]])], ++ [HARDENING_CFLAGS="$HARDENING_CFLAGS -Wl,-z,now" ++ AC_MSG_RESULT(yes)], ++ [AC_MSG_RESULT(no)] ++ ) ++ CFLAGS="$save_CFLAGS" + AC_SUBST([HARDENING_CFLAGS]) + fi + +-- +2.26.2 + diff --git a/app-crypt/swtpm/swtpm-0.3.1-r1.ebuild b/app-crypt/swtpm/swtpm-0.3.1-r1.ebuild deleted file mode 100644 index 279c4c49b1cd..000000000000 --- a/app-crypt/swtpm/swtpm-0.3.1-r1.ebuild +++ /dev/null @@ -1,77 +0,0 @@ -# Copyright 1999-2020 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 - -PYTHON_COMPAT=( python3_{6,7,8} ) - -inherit autotools python-any-r1 - -DESCRIPTION="Libtpms-based TPM emulator" -HOMEPAGE="https://github.com/stefanberger/swtpm" -SRC_URI="https://github.com/stefanberger/swtpm/archive/v${PV}.tar.gz -> ${P}.tar.gz" - -LICENSE="BSD" -SLOT="0" -KEYWORDS="~amd64" -IUSE="fuse gnutls libressl seccomp test" - -RESTRICT="!test? ( test )" - -COMMON_DEPEND=" - fuse? ( - dev-libs/glib:2 - sys-fs/fuse:0 - ) - gnutls? ( - dev-libs/libtasn1:= - >=net-libs/gnutls-3.1.0[tools] - ) - !libressl? ( - dev-libs/openssl:0= - dev-libs/libtpms[-libressl] - ) - libressl? ( - dev-libs/libressl:0= - dev-libs/libtpms[libressl] - ) - seccomp? ( sys-libs/libseccomp ) -" - -DEPEND="${COMMON_DEPEND} - test? ( - net-misc/socat - ${PYTHON_DEPS} - ) -" - -RDEPEND="${COMMON_DEPEND} - acct-group/tss - acct-user/tss - app-crypt/tpm-tools - app-crypt/trousers - dev-tcltk/expect" - -src_prepare() { - use test || eapply "${FILESDIR}/${PN}-disable-test-dependencies.patch" - eapply "${FILESDIR}/${PN}-fix-localca-path.patch" - default - eautoreconf -} - -src_configure() { - econf \ - --disable-static \ - --with-openssl \ - --without-selinux \ - $(use_with fuse cuse) \ - $(use_with gnutls) \ - $(use_with seccomp) -} - -src_install() { - default - fowners tss:tss /var/lib/swtpm-localca - keepdir /var/lib/swtpm-localca - find "${D}" -name '*.la' -delete || die -} diff --git a/app-crypt/swtpm/swtpm-0.3.2.ebuild b/app-crypt/swtpm/swtpm-0.3.2.ebuild new file mode 100644 index 000000000000..00ff234d61a6 --- /dev/null +++ b/app-crypt/swtpm/swtpm-0.3.2.ebuild @@ -0,0 +1,82 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +PYTHON_COMPAT=( python3_{6,7,8} ) + +inherit autotools python-any-r1 + +DESCRIPTION="Libtpms-based TPM emulator" +HOMEPAGE="https://github.com/stefanberger/swtpm" +SRC_URI="https://github.com/stefanberger/swtpm/archive/v${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="BSD" +SLOT="0" +KEYWORDS="~amd64" +IUSE="fuse gnutls libressl seccomp test" + +RESTRICT="!test? ( test )" + +COMMON_DEPEND=" + fuse? ( + dev-libs/glib:2 + sys-fs/fuse:0 + ) + gnutls? ( + dev-libs/libtasn1:= + >=net-libs/gnutls-3.1.0[tools] + ) + !libressl? ( + dev-libs/openssl:0= + dev-libs/libtpms[-libressl] + ) + libressl? ( + dev-libs/libressl:0= + dev-libs/libtpms[libressl] + ) + seccomp? ( sys-libs/libseccomp ) +" + +DEPEND="${COMMON_DEPEND} + test? ( + net-misc/socat + ${PYTHON_DEPS} + ) +" + +RDEPEND="${COMMON_DEPEND} + acct-group/tss + acct-user/tss + app-crypt/tpm-tools + app-crypt/trousers + dev-tcltk/expect" + +PATCHES=( + "${FILESDIR}/${PN}-fix-localca-path.patch" + "${FILESDIR}/${PN}-build-sys-Explicitly-link-libswtpm_libtpms-with-lcry.patch" + "${FILESDIR}/${PN}-build-sys-Use-AC_COMPILE_IFELSE-to-check-for-unused-.patch" + ) + +src_prepare() { + use test || eapply "${FILESDIR}/${PN}-disable-test-dependencies.patch" + default + eautoreconf +} + +src_configure() { + econf \ + --disable-static \ + --with-openssl \ + --without-selinux \ + $(use_with fuse cuse) \ + $(use_with gnutls) \ + $(use_with seccomp) +} + +src_install() { + default + fowners tss:tss /var/lib/swtpm-localca + keepdir /var/lib/swtpm-localca + find "${D}" -name '*.la' -delete || die +} -- cgit v1.2.3