summaryrefslogtreecommitdiff
path: root/app-crypt/tpm2-tools
diff options
context:
space:
mode:
Diffstat (limited to 'app-crypt/tpm2-tools')
-rw-r--r--app-crypt/tpm2-tools/Manifest3
-rw-r--r--app-crypt/tpm2-tools/files/tpm2-tools-5.1.1-fix-tpm-checkquote.patch34
-rw-r--r--app-crypt/tpm2-tools/tpm2-tools-5.1.1-r1.ebuild70
-rw-r--r--app-crypt/tpm2-tools/tpm2-tools-5.1.1.ebuild41
4 files changed, 106 insertions, 42 deletions
diff --git a/app-crypt/tpm2-tools/Manifest b/app-crypt/tpm2-tools/Manifest
index 916a38016958..224a80a70a96 100644
--- a/app-crypt/tpm2-tools/Manifest
+++ b/app-crypt/tpm2-tools/Manifest
@@ -1,6 +1,7 @@
AUX tpm2-tools-4.3.0-Remove-WError.patch 360 BLAKE2B 440f48fca6e8aaf9b2c0fd094011738c467a22dc31bd94b53f6788b8fa52c00c5d7ebe074434be60b6370dcf1e94ee4d57bcfc93857fcf03dbdff30c8e157445 SHA512 0d246d1446b5b2ebca0e12467c746a731897311448840a7aac35b57d22edcdec0c9f424d1c95c9614d969a57dba458bbbad8826516cc05329b47d2dad05318fe
+AUX tpm2-tools-5.1.1-fix-tpm-checkquote.patch 1193 BLAKE2B d65717bc15b490c99123ad8022dace6b337b638b797d6f5b0aa783e04fd4f12f2f4281bcc5d53728a6b612c6106aa2ab1593bce9833fcd4109e94de1a1718135 SHA512 a38cdc124eaf1321d954dc969c3c5a409a90ee7d5d25eb0bb692b9a56f8340a6f783852e995a4e9790f5472c47d8475ad083b76015ccfddb7d74ea167cc54364
DIST tpm2-tools-4.3.2.tar.gz 887708 BLAKE2B ee6fe3d0566138d6289d1a91252ccb106d36ff80d55f2d6f9ee30c8e16338d706e80085ac5f4f56a79bcb339e5dcb240efcf71d4003bcffdad366f3cd7a1165b SHA512 1aa47c62c3d2a83195ec649e50c0be2c8be39f926806d8d7cb96edc499c385d527661813e02024e98f83ae9ebcb22d7dadc507ddfab48be9bbe428d9439d7ee1
DIST tpm2-tools-5.1.1.tar.gz 1044427 BLAKE2B 885ff61ad971c95d067bf8f9339de289f082f3103d1c382f45ac3ffbd4d5effc343ddc3c2c74b97b9d31f3f823d264991d1726c1f9c21d5c9b82ac1cdf714d3f SHA512 4e094dcffb66103773d85e866ab9ba8db5d0f205ff9658e08fe14e8e41250570a7f7274b4048934adf256ea41650fa498fc3d6da2786adc241a4bf2e8f7bf78e
EBUILD tpm2-tools-4.3.2.ebuild 1052 BLAKE2B bf435ee4ce938f58cf82a835e4940c2044ee179a574e575fad1124222216c4d1147d302b9fbe95165303326758e7145112e120f7d1f70c0750fc62b75d4db1c2 SHA512 85155fc93543892a19be80b0826f20fb38be8cfe84ed2e4ae957e2c36bd075126b635fe54f848785aa866c0a22e1e7e19378a22361c30d3fba4f922299cc3048
-EBUILD tpm2-tools-5.1.1.ebuild 993 BLAKE2B e7e8750093ec1056288c291d4384d2c9e02efc208f259b9b476c59ad7f2057d01c7335beaf9475e1f6fe41d2dc615cfb208cd13477ca937e26c2dfd43af5c1f5 SHA512 7ba11ecb516c1e2de20481e784082ee25d101a5522c6219921dab922dd30ff3a5a8cc53997c3845941993e5f121ab2f0a4143832a985c5babf85e6c3be655e82
+EBUILD tpm2-tools-5.1.1-r1.ebuild 1575 BLAKE2B e9a949b1e0387b15b2e87bd95fbcb47edfb4b0cb92a6770274e5607d62617e8635a2265ac12031707c03d54b167b21c0730c92c13f8e0f1d104c4bf8fd03fc7b SHA512 7d6a7d2dd894fb521494110a818433ff804bc0deb72565a35c1e97120fa454978b422627768db3619ac89d68a0651e9077297d2b13d284b68dbdbca269356b8b
MISC metadata.xml 559 BLAKE2B 6c0842aa4bbd95d2047bf3ce11c99fad96491481bbe52cdd81d0d02085d97799129ab5a249925c88c20afc1fba8890fb1809a1809a2c2c23e62bb36673031c98 SHA512 6fe7716a5db796b958fee79d65fa04b32196985f503bfb11ff4790c95f118fb5ca14cc9b4ef59b94caadc60c30453b629c6b93918fde505404646a0165947f5c
diff --git a/app-crypt/tpm2-tools/files/tpm2-tools-5.1.1-fix-tpm-checkquote.patch b/app-crypt/tpm2-tools/files/tpm2-tools-5.1.1-fix-tpm-checkquote.patch
new file mode 100644
index 000000000000..73fb0e3f487a
--- /dev/null
+++ b/app-crypt/tpm2-tools/files/tpm2-tools-5.1.1-fix-tpm-checkquote.patch
@@ -0,0 +1,34 @@
+From 3d7edb1c70cba6c34c71c9b856c07b8adcebb15c Mon Sep 17 00:00:00 2001
+From: Alberto Planas <aplanas@suse.com>
+Date: Thu, 17 Jun 2021 11:07:25 +0200
+Subject: [PATCH] tpm2_checkquote: fix uninitialized variable
+
+The variable `temp_pcrs` is uninitialized, and later partially
+uninitialized when reading the selection data from file.
+
+When activating lto optimizations, this bug presents itself showing an
+error during the read of the quote:
+
+ERROR: Malformed PCR file, pcr count cannot be greater than 32, got: ...
+
+Fixes: #2767
+
+Co-authored-by: Martin Liska <marxin.liska@gmail.com>
+Signed-off-by: Alberto Planas <aplanas@suse.com>
+---
+ tools/misc/tpm2_checkquote.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/tools/misc/tpm2_checkquote.c b/tools/misc/tpm2_checkquote.c
+index 531508579..8d780f111 100644
+--- a/tools/misc/tpm2_checkquote.c
++++ b/tools/misc/tpm2_checkquote.c
+@@ -376,7 +376,7 @@ static tool_rc init(void) {
+ TPM2B_ATTEST *msg = NULL;
+ TPML_PCR_SELECTION pcr_select;
+ tpm2_pcrs *pcrs;
+- tpm2_pcrs temp_pcrs;
++ tpm2_pcrs temp_pcrs = {};
+ tool_rc return_value = tool_rc_general_error;
+
+ msg = message_from_file(ctx.msg_file_path);
diff --git a/app-crypt/tpm2-tools/tpm2-tools-5.1.1-r1.ebuild b/app-crypt/tpm2-tools/tpm2-tools-5.1.1-r1.ebuild
new file mode 100644
index 000000000000..fb7168bfb2f4
--- /dev/null
+++ b/app-crypt/tpm2-tools/tpm2-tools-5.1.1-r1.ebuild
@@ -0,0 +1,70 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python3_{8,9} )
+inherit autotools bash-completion-r1 python-single-r1
+
+DESCRIPTION="Tools for the TPM 2.0 TSS"
+HOMEPAGE="https://github.com/tpm2-software/tpm2-tools"
+SRC_URI="https://github.com/tpm2-software/${PN}/releases/download/${PV}/${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE="+fapi test"
+
+RDEPEND="net-misc/curl:=
+ >=app-crypt/tpm2-tss-3.0.1:=[fapi?]
+ dev-libs/openssl:=
+ ${PYTHON_DEPS}"
+DEPEND="${RDEPEND}
+ test? (
+ app-crypt/swtpm
+ app-crypt/tpm2-abrmd
+ app-editors/vim-core
+ dev-tcltk/expect
+ dev-util/cmocka
+ dev-python/pyyaml
+ )"
+BDEPEND="virtual/pkgconfig
+ sys-devel/autoconf-archive"
+
+RESTRICT="!test? ( test )"
+REQUIRED_USE=" ${PYTHON_REQUIRED_USE} "
+
+# One of the tests fails without this patch. See
+# https://github.com/tpm2-software/tpm2-tools/issues/2767
+PATCHES=(
+ "${FILESDIR}/${PN}-5.1.1-fix-tpm-checkquote.patch"
+)
+
+src_prepare() {
+ sed -i \
+ "s/m4_esyscmd_s(\[git describe --tags --always --dirty\])/${PV}/" \
+ "${S}/configure.ac" || die
+ "${S}/scripts/utils/man_to_bashcompletion.sh"
+ eautoreconf
+ default
+}
+
+src_configure() {
+ econf \
+ $(use_enable fapi) \
+ $(use_enable test unit) \
+ --with-bashcompdir=$(get_bashcompdir) \
+ --enable-hardening
+}
+
+src_install() {
+ default
+
+ mv "${D}/$(get_bashcompdir)/tpm2_completion.bash" \
+ "${D}/$(get_bashcompdir)/tpm2" || die
+ for B in "${D}"/usr/bin/tpm2_*
+ do
+ TPM2_UTILS="${TPM2_UTILS} $(basename ${B})"
+ done
+ bashcomp_alias tpm2 ${TPM2_UTILS}
+}
diff --git a/app-crypt/tpm2-tools/tpm2-tools-5.1.1.ebuild b/app-crypt/tpm2-tools/tpm2-tools-5.1.1.ebuild
deleted file mode 100644
index da8ba7b38474..000000000000
--- a/app-crypt/tpm2-tools/tpm2-tools-5.1.1.ebuild
+++ /dev/null
@@ -1,41 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit autotools
-
-DESCRIPTION="Tools for the TPM 2.0 TSS"
-HOMEPAGE="https://github.com/tpm2-software/tpm2-tools"
-SRC_URI="https://github.com/tpm2-software/${PN}/releases/download/${PV}/${P}.tar.gz"
-
-LICENSE="BSD"
-SLOT="0"
-KEYWORDS="~amd64"
-IUSE="+fapi"
-
-# Integration test are now run as part of the testing suite, which will fail
-# because none of the supported TPM emulators are in Portage. In a future
-# version of tpm2-tools, swtpm will be supported and the tests can be run.
-RESTRICT="test"
-
-RDEPEND="net-misc/curl:=
- >=app-crypt/tpm2-tss-3.0.1:=[fapi?]
- dev-libs/openssl:0="
-DEPEND="${RDEPEND}"
-BDEPEND="virtual/pkgconfig
- sys-devel/autoconf-archive"
-
-src_prepare() {
- sed -i \
- "s/m4_esyscmd_s(\[git describe --tags --always --dirty\])/${PV}/" \
- "${S}/configure.ac" || die
- eautoreconf
- default
-}
-
-src_configure() {
- econf \
- $(use_enable fapi) \
- --enable-hardening
-}