Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 762445 | Differences between
and this patch

Collapse All | Expand All

(-)a/app-crypt/tpm2-tss/files/tpm2-tss-2.4.5-fix-compile-with-libressl.patch (+44 lines)
Line 0 Link Here
1
diff --git a/src/tss2-esys/esys_crypto_ossl.c b/src/tss2-esys/esys_crypto_ossl.c
2
index 2746856b..b6c9fb48 100644
3
--- a/src/tss2-esys/esys_crypto_ossl.c
4
+++ b/src/tss2-esys/esys_crypto_ossl.c
5
@@ -25,7 +25,7 @@
6
 #include "util/log.h"
7
 #include "util/aux_util.h"
8
 
9
-#if OPENSSL_VERSION_NUMBER >= 0x10101000L
10
+#if (OPENSSL_VERSION_NUMBER >= 0x10101000L) && !defined(LIBRESSL_VERSION_NUMBER)
11
 #define EC_POINT_set_affine_coordinates_tss(group, tpm_pub_key, bn_x, bn_y, dmy) \
12
         EC_POINT_set_affine_coordinates(group, tpm_pub_key, bn_x, bn_y, dmy)
13
 
14
@@ -525,7 +525,7 @@ iesys_cryptossl_random2b(TPM2B_NONCE * nonce, size_t num_bytes)
15
         nonce->size = num_bytes;
16
     }
17
 
18
-#if OPENSSL_VERSION_NUMBER >= 0x10100000L
19
+#if (OPENSSL_VERSION_NUMBER >= 0x10100000L) && !defined(LIBRESSL_VERSION_NUMBER)
20
     RAND_set_rand_method(RAND_OpenSSL());
21
 #else
22
     RAND_set_rand_method(RAND_SSLeay());
23
@@ -563,7 +563,7 @@ iesys_cryptossl_pk_encrypt(TPM2B_PUBLIC * pub_tpm_key,
24
                            size_t * out_size, const char *label)
25
 {
26
     const RAND_METHOD *rand_save = RAND_get_rand_method();
27
-#if OPENSSL_VERSION_NUMBER >= 0x10100000L
28
+#if (OPENSSL_VERSION_NUMBER >= 0x10100000L) && !defined(LIBRESSL_VERSION_NUMBER)
29
     RAND_set_rand_method(RAND_OpenSSL());
30
 #else
31
     RAND_set_rand_method(RAND_SSLeay());
32
diff --git a/src/tss2-fapi/fapi_crypto.c b/src/tss2-fapi/fapi_crypto.c
33
index f5b3d272..32962f13 100644
34
--- a/src/tss2-fapi/fapi_crypto.c
35
+++ b/src/tss2-fapi/fapi_crypto.c
36
@@ -26,7 +26,7 @@
37
 #define LOGMODULE fapi
38
 #include "util/log.h"
39
 
40
-#if OPENSSL_VERSION_NUMBER >= 0x10101000L
41
+#if (OPENSSL_VERSION_NUMBER >= 0x10101000L) && !defined(LIBRESSL_VERSION_NUMBER)
42
 #define EC_POINT_set_affine_coordinates_tss(group, tpm_pub_key, bn_x, bn_y, dmy) \
43
         EC_POINT_set_affine_coordinates(group, tpm_pub_key, bn_x, bn_y, dmy)
44
 
(-)a/app-crypt/tpm2-tss/tpm2-tss-2.4.5-r1.ebuild (-1 / +83 lines)
Line 0 Link Here
0
- 
1
# Copyright 1999-2020 Gentoo Authors
2
# Distributed under the terms of the GNU General Public License v2
3
4
EAPI=7
5
6
inherit autotools linux-info tmpfiles udev
7
8
DESCRIPTION="TCG Trusted Platform Module 2.0 Software Stack"
9
HOMEPAGE="https://github.com/tpm2-software/tpm2-tss"
10
SRC_URI="https://github.com/tpm2-software/${PN}/releases/download/${PV}/${P}.tar.gz"
11
12
LICENSE="BSD-2"
13
SLOT="0"
14
KEYWORDS="~amd64 ~arm ~arm64 ~x86"
15
IUSE="doc +fapi libressl gcrypt static-libs test"
16
17
RESTRICT="!test? ( test )"
18
19
REQUIRED_USE="	?? ( gcrypt libressl )
20
		fapi? ( !gcrypt )"
21
22
RDEPEND="acct-group/tss
23
	acct-user/tss
24
	fapi? (
25
		dev-libs/json-c
26
		net-misc/curl
27
	)
28
	gcrypt? ( dev-libs/libgcrypt:= )
29
	libressl? ( dev-libs/libressl:= )
30
	!libressl? (
31
		!gcrypt? ( dev-libs/openssl:= )
32
	)"
33
34
DEPEND="${RDEPEND}
35
	test? ( dev-util/cmocka )"
36
BDEPEND="virtual/pkgconfig
37
	doc? ( app-doc/doxygen )"
38
39
PATCHES=(
40
	"${FILESDIR}/${PN}-2.4.1-configure.ac-wrap-PKG_CHECK_MODULES-in-braces.patch"
41
	"${FILESDIR}/${PN}-2.4.2-Dont-run-systemd-sysusers-in-Makefile.patch"
42
	"${FILESDIR}/${PN}-2.4.5-fix-compile-with-libressl.patch"
43
)
44
45
pkg_setup() {
46
	local CONFIG_CHECK=" \
47
		~TCG_TPM
48
	"
49
	linux-info_pkg_setup
50
	kernel_is ge 4 12 0 || ewarn "At least kernel 4.12.0 is required"
51
}
52
53
src_prepare() {
54
	default
55
	eautoreconf
56
}
57
58
src_configure() {
59
	econf \
60
		--localstatedir=/var \
61
		$(use_enable doc doxygen-doc) \
62
		$(use_enable fapi) \
63
		$(use_enable static-libs static) \
64
		$(use_enable test unit) \
65
		--disable-tcti-mssim \
66
		--disable-defaultflags \
67
		--disable-weakcrypto \
68
		--with-crypto="$(usex gcrypt gcrypt ossl)" \
69
		--with-runstatedir=/run \
70
		--with-udevrulesdir="$(get_udevdir)/rules.d" \
71
		--with-udevrulesprefix=60- \
72
		--with-sysusersdir="/usr/lib/sysusers.d" \
73
		--with-tmpfilesdir="/usr/lib/tmpfiles.d"
74
}
75
76
src_install() {
77
	default
78
	find "${D}" -name '*.la' -delete || die
79
}
80
81
pkg_postinst() {
82
	tmpfiles_process tpm2-tss-fapi.conf
83
}

Return to bug 762445