From patchwork Sat Nov 11 17:28:29 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudio Carvalho X-Patchwork-Id: 837054 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3yZ3qH4TlGz9sRn for ; Sun, 12 Nov 2017 04:31:39 +1100 (AEDT) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3yZ3qH3F92zDrLk for ; Sun, 12 Nov 2017 04:31:39 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=linux.vnet.ibm.com (client-ip=148.163.156.1; helo=mx0a-001b2d01.pphosted.com; envelope-from=cclaudio@linux.vnet.ibm.com; receiver=) Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3yZ3mJ49J2zDrLq for ; Sun, 12 Nov 2017 04:29:04 +1100 (AEDT) Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id vABHOTT1057906 for ; Sat, 11 Nov 2017 12:29:02 -0500 Received: from e35.co.us.ibm.com (e35.co.us.ibm.com [32.97.110.153]) by mx0a-001b2d01.pphosted.com with ESMTP id 2e5x60w02v-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Sat, 11 Nov 2017 12:29:02 -0500 Received: from localhost by e35.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Sat, 11 Nov 2017 10:29:01 -0700 Received: from b03cxnp08025.gho.boulder.ibm.com (9.17.130.17) by e35.co.us.ibm.com (192.168.1.135) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Sat, 11 Nov 2017 10:28:59 -0700 Received: from b03ledav006.gho.boulder.ibm.com (b03ledav006.gho.boulder.ibm.com [9.17.130.237]) by b03cxnp08025.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id vABHSx761966366 for ; Sat, 11 Nov 2017 10:28:59 -0700 Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 37568C603C for ; Sat, 11 Nov 2017 10:28:59 -0700 (MST) Received: from legolas.ibm.com (unknown [9.85.175.178]) by b03ledav006.gho.boulder.ibm.com (Postfix) with ESMTP id 9EDE1C6037 for ; Sat, 11 Nov 2017 10:28:58 -0700 (MST) From: Claudio Carvalho To: skiboot@lists.ozlabs.org Date: Sat, 11 Nov 2017 15:28:29 -0200 X-Mailer: git-send-email 2.7.4 In-Reply-To: <1510421322-27237-1-git-send-email-cclaudio@linux.vnet.ibm.com> References: <1510421322-27237-1-git-send-email-cclaudio@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 17111117-0012-0000-0000-000015477B60 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00008051; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000239; SDB=6.00944424; UDB=6.00476526; IPR=6.00724686; BA=6.00005688; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00017969; XFM=3.00000015; UTC=2017-11-11 17:29:00 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17111117-0013-0000-0000-0000503A26F0 Message-Id: <1510421322-27237-7-git-send-email-cclaudio@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-11-11_05:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000 definitions=main-1711110250 Subject: [Skiboot] [PATCH 06/19] libstb: move drivers/sha512.* to mbedtls directory X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.24 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" The drivers/sha512.c file is a SHA512 hash implementation imported from the mbed TLS project. As a matter of semantics, this moves drivers/sha512.* to the mbedtls directory. Signed-off-by: Claudio Carvalho --- libstb/Makefile.inc | 3 ++- libstb/drivers/Makefile.inc | 2 +- libstb/drivers/sw_driver.c | 2 +- libstb/mbedtls/Makefile.inc | 11 +++++++++++ libstb/{drivers => mbedtls}/sha512.c | 0 libstb/{drivers => mbedtls}/sha512.h | 0 6 files changed, 15 insertions(+), 3 deletions(-) create mode 100644 libstb/mbedtls/Makefile.inc rename libstb/{drivers => mbedtls}/sha512.c (100%) rename libstb/{drivers => mbedtls}/sha512.h (100%) diff --git a/libstb/Makefile.inc b/libstb/Makefile.inc index 010e4b1..473edec 100644 --- a/libstb/Makefile.inc +++ b/libstb/Makefile.inc @@ -8,10 +8,11 @@ LIBSTB_SRCS = container.c rom.c tpm_chip.c stb.c cvc.c LIBSTB_OBJS = $(LIBSTB_SRCS:%.c=%.o) LIBSTB = $(LIBSTB_DIR)/built-in.o +include $(SRC)/$(LIBSTB_DIR)/mbedtls/Makefile.inc include $(SRC)/$(LIBSTB_DIR)/drivers/Makefile.inc include $(SRC)/$(LIBSTB_DIR)/tss/Makefile.inc -$(LIBSTB): $(LIBSTB_OBJS:%=$(LIBSTB_DIR)/%) $(DRIVERS) $(TSS) +$(LIBSTB): $(LIBSTB_OBJS:%=$(LIBSTB_DIR)/%) $(DRIVERS) $(TSS) $(MBEDTLS) libstb/create-container: libstb/create-container.c $(call Q, HOSTCC ,$(HOSTCC) $(HOSTCFLAGS) \ diff --git a/libstb/drivers/Makefile.inc b/libstb/drivers/Makefile.inc index d0f88ea..9eaa257 100644 --- a/libstb/drivers/Makefile.inc +++ b/libstb/drivers/Makefile.inc @@ -4,7 +4,7 @@ DRIVERS_DIR = libstb/drivers SUBDIRS += $(DRIVERS_DIR) -DRIVERS_SRCS = romcode.c tpm_i2c_interface.c tpm_i2c_nuvoton.c sw_driver.c sha512.c +DRIVERS_SRCS = romcode.c tpm_i2c_interface.c tpm_i2c_nuvoton.c sw_driver.c DRIVERS_OBJS = $(DRIVERS_SRCS:%.c=%.o) DRIVERS = $(DRIVERS_DIR)/built-in.o diff --git a/libstb/drivers/sw_driver.c b/libstb/drivers/sw_driver.c index e7f3740..287dae9 100644 --- a/libstb/drivers/sw_driver.c +++ b/libstb/drivers/sw_driver.c @@ -17,8 +17,8 @@ #include #include #include +#include #include "../rom.h" -#include "sha512.h" #include "sw_driver.h" static sha2_hash_t *hw_key_hash = NULL; diff --git a/libstb/mbedtls/Makefile.inc b/libstb/mbedtls/Makefile.inc new file mode 100644 index 0000000..07aa26a --- /dev/null +++ b/libstb/mbedtls/Makefile.inc @@ -0,0 +1,11 @@ +# -*-Makefile-*- + +MBEDTLS_DIR = libstb/mbedtls + +SUBDIRS += $(MBEDTLS_DIR) + +MBEDTLS_SRCS = sha512.c +MBEDTLS_OBJS = $(MBEDTLS_SRCS:%.c=%.o) +MBEDTLS = $(MBEDTLS_DIR)/built-in.o + +$(MBEDTLS): $(MBEDTLS_OBJS:%=$(MBEDTLS_DIR)/%) diff --git a/libstb/drivers/sha512.c b/libstb/mbedtls/sha512.c similarity index 100% rename from libstb/drivers/sha512.c rename to libstb/mbedtls/sha512.c diff --git a/libstb/drivers/sha512.h b/libstb/mbedtls/sha512.h similarity index 100% rename from libstb/drivers/sha512.h rename to libstb/mbedtls/sha512.h