summaryrefslogtreecommitdiff
path: root/app-crypt/tpm2-tools
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2019-01-12 16:58:08 +0000
committerV3n3RiX <venerix@redcorelinux.org>2019-01-12 16:58:08 +0000
commitc8a77dfe4d3d307c1d5dd2650b7297447d8b609d (patch)
tree9ea78393bc3ecd6ab4de449383d4e97e5f3648ae /app-crypt/tpm2-tools
parent2891d29af8907ce881662f4a02844926d7a293c7 (diff)
gentoo resync : 12.01.2019
Diffstat (limited to 'app-crypt/tpm2-tools')
-rw-r--r--app-crypt/tpm2-tools/Manifest3
-rw-r--r--app-crypt/tpm2-tools/files/tpm2-tools-3.1.3-libressl.patch81
-rw-r--r--app-crypt/tpm2-tools/tpm2-tools-3.1.3.ebuild6
3 files changed, 88 insertions, 2 deletions
diff --git a/app-crypt/tpm2-tools/Manifest b/app-crypt/tpm2-tools/Manifest
index 4bd9b9b41eab..e6d0efbdfab8 100644
--- a/app-crypt/tpm2-tools/Manifest
+++ b/app-crypt/tpm2-tools/Manifest
@@ -1,3 +1,4 @@
+AUX tpm2-tools-3.1.3-libressl.patch 2589 BLAKE2B 2d949ed3d8470bbfee647e691f03ee4a53cc70230140dddba85424238670f147465eecaf85ce95696782e2cf3e8229fa5233300e93e33f4d48c0d56485f3d0a5 SHA512 e45ba9fa0f758105cccd4ded4422f285fdf3c8bd35240c8301ac911049618ae35ad5084045dc72658aced371a4af807dc521e830fdafe1cf9b71bc0f1a7a1325
DIST tpm2-tools-3.1.3.tar.gz 544098 BLAKE2B 4c22ae98ed444b7d5b5f99e6a7d4cc37fcf9d46979669a2225b6f2abf8ccaaff203ccc8c816169be215c6160ce2480e4c9a0197040764013ab362dd060c29bec SHA512 37edf59e47168c42ffc66e948722753334ae3e00f3e258d9e801dffd259a763a1bf4f63b3feecf7728b4dade69ca5da15d631e1a606f68e10f7d314a1a757bdc
-EBUILD tpm2-tools-3.1.3.ebuild 634 BLAKE2B 7a79635d19aee0774d05675b1cd793b08696948405c04de215e9778ea3706be681d9d968a16d2c6e07e3e487f08afbd301e86083633415e4a7c96a661bbd4a81 SHA512 f7d0d985ffcb2d66c1eae57673028643941270660a5aa05864626ca503a37365c4fa0dedb41a206184211c45b5a961813c974dcea2c86c9f4b5f41d461cf8311
+EBUILD tpm2-tools-3.1.3.ebuild 682 BLAKE2B e8cdeba71654b6c0cd36f1362a1846eb5c7c0fc0b1a0bbfc0b9d7a524b9be1e5d1f7c2bc86a473ecd7e1f74baf811598ca6bda19657cffc8f581581a9f7a390b SHA512 85af6624609561725be46ca88a8d277cd578c840b3820d6ba23a9ed38c05bd70918e956c3742e09aed866fae721604bff839b876f7f3ebf941eaeabcabf8440b
MISC metadata.xml 329 BLAKE2B 4839966acc6a4c84deaf050a21adaa680d3a93e5cb17ecff79dd6818723264570b215796e9733ef9beb078b17977078bad12deb6716ee3774947502e8efbbd78 SHA512 49d92ff1f240ce29957166befc9af7af18e665a388943f81c5a3c11c6dd12a924b19ed8dfaf2656223028444bfafa63fb15a54ad6c51e7c37b55ff1fe7287912
diff --git a/app-crypt/tpm2-tools/files/tpm2-tools-3.1.3-libressl.patch b/app-crypt/tpm2-tools/files/tpm2-tools-3.1.3-libressl.patch
new file mode 100644
index 000000000000..7c26d6e14f8c
--- /dev/null
+++ b/app-crypt/tpm2-tools/files/tpm2-tools-3.1.3-libressl.patch
@@ -0,0 +1,81 @@
+From a3447989483e09638e6ebeab7eabe6273aa5f3db Mon Sep 17 00:00:00 2001
+From: Alon Bar-Lev <alon.barlev@gmail.com>
+Date: Fri, 4 Jan 2019 10:33:15 +0200
+Subject: [PATCH] build: fixup libressl support and add libressl-2.7
+
+Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
+Backport: 5d4cc4ee
+---
+ lib/conversion.c | 6 +++++-
+ lib/tpm_kdfa.c | 10 +++++++---
+ 2 files changed, 12 insertions(+), 4 deletions(-)
+
+diff --git a/lib/conversion.c b/lib/conversion.c
+index ce0f5b3..f55af6f 100644
+--- a/lib/conversion.c
++++ b/lib/conversion.c
+@@ -45,6 +45,10 @@
+ #include "tpm2_alg_util.h"
+ #include "tpm2_util.h"
+
++#if (OPENSSL_VERSION_NUMBER < 0x1010000fL && !defined(LIBRESSL_VERSION_NUMBER)) || (defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x20700000L) /* OpenSSL 1.1.0 */
++#define LIB_TPM2_OPENSSL_OPENSSL_PRE11
++#endif
++
+ static bool tpm2_convert_pubkey_ssl(TPMT_PUBLIC *public, pubkey_format format, const char *path);
+
+ pubkey_format tpm2_parse_pubkey_format(const char *label) {
+@@ -134,7 +138,7 @@ static bool tpm2_convert_pubkey_ssl(TPMT_PUBLIC *public, pubkey_format format, c
+ goto error;
+ }
+
+-#if OPENSSL_VERSION_NUMBER < 0x1010000fL /* OpenSSL 1.1.0 */
++#if defined(LIB_TPM2_OPENSSL_OPENSSL_PRE11)
+ ssl_rsa_key->e = e;
+ ssl_rsa_key->n = n;
+ #else
+diff --git a/lib/tpm_kdfa.c b/lib/tpm_kdfa.c
+index 3d1ed50..fc03af8 100644
+--- a/lib/tpm_kdfa.c
++++ b/lib/tpm_kdfa.c
+@@ -34,6 +34,10 @@
+ #include "log.h"
+ #include "tpm2_util.h"
+
++#if (OPENSSL_VERSION_NUMBER < 0x1010000fL && !defined(LIBRESSL_VERSION_NUMBER)) || (defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x20700000L) /* OpenSSL 1.1.0 */
++#define LIB_TPM2_OPENSSL_OPENSSL_PRE11
++#endif
++
+ static const EVP_MD *tpm_algorithm_to_openssl_digest(TPMI_ALG_HASH algorithm) {
+
+ switch(algorithm) {
+@@ -54,7 +58,7 @@ static const EVP_MD *tpm_algorithm_to_openssl_digest(TPMI_ALG_HASH algorithm) {
+ static HMAC_CTX *hmac_alloc()
+ {
+ HMAC_CTX *ctx;
+-#if OPENSSL_VERSION_NUMBER < 0x1010000fL /* OpenSSL 1.1.0 */
++#if defined(LIB_TPM2_OPENSSL_OPENSSL_PRE11)
+ ctx = malloc(sizeof(*ctx));
+ #else
+ ctx = HMAC_CTX_new();
+@@ -62,7 +66,7 @@ static HMAC_CTX *hmac_alloc()
+ if (!ctx)
+ return NULL;
+
+-#if OPENSSL_VERSION_NUMBER < 0x1010000fL
++#if defined(LIB_TPM2_OPENSSL_OPENSSL_PRE11)
+ HMAC_CTX_init(ctx);
+ #endif
+
+@@ -71,7 +75,7 @@ static HMAC_CTX *hmac_alloc()
+
+ static void hmac_del(HMAC_CTX *ctx)
+ {
+-#if OPENSSL_VERSION_NUMBER < 0x1010000fL
++#if defined(LIB_TPM2_OPENSSL_OPENSSL_PRE11)
+ HMAC_CTX_cleanup(ctx);
+ free(ctx);
+ #else
+--
+2.19.2
+
diff --git a/app-crypt/tpm2-tools/tpm2-tools-3.1.3.ebuild b/app-crypt/tpm2-tools/tpm2-tools-3.1.3.ebuild
index a23c0b4d9a6a..df27445aa2b5 100644
--- a/app-crypt/tpm2-tools/tpm2-tools-3.1.3.ebuild
+++ b/app-crypt/tpm2-tools/tpm2-tools-3.1.3.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2018 Gentoo Authors
+# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
@@ -20,6 +20,10 @@ DEPEND="${RDEPEND}
test? ( dev-util/cmocka )"
BDEPEND="virtual/pkgconfig"
+PATCHES=(
+ "${FILESDIR}/${P}-libressl.patch"
+)
+
src_configure() {
econf \
--disable-hardening \