* [gentoo-commits] repo/proj/libressl:master commit in: app-crypt/tpm2-tss/files/, app-crypt/tpm2-tss/
@ 2022-10-07 21:11 Quentin Retornaz
0 siblings, 0 replies; 5+ messages in thread
From: Quentin Retornaz @ 2022-10-07 21:11 UTC (permalink / raw
To: gentoo-commits
commit: 3e6fcbdaa8f248d37bb4bb06bfc0973dd35768da
Author: orbea <orbea <AT> riseup <DOT> net>
AuthorDate: Fri Oct 7 15:28:29 2022 +0000
Commit: Quentin Retornaz <gentoo <AT> retornaz <DOT> com>
CommitDate: Fri Oct 7 21:11:14 2022 +0000
URL: https://gitweb.gentoo.org/repo/proj/libressl.git/commit/?id=3e6fcbda
app-crypt/tpm2-tss: Add 3.2.0-r4
Signed-off-by: orbea <orbea <AT> riseup.net>
Signed-off-by: Quentin Retornaz <gentoo <AT> retornaz.com>
...2.0-Dont-run-systemd-sysusers-in-Makefile.patch | 57 ++++++++
.../tpm2-tss/files/tpm2-tss-3.2.0-slibtool.patch | 49 +++++++
...st-fix-usage-of-FILE-in-unit-test-fapi-io.patch | 146 +++++++++++++++++++++
app-crypt/tpm2-tss/tpm2-tss-3.2.0-r4.ebuild | 105 +++++++++++++++
4 files changed, 357 insertions(+)
diff --git a/app-crypt/tpm2-tss/files/tpm2-tss-3.2.0-Dont-run-systemd-sysusers-in-Makefile.patch b/app-crypt/tpm2-tss/files/tpm2-tss-3.2.0-Dont-run-systemd-sysusers-in-Makefile.patch
new file mode 100644
index 0000000..90b1280
--- /dev/null
+++ b/app-crypt/tpm2-tss/files/tpm2-tss-3.2.0-Dont-run-systemd-sysusers-in-Makefile.patch
@@ -0,0 +1,57 @@
+diff --git a/Makefile.am b/Makefile.am
+index ce19aac3..22a8c075 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -498,10 +498,9 @@ fapi-config.json: dist/fapi-config.json.in
+ -e 's|[@]userstatedir@|$(userstatedir)|g' \
+ < "$<" > "$@"
+
+-sysusers_DATA = dist/sysusers.d/tpm2-tss.conf
+ tmpfiles_DATA = tpm2-tss-fapi.conf
+
+-EXTRA_DIST += dist/sysusers.d/tpm2-tss.conf dist/tmpfiles.d/tpm2-tss-fapi.conf.in
++EXTRA_DIST += dist/tmpfiles.d/tpm2-tss-fapi.conf.in
+ CLEANFILES += tpm2-tss-fapi.conf
+
+ # We have to do this ourselves, in order to get absolute paths
+@@ -726,13 +725,6 @@ EXTRA_DIST += dist/tpm-udev.rules
+
+ install-dirs:
+ if HOSTOS_LINUX
+-if SYSD_SYSUSERS
+- @echo "systemd-sysusers $(DESTDIR)$(sysconfdir)/sysusers.d/tpm2-tss.conf"
+- @systemd-sysusers $(DESTDIR)$(sysconfdir)/sysusers.d/tpm2-tss.conf || echo "WARNING Failed to create the tss user and group"
+-else
+- @echo "call make_tss_user_and_group"
+- @$(call make_tss_user_and_group) || echo "WARNING Failed to create the tss user and group"
+-endif
+ if SYSD_TMPFILES
+ @echo "systemd-tmpfiles --create $(DESTDIR)$(sysconfdir)/tmpfiles.d/tpm2-tss-fapi.conf"
+ @systemd-tmpfiles --create $(DESTDIR)$(sysconfdir)/tmpfiles.d/tpm2-tss-fapi.conf|| echo "WARNING Failed to create the FAPI directories with the correct permissions"
+diff --git a/configure.ac b/configure.ac
+index 6482944f..44c0e383 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -483,22 +483,9 @@ AS_IF([test "x$enable_integration" = "xyes" && test "x$enable_self_generated_cer
+ [AC_MSG_WARN([Running integration tests without EK certificate verification, use --enable-self-generated-certificate for full test coverage])])
+
+ # Check for systemd helper tools used by make install
+-AC_CHECK_PROG(systemd_sysusers, systemd-sysusers, yes)
+-AM_CONDITIONAL(SYSD_SYSUSERS, test "x$systemd_sysusers" = "xyes")
+ AC_CHECK_PROG(systemd_tmpfiles, systemd-tmpfiles, yes)
+ AM_CONDITIONAL(SYSD_TMPFILES, test "x$systemd_tmpfiles" = "xyes")
+
+-# Check all tools used by make install
+-AS_IF([test "$HOSTOS" = "Linux"],
+- [ AC_CHECK_PROG(useradd, useradd, yes)
+- AC_CHECK_PROG(groupadd, groupadd, yes)
+- AC_CHECK_PROG(adduser, adduser, yes)
+- AC_CHECK_PROG(addgroup, addgroup, yes)
+- AS_IF([test "x$addgroup" != "xyes" && test "x$groupadd" != "xyes" ],
+- [AC_MSG_ERROR([addgroup or groupadd are needed.])])
+- AS_IF([test "x$adduser" != "xyes" && test "x$useradd" != "xyes" ],
+- [AC_MSG_ERROR([adduser or useradd are needed.])])])
+-
+ AC_SUBST([PATH])
+
+ dnl --------- Doxy Gen -----------------------
diff --git a/app-crypt/tpm2-tss/files/tpm2-tss-3.2.0-slibtool.patch b/app-crypt/tpm2-tss/files/tpm2-tss-3.2.0-slibtool.patch
new file mode 100644
index 0000000..b7d5e5c
--- /dev/null
+++ b/app-crypt/tpm2-tss/files/tpm2-tss-3.2.0-slibtool.patch
@@ -0,0 +1,49 @@
+Bug: https://bugs.gentoo.org/858674
+Upstream-PR: https://github.com/tpm2-software/tpm2-tss/pull/2391
+Upstream-Commit: https://github.com/tpm2-software/tpm2-tss/commit/5e626ab72283017cf4cb2dc4b101d16a58a6c470
+
+From f61fd726c064e909b7576f233f0ad0e885e1752e Mon Sep 17 00:00:00 2001
+From: orbea <orbea@riseup.net>
+Date: Thu, 14 Jul 2022 09:22:49 -0700
+Subject: [PATCH] build: Remove erroneous comma
+
+When building tpm2-tss with slibtool instead of GNU libtool the build
+will fail during 'make check'. This happens because there is an extra
+erroneous comma which is then passed to gcc causing it to fail to find a
+non-existent file. With GNU libtool it appears that the comma is
+silently removed while slibtool does not do this.
+
+rdlibtool --tag=CC --mode=link gcc -I./src -I./include/tss2 -I./test/fuzz/tcti -std=c99 -Wall -Wextra -Wformat-security -Werror -fstack-protector-all -fpic -fPIC -Wno-missing-braces -Wstrict-overflow=5 -DINTERNALBUILD=1 -I./include -I./src/tss2-mu -I./src/tss2-sys -I./src/tss2-esys -I./src/tss2-fapi -I./test/data -Wno-unused-parameter -Wno-missing-field-initializers -DTOP_SOURCEDIR="." -DTOP_SOURCEDIR="." -g -Wl,--wrap=read -Wl,--wrap=write, -Wl,--wrap=poll -Wl,--wrap=open -o test/unit/tcti-device test/unit/tcti_device-tcti-device.o src/tss2-tcti/test_unit_tcti_device-tcti-common.o src/tss2-tcti/test_unit_tcti_device-tcti-device.o -lcmocka src/tss2-mu/libtss2-mu.la libutil.la
+
+rdlibtool: lconf: {.name="libtool"}.
+rdlibtool: fdcwd: {.fdcwd=AT_FDCWD, .realpath="/tmp/tpm2-tss"}.
+rdlibtool: lconf: fstatat(AT_FDCWD,".",...) = 0 {.st_dev = 45, .st_ino = 15835}.
+rdlibtool: lconf: openat(AT_FDCWD,"libtool",O_RDONLY,0) = 3.
+rdlibtool: lconf: found "/tmp/tpm2-tss/libtool".
+rdlibtool: link: gcc test/unit/tcti_device-tcti-device.o src/tss2-tcti/test_unit_tcti_device-tcti-common.o src/tss2-tcti/test_unit_tcti_device-tcti-device.o .libs/libutil.a -I./src -I./include/tss2 -I./test/fuzz/tcti -std=c99 -Wall -Wextra -Wformat-security -Werror -fstack-protector-all -fpic -fPIC -Wno-missing-braces -Wstrict-overflow=5 -DINTERNALBUILD=1 -I./include -I./src/tss2-mu -I./src/tss2-sys -I./src/tss2-esys -I./src/tss2-fapi -I./test/data -Wno-unused-parameter -Wno-missing-field-initializers -DTOP_SOURCEDIR="." -DTOP_SOURCEDIR="." -g -Wl,--wrap=read -Wl,--wrap=write, -Wl,--wrap=poll -Wl,--wrap=open -lcmocka -Lsrc/tss2-mu/.libs -ltss2-mu -L.libs -o test/unit/.libs/tcti-device
+/usr/lib/gcc/x86_64-pc-linux-gnu/11.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find : No such file or directory
+collect2: error: ld returned 1 exit status
+rdlibtool: exec error upon slbt_exec_link_create_executable(), line 1745: (see child process error messages).
+rdlibtool: < returned to > slbt_exec_link(), line 2155.
+make[1]: *** [Makefile:14899: test/unit/tcti-device] Error 2
+make[1]: Leaving directory '/tmp/tpm2-tss'
+make: *** [Makefile:29619: check-am] Error 2
+
+Signed-off-by: orbea <orbea@riseup.net>
+---
+ Makefile-test.am | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile-test.am b/Makefile-test.am
+index bb933e956..533dfb38a 100644
+--- a/Makefile-test.am
++++ b/Makefile-test.am
+@@ -413,7 +413,7 @@ if UNIT
+ if ENABLE_TCTI_DEVICE
+ test_unit_tcti_device_CFLAGS = $(CMOCKA_CFLAGS) $(TESTS_CFLAGS)
+ test_unit_tcti_device_LDADD = $(CMOCKA_LIBS) $(libtss2_mu) $(libutil)
+-test_unit_tcti_device_LDFLAGS = -Wl,--wrap=read -Wl,--wrap=write, -Wl,--wrap=poll \
++test_unit_tcti_device_LDFLAGS = -Wl,--wrap=read -Wl,--wrap=write -Wl,--wrap=poll \
+ -Wl,--wrap=open
+ test_unit_tcti_device_SOURCES = test/unit/tcti-device.c \
+ src/tss2-tcti/tcti-common.c \
diff --git a/app-crypt/tpm2-tss/files/tpm2-tss-3.2.0-test-fix-usage-of-FILE-in-unit-test-fapi-io.patch b/app-crypt/tpm2-tss/files/tpm2-tss-3.2.0-test-fix-usage-of-FILE-in-unit-test-fapi-io.patch
new file mode 100644
index 0000000..aff792a
--- /dev/null
+++ b/app-crypt/tpm2-tss/files/tpm2-tss-3.2.0-test-fix-usage-of-FILE-in-unit-test-fapi-io.patch
@@ -0,0 +1,146 @@
+https://github.com/tpm2-software/tpm2-tss/commit/bda22252507124bb8e466ac2f0c61d5ebed9027d
+https://github.com/tpm2-software/tpm2-tss/pull/2423
+https://bugs.gentoo.org/833530
+
+From bda22252507124bb8e466ac2f0c61d5ebed9027d Mon Sep 17 00:00:00 2001
+From: William Roberts <william.c.roberts@intel.com>
+Date: Mon, 26 Sep 2022 15:16:15 -0500
+Subject: [PATCH] test: fix usage of FILE in unit test fapi-io
+
+The unit test had a static FILE structure used to pass to stdio FILE *
+routines as a dummy value to indicate to use the __real_xxx variant of
+the mocked function. This doesn't work when FILE is opaque as the
+compiler cannot figure out how much storage space is needed for a FILE
+struct.
+
+Fix this by passing a dummy pointer to a data type the compiler knows
+about and casting it to FILE pointer.
+
+Fixes: #2419
+
+Signed-off-by: William Roberts <william.c.roberts@intel.com>
+---
+ test/unit/fapi-io.c | 30 ++++++++++++++++--------------
+ 1 file changed, 16 insertions(+), 14 deletions(-)
+
+diff --git a/test/unit/fapi-io.c b/test/unit/fapi-io.c
+index dbadcb47..8a883a43 100644
+--- a/test/unit/fapi-io.c
++++ b/test/unit/fapi-io.c
+@@ -38,7 +38,9 @@
+ bool wrap_fcntl_test = false;
+ bool wrap_malloc_test = false;
+ bool wrap_read_test = false;
+-FILE mock_stream; /**< stream will be used to activate wrapper.*/
++char _mock_stream; /**< stream will be used to activate wrapper.*/
++
++#define MOCK_STREAM ((FILE *)(&_mock_stream))
+
+ /*
+ * Wrapper functions for file system io.
+@@ -74,7 +76,7 @@ __real_fclose(FILE *stream, ...);
+ int
+ __wrap_fclose(FILE *stream, ...)
+ {
+- if (stream != &mock_stream) {
++ if (stream != MOCK_STREAM) {
+ return __real_fclose(stream);
+ }
+ return mock_type(int);
+@@ -86,7 +88,7 @@ __real_fseek(FILE *stream, long offset, int whence, ...);
+ int
+ __wrap_fseek(FILE *stream, long offset, int whence, ...)
+ {
+- if (stream != &mock_stream) {
++ if (stream != MOCK_STREAM) {
+ return __real_fseek(stream, offset, whence);
+ }
+ return mock_type(int);
+@@ -98,7 +100,7 @@ __real_ftell(FILE *stream, ...);
+ long
+ __wrap_ftell(FILE *stream, ...)
+ {
+- if (stream != &mock_stream) {
++ if (stream != MOCK_STREAM) {
+ return __real_ftell(stream);
+ }
+ return mock_type(int);
+@@ -135,7 +137,7 @@ __real_fileno(FILE *stream, ...);
+ int
+ __wrap_fileno(FILE *stream, ...)
+ {
+- if (stream != &mock_stream) {
++ if (stream != MOCK_STREAM) {
+ return __real_fileno(stream);
+ }
+ return 1;
+@@ -179,7 +181,7 @@ check_io_read_async(void **state) {
+ assert_int_equal(r, TSS2_FAPI_RC_IO_ERROR);
+
+ wrap_fcntl_test = true;
+- will_return(__wrap_fopen, &mock_stream);
++ will_return(__wrap_fopen, MOCK_STREAM);
+ will_return(__wrap_fcntl, -1);
+ will_return_always(__wrap_fclose, 0);
+ errno = EAGAIN;
+@@ -187,8 +189,8 @@ check_io_read_async(void **state) {
+ r = ifapi_io_read_async(&io, "tss_unit_dummyf");
+ assert_int_equal(r, TSS2_FAPI_RC_IO_ERROR);
+
+- will_return(__wrap_fopen, &mock_stream);
+- will_return(__wrap_fopen, &mock_stream);
++ will_return(__wrap_fopen, MOCK_STREAM);
++ will_return(__wrap_fopen, MOCK_STREAM);
+ will_return(__wrap_fcntl, 0);
+ will_return(__wrap_fseek, 0);
+ will_return(__wrap_ftell, 1);
+@@ -202,8 +204,8 @@ check_io_read_async(void **state) {
+
+ wrap_malloc_test = false;
+
+- will_return(__wrap_fopen, &mock_stream);
+- will_return(__wrap_fopen, &mock_stream);
++ will_return(__wrap_fopen, MOCK_STREAM);
++ will_return(__wrap_fopen, MOCK_STREAM);
+ will_return(__wrap_fcntl, 0);
+ will_return(__wrap_fseek, 0);
+ will_return(__wrap_ftell, 1);
+@@ -236,7 +238,7 @@ check_io_read_finish(void **state) {
+ will_return_always(__wrap_fclose, 0);
+ io.char_buffer = &io_char_buffer[0];
+ io.buffer_length = 10;
+- io.stream = &mock_stream;
++ io.stream = MOCK_STREAM;
+ errno = EAGAIN;
+ r = ifapi_io_read_finish(&io, &buffer[0], &count);
+ assert_int_equal(r, TSS2_FAPI_RC_TRY_AGAIN);
+@@ -298,7 +300,7 @@ check_io_write_async(void **state) {
+ assert_int_equal(r, TSS2_FAPI_RC_IO_ERROR);
+
+ wrap_fcntl_test = true;
+- will_return(__wrap_fopen, &mock_stream);
++ will_return(__wrap_fopen, MOCK_STREAM);
+ will_return(__wrap_fcntl, -1);
+
+ errno = EAGAIN;
+@@ -306,7 +308,7 @@ check_io_write_async(void **state) {
+ assert_int_equal(r, TSS2_FAPI_RC_IO_ERROR);
+
+ io.char_rbuffer = NULL;
+- will_return(__wrap_fopen, &mock_stream);
++ will_return(__wrap_fopen, MOCK_STREAM);
+ will_return(__wrap_fcntl, 0);
+ will_return(__wrap_fcntl, 0);
+ will_return(__wrap_fcntl, -1);
+@@ -345,7 +347,7 @@ check_io_write_finish(void **state) {
+ will_return_always(__wrap_fclose, 0);
+
+ wrap_write_test = true;
+- io.stream = &mock_stream;
++ io.stream = MOCK_STREAM;
+ will_return(__wrap_write, -1);
+ errno = EAGAIN;
+ r = ifapi_io_write_finish(&io);
+--
+2.35.1
+
diff --git a/app-crypt/tpm2-tss/tpm2-tss-3.2.0-r4.ebuild b/app-crypt/tpm2-tss/tpm2-tss-3.2.0-r4.ebuild
new file mode 100644
index 0000000..adb5298
--- /dev/null
+++ b/app-crypt/tpm2-tss/tpm2-tss-3.2.0-r4.ebuild
@@ -0,0 +1,105 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit autotools flag-o-matic linux-info multilib-minimal tmpfiles udev
+
+DESCRIPTION="TCG Trusted Platform Module 2.0 Software Stack"
+HOMEPAGE="https://github.com/tpm2-software/tpm2-tss"
+SRC_URI="https://github.com/tpm2-software/${PN}/releases/download/${PV}/${P}.tar.gz"
+
+LICENSE="BSD-2"
+SLOT="0/3"
+KEYWORDS="amd64 arm arm64 ppc64 ~riscv x86"
+IUSE="doc +fapi +openssl mbedtls static-libs test"
+
+RESTRICT="!test? ( test )"
+
+REQUIRED_USE="^^ ( mbedtls openssl )
+ fapi? ( openssl !mbedtls )"
+
+RDEPEND="acct-group/tss
+ acct-user/tss
+ fapi? ( dev-libs/json-c:=[${MULTILIB_USEDEP}]
+ >=net-misc/curl-7.80.0[${MULTILIB_USEDEP}] )
+ mbedtls? ( net-libs/mbedtls:=[${MULTILIB_USEDEP}] )
+ openssl? ( dev-libs/openssl:=[${MULTILIB_USEDEP}] )"
+
+DEPEND="${RDEPEND}
+ test? ( app-crypt/swtpm
+ dev-libs/uthash
+ dev-util/cmocka
+ fapi? ( >=net-misc/curl-7.80.0 ) )"
+BDEPEND="sys-apps/acl
+ virtual/pkgconfig
+ doc? ( app-doc/doxygen )"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-3.2.0-Dont-run-systemd-sysusers-in-Makefile.patch"
+ "${FILESDIR}/${PN}-3.2.0-slibtool.patch" # 858674
+ "${FILESDIR}/${PN}-3.2.0-test-fix-usage-of-FILE-in-unit-test-fapi-io.patch"
+ "${FILESDIR}/${PN}-3.2.0-libressl.patch"
+)
+
+pkg_setup() {
+ local CONFIG_CHECK=" \
+ ~TCG_TPM
+ "
+ linux-info_pkg_setup
+ kernel_is ge 4 12 0 || ewarn "At least kernel 4.12.0 is required"
+}
+
+src_prepare() {
+ default
+
+ # See bug #833887 (and similar); eautoreconf means .pc file gets wrong version.
+ sed -i \
+ "s/m4_esyscmd_s(\[git describe --tags --always --dirty\])/${PV}/" \
+ "configure.ac" || die
+
+ eautoreconf
+}
+
+multilib_src_configure() {
+ # tests fail with LTO enabbled. See bug 865275 and 865279
+ filter-lto
+
+ ECONF_SOURCE=${S} econf \
+ --localstatedir=/var \
+ $(multilib_native_use_enable doc doxygen-doc) \
+ $(use_enable fapi) \
+ $(use_enable static-libs static) \
+ $(multilib_native_use_enable test unit) \
+ $(multilib_native_use_enable test integration) \
+ $(multilib_native_use_enable test self-generated-certificate) \
+ --disable-tcti-libtpms \
+ --disable-defaultflags \
+ --disable-weakcrypto \
+ --with-crypto="$(usex mbedtls mbed ossl)" \
+ --with-runstatedir=/run \
+ --with-udevrulesdir="$(get_udevdir)/rules.d" \
+ --with-udevrulesprefix=60- \
+ --with-sysusersdir="/usr/lib/sysusers.d" \
+ --with-tmpfilesdir="/usr/lib/tmpfiles.d"
+}
+
+multilib_src_install() {
+ default
+
+ if [[ ${PV} != $(sed -n -e 's/^Version: //p' "${ED}/usr/$(get_libdir)/pkgconfig/tss2-sys.pc" || die) ]] ; then
+ # Safeguard for bug #833887
+ die "pkg-config file version doesn't match ${PV}! Please report a bug!"
+ fi
+
+ find "${D}" -name '*.la' -delete || die
+}
+
+pkg_postinst() {
+ tmpfiles_process tpm2-tss-fapi.conf
+ udev_reload
+}
+
+pkg_postrm() {
+ udev_reload
+}
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [gentoo-commits] repo/proj/libressl:master commit in: app-crypt/tpm2-tss/files/, app-crypt/tpm2-tss/
@ 2023-04-14 1:16 orbea
0 siblings, 0 replies; 5+ messages in thread
From: orbea @ 2023-04-14 1:16 UTC (permalink / raw
To: gentoo-commits
commit: 65f4a4e760d392a809b42270ad4c08b9866643fb
Author: orbea <orbea <AT> riseup <DOT> net>
AuthorDate: Fri Apr 14 00:34:41 2023 +0000
Commit: orbea <orbea <AT> riseup <DOT> net>
CommitDate: Fri Apr 14 00:36:56 2023 +0000
URL: https://gitweb.gentoo.org/repo/proj/libressl.git/commit/?id=65f4a4e7
app-crypt/tpm2-tss: update patch + workaround test failure
Upstream-PR: https://github.com/tpm2-software/tpm2-tss/pull/2380
Signed-off-by: orbea <orbea <AT> riseup.net>
.../tpm2-tss/files/tpm2-tss-3.2.0-libressl.patch | 29 +++++++++++++---------
app-crypt/tpm2-tss/tpm2-tss-3.2.0-r4.ebuild | 5 +++-
2 files changed, 21 insertions(+), 13 deletions(-)
diff --git a/app-crypt/tpm2-tss/files/tpm2-tss-3.2.0-libressl.patch b/app-crypt/tpm2-tss/files/tpm2-tss-3.2.0-libressl.patch
index 211424c..7a8f267 100644
--- a/app-crypt/tpm2-tss/files/tpm2-tss-3.2.0-libressl.patch
+++ b/app-crypt/tpm2-tss/files/tpm2-tss-3.2.0-libressl.patch
@@ -1,32 +1,37 @@
Upstream-PR: https://github.com/tpm2-software/tpm2-tss/pull/2380
-From bf6831c474334cbb923de0193d7431ad7805f484 Mon Sep 17 00:00:00 2001
From: orbea <orbea@riseup.net>
-Date: Mon, 4 Jul 2022 23:55:18 -0700
+Date: Thu, 13 Apr 2023 17:11:07 -0700
Subject: [PATCH] Support LibreSSL
This works with LibreSSL 3.5.x.
+Still missing in LibreSSL:
+
+* RAND_OpenSSL
+* NID_sm2
+
Signed-off-by: orbea <orbea@riseup.net>
---
- src/tss2-esys/esys_crypto_ossl.c | 13 ++++++++++---
+ src/tss2-esys/esys_crypto_ossl.c | 14 +++++++++++---
src/tss2-fapi/fapi_crypto.c | 4 ++--
- 2 files changed, 12 insertions(+), 5 deletions(-)
+ 2 files changed, 13 insertions(+), 5 deletions(-)
diff --git a/src/tss2-esys/esys_crypto_ossl.c b/src/tss2-esys/esys_crypto_ossl.c
-index 89d312f70..961d7707f 100644
+index a92ecc46..2baae814 100644
--- a/src/tss2-esys/esys_crypto_ossl.c
+++ b/src/tss2-esys/esys_crypto_ossl.c
-@@ -392,7 +392,7 @@ iesys_cryptossl_hmac_start(ESYS_CRYPTO_CONTEXT_BLOB ** context,
+@@ -392,7 +392,8 @@ iesys_cryptossl_hmac_start(ESYS_CRYPTO_CONTEXT_BLOB ** context,
"Error EVP_MD_CTX_create", cleanup);
}
-#if OPENSSL_VERSION_NUMBER < 0x10101000L
-+#if OPENSSL_VERSION_NUMBER < 0x10101000L || defined(LIBRESSL_VERSION_NUMBER)
++#if OPENSSL_VERSION_NUMBER < 0x10101000L || \
++ ( defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x3070000fL )
if (!(hkey = EVP_PKEY_new_mac_key(EVP_PKEY_HMAC, NULL, key, size))) {
#else
/* this is preferred, but available since OpenSSL 1.1.1 only */
-@@ -558,7 +558,11 @@ iesys_cryptossl_random2b(
+@@ -558,7 +559,11 @@ iesys_cryptossl_random2b(
int rc;
#if OPENSSL_VERSION_NUMBER < 0x30000000L
const RAND_METHOD *rand_save = RAND_get_rand_method();
@@ -38,7 +43,7 @@ index 89d312f70..961d7707f 100644
#else
OSSL_LIB_CTX *libctx = OSSL_LIB_CTX_new();
if (!libctx)
-@@ -615,8 +619,11 @@ iesys_cryptossl_pk_encrypt(TPM2B_PUBLIC * pub_tpm_key,
+@@ -615,8 +620,11 @@ iesys_cryptossl_pk_encrypt(TPM2B_PUBLIC * pub_tpm_key,
RSA *rsa_key = NULL;
const EVP_MD * hashAlg = NULL;
const RAND_METHOD *rand_save = RAND_get_rand_method();
@@ -51,7 +56,7 @@ index 89d312f70..961d7707f 100644
#else
OSSL_LIB_CTX *libctx = NULL;
EVP_MD * hashAlg = NULL;
-@@ -919,7 +926,7 @@ iesys_cryptossl_get_ecdh_point(TPM2B_PUBLIC *key,
+@@ -919,7 +927,7 @@ iesys_cryptossl_get_ecdh_point(TPM2B_PUBLIC *key,
curveId = NID_secp521r1;
key_size = 66;
break;
@@ -61,7 +66,7 @@ index 89d312f70..961d7707f 100644
curveId = NID_sm2;
key_size = 32;
diff --git a/src/tss2-fapi/fapi_crypto.c b/src/tss2-fapi/fapi_crypto.c
-index 2fe37c0c4..c1563237a 100644
+index 3f11b3d6..0d03c5b1 100644
--- a/src/tss2-fapi/fapi_crypto.c
+++ b/src/tss2-fapi/fapi_crypto.c
@@ -544,7 +544,7 @@ ossl_ecc_pub_from_tpm(const TPM2B_PUBLIC *tpmPublicKey, EVP_PKEY **evpPublicKey)
@@ -73,7 +78,7 @@ index 2fe37c0c4..c1563237a 100644
case TPM2_ECC_SM2_P256:
curveId = NID_sm2;
break;
-@@ -1155,7 +1155,7 @@ get_ecc_tpm2b_public_from_evp(
+@@ -1195,7 +1195,7 @@ get_ecc_tpm2b_public_from_evp(
case NID_secp521r1:
tpmCurveId = TPM2_ECC_NIST_P521;
break;
diff --git a/app-crypt/tpm2-tss/tpm2-tss-3.2.0-r4.ebuild b/app-crypt/tpm2-tss/tpm2-tss-3.2.0-r4.ebuild
index 3d2a488..1064e7f 100644
--- a/app-crypt/tpm2-tss/tpm2-tss-3.2.0-r4.ebuild
+++ b/app-crypt/tpm2-tss/tpm2-tss-3.2.0-r4.ebuild
@@ -65,6 +65,10 @@ multilib_src_configure() {
# tests fail with LTO enabbled. See bug 865275 and 865279
filter-lto
+ # Disable for libressl for now
+ # https://github.com/tpm2-software/tpm2-tss/pull/2380
+ # $(multilib_native_use_enable test self-generated-certificate) \
+
ECONF_SOURCE=${S} econf \
--localstatedir=/var \
$(multilib_native_use_enable doc doxygen-doc) \
@@ -72,7 +76,6 @@ multilib_src_configure() {
$(use_enable static-libs static) \
$(multilib_native_use_enable test unit) \
$(multilib_native_use_enable test integration) \
- $(multilib_native_use_enable test self-generated-certificate) \
--disable-tcti-libtpms \
--disable-defaultflags \
--disable-weakcrypto \
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [gentoo-commits] repo/proj/libressl:master commit in: app-crypt/tpm2-tss/files/, app-crypt/tpm2-tss/
@ 2023-04-14 1:16 orbea
0 siblings, 0 replies; 5+ messages in thread
From: orbea @ 2023-04-14 1:16 UTC (permalink / raw
To: gentoo-commits
commit: 9424f1d7a359db8e23670f43a477a00df1c8a9c3
Author: orbea <orbea <AT> riseup <DOT> net>
AuthorDate: Fri Apr 14 00:22:32 2023 +0000
Commit: orbea <orbea <AT> riseup <DOT> net>
CommitDate: Fri Apr 14 00:22:32 2023 +0000
URL: https://gitweb.gentoo.org/repo/proj/libressl.git/commit/?id=9424f1d7
app-crypt/tpm2-tss: drop 3.2.0-r3
Signed-off-by: orbea <orbea <AT> riseup.net>
...1.0-Dont-run-systemd-sysusers-in-Makefile.patch | 29 ------
app-crypt/tpm2-tss/tpm2-tss-3.2.0-r3.ebuild | 103 ---------------------
2 files changed, 132 deletions(-)
diff --git a/app-crypt/tpm2-tss/files/tpm2-tss-3.1.0-Dont-run-systemd-sysusers-in-Makefile.patch b/app-crypt/tpm2-tss/files/tpm2-tss-3.1.0-Dont-run-systemd-sysusers-in-Makefile.patch
deleted file mode 100644
index b66b6e7..0000000
--- a/app-crypt/tpm2-tss/files/tpm2-tss-3.1.0-Dont-run-systemd-sysusers-in-Makefile.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-diff --git a/Makefile.am b/Makefile.am
-index 183289f7..c791896c 100644
---- a/Makefile.am
-+++ b/Makefile.am
-@@ -689,24 +689,6 @@ endif #FAPI
- EXTRA_DIST += dist/tpm-udev.rules
-
- install-dirs:
--if HOSTOS_LINUX
--if SYSD_SYSUSERS
-- @echo "systemd-sysusers $(DESTDIR)$(sysconfdir)/sysusers.d/tpm2-tss.conf"
-- @systemd-sysusers $(DESTDIR)$(sysconfdir)/sysusers.d/tpm2-tss.conf || echo "WARNING Failed to create the tss user and group"
--else
-- @echo "call make_tss_user_and_group"
-- @$(call make_tss_user_and_group) || echo "WARNING Failed to create the tss user and group"
--endif
--if SYSD_TMPFILES
-- @echo "systemd-tmpfiles --create $(DESTDIR)$(sysconfdir)/tmpfiles.d/tpm2-tss-fapi.conf"
-- @systemd-tmpfiles --create $(DESTDIR)$(sysconfdir)/tmpfiles.d/tpm2-tss-fapi.conf|| echo "WARNING Failed to create the FAPI directories with the correct permissions"
--else
-- @echo "(call make_fapi_dirs) && (call set_fapi_permissions)"
-- @-$(call make_fapi_dirs) && $(call set_fapi_permissions) || echo "WARNING Failed to create the FAPI directories with the correct permissions"
--endif
-- @echo "call check_fapi_dirs"
-- @$(call check_fapi_dirs)
--endif
-
- install-data-hook: install-dirs
- -if [ ! -z "$(udevrulesprefix)" ]; then \
diff --git a/app-crypt/tpm2-tss/tpm2-tss-3.2.0-r3.ebuild b/app-crypt/tpm2-tss/tpm2-tss-3.2.0-r3.ebuild
deleted file mode 100644
index a0a03c8..0000000
--- a/app-crypt/tpm2-tss/tpm2-tss-3.2.0-r3.ebuild
+++ /dev/null
@@ -1,103 +0,0 @@
-# Copyright 1999-2022 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit autotools flag-o-matic linux-info multilib-minimal tmpfiles udev
-
-DESCRIPTION="TCG Trusted Platform Module 2.0 Software Stack"
-HOMEPAGE="https://github.com/tpm2-software/tpm2-tss"
-SRC_URI="https://github.com/tpm2-software/${PN}/releases/download/${PV}/${P}.tar.gz"
-
-LICENSE="BSD-2"
-SLOT="0/3"
-KEYWORDS="amd64 arm arm64 ppc64 ~riscv x86"
-IUSE="doc +fapi +openssl mbedtls static-libs test"
-
-RESTRICT="!test? ( test )"
-
-REQUIRED_USE="^^ ( mbedtls openssl )
- fapi? ( openssl !mbedtls )"
-
-RDEPEND="acct-group/tss
- acct-user/tss
- fapi? ( dev-libs/json-c:=[${MULTILIB_USEDEP}]
- >=net-misc/curl-7.80.0[${MULTILIB_USEDEP}] )
- mbedtls? ( net-libs/mbedtls:=[${MULTILIB_USEDEP}] )
- openssl? ( dev-libs/openssl:=[${MULTILIB_USEDEP}] )"
-
-DEPEND="${RDEPEND}
- test? ( app-crypt/swtpm
- dev-libs/uthash
- dev-util/cmocka
- fapi? ( >=net-misc/curl-7.80.0 ) )"
-BDEPEND="sys-apps/acl
- virtual/pkgconfig
- doc? ( app-doc/doxygen )"
-
-PATCHES=(
- "${FILESDIR}/${PN}-3.1.0-Dont-run-systemd-sysusers-in-Makefile.patch"
- "${FILESDIR}/${P}-libressl.patch"
-)
-
-pkg_setup() {
- local CONFIG_CHECK=" \
- ~TCG_TPM
- "
- linux-info_pkg_setup
- kernel_is ge 4 12 0 || ewarn "At least kernel 4.12.0 is required"
-}
-
-src_prepare() {
- default
-
- # See bug #833887 (and similar); eautoreconf means .pc file gets wrong version.
- sed -i \
- "s/m4_esyscmd_s(\[git describe --tags --always --dirty\])/${PV}/" \
- "configure.ac" || die
-
- eautoreconf
-}
-
-multilib_src_configure() {
- # tests fail with LTO enabbled. See bug 865275 and 865279
- filter-lto
-
- ECONF_SOURCE=${S} econf \
- --localstatedir=/var \
- $(multilib_native_use_enable doc doxygen-doc) \
- $(use_enable fapi) \
- $(use_enable static-libs static) \
- $(multilib_native_use_enable test unit) \
- $(multilib_native_use_enable test integration) \
- $(multilib_native_use_enable test self-generated-certificate) \
- --disable-tcti-libtpms \
- --disable-defaultflags \
- --disable-weakcrypto \
- --with-crypto="$(usex mbedtls mbed ossl)" \
- --with-runstatedir=/run \
- --with-udevrulesdir="$(get_udevdir)/rules.d" \
- --with-udevrulesprefix=60- \
- --with-sysusersdir="/usr/lib/sysusers.d" \
- --with-tmpfilesdir="/usr/lib/tmpfiles.d"
-}
-
-multilib_src_install() {
- default
-
- if [[ ${PV} != $(sed -n -e 's/^Version: //p' "${ED}/usr/$(get_libdir)/pkgconfig/tss2-sys.pc" || die) ]] ; then
- # Safeguard for bug #833887
- die "pkg-config file version doesn't match ${PV}! Please report a bug!"
- fi
-
- find "${D}" -name '*.la' -delete || die
-}
-
-pkg_postinst() {
- tmpfiles_process tpm2-tss-fapi.conf
- udev_reload
-}
-
-pkg_postrm() {
- udev_reload
-}
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [gentoo-commits] repo/proj/libressl:master commit in: app-crypt/tpm2-tss/files/, app-crypt/tpm2-tss/
@ 2023-04-14 1:16 orbea
0 siblings, 0 replies; 5+ messages in thread
From: orbea @ 2023-04-14 1:16 UTC (permalink / raw
To: gentoo-commits
commit: 283ced32ed0b492e0bc45821ab22fcdcde64774b
Author: orbea <orbea <AT> riseup <DOT> net>
AuthorDate: Fri Apr 14 00:52:44 2023 +0000
Commit: orbea <orbea <AT> riseup <DOT> net>
CommitDate: Fri Apr 14 00:52:44 2023 +0000
URL: https://gitweb.gentoo.org/repo/proj/libressl.git/commit/?id=283ced32
app-crypt/tpm2-tss: add 3.2.1, 3.2.2, 4.0.0, 4.0.1
Signed-off-by: orbea <orbea <AT> riseup.net>
app-crypt/tpm2-tss/Manifest | 4 +
...2.1-Dont-run-systemd-sysusers-in-Makefile.patch | 61 ++++++++++++++
...pm2-tss-4.0.0-Dont-install-files-into-run.patch | 26 ++++++
app-crypt/tpm2-tss/tpm2-tss-3.2.1.ebuild | 90 ++++++++++++++++++++
app-crypt/tpm2-tss/tpm2-tss-3.2.2.ebuild | 94 +++++++++++++++++++++
app-crypt/tpm2-tss/tpm2-tss-4.0.0.ebuild | 97 +++++++++++++++++++++
app-crypt/tpm2-tss/tpm2-tss-4.0.1.ebuild | 98 ++++++++++++++++++++++
7 files changed, 470 insertions(+)
diff --git a/app-crypt/tpm2-tss/Manifest b/app-crypt/tpm2-tss/Manifest
index fbe1511..b76f835 100644
--- a/app-crypt/tpm2-tss/Manifest
+++ b/app-crypt/tpm2-tss/Manifest
@@ -1 +1,5 @@
DIST tpm2-tss-3.2.0.tar.gz 1629211 BLAKE2B a89aa4d89a50bdfb5a9652874d30e2138747bd022049f2be2d0b56e296329d0c41254033ec3a062dbd64fde54a62e952f54446c551e5788231827cd53fae045a SHA512 cabb411f074dfa94919ba914849aac77a0ac2f50622e28a1406cf575369148774748e0e2b7a7c566ec83561a96d4b883bac5a3b1763f4cf48668a0c5d68c0a23
+DIST tpm2-tss-3.2.1.tar.gz 1638566 BLAKE2B bdf5eeca1e7269a639cefd8b4a38e16c5b7c08518411a22718dcd14bc9fe3b621eee77cdd98f9ece0f6d9a52319bce5e0a502ff9a6e4ba6716341bd01f5967a9 SHA512 dbe5e29349d78621fcd608d9c75fa58f5e6462264b9654ca85af9f9faafebe1107d9f735a1b6ad4956a089b0dd96cbda3f46364cabd846f9fb29a419b074c78f
+DIST tpm2-tss-3.2.2.tar.gz 1638857 BLAKE2B 164c54b7c43a3379a9aae86fd39788a0906030bc2df9a96d7264635b0e281088f46f470d28098e194e77067f1c4412a8f1ef30d7877eb2410aeefee2d3639409 SHA512 efa71d04de907f74cf0e451a55124cb6fa804fddc2530ecc728a76030e0ae1e8597048c81cd4316397318f273e95754cf85745fc49966208b60babd398989aa6
+DIST tpm2-tss-4.0.0.tar.gz 1787084 BLAKE2B 9b9d466eab77ae71ec916c911f9e1321013fe49594e103610fcb03492a2f20e811a2faddc2237519b710a1931226d5664581cd671d2318319a92e16bcb5ccfb4 SHA512 1058aa74e2358bfb60a17b85291dc642d40b49bb076453810c5b2b0c37c72671c319d783c879f719ccbe7aaeb5f464e0144c6ee12d28242b477be5d579cb3f9c
+DIST tpm2-tss-4.0.1.tar.gz 1787139 BLAKE2B 627cdefeff6c64148f9da1425922a0a7a72debcee4930ffab208a3b9b66127c2d4f923e3e105bfd45410cdb13c19cb40cc15a720e9a05dd32ff622dabf5fcc32 SHA512 ed6ddc52cb0e8c1082a4bb001e1225eb9905fd2380da88db5fd69ff5b5d9d43a93eb67b634e49d53eb5d586832da3aef2c4c7e5f18d51bb730481f8913319d7d
diff --git a/app-crypt/tpm2-tss/files/tpm2-tss-3.2.1-Dont-run-systemd-sysusers-in-Makefile.patch b/app-crypt/tpm2-tss/files/tpm2-tss-3.2.1-Dont-run-systemd-sysusers-in-Makefile.patch
new file mode 100644
index 0000000..7e55f96
--- /dev/null
+++ b/app-crypt/tpm2-tss/files/tpm2-tss-3.2.1-Dont-run-systemd-sysusers-in-Makefile.patch
@@ -0,0 +1,61 @@
+diff --git a/Makefile.am b/Makefile.am
+index 6242b19c..b30ec6e0 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -492,7 +492,6 @@ fapi-config.json: dist/fapi-config.json.in
+ -e 's|[@]userstatedir@|$(userstatedir)|g' \
+ < "$<" > "$@"
+
+-sysusers_DATA = dist/sysusers.d/tpm2-tss.conf
+ tmpfiles_DATA = tpm2-tss-fapi.conf
+
+ CLEANFILES += tpm2-tss-fapi.conf
+@@ -516,7 +515,6 @@ EXTRA_DIST += \
+ dist/fapi-config.json.in \
+ dist/fapi-profiles/P_RSA2048SHA256.json \
+ dist/fapi-profiles/P_ECCP256SHA256.json \
+- dist/sysusers.d/tpm2-tss.conf \
+ dist/tmpfiles.d/tpm2-tss-fapi.conf.in \
+ doc/fapi-config.md \
+ doc/fapi-profile.md \
+@@ -726,13 +724,6 @@ EXTRA_DIST += dist/tpm-udev.rules
+
+ install-dirs:
+ if HOSTOS_LINUX
+-if SYSD_SYSUSERS
+- @echo "systemd-sysusers $(DESTDIR)$(sysconfdir)/sysusers.d/tpm2-tss.conf"
+- @systemd-sysusers $(DESTDIR)$(sysconfdir)/sysusers.d/tpm2-tss.conf || echo "WARNING Failed to create the tss user and group"
+-else
+- @echo "call make_tss_user_and_group"
+- @$(call make_tss_user_and_group) || echo "WARNING Failed to create the tss user and group"
+-endif
+ if SYSD_TMPFILES
+ @echo "systemd-tmpfiles --create $(DESTDIR)$(sysconfdir)/tmpfiles.d/tpm2-tss-fapi.conf"
+ @systemd-tmpfiles --create $(DESTDIR)$(sysconfdir)/tmpfiles.d/tpm2-tss-fapi.conf|| echo "WARNING Failed to create the FAPI directories with the correct permissions"
+diff --git a/configure.ac b/configure.ac
+index 83554edd..c9599b93 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -483,22 +483,9 @@ AS_IF([test "x$enable_integration" = "xyes" && test "x$enable_self_generated_cer
+ [AC_MSG_WARN([Running integration tests without EK certificate verification, use --enable-self-generated-certificate for full test coverage])])
+
+ # Check for systemd helper tools used by make install
+-AC_CHECK_PROG(systemd_sysusers, systemd-sysusers, yes)
+-AM_CONDITIONAL(SYSD_SYSUSERS, test "x$systemd_sysusers" = "xyes")
+ AC_CHECK_PROG(systemd_tmpfiles, systemd-tmpfiles, yes)
+ AM_CONDITIONAL(SYSD_TMPFILES, test "x$systemd_tmpfiles" = "xyes")
+
+-# Check all tools used by make install
+-AS_IF([test "$HOSTOS" = "Linux"],
+- [ AC_CHECK_PROG(useradd, useradd, yes)
+- AC_CHECK_PROG(groupadd, groupadd, yes)
+- AC_CHECK_PROG(adduser, adduser, yes)
+- AC_CHECK_PROG(addgroup, addgroup, yes)
+- AS_IF([test "x$addgroup" != "xyes" && test "x$groupadd" != "xyes" ],
+- [AC_MSG_ERROR([addgroup or groupadd are needed.])])
+- AS_IF([test "x$adduser" != "xyes" && test "x$useradd" != "xyes" ],
+- [AC_MSG_ERROR([adduser or useradd are needed.])])])
+-
+ AC_SUBST([PATH])
+
+ dnl --------- Doxy Gen -----------------------
diff --git a/app-crypt/tpm2-tss/files/tpm2-tss-4.0.0-Dont-install-files-into-run.patch b/app-crypt/tpm2-tss/files/tpm2-tss-4.0.0-Dont-install-files-into-run.patch
new file mode 100644
index 0000000..ca51ab7
--- /dev/null
+++ b/app-crypt/tpm2-tss/files/tpm2-tss-4.0.0-Dont-install-files-into-run.patch
@@ -0,0 +1,26 @@
+diff --git a/Makefile.am b/Makefile.am
+index 2c81cfa9..2673995c 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -767,13 +767,11 @@ define set_tss_permissions
+ endef
+
+ define make_fapi_dirs
+- ($(call make_tss_dir,$(DESTDIR)$(runstatedir)/tpm2-tss/eventlog/) || true) && \
+ ($(call make_tss_dir,$(DESTDIR)$(localstatedir)/lib/tpm2-tss/system/keystore/))
+ endef
+
+ define set_fapi_permissions
+ if test -z "${DESTDIR}"; then \ e
+- ($(call set_tss_permissions,$(DESTDIR)$(runstatedir)/tpm2-tss)) && \
+ ($(call set_tss_permissions,$(DESTDIR)$(localstatedir)/lib/tpm2-tss)) \
+ fi
+ endef
+@@ -784,7 +782,6 @@ endef
+
+ define check_fapi_dirs
+ if test -z "${DESTDIR}"; then \
+- ($(call check_dir,$(DESTDIR)$(runstatedir)/tpm2-tss/eventlog/)) && \
+ ($(call check_dir,$(DESTDIR)$(localstatedir)/lib/tpm2-tss/system/keystore/)) \
+ fi;
+ endef
diff --git a/app-crypt/tpm2-tss/tpm2-tss-3.2.1.ebuild b/app-crypt/tpm2-tss/tpm2-tss-3.2.1.ebuild
new file mode 100644
index 0000000..fc628bd
--- /dev/null
+++ b/app-crypt/tpm2-tss/tpm2-tss-3.2.1.ebuild
@@ -0,0 +1,90 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit autotools flag-o-matic linux-info multilib-minimal tmpfiles udev
+
+DESCRIPTION="TCG Trusted Platform Module 2.0 Software Stack"
+HOMEPAGE="https://github.com/tpm2-software/tpm2-tss"
+SRC_URI="https://github.com/tpm2-software/${PN}/releases/download/${PV}/${P}.tar.gz"
+
+LICENSE="BSD-2"
+SLOT="0/3"
+KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc64 ~riscv ~x86"
+IUSE="doc +fapi +openssl mbedtls static-libs test"
+
+RESTRICT="!test? ( test )"
+
+REQUIRED_USE="^^ ( mbedtls openssl )
+ fapi? ( openssl !mbedtls )"
+
+RDEPEND="acct-group/tss
+ acct-user/tss
+ fapi? ( dev-libs/json-c:=[${MULTILIB_USEDEP}]
+ >=net-misc/curl-7.80.0[${MULTILIB_USEDEP}] )
+ mbedtls? ( net-libs/mbedtls:=[${MULTILIB_USEDEP}] )
+ openssl? ( dev-libs/openssl:=[${MULTILIB_USEDEP}] )"
+
+DEPEND="${RDEPEND}
+ test? ( app-crypt/swtpm
+ dev-libs/uthash
+ dev-util/cmocka
+ fapi? ( >=net-misc/curl-7.80.0 ) )"
+BDEPEND="sys-apps/acl
+ virtual/pkgconfig
+ doc? ( app-doc/doxygen )"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-3.2.0-libressl.patch"
+ "${FILESDIR}/${PN}-3.2.1-Dont-run-systemd-sysusers-in-Makefile.patch"
+)
+
+pkg_setup() {
+ local CONFIG_CHECK=" \
+ ~TCG_TPM
+ "
+ linux-info_pkg_setup
+ kernel_is ge 4 12 0 || ewarn "At least kernel 4.12.0 is required"
+}
+
+src_prepare() {
+ eautoreconf
+ default
+}
+
+multilib_src_configure() {
+ # tests fail with LTO enabbled. See bug 865275 and 865279
+ filter-lto
+
+ ECONF_SOURCE=${S} econf \
+ --localstatedir=/var \
+ $(multilib_native_use_enable doc doxygen-doc) \
+ $(use_enable fapi) \
+ $(use_enable static-libs static) \
+ $(multilib_native_use_enable test unit) \
+ $(multilib_native_use_enable test integration) \
+ --disable-tcti-libtpms \
+ --disable-defaultflags \
+ --disable-weakcrypto \
+ --with-crypto="$(usex mbedtls mbed ossl)" \
+ --with-runstatedir=/run \
+ --with-udevrulesdir="$(get_udevdir)/rules.d" \
+ --with-udevrulesprefix=60- \
+ --with-sysusersdir="/usr/lib/sysusers.d" \
+ --with-tmpfilesdir="/usr/lib/tmpfiles.d"
+}
+
+multilib_src_install() {
+ default
+ find "${D}" -name '*.la' -delete || die
+}
+
+pkg_postinst() {
+ tmpfiles_process tpm2-tss-fapi.conf
+ udev_reload
+}
+
+pkg_postrm() {
+ udev_reload
+}
diff --git a/app-crypt/tpm2-tss/tpm2-tss-3.2.2.ebuild b/app-crypt/tpm2-tss/tpm2-tss-3.2.2.ebuild
new file mode 100644
index 0000000..b8edead
--- /dev/null
+++ b/app-crypt/tpm2-tss/tpm2-tss-3.2.2.ebuild
@@ -0,0 +1,94 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit autotools flag-o-matic linux-info multilib-minimal tmpfiles udev
+
+DESCRIPTION="TCG Trusted Platform Module 2.0 Software Stack"
+HOMEPAGE="https://github.com/tpm2-software/tpm2-tss"
+SRC_URI="https://github.com/tpm2-software/${PN}/releases/download/${PV}/${P}.tar.gz"
+
+LICENSE="BSD-2"
+SLOT="0/3"
+KEYWORDS="amd64 arm arm64 ~loong ppc64 ~riscv x86"
+IUSE="doc +fapi +openssl mbedtls static-libs test"
+
+RESTRICT="!test? ( test )"
+
+REQUIRED_USE="^^ ( mbedtls openssl )
+ fapi? ( openssl !mbedtls )"
+
+RDEPEND="acct-group/tss
+ acct-user/tss
+ fapi? ( dev-libs/json-c:=[${MULTILIB_USEDEP}]
+ >=net-misc/curl-7.80.0[${MULTILIB_USEDEP}] )
+ mbedtls? ( net-libs/mbedtls:=[${MULTILIB_USEDEP}] )
+ openssl? ( dev-libs/openssl:=[${MULTILIB_USEDEP}] )"
+
+DEPEND="${RDEPEND}
+ test? ( app-crypt/swtpm
+ dev-libs/uthash
+ dev-util/cmocka
+ fapi? ( >=net-misc/curl-7.80.0 ) )"
+BDEPEND="sys-apps/acl
+ virtual/pkgconfig
+ doc? ( app-doc/doxygen )"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-3.2.0-libressl.patch"
+ "${FILESDIR}/${PN}-3.2.1-Dont-run-systemd-sysusers-in-Makefile.patch"
+)
+
+pkg_setup() {
+ local CONFIG_CHECK=" \
+ ~TCG_TPM
+ "
+ linux-info_pkg_setup
+ kernel_is ge 4 12 0 || ewarn "At least kernel 4.12.0 is required"
+}
+
+src_prepare() {
+ eautoreconf
+ default
+}
+
+multilib_src_configure() {
+ # tests fail with LTO enabbled. See bug 865275 and 865279
+ filter-lto
+
+ # Disable for libressl for now
+ # https://github.com/tpm2-software/tpm2-tss/pull/2380
+ # $(multilib_native_use_enable test self-generated-certificate) \
+
+ ECONF_SOURCE=${S} econf \
+ --localstatedir=/var \
+ $(multilib_native_use_enable doc doxygen-doc) \
+ $(use_enable fapi) \
+ $(use_enable static-libs static) \
+ $(multilib_native_use_enable test unit) \
+ $(multilib_native_use_enable test integration) \
+ --disable-tcti-libtpms \
+ --disable-defaultflags \
+ --disable-weakcrypto \
+ --with-crypto="$(usex mbedtls mbed ossl)" \
+ --with-runstatedir=/run \
+ --with-udevrulesdir="$(get_udevdir)/rules.d" \
+ --with-udevrulesprefix=60- \
+ --with-sysusersdir="/usr/lib/sysusers.d" \
+ --with-tmpfilesdir="/usr/lib/tmpfiles.d"
+}
+
+multilib_src_install() {
+ default
+ find "${D}" -name '*.la' -delete || die
+}
+
+pkg_postinst() {
+ tmpfiles_process tpm2-tss-fapi.conf
+ udev_reload
+}
+
+pkg_postrm() {
+ udev_reload
+}
diff --git a/app-crypt/tpm2-tss/tpm2-tss-4.0.0.ebuild b/app-crypt/tpm2-tss/tpm2-tss-4.0.0.ebuild
new file mode 100644
index 0000000..a3e6f01
--- /dev/null
+++ b/app-crypt/tpm2-tss/tpm2-tss-4.0.0.ebuild
@@ -0,0 +1,97 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit autotools flag-o-matic linux-info multilib-minimal tmpfiles udev
+
+DESCRIPTION="TCG Trusted Platform Module 2.0 Software Stack"
+HOMEPAGE="https://github.com/tpm2-software/tpm2-tss"
+SRC_URI="https://github.com/tpm2-software/${PN}/releases/download/${PV}/${P}.tar.gz"
+
+LICENSE="BSD-2"
+SLOT="0/4"
+KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc64 ~riscv ~x86"
+IUSE="doc +fapi +openssl mbedtls +policy static-libs test"
+
+RESTRICT="!test? ( test )"
+
+REQUIRED_USE="^^ ( mbedtls openssl )
+ fapi? ( openssl !mbedtls )
+ policy? ( openssl !mbedtls )"
+
+RDEPEND="acct-group/tss
+ acct-user/tss
+ fapi? ( dev-libs/json-c:=[${MULTILIB_USEDEP}]
+ >=net-misc/curl-7.80.0[${MULTILIB_USEDEP}] )
+ mbedtls? ( net-libs/mbedtls:=[${MULTILIB_USEDEP}] )
+ openssl? ( dev-libs/openssl:=[${MULTILIB_USEDEP}] )"
+
+DEPEND="${RDEPEND}
+ test? ( app-crypt/swtpm
+ dev-libs/uthash
+ dev-util/cmocka
+ fapi? ( >=net-misc/curl-7.80.0 ) )"
+BDEPEND="sys-apps/acl
+ virtual/pkgconfig
+ doc? ( app-doc/doxygen )"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-3.2.0-libressl.patch"
+ "${FILESDIR}/${PN}-4.0.0-Dont-install-files-into-run.patch"
+ )
+
+pkg_setup() {
+ local CONFIG_CHECK=" \
+ ~TCG_TPM
+ "
+ linux-info_pkg_setup
+ kernel_is ge 4 12 0 || ewarn "At least kernel 4.12.0 is required"
+}
+
+src_prepare() {
+ eautoreconf
+ default
+}
+
+multilib_src_configure() {
+ # tests fail with LTO enabbled. See bug 865275 and 865279
+ filter-lto
+
+ # Disable for libressl for now
+ # https://github.com/tpm2-software/tpm2-tss/pull/2380
+ # $(multilib_native_use_enable test self-generated-certificate) \
+
+ ECONF_SOURCE=${S} econf \
+ --localstatedir=/var \
+ $(multilib_native_use_enable doc doxygen-doc) \
+ $(use_enable fapi) \
+ $(use_enable policy) \
+ $(use_enable static-libs static) \
+ $(multilib_native_use_enable test unit) \
+ $(multilib_native_use_enable test integration) \
+ --disable-tcti-libtpms \
+ --disable-defaultflags \
+ --disable-weakcrypto \
+ --with-crypto="$(usex mbedtls mbed ossl)" \
+ --with-runstatedir=/run \
+ --with-udevrulesdir="$(get_udevdir)/rules.d" \
+ --with-udevrulesprefix=60- \
+ --without-sysusersdir \
+ --with-tmpfilesdir="/usr/lib/tmpfiles.d"
+}
+
+multilib_src_install() {
+ default
+ keepdir /var/lib/tpm2-tss/system/keystore
+ find "${ED}" -name '*.la' -delete || die
+}
+
+pkg_postinst() {
+ tmpfiles_process tpm2-tss-fapi.conf
+ udev_reload
+}
+
+pkg_postrm() {
+ udev_reload
+}
diff --git a/app-crypt/tpm2-tss/tpm2-tss-4.0.1.ebuild b/app-crypt/tpm2-tss/tpm2-tss-4.0.1.ebuild
new file mode 100644
index 0000000..4cf21aa
--- /dev/null
+++ b/app-crypt/tpm2-tss/tpm2-tss-4.0.1.ebuild
@@ -0,0 +1,98 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit autotools flag-o-matic linux-info multilib-minimal tmpfiles udev
+
+DESCRIPTION="TCG Trusted Platform Module 2.0 Software Stack"
+HOMEPAGE="https://github.com/tpm2-software/tpm2-tss"
+SRC_URI="https://github.com/tpm2-software/${PN}/releases/download/${PV}/${P}.tar.gz"
+
+LICENSE="BSD-2"
+SLOT="0/4"
+KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc64 ~riscv ~x86"
+IUSE="doc +fapi +openssl mbedtls +policy static-libs test"
+
+RESTRICT="!test? ( test )"
+
+REQUIRED_USE="^^ ( mbedtls openssl )
+ fapi? ( openssl !mbedtls )
+ policy? ( openssl !mbedtls )"
+
+RDEPEND="acct-group/tss
+ acct-user/tss
+ sys-apps/util-linux:=[${MULTILIB_USEDEP}]
+ fapi? ( dev-libs/json-c:=[${MULTILIB_USEDEP}]
+ >=net-misc/curl-7.80.0[${MULTILIB_USEDEP}] )
+ mbedtls? ( net-libs/mbedtls:=[${MULTILIB_USEDEP}] )
+ openssl? ( dev-libs/openssl:=[${MULTILIB_USEDEP}] )"
+
+DEPEND="${RDEPEND}
+ test? ( app-crypt/swtpm
+ dev-libs/uthash
+ dev-util/cmocka
+ fapi? ( >=net-misc/curl-7.80.0 ) )"
+BDEPEND="sys-apps/acl
+ virtual/pkgconfig
+ doc? ( app-doc/doxygen )"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-3.2.0-libressl.patch"
+ "${FILESDIR}/${PN}-4.0.0-Dont-install-files-into-run.patch"
+ )
+
+pkg_setup() {
+ local CONFIG_CHECK=" \
+ ~TCG_TPM
+ "
+ linux-info_pkg_setup
+ kernel_is ge 4 12 0 || ewarn "At least kernel 4.12.0 is required"
+}
+
+src_prepare() {
+ eautoreconf
+ default
+}
+
+multilib_src_configure() {
+ # tests fail with LTO enabbled. See bug 865275 and 865279
+ filter-lto
+
+ # Disable for libressl for now
+ # https://github.com/tpm2-software/tpm2-tss/pull/2380
+ # $(multilib_native_use_enable test self-generated-certificate) \
+
+ ECONF_SOURCE=${S} econf \
+ --localstatedir=/var \
+ $(multilib_native_use_enable doc doxygen-doc) \
+ $(use_enable fapi) \
+ $(use_enable policy) \
+ $(use_enable static-libs static) \
+ $(multilib_native_use_enable test unit) \
+ $(multilib_native_use_enable test integration) \
+ --disable-tcti-libtpms \
+ --disable-defaultflags \
+ --disable-weakcrypto \
+ --with-crypto="$(usex mbedtls mbed ossl)" \
+ --with-runstatedir=/run \
+ --with-udevrulesdir="$(get_udevdir)/rules.d" \
+ --with-udevrulesprefix=60- \
+ --without-sysusersdir \
+ --with-tmpfilesdir="/usr/lib/tmpfiles.d"
+}
+
+multilib_src_install() {
+ default
+ keepdir /var/lib/tpm2-tss/system/keystore
+ find "${ED}" -name '*.la' -delete || die
+}
+
+pkg_postinst() {
+ tmpfiles_process tpm2-tss-fapi.conf
+ udev_reload
+}
+
+pkg_postrm() {
+ udev_reload
+}
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [gentoo-commits] repo/proj/libressl:master commit in: app-crypt/tpm2-tss/files/, app-crypt/tpm2-tss/
@ 2025-01-12 16:31 orbea
0 siblings, 0 replies; 5+ messages in thread
From: orbea @ 2025-01-12 16:31 UTC (permalink / raw
To: gentoo-commits
commit: 1b171b51ca4885285bdf5f5f4ebf84a91e953337
Author: orbea <orbea <AT> riseup <DOT> net>
AuthorDate: Sun Jan 12 15:40:38 2025 +0000
Commit: orbea <orbea <AT> riseup <DOT> net>
CommitDate: Sun Jan 12 15:40:38 2025 +0000
URL: https://gitweb.gentoo.org/repo/proj/libressl.git/commit/?id=1b171b51
app-crypt/tpm2-tss: drop 4.0.1, 4.0.1-r1, 4.0.2, 4.0.2-r1, 4.1.3
Signed-off-by: orbea <orbea <AT> riseup.net>
app-crypt/tpm2-tss/Manifest | 1 -
...pm2-tss-4.0.0-Dont-install-files-into-run.patch | 26 -----
.../tpm2-tss-4.0.0-libressl-no-cert-tests.patch | 90 -----------------
app-crypt/tpm2-tss/tpm2-tss-4.0.1-r1.ebuild | 110 ---------------------
app-crypt/tpm2-tss/tpm2-tss-4.0.1.ebuild | 102 -------------------
app-crypt/tpm2-tss/tpm2-tss-4.0.2-r1.ebuild | 110 ---------------------
app-crypt/tpm2-tss/tpm2-tss-4.0.2.ebuild | 109 --------------------
app-crypt/tpm2-tss/tpm2-tss-4.1.3.ebuild | 110 ---------------------
8 files changed, 658 deletions(-)
diff --git a/app-crypt/tpm2-tss/Manifest b/app-crypt/tpm2-tss/Manifest
index e08c54a..25adb5d 100644
--- a/app-crypt/tpm2-tss/Manifest
+++ b/app-crypt/tpm2-tss/Manifest
@@ -1,3 +1,2 @@
-DIST tpm2-tss-4.0.1.tar.gz 1787139 BLAKE2B 627cdefeff6c64148f9da1425922a0a7a72debcee4930ffab208a3b9b66127c2d4f923e3e105bfd45410cdb13c19cb40cc15a720e9a05dd32ff622dabf5fcc32 SHA512 ed6ddc52cb0e8c1082a4bb001e1225eb9905fd2380da88db5fd69ff5b5d9d43a93eb67b634e49d53eb5d586832da3aef2c4c7e5f18d51bb730481f8913319d7d
DIST tpm2-tss-4.0.2.tar.gz 1833499 BLAKE2B 91e70bcc66099fe5d7d53cf98a2c46582e96f204fc7bcb89c46497cc811ca1eb39c752be077a6e8132fc980a6581a2df075fcc6670d646d1270e642c144f043c SHA512 e92038de985ac928bf87a707b0f9b190aaa936827923ea5e3cbdda216cbc6cf8590af650c59c2e1e420ad9914dc6c1f14232ab7930ffc1a50fb0c49fdef6d3f0
DIST tpm2-tss-4.1.3.tar.gz 1902009 BLAKE2B d8592f4797a4254883667476efb2fdf3c95547d9c472fe3557031e934c725e20e3cc70a9b7b41eaddac71e8d9f94beb5fbb39aec5d81b3eeb1b612df27312923 SHA512 c9a5e1e90f6545a466d43790ab2d67c52c4b788a0b21f8212575e27e04e0ac663105863fe00824e08a4e56a4f8c6b00c48c1a1c132531b8569cd5042c3bb9e69
diff --git a/app-crypt/tpm2-tss/files/tpm2-tss-4.0.0-Dont-install-files-into-run.patch b/app-crypt/tpm2-tss/files/tpm2-tss-4.0.0-Dont-install-files-into-run.patch
deleted file mode 100644
index ca51ab7..0000000
--- a/app-crypt/tpm2-tss/files/tpm2-tss-4.0.0-Dont-install-files-into-run.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-diff --git a/Makefile.am b/Makefile.am
-index 2c81cfa9..2673995c 100644
---- a/Makefile.am
-+++ b/Makefile.am
-@@ -767,13 +767,11 @@ define set_tss_permissions
- endef
-
- define make_fapi_dirs
-- ($(call make_tss_dir,$(DESTDIR)$(runstatedir)/tpm2-tss/eventlog/) || true) && \
- ($(call make_tss_dir,$(DESTDIR)$(localstatedir)/lib/tpm2-tss/system/keystore/))
- endef
-
- define set_fapi_permissions
- if test -z "${DESTDIR}"; then \ e
-- ($(call set_tss_permissions,$(DESTDIR)$(runstatedir)/tpm2-tss)) && \
- ($(call set_tss_permissions,$(DESTDIR)$(localstatedir)/lib/tpm2-tss)) \
- fi
- endef
-@@ -784,7 +782,6 @@ endef
-
- define check_fapi_dirs
- if test -z "${DESTDIR}"; then \
-- ($(call check_dir,$(DESTDIR)$(runstatedir)/tpm2-tss/eventlog/)) && \
- ($(call check_dir,$(DESTDIR)$(localstatedir)/lib/tpm2-tss/system/keystore/)) \
- fi;
- endef
diff --git a/app-crypt/tpm2-tss/files/tpm2-tss-4.0.0-libressl-no-cert-tests.patch b/app-crypt/tpm2-tss/files/tpm2-tss-4.0.0-libressl-no-cert-tests.patch
deleted file mode 100644
index d402822..0000000
--- a/app-crypt/tpm2-tss/files/tpm2-tss-4.0.0-libressl-no-cert-tests.patch
+++ /dev/null
@@ -1,90 +0,0 @@
-Upstream-PR: https://github.com/tpm2-software/tpm2-tss/pull/2585
-
-From 59d5382e94a2ace2292cb0add68c5e94cf1c071c Mon Sep 17 00:00:00 2001
-From: Juergen Repp <juergen_repp@web.de>
-Date: Wed, 22 Mar 2023 10:54:59 +0100
-Subject: [PATCH] FAPI: Skip test fapi-fix-provisioning-with template if no
- certificate is available.
-
-If the configure option --enable-self-generated-certificate is not used this
-test can't be executed because no certificate will be stored in NV ram. The
-test will be skipped if no certificate is available.
-Fixes: #2558
-
-Signed-off-by: Juergen Repp <juergen_repp@web.de>
----
- .../fapi-provisioning-with-template.int.c | 40 ++++++++++++++++++-
- 1 file changed, 39 insertions(+), 1 deletion(-)
-
-diff --git a/test/integration/fapi-provisioning-with-template.int.c b/test/integration/fapi-provisioning-with-template.int.c
-index 27f8e579d..ddef2a8e1 100644
---- a/test/integration/fapi-provisioning-with-template.int.c
-+++ b/test/integration/fapi-provisioning-with-template.int.c
-@@ -4,6 +4,8 @@
- #endif
-
- #include <stdlib.h>
-+#include <stdio.h>
-+#include <unistd.h>
-
- #include "tss2_esys.h"
- #include "tss2_fapi.h"
-@@ -31,6 +33,39 @@
- * @retval EXIT_SKIP
- *
- */
-+static bool
-+fapi_ek_certless()
-+{
-+ FILE *stream = NULL;
-+ long config_size;
-+ char *config = NULL;
-+ char *fapi_config_file = getenv("TSS2_FAPICONF");
-+
-+ stream = fopen(fapi_config_file, "r");
-+ if (!stream) {
-+ LOG_ERROR("File %s does not exist", fapi_config_file);
-+ return NULL;
-+ }
-+ fseek(stream, 0L, SEEK_END);
-+ config_size = ftell(stream);
-+ fclose(stream);
-+ config = malloc(config_size + 1);
-+ stream = fopen(fapi_config_file, "r");
-+ ssize_t ret = read(fileno(stream), config, config_size);
-+ if (ret != config_size) {
-+ LOG_ERROR("IO error %s.", fapi_config_file);
-+ return NULL;
-+ }
-+ config[config_size] = '\0';
-+ if (strstr(config, "\"ek_cert_less\": \"yes\"") == NULL) {
-+ SAFE_FREE(config);
-+ return false;
-+ } else {
-+ SAFE_FREE(config);
-+ return true;
-+ }
-+}
-+
- int
- test_fapi_provision_template(FAPI_CONTEXT *context)
- {
-@@ -148,6 +183,9 @@ test_fapi_provision_template(FAPI_CONTEXT *context)
- TPM2B_AUTH auth = { .size = 0, .buffer = {} };
- TPM2B_MAX_NV_BUFFER nv_data;
-
-+ if (fapi_ek_certless())
-+ return EXIT_SKIP;
-+
- if (strcmp(FAPI_PROFILE, "P_ECC") == 0) {
- nv_template_idx = ecc_nv_template_idx;
- nv_nonce_idx = ecc_nv_nonce_idx;
-@@ -166,7 +204,7 @@ test_fapi_provision_template(FAPI_CONTEXT *context)
- r = Esys_Initialize(&esys_ctx, tcti, NULL);
- goto_if_error(r, "Error Esys_Initialize", error);
-
-- /*
-+ /*
- * Store template (marshaled TPMT_PUBLIC) in NV ram.
- */
- r = Tss2_MU_TPMT_PUBLIC_Marshal(&in_public, &nv_data.buffer[0],
diff --git a/app-crypt/tpm2-tss/tpm2-tss-4.0.1-r1.ebuild b/app-crypt/tpm2-tss/tpm2-tss-4.0.1-r1.ebuild
deleted file mode 100644
index d5852e8..0000000
--- a/app-crypt/tpm2-tss/tpm2-tss-4.0.1-r1.ebuild
+++ /dev/null
@@ -1,110 +0,0 @@
-# Copyright 1999-2024 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-inherit autotools flag-o-matic linux-info multilib-minimal tmpfiles udev
-
-DESCRIPTION="TCG Trusted Platform Module 2.0 Software Stack"
-HOMEPAGE="https://github.com/tpm2-software/tpm2-tss"
-SRC_URI="https://github.com/tpm2-software/${PN}/releases/download/${PV}/${P}.tar.gz"
-
-LICENSE="BSD-2"
-SLOT="0/4"
-KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc64 ~riscv ~x86"
-IUSE="doc +fapi +openssl mbedtls +policy static-libs test"
-RESTRICT="!test? ( test )"
-
-REQUIRED_USE="
- ^^ ( mbedtls openssl )
- fapi? ( openssl !mbedtls )
- policy? ( openssl !mbedtls )
-"
-
-RDEPEND="
- acct-group/tss
- acct-user/tss
- sys-apps/util-linux:=[${MULTILIB_USEDEP}]
- fapi? (
- dev-libs/json-c:=[${MULTILIB_USEDEP}]
- >=net-misc/curl-7.80.0[${MULTILIB_USEDEP}]
- )
- mbedtls? ( net-libs/mbedtls:=[${MULTILIB_USEDEP}] )
- openssl? ( dev-libs/openssl:=[${MULTILIB_USEDEP}] )
-"
-
-DEPEND="
- ${RDEPEND}
- test? ( app-crypt/swtpm
- dev-libs/uthash
- dev-util/cmocka
- fapi? ( >=net-misc/curl-7.80.0 ) )
-"
-
-BDEPEND="
- sys-apps/acl
- virtual/pkgconfig
- doc? ( app-text/doxygen )
-"
-
-PATCHES=(
- "${FILESDIR}/${PN}-3.2.0-libressl.patch"
- "${FILESDIR}/${PN}-4.0.0-libressl-no-cert-tests.patch"
- "${FILESDIR}/${PN}-4.0.0-Dont-install-files-into-run.patch"
- "${FILESDIR}/${PN}-4.0.1-Make-sysusers-and-tmpfiles-optional.patch"
- "${FILESDIR}/${PN}-4.0.1-Do-not-consider-failures-to-write-files-in-sys-hard.patch"
-)
-
-pkg_setup() {
- local CONFIG_CHECK="~TCG_TPM"
- linux-info_pkg_setup
- kernel_is ge 4 12 0 || ewarn "At least kernel 4.12.0 is required"
-}
-
-src_prepare() {
- default
- eautoreconf
-}
-
-multilib_src_configure() {
- # Fails with inlining
- filter-flags -fno-semantic-interposition
- # tests fail with LTO enabbled. See bug 865275 and 865279
- filter-lto
-
- local myconf=(
- --localstatedir=/var
- $(multilib_native_use_enable doc doxygen-doc)
- $(use_enable fapi)
- $(use_enable policy)
- $(use_enable static-libs static)
- $(multilib_native_use_enable test unit)
- $(multilib_native_use_enable test integration)
- --disable-tcti-libtpms
- --disable-defaultflags
- --disable-weakcrypto
- --with-crypto="$(usex mbedtls mbed ossl)"
- --with-runstatedir=/run
- --with-udevrulesdir="$(get_udevdir)/rules.d"
- --with-udevrulesprefix=60-
- --without-sysusersdir
- --with-tmpfilesdir="/usr/lib/tmpfiles.d"
- )
-
- ECONF_SOURCE=${S} econf "${myconf[@]}"
-}
-
-multilib_src_install() {
- default
- keepdir /var/lib/tpm2-tss/system/keystore
- find "${ED}" -name '*.la' -delete || die
-}
-
-pkg_postinst() {
- tmpfiles_process tpm2-tss-fapi.conf
- udev_reload
-}
-
-pkg_postrm() {
- udev_reload
-}
diff --git a/app-crypt/tpm2-tss/tpm2-tss-4.0.1.ebuild b/app-crypt/tpm2-tss/tpm2-tss-4.0.1.ebuild
deleted file mode 100644
index a0f8412..0000000
--- a/app-crypt/tpm2-tss/tpm2-tss-4.0.1.ebuild
+++ /dev/null
@@ -1,102 +0,0 @@
-# Copyright 1999-2024 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-inherit autotools flag-o-matic linux-info multilib-minimal tmpfiles udev
-
-DESCRIPTION="TCG Trusted Platform Module 2.0 Software Stack"
-HOMEPAGE="https://github.com/tpm2-software/tpm2-tss"
-SRC_URI="https://github.com/tpm2-software/${PN}/releases/download/${PV}/${P}.tar.gz"
-
-LICENSE="BSD-2"
-SLOT="0/4"
-KEYWORDS="amd64 arm arm64 ~loong ppc64 ~riscv x86"
-IUSE="doc +fapi +openssl mbedtls +policy static-libs test"
-
-RESTRICT="!test? ( test )"
-
-REQUIRED_USE="^^ ( mbedtls openssl )
- fapi? ( openssl !mbedtls )
- policy? ( openssl !mbedtls )"
-
-RDEPEND="acct-group/tss
- acct-user/tss
- sys-apps/util-linux:=[${MULTILIB_USEDEP}]
- fapi? ( dev-libs/json-c:=[${MULTILIB_USEDEP}]
- >=net-misc/curl-7.80.0[${MULTILIB_USEDEP}] )
- mbedtls? ( net-libs/mbedtls:=[${MULTILIB_USEDEP}] )
- openssl? ( dev-libs/openssl:=[${MULTILIB_USEDEP}] )"
-
-DEPEND="${RDEPEND}
- test? ( app-crypt/swtpm
- dev-libs/uthash
- dev-util/cmocka
- fapi? ( >=net-misc/curl-7.80.0 ) )"
-BDEPEND="sys-apps/acl
- virtual/pkgconfig
- doc? ( app-text/doxygen )"
-
-PATCHES=(
- "${FILESDIR}/${PN}-3.2.0-libressl.patch"
- "${FILESDIR}/${PN}-4.0.0-libressl-no-cert-tests.patch"
- "${FILESDIR}/${PN}-4.0.0-Dont-install-files-into-run.patch"
- "${FILESDIR}/${PN}-4.0.1-Make-sysusers-and-tmpfiles-optional.patch"
- )
-
-pkg_setup() {
- local CONFIG_CHECK=" \
- ~TCG_TPM
- "
- linux-info_pkg_setup
- kernel_is ge 4 12 0 || ewarn "At least kernel 4.12.0 is required"
-}
-
-src_prepare() {
- default
- eautoreconf
-}
-
-multilib_src_configure() {
- # Fails with inlining
- filter-flags -fno-semantic-interposition
- # tests fail with LTO enabbled. See bug 865275 and 865279
- filter-lto
-
- # Disable for libressl for now
- # https://github.com/tpm2-software/tpm2-tss/pull/2380
- # $(multilib_native_use_enable test self-generated-certificate) \
-
- ECONF_SOURCE=${S} econf \
- --localstatedir=/var \
- $(multilib_native_use_enable doc doxygen-doc) \
- $(use_enable fapi) \
- $(use_enable policy) \
- $(use_enable static-libs static) \
- $(multilib_native_use_enable test unit) \
- $(multilib_native_use_enable test integration) \
- --disable-tcti-libtpms \
- --disable-defaultflags \
- --disable-weakcrypto \
- --with-crypto="$(usex mbedtls mbed ossl)" \
- --with-runstatedir=/run \
- --with-udevrulesdir="$(get_udevdir)/rules.d" \
- --with-udevrulesprefix=60- \
- --without-sysusersdir \
- --with-tmpfilesdir="/usr/lib/tmpfiles.d"
-}
-
-multilib_src_install() {
- default
- keepdir /var/lib/tpm2-tss/system/keystore
- find "${ED}" -name '*.la' -delete || die
-}
-
-pkg_postinst() {
- tmpfiles_process tpm2-tss-fapi.conf
- udev_reload
-}
-
-pkg_postrm() {
- udev_reload
-}
diff --git a/app-crypt/tpm2-tss/tpm2-tss-4.0.2-r1.ebuild b/app-crypt/tpm2-tss/tpm2-tss-4.0.2-r1.ebuild
deleted file mode 100644
index 92363ec..0000000
--- a/app-crypt/tpm2-tss/tpm2-tss-4.0.2-r1.ebuild
+++ /dev/null
@@ -1,110 +0,0 @@
-# Copyright 1999-2024 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-inherit autotools flag-o-matic linux-info multilib-minimal tmpfiles udev
-
-DESCRIPTION="TCG Trusted Platform Module 2.0 Software Stack"
-HOMEPAGE="https://github.com/tpm2-software/tpm2-tss"
-SRC_URI="https://github.com/tpm2-software/${PN}/releases/download/${PV}/${P}.tar.gz"
-
-LICENSE="BSD-2"
-SLOT="0/4"
-KEYWORDS="amd64 arm arm64 ~loong ppc64 ~riscv x86"
-IUSE="doc +fapi +openssl mbedtls +policy static-libs test"
-RESTRICT="!test? ( test )"
-
-REQUIRED_USE="
- ^^ ( mbedtls openssl )
- fapi? ( openssl !mbedtls )
- policy? ( openssl !mbedtls )
-"
-
-RDEPEND="
- acct-group/tss
- acct-user/tss
- sys-apps/util-linux:=[${MULTILIB_USEDEP}]
- fapi? (
- dev-libs/json-c:=[${MULTILIB_USEDEP}]
- >=net-misc/curl-7.80.0[${MULTILIB_USEDEP}]
- )
- mbedtls? ( net-libs/mbedtls:=[${MULTILIB_USEDEP}] )
- openssl? ( dev-libs/openssl:=[${MULTILIB_USEDEP}] )
-"
-
-DEPEND="
- ${RDEPEND}
- test? ( app-crypt/swtpm
- dev-libs/uthash
- dev-util/cmocka
- fapi? ( >=net-misc/curl-7.80.0 ) )
-"
-
-BDEPEND="
- sys-apps/acl
- virtual/pkgconfig
- doc? ( app-text/doxygen )
-"
-
-PATCHES=(
- "${FILESDIR}/${PN}-3.2.0-libressl.patch"
- "${FILESDIR}/${PN}-4.0.2-Dont-install-files-into-run.patch"
- "${FILESDIR}/${PN}-4.0.1-Make-sysusers-and-tmpfiles-optional.patch"
- "${FILESDIR}/${PN}-4.0.1-Do-not-consider-failures-to-write-files-in-sys-hard.patch"
- "${FILESDIR}/${PN}-4.0.2-Hide-write-all-function.patch"
-)
-
-pkg_setup() {
- local CONFIG_CHECK="~TCG_TPM"
- linux-info_pkg_setup
- kernel_is ge 4 12 0 || ewarn "At least kernel 4.12.0 is required"
-}
-
-src_prepare() {
- default
- eautoreconf
-}
-
-multilib_src_configure() {
- # Fails with inlining
- filter-flags -fno-semantic-interposition
- # tests fail with LTO enabbled. See bug 865275 and 865279
- filter-lto
-
- local myconf=(
- --localstatedir=/var
- $(multilib_native_use_enable doc doxygen-doc)
- $(use_enable fapi)
- $(use_enable policy)
- $(use_enable static-libs static)
- $(multilib_native_use_enable test unit)
- $(multilib_native_use_enable test integration)
- --disable-tcti-libtpms
- --disable-defaultflags
- --disable-weakcrypto
- --with-crypto="$(usex mbedtls mbed ossl)"
- --with-runstatedir=/run
- --with-udevrulesdir="$(get_udevdir)/rules.d"
- --with-udevrulesprefix=60-
- --without-sysusersdir
- --with-tmpfilesdir="/usr/lib/tmpfiles.d"
- )
-
- ECONF_SOURCE=${S} econf "${myconf[@]}"
-}
-
-multilib_src_install() {
- default
- keepdir /var/lib/tpm2-tss/system/keystore
- find "${ED}" -name '*.la' -delete || die
-}
-
-pkg_postinst() {
- tmpfiles_process tpm2-tss-fapi.conf
- udev_reload
-}
-
-pkg_postrm() {
- udev_reload
-}
diff --git a/app-crypt/tpm2-tss/tpm2-tss-4.0.2.ebuild b/app-crypt/tpm2-tss/tpm2-tss-4.0.2.ebuild
deleted file mode 100644
index 796825d..0000000
--- a/app-crypt/tpm2-tss/tpm2-tss-4.0.2.ebuild
+++ /dev/null
@@ -1,109 +0,0 @@
-# Copyright 1999-2024 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-inherit autotools flag-o-matic linux-info multilib-minimal tmpfiles udev
-
-DESCRIPTION="TCG Trusted Platform Module 2.0 Software Stack"
-HOMEPAGE="https://github.com/tpm2-software/tpm2-tss"
-SRC_URI="https://github.com/tpm2-software/${PN}/releases/download/${PV}/${P}.tar.gz"
-
-LICENSE="BSD-2"
-SLOT="0/4"
-KEYWORDS="amd64 arm arm64 ~loong ppc64 ~riscv x86"
-IUSE="doc +fapi +openssl mbedtls +policy static-libs test"
-RESTRICT="!test? ( test )"
-
-REQUIRED_USE="
- ^^ ( mbedtls openssl )
- fapi? ( openssl !mbedtls )
- policy? ( openssl !mbedtls )
-"
-
-RDEPEND="
- acct-group/tss
- acct-user/tss
- sys-apps/util-linux:=[${MULTILIB_USEDEP}]
- fapi? (
- dev-libs/json-c:=[${MULTILIB_USEDEP}]
- >=net-misc/curl-7.80.0[${MULTILIB_USEDEP}]
- )
- mbedtls? ( net-libs/mbedtls:=[${MULTILIB_USEDEP}] )
- openssl? ( dev-libs/openssl:=[${MULTILIB_USEDEP}] )
-"
-
-DEPEND="
- ${RDEPEND}
- test? ( app-crypt/swtpm
- dev-libs/uthash
- dev-util/cmocka
- fapi? ( >=net-misc/curl-7.80.0 ) )
-"
-
-BDEPEND="
- sys-apps/acl
- virtual/pkgconfig
- doc? ( app-text/doxygen )
-"
-
-PATCHES=(
- "${FILESDIR}/${PN}-3.2.0-libressl.patch"
- "${FILESDIR}/${PN}-4.0.2-Dont-install-files-into-run.patch"
- "${FILESDIR}/${PN}-4.0.1-Make-sysusers-and-tmpfiles-optional.patch"
- "${FILESDIR}/${PN}-4.0.1-Do-not-consider-failures-to-write-files-in-sys-hard.patch"
-)
-
-pkg_setup() {
- local CONFIG_CHECK="~TCG_TPM"
- linux-info_pkg_setup
- kernel_is ge 4 12 0 || ewarn "At least kernel 4.12.0 is required"
-}
-
-src_prepare() {
- default
- eautoreconf
-}
-
-multilib_src_configure() {
- # Fails with inlining
- filter-flags -fno-semantic-interposition
- # tests fail with LTO enabbled. See bug 865275 and 865279
- filter-lto
-
- local myconf=(
- --localstatedir=/var
- $(multilib_native_use_enable doc doxygen-doc)
- $(use_enable fapi)
- $(use_enable policy)
- $(use_enable static-libs static)
- $(multilib_native_use_enable test unit)
- $(multilib_native_use_enable test integration)
- --disable-tcti-libtpms
- --disable-defaultflags
- --disable-weakcrypto
- --with-crypto="$(usex mbedtls mbed ossl)"
- --with-runstatedir=/run
- --with-udevrulesdir="$(get_udevdir)/rules.d"
- --with-udevrulesprefix=60-
- --without-sysusersdir
- --with-tmpfilesdir="/usr/lib/tmpfiles.d"
- )
-
- ECONF_SOURCE=${S} econf "${myconf[@]}"
-}
-
-multilib_src_install() {
- default
- keepdir /var/lib/tpm2-tss/system/keystore
- find "${ED}" -name '*.la' -delete || die
-}
-
-pkg_postinst() {
- tmpfiles_process tpm2-tss-fapi.conf
- udev_reload
-}
-
-pkg_postrm() {
- udev_reload
-}
diff --git a/app-crypt/tpm2-tss/tpm2-tss-4.1.3.ebuild b/app-crypt/tpm2-tss/tpm2-tss-4.1.3.ebuild
deleted file mode 100644
index 6584f2d..0000000
--- a/app-crypt/tpm2-tss/tpm2-tss-4.1.3.ebuild
+++ /dev/null
@@ -1,110 +0,0 @@
-# Copyright 1999-2024 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-inherit autotools flag-o-matic linux-info multilib-minimal tmpfiles udev
-
-DESCRIPTION="TCG Trusted Platform Module 2.0 Software Stack"
-HOMEPAGE="https://github.com/tpm2-software/tpm2-tss"
-SRC_URI="https://github.com/tpm2-software/${PN}/releases/download/${PV}/${P}.tar.gz"
-
-LICENSE="BSD-2"
-SLOT="0/4"
-KEYWORDS="amd64 arm arm64 ~loong ppc64 ~riscv x86"
-IUSE="doc +fapi +openssl mbedtls +policy static-libs test"
-RESTRICT="!test? ( test )"
-
-REQUIRED_USE="
- ^^ ( mbedtls openssl )
- fapi? ( openssl !mbedtls )
- policy? ( openssl !mbedtls )
-"
-
-RDEPEND="
- acct-group/tss
- acct-user/tss
- sys-apps/util-linux:=[${MULTILIB_USEDEP}]
- fapi? (
- dev-libs/json-c:=[${MULTILIB_USEDEP}]
- >=net-misc/curl-7.80.0[${MULTILIB_USEDEP}]
- )
- mbedtls? ( net-libs/mbedtls:=[${MULTILIB_USEDEP}] )
- openssl? ( dev-libs/openssl:=[${MULTILIB_USEDEP}] )
-"
-
-DEPEND="
- ${RDEPEND}
- test? ( app-crypt/swtpm
- dev-libs/uthash
- dev-util/cmocka
- fapi? ( >=net-misc/curl-7.80.0 ) )
-"
-
-BDEPEND="
- sys-apps/acl
- virtual/pkgconfig
- doc? ( app-text/doxygen )
-"
-
-PATCHES=(
- "${FILESDIR}/${PN}-4.0.2-Dont-install-files-into-run.patch"
- "${FILESDIR}/${PN}-4.1.3-libressl.patch"
-)
-
-pkg_setup() {
- local CONFIG_CHECK="~TCG_TPM"
- linux-info_pkg_setup
- kernel_is ge 4 12 0 || ewarn "At least kernel 4.12.0 is required"
-}
-
-src_prepare() {
- default
- eautoreconf
-}
-
-multilib_src_configure() {
- # Fails with inlining
- filter-flags -fno-semantic-interposition
- # tests fail with LTO enabbled. See bug 865275 and 865279
- filter-lto
-
- local myconf=(
- --localstatedir=/var
- $(multilib_native_use_enable doc doxygen-doc)
- $(use_enable fapi)
- $(use_enable policy)
- $(use_enable static-libs static)
- $(multilib_native_use_enable test unit)
- $(multilib_native_use_enable test integration)
- --disable-tcti-libtpms
- --disable-tcti-spi-ltt2go
- --disable-tcti-spi-ftdi
- --disable-tcti-i2c-ftdi
- --disable-defaultflags
- --disable-weakcrypto
- --with-crypto="$(usex mbedtls mbed ossl)"
- --with-runstatedir=/run
- --with-udevrulesdir="$(get_udevdir)/rules.d"
- --with-udevrulesprefix=60-
- --without-sysusersdir
- --with-tmpfilesdir="/usr/lib/tmpfiles.d"
- )
-
- ECONF_SOURCE=${S} econf "${myconf[@]}"
-}
-
-multilib_src_install() {
- default
- keepdir /var/lib/tpm2-tss/system/keystore
- find "${ED}" -name '*.la' -delete || die
-}
-
-pkg_postinst() {
- tmpfiles_process tpm2-tss-fapi.conf
- udev_reload
-}
-
-pkg_postrm() {
- udev_reload
-}
^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2025-01-12 16:31 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-14 1:16 [gentoo-commits] repo/proj/libressl:master commit in: app-crypt/tpm2-tss/files/, app-crypt/tpm2-tss/ orbea
-- strict thread matches above, loose matches on Subject: below --
2025-01-12 16:31 orbea
2023-04-14 1:16 orbea
2023-04-14 1:16 orbea
2022-10-07 21:11 Quentin Retornaz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox