From patchwork Fri Nov 16 02:52:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carlos Santos X-Patchwork-Id: 998716 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.137; helo=fraxinus.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=datacom.com.br Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42x2pP5jstz9s3Z for ; Fri, 16 Nov 2018 13:52:45 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 5A88987431; Fri, 16 Nov 2018 02:52:41 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id s0tMgzTkJd6V; Fri, 16 Nov 2018 02:52:37 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 00FA9873AD; Fri, 16 Nov 2018 02:52:37 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id ECCE91BF357 for ; Fri, 16 Nov 2018 02:52:35 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id E9F9E22839 for ; Fri, 16 Nov 2018 02:52:35 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8ikAuPOktUql for ; Fri, 16 Nov 2018 02:52:33 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail.datacom.com.br (mx.datacom.ind.br [177.66.5.10]) by silver.osuosl.org (Postfix) with ESMTPS id A9EF92274F for ; Fri, 16 Nov 2018 02:52:32 +0000 (UTC) Received: from mail.datacom.com.br (localhost [127.0.0.1]) by mail.datacom.com.br (Postfix) with ESMTPS id E68621BA2A12 for ; Fri, 16 Nov 2018 00:53:04 -0200 (-02) Received: from localhost (localhost [127.0.0.1]) by mail.datacom.com.br (Postfix) with ESMTP id D78F51BA29BE for ; Fri, 16 Nov 2018 00:53:04 -0200 (-02) Received: from mail.datacom.com.br ([127.0.0.1]) by localhost (mail.datacom.com.br [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id s8rnNyfukvQQ for ; Fri, 16 Nov 2018 00:53:04 -0200 (-02) Received: from p7-1130br.casantos.org (unknown [191.35.210.10]) by mail.datacom.com.br (Postfix) with ESMTPSA id 86ECA1BA29FD for ; Fri, 16 Nov 2018 00:53:04 -0200 (-02) From: Carlos Santos To: buildroot@buildroot.org Date: Fri, 16 Nov 2018 00:52:15 -0200 Message-Id: <20181116025217.27928-2-casantos@datacom.com.br> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181116025217.27928-1-casantos@datacom.com.br> References: <20181116025217.27928-1-casantos@datacom.com.br> MIME-Version: 1.0 Subject: [Buildroot] [PATCH next 1/3] tpm2-tss: bump to version 2.1.0 X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" - Drop C++ requirement (tmp2-tss is pure C now). - Add explicit dependency on openssl (gnutls can be used too but this option will be added by a subsequent patch). - Drop the patch on tcti_socket.cpp, which is not applicable. - Add a patch already submitted upstream to support using libressl[1]. - Update LICENSE hash. The terms are is still BSD-2-Clause but the file now contains a SPDX license identifier. 1. https://github.com/tpm2-software/tpm2-tss/pull/1207 Signed-off-by: Carlos Santos --- .../0001-ESYS-Fix-build-with-LibreSSL.patch | 48 +++++++++++++++++++ ....cpp-add-missing-inclusion-of-sys-se.patch | 33 ------------- package/tpm2-tss/Config.in | 5 +- package/tpm2-tss/tpm2-tss.hash | 4 +- package/tpm2-tss/tpm2-tss.mk | 9 ++-- 5 files changed, 54 insertions(+), 45 deletions(-) create mode 100644 package/tpm2-tss/0001-ESYS-Fix-build-with-LibreSSL.patch delete mode 100644 package/tpm2-tss/0001-tcti-tcti_socket.cpp-add-missing-inclusion-of-sys-se.patch diff --git a/package/tpm2-tss/0001-ESYS-Fix-build-with-LibreSSL.patch b/package/tpm2-tss/0001-ESYS-Fix-build-with-LibreSSL.patch new file mode 100644 index 0000000000..d8bf2a665c --- /dev/null +++ b/package/tpm2-tss/0001-ESYS-Fix-build-with-LibreSSL.patch @@ -0,0 +1,48 @@ +From e8b8ecd2f761430dd2e2c74505974b429fe6b40f Mon Sep 17 00:00:00 2001 +From: Carlos Santos +Date: Wed, 14 Nov 2018 23:31:25 -0200 +Subject: [PATCH] ESYS: Fix build with LibreSSL + +RAND_bytes() is declared in rand.h. Also, LibreSSL does not provide OAEP +macros EVP_PKEY_CTX_set0_rsa_oaep_label and EVP_PKEY_CTX_set_rsa_oaep_md +so use them conditionally. + +Signed-off-by: Carlos Santos +--- + src/tss2-esys/esys_crypto_ossl.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/src/tss2-esys/esys_crypto_ossl.c b/src/tss2-esys/esys_crypto_ossl.c +index 43088f4a..6c0c76fe 100644 +--- a/src/tss2-esys/esys_crypto_ossl.c ++++ b/src/tss2-esys/esys_crypto_ossl.c +@@ -10,6 +10,7 @@ + #include + #include + #include ++#include + #include + + #include "tss2_esys.h" +@@ -660,6 +661,8 @@ iesys_cryptossl_pk_encrypt(TPM2B_PUBLIC * pub_tpm_key, + "Could not set RSA passing.", cleanup); + } + ++/* LibreSSL does not provide these OAEP functions */ ++#ifdef EVP_PKEY_CTX_set0_rsa_oaep_label + if (1 != EVP_PKEY_CTX_set0_rsa_oaep_label(ctx, label, strlen(label)+1)) { + goto_error(r, TSS2_ESYS_RC_GENERAL_FAILURE, + "Could not set RSA label.", cleanup); +@@ -669,6 +672,9 @@ iesys_cryptossl_pk_encrypt(TPM2B_PUBLIC * pub_tpm_key, + goto_error(r, TSS2_ESYS_RC_GENERAL_FAILURE, + "Could not set hash algorithm.", cleanup); + } ++#else ++ (void) label; ++#endif + + /* Determine out size */ + if (1 != EVP_PKEY_encrypt(ctx, NULL, out_size, in_buffer, in_size)) { +-- +2.19.1 + diff --git a/package/tpm2-tss/0001-tcti-tcti_socket.cpp-add-missing-inclusion-of-sys-se.patch b/package/tpm2-tss/0001-tcti-tcti_socket.cpp-add-missing-inclusion-of-sys-se.patch deleted file mode 100644 index e8e0d842f2..0000000000 --- a/package/tpm2-tss/0001-tcti-tcti_socket.cpp-add-missing-inclusion-of-sys-se.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 2fdbf9f56bd6e7b00c695881a81c0df2f5088760 Mon Sep 17 00:00:00 2001 -From: Carlos Santos -Date: Fri, 23 Mar 2018 09:15:44 -0300 -Subject: [PATCH] tcti/tcti_socket.cpp: add missing inclusion of sys/select.h - -Prevents compilation errors due to undeclared "fd_set" type. - -Fixes: - http://autobuild.buildroot.net/results/09e8b3b85d7113d60e8967a2d41a6aea8f8197c0 - http://autobuild.buildroot.net/results/2e4c70f2f1239eb19235ae04a936a6492daf316d - http://autobuild.buildroot.net/results/bbd68f52781da735e983b1260de5b804787374b1 - -Signed-off-by: Carlos Santos ---- - tcti/tcti_socket.cpp | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/tcti/tcti_socket.cpp b/tcti/tcti_socket.cpp -index e8982f1..b6e5874 100644 ---- a/tcti/tcti_socket.cpp -+++ b/tcti/tcti_socket.cpp -@@ -28,6 +28,8 @@ - #include - #include // Needed for _wtoi - -+#include // for fd_set -+ - #include "sapi/tpm20.h" - #include "tcti/tcti_socket.h" - #include "sysapi_util.h" --- -2.14.3 - diff --git a/package/tpm2-tss/Config.in b/package/tpm2-tss/Config.in index 7a757bd70a..4e299eccc1 100644 --- a/package/tpm2-tss/Config.in +++ b/package/tpm2-tss/Config.in @@ -1,7 +1,7 @@ config BR2_PACKAGE_TPM2_TSS bool "tpm2-tss" - depends on BR2_INSTALL_LIBSTDCPP select BR2_PACKAGE_LIBURIPARSER + select BR2_PACKAGE_OPENSSL help OSS implementation of the Trusted Computing Group's (TCG) TPM2 Software Stack (TSS). This stack consists of the following @@ -30,6 +30,3 @@ config BR2_PACKAGE_TPM2_TSS Microsoft software TPM2 simulator. https://github.com/tpm2-software/tpm2-tss - -comment "tpm2-tss needs a toolchain w/ C++" - depends on !BR2_INSTALL_LIBSTDCPP diff --git a/package/tpm2-tss/tpm2-tss.hash b/package/tpm2-tss/tpm2-tss.hash index 67c5a85842..d6f65fa7de 100644 --- a/package/tpm2-tss/tpm2-tss.hash +++ b/package/tpm2-tss/tpm2-tss.hash @@ -1,3 +1,3 @@ # Locally computed: -sha256 cf8784cc536be16e6fba47f77033e093a6aeaed8420877ac9f42f77fb7b09031 tpm2-tss-1.4.0.tar.gz -sha256 18c1bf4b1ba1fb2c4ffa7398c234d83c0d55475298e470ae1e5e3a8a8bd2e448 LICENSE +sha256 a50b8dbd51f0c274cf874351786ed252c5024c952bf699fbd595ac292a27ab19 tpm2-tss-2.1.0.tar.gz +sha256 f7da3c2da12cec3348bb7ee9e2a9e651a241450b2efb67da29d5a75ef2da058a LICENSE diff --git a/package/tpm2-tss/tpm2-tss.mk b/package/tpm2-tss/tpm2-tss.mk index dcc1e5d74d..3bb0702916 100644 --- a/package/tpm2-tss/tpm2-tss.mk +++ b/package/tpm2-tss/tpm2-tss.mk @@ -4,15 +4,12 @@ # ################################################################################ -TPM2_TSS_VERSION = 1.4.0 +TPM2_TSS_VERSION = 2.1.0 TPM2_TSS_SITE = https://github.com/tpm2-software/tpm2-tss/releases/download/$(TPM2_TSS_VERSION) TPM2_TSS_LICENSE = BSD-2-Clause TPM2_TSS_LICENSE_FILES = LICENSE TPM2_TSS_INSTALL_STAGING = YES -TPM2_TSS_DEPENDENCIES = liburiparser host-pkgconf - -# configure.ac doesn't contain a link test, so it doesn't detect when -# libssp is missing. -TPM2_TSS_CONF_ENV = ax_cv_check_cflags___________Wall__Werror_______fstack_protector_all=$(if $(BR2_TOOLCHAIN_HAS_SSP),yes,no) +TPM2_TSS_DEPENDENCIES = liburiparser openssl host-pkgconf +TPM2_TSS_CONF_OPTS = --with-crypto=ossl --disable-doxygen-doc $(eval $(autotools-package))