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/, app-crypt/tpm2-tss/files/
@ 2022-07-05 21:19 Quentin Retornaz
  0 siblings, 0 replies; 5+ messages in thread
From: Quentin Retornaz @ 2022-07-05 21:19 UTC (permalink / raw
  To: gentoo-commits

commit:     0df6c8964f4fe0fff2aac033e5f1622be55a4cfe
Author:     orbea <orbea <AT> riseup <DOT> net>
AuthorDate: Tue Jul  5 07:01:35 2022 +0000
Commit:     Quentin Retornaz <gentoo <AT> retornaz <DOT> com>
CommitDate: Tue Jul  5 21:18:45 2022 +0000
URL:        https://gitweb.gentoo.org/repo/proj/libressl.git/commit/?id=0df6c896

app-crypt/tpm2-tss: Add package

Upstream-PR: https://github.com/tpm2-software/tpm2-tss/pull/2380
Signed-off-by: orbea <orbea <AT> riseup.net>
Signed-off-by: Quentin Retornaz <gentoo <AT> retornaz.com>

 app-crypt/tpm2-tss/Manifest                        |   1 +
 ...1.0-Dont-run-systemd-sysusers-in-Makefile.patch |  29 ++++++
 .../tpm2-tss/files/tpm2-tss-3.2.0-libressl.patch   |  84 +++++++++++++++++
 app-crypt/tpm2-tss/metadata.xml                    |  20 +++++
 app-crypt/tpm2-tss/tpm2-tss-3.2.0-r3.ebuild        | 100 +++++++++++++++++++++
 5 files changed, 234 insertions(+)

diff --git a/app-crypt/tpm2-tss/Manifest b/app-crypt/tpm2-tss/Manifest
new file mode 100644
index 0000000..fbe1511
--- /dev/null
+++ b/app-crypt/tpm2-tss/Manifest
@@ -0,0 +1 @@
+DIST tpm2-tss-3.2.0.tar.gz 1629211 BLAKE2B a89aa4d89a50bdfb5a9652874d30e2138747bd022049f2be2d0b56e296329d0c41254033ec3a062dbd64fde54a62e952f54446c551e5788231827cd53fae045a SHA512 cabb411f074dfa94919ba914849aac77a0ac2f50622e28a1406cf575369148774748e0e2b7a7c566ec83561a96d4b883bac5a3b1763f4cf48668a0c5d68c0a23

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
new file mode 100644
index 0000000..b66b6e7
--- /dev/null
+++ b/app-crypt/tpm2-tss/files/tpm2-tss-3.1.0-Dont-run-systemd-sysusers-in-Makefile.patch
@@ -0,0 +1,29 @@
+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/files/tpm2-tss-3.2.0-libressl.patch b/app-crypt/tpm2-tss/files/tpm2-tss-3.2.0-libressl.patch
new file mode 100644
index 0000000..211424c
--- /dev/null
+++ b/app-crypt/tpm2-tss/files/tpm2-tss-3.2.0-libressl.patch
@@ -0,0 +1,84 @@
+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
+Subject: [PATCH] Support LibreSSL
+
+This works with LibreSSL 3.5.x.
+
+Signed-off-by: orbea <orbea@riseup.net>
+---
+ src/tss2-esys/esys_crypto_ossl.c | 13 ++++++++++---
+ src/tss2-fapi/fapi_crypto.c      |  4 ++--
+ 2 files changed, 12 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
+--- 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,
+                    "Error EVP_MD_CTX_create", cleanup);
+     }
+ 
+-#if OPENSSL_VERSION_NUMBER < 0x10101000L
++#if OPENSSL_VERSION_NUMBER < 0x10101000L || defined(LIBRESSL_VERSION_NUMBER)
+     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(
+     int rc;
+ #if OPENSSL_VERSION_NUMBER < 0x30000000L
+     const RAND_METHOD *rand_save = RAND_get_rand_method();
++#ifdef LIBRESSL_VERSION_NUMBER
++    RAND_set_rand_method(RAND_SSLeay());
++#else
+     RAND_set_rand_method(RAND_OpenSSL());
++#endif
+ #else
+     OSSL_LIB_CTX *libctx = OSSL_LIB_CTX_new();
+     if (!libctx)
+@@ -615,8 +619,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();
+-
++#ifdef LIBRESSL_VERSION_NUMBER
++    RAND_set_rand_method(RAND_SSLeay());
++#else
+     RAND_set_rand_method(RAND_OpenSSL());
++#endif
+ #else
+     OSSL_LIB_CTX *libctx = NULL;
+     EVP_MD * hashAlg = NULL;
+@@ -919,7 +926,7 @@ iesys_cryptossl_get_ecdh_point(TPM2B_PUBLIC *key,
+         curveId = NID_secp521r1;
+         key_size = 66;
+         break;
+-#if OPENSSL_VERSION_NUMBER >= 0x10101000L
++#if OPENSSL_VERSION_NUMBER >= 0x10101000L && !defined(LIBRESSL_VERSION_NUMBER)
+     case TPM2_ECC_SM2_P256:
+         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
+--- 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)
+     case TPM2_ECC_NIST_P521:
+         curveId = NID_secp521r1;
+         break;
+-#if OPENSSL_VERSION_NUMBER >= 0x10101000L
++#if OPENSSL_VERSION_NUMBER >= 0x10101000L && !defined(LIBRESSL_VERSION_NUMBER)
+     case TPM2_ECC_SM2_P256:
+         curveId = NID_sm2;
+         break;
+@@ -1155,7 +1155,7 @@ get_ecc_tpm2b_public_from_evp(
+     case NID_secp521r1:
+         tpmCurveId = TPM2_ECC_NIST_P521;
+         break;
+-#if OPENSSL_VERSION_NUMBER >= 0x10101000L
++#if OPENSSL_VERSION_NUMBER >= 0x10101000L && !defined(LIBRESSL_VERSION_NUMBER)
+     case NID_sm2:
+         tpmCurveId = TPM2_ECC_SM2_P256;
+         break;

diff --git a/app-crypt/tpm2-tss/metadata.xml b/app-crypt/tpm2-tss/metadata.xml
new file mode 100644
index 0000000..0a726fa
--- /dev/null
+++ b/app-crypt/tpm2-tss/metadata.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+	<maintainer type="person" proxied="yes">
+		<email>salah.coronya@gmail.com</email>
+		<name>Christopher Byrne</name>
+	</maintainer>
+	<maintainer type="project" proxied="proxy">
+		<email>proxy-maint@gentoo.org</email>
+		<name>Proxy Maintainers</name>
+	</maintainer>
+	<use>
+		<flag name="fapi">Enable feature API (requires openssl as crypto backend)</flag>
+		<flag name="mbedtls">Use <pkg>net-libs/mbedtls</pkg> as crypto engine</flag>
+		<flag name="openssl">Use <pkg>dev-libs/openssl</pkg> as crypto engine</flag>
+	</use>
+	<upstream>
+		<remote-id type="github">tpm2-software/tpm2-tss</remote-id>
+	</upstream>
+</pkgmetadata>

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
new file mode 100644
index 0000000..bc8875b
--- /dev/null
+++ b/app-crypt/tpm2-tss/tpm2-tss-3.2.0-r3.ebuild
@@ -0,0 +1,100 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit autotools 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() {
+	ECONF_SOURCE=${S} econf \
+		--localstatedir=/var \
+		$(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/, app-crypt/tpm2-tss/files/
@ 2023-04-15  0:49 orbea
  0 siblings, 0 replies; 5+ messages in thread
From: orbea @ 2023-04-15  0:49 UTC (permalink / raw
  To: gentoo-commits

commit:     22da0bdd0547668548cd1c0ef73f95d538a6356c
Author:     orbea <orbea <AT> riseup <DOT> net>
AuthorDate: Sat Apr 15 00:48:24 2023 +0000
Commit:     orbea <orbea <AT> riseup <DOT> net>
CommitDate: Sat Apr 15 00:48:24 2023 +0000
URL:        https://gitweb.gentoo.org/repo/proj/libressl.git/commit/?id=22da0bdd

app-crypt/tpm2-tss: Fix tests

Disables two tests that create certificates which doesn't currently work
with libressl.

Uptream-PR: https://github.com/tpm2-software/tpm2-tss/pull/2585
Signed-off-by: orbea <orbea <AT> riseup.net>

 .../tpm2-tss-4.0.0-libressl-no-cert-tests.patch    | 90 ++++++++++++++++++++++
 app-crypt/tpm2-tss/tpm2-tss-4.0.0.ebuild           |  1 +
 app-crypt/tpm2-tss/tpm2-tss-4.0.1.ebuild           |  1 +
 3 files changed, 92 insertions(+)

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
new file mode 100644
index 0000000..d402822
--- /dev/null
+++ b/app-crypt/tpm2-tss/files/tpm2-tss-4.0.0-libressl-no-cert-tests.patch
@@ -0,0 +1,90 @@
+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.0.ebuild b/app-crypt/tpm2-tss/tpm2-tss-4.0.0.ebuild
index a3e6f01..375dce6 100644
--- a/app-crypt/tpm2-tss/tpm2-tss-4.0.0.ebuild
+++ b/app-crypt/tpm2-tss/tpm2-tss-4.0.0.ebuild
@@ -38,6 +38,7 @@ BDEPEND="sys-apps/acl
 
 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"
 	)
 

diff --git a/app-crypt/tpm2-tss/tpm2-tss-4.0.1.ebuild b/app-crypt/tpm2-tss/tpm2-tss-4.0.1.ebuild
index 4cf21aa..664e42c 100644
--- a/app-crypt/tpm2-tss/tpm2-tss-4.0.1.ebuild
+++ b/app-crypt/tpm2-tss/tpm2-tss-4.0.1.ebuild
@@ -39,6 +39,7 @@ BDEPEND="sys-apps/acl
 
 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"
 	)
 


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [gentoo-commits] repo/proj/libressl:master commit in: app-crypt/tpm2-tss/, app-crypt/tpm2-tss/files/
@ 2023-06-28  1:12 orbea
  0 siblings, 0 replies; 5+ messages in thread
From: orbea @ 2023-06-28  1:12 UTC (permalink / raw
  To: gentoo-commits

commit:     34bdabd51bedb7596d21167c51be2b7b39562331
Author:     orbea <orbea <AT> riseup <DOT> net>
AuthorDate: Wed Jun 28 00:29:43 2023 +0000
Commit:     orbea <orbea <AT> riseup <DOT> net>
CommitDate: Wed Jun 28 00:29:43 2023 +0000
URL:        https://gitweb.gentoo.org/repo/proj/libressl.git/commit/?id=34bdabd5

app-crypt/tpm2-tss: drop 3.2.0-r4, 3.2.1, 3.2.2, 4.0.0

Signed-off-by: orbea <orbea <AT> riseup.net>

 app-crypt/tpm2-tss/Manifest                        |   4 -
 ...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 ---------------------
 ...2.1-Dont-run-systemd-sysusers-in-Makefile.patch |  61 ---------
 app-crypt/tpm2-tss/tpm2-tss-3.2.0-r4.ebuild        | 108 ---------------
 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           |  98 --------------
 9 files changed, 707 deletions(-)

diff --git a/app-crypt/tpm2-tss/Manifest b/app-crypt/tpm2-tss/Manifest
index b76f835..e5a285d 100644
--- a/app-crypt/tpm2-tss/Manifest
+++ b/app-crypt/tpm2-tss/Manifest
@@ -1,5 +1 @@
-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.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
deleted file mode 100644
index 90b1280..0000000
--- a/app-crypt/tpm2-tss/files/tpm2-tss-3.2.0-Dont-run-systemd-sysusers-in-Makefile.patch
+++ /dev/null
@@ -1,57 +0,0 @@
-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
deleted file mode 100644
index b7d5e5c..0000000
--- a/app-crypt/tpm2-tss/files/tpm2-tss-3.2.0-slibtool.patch
+++ /dev/null
@@ -1,49 +0,0 @@
-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
deleted file mode 100644
index aff792a..0000000
--- a/app-crypt/tpm2-tss/files/tpm2-tss-3.2.0-test-fix-usage-of-FILE-in-unit-test-fapi-io.patch
+++ /dev/null
@@ -1,146 +0,0 @@
-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/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
deleted file mode 100644
index 7e55f96..0000000
--- a/app-crypt/tpm2-tss/files/tpm2-tss-3.2.1-Dont-run-systemd-sysusers-in-Makefile.patch
+++ /dev/null
@@ -1,61 +0,0 @@
-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/tpm2-tss-3.2.0-r4.ebuild b/app-crypt/tpm2-tss/tpm2-tss-3.2.0-r4.ebuild
deleted file mode 100644
index 1064e7f..0000000
--- a/app-crypt/tpm2-tss/tpm2-tss-3.2.0-r4.ebuild
+++ /dev/null
@@ -1,108 +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 ~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-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
-
-	# 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
-
-	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
-}

diff --git a/app-crypt/tpm2-tss/tpm2-tss-3.2.1.ebuild b/app-crypt/tpm2-tss/tpm2-tss-3.2.1.ebuild
deleted file mode 100644
index fc628bd..0000000
--- a/app-crypt/tpm2-tss/tpm2-tss-3.2.1.ebuild
+++ /dev/null
@@ -1,90 +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 ~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
deleted file mode 100644
index b8edead..0000000
--- a/app-crypt/tpm2-tss/tpm2-tss-3.2.2.ebuild
+++ /dev/null
@@ -1,94 +0,0 @@
-# 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
deleted file mode 100644
index e924072..0000000
--- a/app-crypt/tpm2-tss/tpm2-tss-4.0.0.ebuild
+++ /dev/null
@@ -1,98 +0,0 @@
-# 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-libressl-no-cert-tests.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() {
-	default
-	eautoreconf
-}
-
-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/, app-crypt/tpm2-tss/files/
@ 2023-06-28  1:12 orbea
  0 siblings, 0 replies; 5+ messages in thread
From: orbea @ 2023-06-28  1:12 UTC (permalink / raw
  To: gentoo-commits

commit:     9e0048a2998bd01369341333a193eb3348bdd94c
Author:     orbea <orbea <AT> riseup <DOT> net>
AuthorDate: Wed Jun 28 00:26:55 2023 +0000
Commit:     orbea <orbea <AT> riseup <DOT> net>
CommitDate: Wed Jun 28 00:26:55 2023 +0000
URL:        https://gitweb.gentoo.org/repo/proj/libressl.git/commit/?id=9e0048a2

app-crypt/tpm2-tss: add ::gentoo patch

Signed-off-by: orbea <orbea <AT> riseup.net>

 ...4.0.1-Make-sysusers-and-tmpfiles-optional.patch | 50 ++++++++++++++++++++++
 app-crypt/tpm2-tss/tpm2-tss-4.0.1.ebuild           |  1 +
 2 files changed, 51 insertions(+)

diff --git a/app-crypt/tpm2-tss/files/tpm2-tss-4.0.1-Make-sysusers-and-tmpfiles-optional.patch b/app-crypt/tpm2-tss/files/tpm2-tss-4.0.1-Make-sysusers-and-tmpfiles-optional.patch
new file mode 100644
index 0000000..d93fcf9
--- /dev/null
+++ b/app-crypt/tpm2-tss/files/tpm2-tss-4.0.1-Make-sysusers-and-tmpfiles-optional.patch
@@ -0,0 +1,50 @@
+From 75f53cf7eab591870ce735203995d01d2f577187 Mon Sep 17 00:00:00 2001
+From: Christopher Byrne <salah.coronya@gmail.com>
+Date: Tue, 13 Jun 2023 21:40:56 -0500
+Subject: [PATCH] configure.ac: Make sysusers and tmpfiles optional
+
+Signed-off-by: Christopher Byrne <salah.coronya@gmail.com>
+---
+ Makefile.am  | 6 +++++-
+ configure.ac | 4 ++--
+ 2 files changed, 7 insertions(+), 3 deletions(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index 2c81cfa9..98965fa7 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -563,10 +563,14 @@ fapi-config.json: dist/fapi-config.json.in
+ 		-e 's|[@]sysmeasurements@|$(sysmeasurements)|g' \
+ 		< "$<" > "$@"
+ 
++if SYSD_SYSUSERS
+ sysusers_DATA = dist/sysusers.d/tpm2-tss.conf
+-tmpfiles_DATA = tpm2-tss-fapi.conf
++endif
+ 
++if SYSD_TMPFILES
++tmpfiles_DATA = tpm2-tss-fapi.conf
+ CLEANFILES += tpm2-tss-fapi.conf
++endif
+ 
+ # We have to do this ourselves, in order to get absolute paths
+ tpm2-tss-fapi.conf: dist/tmpfiles.d/tpm2-tss-fapi.conf.in
+diff --git a/configure.ac b/configure.ac
+index b6550278..2d478147 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -550,9 +550,9 @@ AS_IF([test "x$enable_integration" = "xyes" && test "x$enable_self_generated_cer
+ 
+ # 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")
++AM_CONDITIONAL([SYSD_SYSUSERS], [test "x$systemd_sysusers" = "xyes" && test "x$sysusersdir" != "xno"])
+ AC_CHECK_PROG(systemd_tmpfiles, systemd-tmpfiles, yes)
+-AM_CONDITIONAL(SYSD_TMPFILES, test "x$systemd_tmpfiles" = "xyes")
++AM_CONDITIONAL([SYSD_TMPFILES], [test "x$systemd_tmpfiles" = "xyes" && test "x$tmpfilesdir" != "xno"])
+ 
+ # Check all tools used by make install
+ AS_IF([test "$HOSTOS" = "Linux" && test "x$systemd_sysusers" != "xyes"],
+-- 
+2.39.3
+

diff --git a/app-crypt/tpm2-tss/tpm2-tss-4.0.1.ebuild b/app-crypt/tpm2-tss/tpm2-tss-4.0.1.ebuild
index fc8b4ae..41d4bfd 100644
--- a/app-crypt/tpm2-tss/tpm2-tss-4.0.1.ebuild
+++ b/app-crypt/tpm2-tss/tpm2-tss-4.0.1.ebuild
@@ -41,6 +41,7 @@ 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() {


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [gentoo-commits] repo/proj/libressl:master commit in: app-crypt/tpm2-tss/, app-crypt/tpm2-tss/files/
@ 2024-11-11 20:16 orbea
  0 siblings, 0 replies; 5+ messages in thread
From: orbea @ 2024-11-11 20:16 UTC (permalink / raw
  To: gentoo-commits

commit:     bf87663f6b97c34728808a5e7ca8218e7230a32f
Author:     orbea <orbea <AT> riseup <DOT> net>
AuthorDate: Mon Nov 11 20:13:13 2024 +0000
Commit:     orbea <orbea <AT> riseup <DOT> net>
CommitDate: Mon Nov 11 20:14:39 2024 +0000
URL:        https://gitweb.gentoo.org/repo/proj/libressl.git/commit/?id=bf87663f

app-crypt/tpm2-tss: add versions

Signed-off-by: orbea <orbea <AT> riseup.net>

 app-crypt/tpm2-tss/Manifest                        |   2 +
 ...sider-failures-to-write-files-in-sys-hard.patch |  27 +++++
 ...pm2-tss-4.0.2-Dont-install-files-into-run.patch |  26 +++++
 .../tpm2-tss-4.0.2-Hide-write-all-function.patch   |  24 +++++
 .../tpm2-tss/files/tpm2-tss-4.1.3-libressl.patch   |  24 +++++
 app-crypt/tpm2-tss/tpm2-tss-4.0.1-r1.ebuild        | 110 +++++++++++++++++++++
 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 +++++++++++++++++++++
 9 files changed, 542 insertions(+)

diff --git a/app-crypt/tpm2-tss/Manifest b/app-crypt/tpm2-tss/Manifest
index e5a285d..e08c54a 100644
--- a/app-crypt/tpm2-tss/Manifest
+++ b/app-crypt/tpm2-tss/Manifest
@@ -1 +1,3 @@
 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.1-Do-not-consider-failures-to-write-files-in-sys-hard.patch b/app-crypt/tpm2-tss/files/tpm2-tss-4.0.1-Do-not-consider-failures-to-write-files-in-sys-hard.patch
new file mode 100644
index 0000000..83f123f
--- /dev/null
+++ b/app-crypt/tpm2-tss/files/tpm2-tss-4.0.1-Do-not-consider-failures-to-write-files-in-sys-hard.patch
@@ -0,0 +1,27 @@
+From 0632885d08917092ffc8d98febd158745a74465a Mon Sep 17 00:00:00 2001
+From: Daan De Meyer <daan.j.demeyer@gmail.com>
+Date: Fri, 4 Aug 2023 16:07:52 +0200
+Subject: [PATCH] Do not consider failures to write files in /sys hard errors
+
+systemd-tmpfiles can run in containers, chroots, ... where writing to /sys will fail, so let's suffix these lines with "-" to avoid considering these cases hard errors.
+
+Signed-off-by: Daan De Meyer <daan.j.demeyer@gmail.com>
+---
+ dist/tmpfiles.d/tpm2-tss-fapi.conf.in | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/dist/tmpfiles.d/tpm2-tss-fapi.conf.in b/dist/tmpfiles.d/tpm2-tss-fapi.conf.in
+index 7ea3c652..51ff78e5 100644
+--- a/dist/tmpfiles.d/tpm2-tss-fapi.conf.in
++++ b/dist/tmpfiles.d/tpm2-tss-fapi.conf.in
+@@ -3,5 +3,5 @@ d       @localstatedir@/lib/tpm2-tss/system/keystore   2775 tss  tss   -
+ a+      @localstatedir@/lib/tpm2-tss/system/keystore   -    -    -     -           default:group:tss:rwx
+ d       @runstatedir@/tpm2-tss/eventlog                2775 tss  tss   -           -
+ a+      @runstatedir@/tpm2-tss/eventlog                -    -    -     -           default:group:tss:rwx
+-z	/sys/kernel/security/tpm[0-9]/binary_bios_measurements	0440  root tss	-	    -
+-z	/sys/kernel/security/ima/binary_runtime_measurements	0440  root tss	-	    -
++z-	/sys/kernel/security/tpm[0-9]/binary_bios_measurements	0440  root tss	-	    -
++z-	/sys/kernel/security/ima/binary_runtime_measurements	0440  root tss	-	    -
+-- 
+2.43.0
+

diff --git a/app-crypt/tpm2-tss/files/tpm2-tss-4.0.2-Dont-install-files-into-run.patch b/app-crypt/tpm2-tss/files/tpm2-tss-4.0.2-Dont-install-files-into-run.patch
new file mode 100644
index 0000000..022cd61
--- /dev/null
+++ b/app-crypt/tpm2-tss/files/tpm2-tss-4.0.2-Dont-install-files-into-run.patch
@@ -0,0 +1,26 @@
+diff --git a/Makefile.am b/Makefile.am
+index 07b7a2bf..e478fc77 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -770,13 +770,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 \
+-        ($(call set_tss_permissions,$(DESTDIR)$(runstatedir)/tpm2-tss)) && \
+         ($(call set_tss_permissions,$(DESTDIR)$(localstatedir)/lib/tpm2-tss)) \
+     fi
+ endef
+@@ -787,7 +785,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.2-Hide-write-all-function.patch b/app-crypt/tpm2-tss/files/tpm2-tss-4.0.2-Hide-write-all-function.patch
new file mode 100644
index 0000000..bd682df
--- /dev/null
+++ b/app-crypt/tpm2-tss/files/tpm2-tss-4.0.2-Hide-write-all-function.patch
@@ -0,0 +1,24 @@
+diff --git a/src/util/io.c b/src/util/io.c
+index c6446826..50c0fd6c 100644
+--- a/src/util/io.c
++++ b/src/util/io.c
+@@ -81,6 +81,7 @@ read_all (
+     return recvd_total;
+ }
+ 
++__attribute__ ((visibility("hidden")))
+ ssize_t
+ write_all (
+     SOCKET fd,
+diff --git a/src/util/io.h b/src/util/io.h
+index 25dd5c45..fec391d8 100644
+--- a/src/util/io.h
++++ b/src/util/io.h
+@@ -70,6 +70,7 @@ read_all (
+  * are detected. This is currently limited to interrupted system calls and
+  * short writes.
+  */
++__attribute__ ((visibility("hidden")))
+ ssize_t
+ write_all (
+     SOCKET fd,

diff --git a/app-crypt/tpm2-tss/files/tpm2-tss-4.1.3-libressl.patch b/app-crypt/tpm2-tss/files/tpm2-tss-4.1.3-libressl.patch
new file mode 100644
index 0000000..5fdad44
--- /dev/null
+++ b/app-crypt/tpm2-tss/files/tpm2-tss-4.1.3-libressl.patch
@@ -0,0 +1,24 @@
+Based on https://github.com/tpm2-software/tpm2-tss/pull/2380 
+
+--- a/src/tss2-esys/esys_crypto_ossl.c
++++ b/src/tss2-esys/esys_crypto_ossl.c
+@@ -563,7 +563,9 @@ iesys_cryptossl_random2b(
+     int rc;
+ #if OPENSSL_VERSION_NUMBER < 0x30000000L
+     const RAND_METHOD *rand_save = RAND_get_rand_method();
++#ifndef LIBRESSL_VERSION_NUMBER
+     RAND_set_rand_method(RAND_OpenSSL());
++#endif
+ #else
+     OSSL_LIB_CTX *libctx = OSSL_LIB_CTX_new();
+     if (!libctx)
+@@ -621,7 +623,9 @@ iesys_cryptossl_pk_encrypt(TPM2B_PUBLIC * pub_tpm_key,
+     const EVP_MD * hashAlg = NULL;
+     const RAND_METHOD *rand_save = RAND_get_rand_method();
+ 
++#ifndef LIBRESSL_VERSION_NUMBER
+     RAND_set_rand_method(RAND_OpenSSL());
++#endif
+ #else
+     OSSL_LIB_CTX *libctx = NULL;
+     EVP_MD * hashAlg = NULL;

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
new file mode 100644
index 0000000..d5852e8
--- /dev/null
+++ b/app-crypt/tpm2-tss/tpm2-tss-4.0.1-r1.ebuild
@@ -0,0 +1,110 @@
+# 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.2-r1.ebuild b/app-crypt/tpm2-tss/tpm2-tss-4.0.2-r1.ebuild
new file mode 100644
index 0000000..92363ec
--- /dev/null
+++ b/app-crypt/tpm2-tss/tpm2-tss-4.0.2-r1.ebuild
@@ -0,0 +1,110 @@
+# 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
new file mode 100644
index 0000000..796825d
--- /dev/null
+++ b/app-crypt/tpm2-tss/tpm2-tss-4.0.2.ebuild
@@ -0,0 +1,109 @@
+# 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
new file mode 100644
index 0000000..6584f2d
--- /dev/null
+++ b/app-crypt/tpm2-tss/tpm2-tss-4.1.3.ebuild
@@ -0,0 +1,110 @@
+# 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:[~2024-11-11 20:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-05 21:19 [gentoo-commits] repo/proj/libressl:master commit in: app-crypt/tpm2-tss/, app-crypt/tpm2-tss/files/ Quentin Retornaz
  -- strict thread matches above, loose matches on Subject: below --
2023-04-15  0:49 orbea
2023-06-28  1:12 orbea
2023-06-28  1:12 orbea
2024-11-11 20:16 orbea

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox