summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSalah Coronya <salah.coronya@gmail.com>2020-12-30 16:29:41 -0600
committerJoonas Niilola <juippis@gentoo.org>2021-01-20 16:13:40 +0200
commitc03f24ee12d3d31273e6bd5501402032c4e75328 (patch)
tree1cc28d85a0e22e9d596216d115be29556cd32f37 /app-crypt/tpm2-tools
parentapp-crypt/tpm2-tools: Don't let configure run git, add missing dep (diff)
downloadgentoo-c03f24ee12d3d31273e6bd5501402032c4e75328.tar.gz
gentoo-c03f24ee12d3d31273e6bd5501402032c4e75328.tar.bz2
gentoo-c03f24ee12d3d31273e6bd5501402032c4e75328.zip
app-crypt/tpm2-tools: Fix libressl support
Package-Manager: Portage-3.0.9, Repoman-3.0.2 Signed-off-by: Salah Coronya <salah.coronya@gmail.com> Signed-off-by: Joonas Niilola <juippis@gentoo.org>
Diffstat (limited to 'app-crypt/tpm2-tools')
-rw-r--r--app-crypt/tpm2-tools/files/tpm2-tools-5.0-libressl.patch39
-rw-r--r--app-crypt/tpm2-tools/tpm2-tools-5.0-r1.ebuild2
2 files changed, 40 insertions, 1 deletions
diff --git a/app-crypt/tpm2-tools/files/tpm2-tools-5.0-libressl.patch b/app-crypt/tpm2-tools/files/tpm2-tools-5.0-libressl.patch
new file mode 100644
index 000000000000..b41c9f50e272
--- /dev/null
+++ b/app-crypt/tpm2-tools/files/tpm2-tools-5.0-libressl.patch
@@ -0,0 +1,39 @@
+diff --git a/lib/tpm2_identity_util.c b/lib/tpm2_identity_util.c
+index a3b0e387..9519ca7b 100644
+--- a/lib/tpm2_identity_util.c
++++ b/lib/tpm2_identity_util.c
+@@ -17,7 +17,7 @@
+
+ // Identity-related functionality that the TPM normally does, but using OpenSSL
+
+-#if defined(LIBRESSL_VERSION_NUMBER)
++#if 0
+ static int RSA_padding_add_PKCS1_OAEP_mgf1(unsigned char *to, int tlen,
+ const unsigned char *from, int flen, const unsigned char *param, int plen,
+ const EVP_MD *md, const EVP_MD *mgf1md) {
+diff --git a/lib/tpm2_openssl.c b/lib/tpm2_openssl.c
+index e769d6df..54f124c9 100644
+--- a/lib/tpm2_openssl.c
++++ b/lib/tpm2_openssl.c
+@@ -15,7 +15,7 @@
+ #include "tpm2_systemdeps.h"
+
+ /* compatibility function for OpenSSL versions < 1.1.0 */
+-#if OPENSSL_VERSION_NUMBER < 0x10100000L
++#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
+ static int BN_bn2binpad(const BIGNUM *a, unsigned char *to, int tolen) {
+ int r;
+ int topad;
+diff --git a/lib/tpm2_openssl.h b/lib/tpm2_openssl.h
+index 46c8f9c0..71206309 100644
+--- a/lib/tpm2_openssl.h
++++ b/lib/tpm2_openssl.h
+@@ -17,7 +17,7 @@
+ #define LIB_TPM2_OPENSSL_OPENSSL_PRE11
+ #endif
+
+-#if OPENSSL_VERSION_NUMBER >= 0x10101000L
++#if (OPENSSL_VERSION_NUMBER >= 0x10101000L) && !defined(LIBRESSL_VERSION_NUMBER)
+ #define EC_POINT_set_affine_coordinates_tss(group, tpm_pub_key, bn_x, bn_y, dmy) \
+ EC_POINT_set_affine_coordinates(group, tpm_pub_key, bn_x, bn_y, dmy)
+
diff --git a/app-crypt/tpm2-tools/tpm2-tools-5.0-r1.ebuild b/app-crypt/tpm2-tools/tpm2-tools-5.0-r1.ebuild
index c03f468e3955..375c04e216eb 100644
--- a/app-crypt/tpm2-tools/tpm2-tools-5.0-r1.ebuild
+++ b/app-crypt/tpm2-tools/tpm2-tools-5.0-r1.ebuild
@@ -27,7 +27,7 @@ DEPEND="${RDEPEND}"
BDEPEND="virtual/pkgconfig
sys-devel/autoconf-archive"
PATCHES=(
- "${FILESDIR}/${PN}-4.2.1-libressl.patch"
+ "${FILESDIR}/${PN}-5.0-libressl.patch"
"${FILESDIR}/${PN}-4.3.0-Remove-WError.patch"
)