public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [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; 4+ 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] 4+ 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; 4+ 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] 4+ 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; 4+ 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] 4+ 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; 4+ 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] 4+ messages in thread

end of thread, other threads:[~2023-04-14  1:16 UTC | newest]

Thread overview: 4+ 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 --
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