commit:     2c12e051f16f72eba50104d04527567e7a541591
Author:     Salah Coronya <salah.coronya <AT> gmail <DOT> com>
AuthorDate: Wed Dec 30 22:26:43 2020 +0000
Commit:     Joonas Niilola <juippis <AT> gentoo <DOT> org>
CommitDate: Wed Jan 20 14:13:40 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2c12e051

app-crypt/tpm2-tools: Fix libressl support

Package-Manager: Portage-3.0.9, Repoman-3.0.2
Signed-off-by: Salah Coronya <salah.coronya <AT> gmail.com>
Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org>

 .../files/tpm2-tools-4.2.1-libressl.patch          | 26 ----------------------
 .../files/tpm2-tools-4.3.0-libressl.patch          | 26 ++++++++++++++++++++++
 app-crypt/tpm2-tools/tpm2-tools-4.3.0-r1.ebuild    |  2 +-
 3 files changed, 27 insertions(+), 27 deletions(-)

diff --git a/app-crypt/tpm2-tools/files/tpm2-tools-4.2.1-libressl.patch 
b/app-crypt/tpm2-tools/files/tpm2-tools-4.2.1-libressl.patch
deleted file mode 100644
index 2f39db3283c..00000000000
--- a/app-crypt/tpm2-tools/files/tpm2-tools-4.2.1-libressl.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-From a1ac2ee0c6592e6f730458c03a2abd1532c66046 Mon Sep 17 00:00:00 2001
-From: Salah Coronya <[email protected]>
-Date: Sun, 12 Jan 2020 19:17:48 -0600
-Subject: [PATCH] lib/tpm2_openssl.c: Fix build for libressl
-
-Signed-off-by: Salah Coronya <[email protected]>
----
- lib/tpm2_openssl.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/lib/tpm2_openssl.c b/lib/tpm2_openssl.c
-index 505dd7a0..fd3861d9 100644
---- a/lib/tpm2_openssl.c
-+++ b/lib/tpm2_openssl.c
-@@ -14,7 +14,7 @@
- #include "tpm2_openssl.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;
--- 
-2.24.1
-

diff --git a/app-crypt/tpm2-tools/files/tpm2-tools-4.3.0-libressl.patch 
b/app-crypt/tpm2-tools/files/tpm2-tools-4.3.0-libressl.patch
new file mode 100644
index 00000000000..88948546353
--- /dev/null
+++ b/app-crypt/tpm2-tools/files/tpm2-tools-4.3.0-libressl.patch
@@ -0,0 +1,26 @@
+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 6d29c0d4..bd375ce3 100644
+--- a/lib/tpm2_openssl.c
++++ b/lib/tpm2_openssl.c
+@@ -14,7 +14,7 @@
+ #include "tpm2_openssl.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/app-crypt/tpm2-tools/tpm2-tools-4.3.0-r1.ebuild 
b/app-crypt/tpm2-tools/tpm2-tools-4.3.0-r1.ebuild
index a3d0239561c..f9edff247c5 100644
--- a/app-crypt/tpm2-tools/tpm2-tools-4.3.0-r1.ebuild
+++ b/app-crypt/tpm2-tools/tpm2-tools-4.3.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}-4.3.0-libressl.patch"
        "${FILESDIR}/${PN}-4.3.0-Remove-WError.patch"
 )
 

Reply via email to