From patchwork Mon Oct 10 08:44:01 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stewart Smith X-Patchwork-Id: 680262 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 AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3ssv291pSPz9ryr for ; Mon, 10 Oct 2016 19:49:37 +1100 (AEDT) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3ssv290ys7zDsx7 for ; Mon, 10 Oct 2016 19:49:37 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (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 3sstwX30xrzDsj2 for ; Mon, 10 Oct 2016 19:44:43 +1100 (AEDT) Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.17/8.16.0.17) with SMTP id u9A8WTm5120828 for ; Mon, 10 Oct 2016 04:44:41 -0400 Received: from e34.co.us.ibm.com (e34.co.us.ibm.com [32.97.110.152]) by mx0a-001b2d01.pphosted.com with ESMTP id 2606wutg7x-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Mon, 10 Oct 2016 04:44:41 -0400 Received: from localhost by e34.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 10 Oct 2016 02:44:40 -0600 Received: from d03dlp01.boulder.ibm.com (9.17.202.177) by e34.co.us.ibm.com (192.168.1.134) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 10 Oct 2016 02:44:37 -0600 Received: from b01cxnp23032.gho.pok.ibm.com (b01cxnp23032.gho.pok.ibm.com [9.57.198.27]) by d03dlp01.boulder.ibm.com (Postfix) with ESMTP id D977C1FF001F for ; Mon, 10 Oct 2016 02:44:17 -0600 (MDT) Received: from b01ledav002.gho.pok.ibm.com (b01ledav002.gho.pok.ibm.com [9.57.199.107]) by b01cxnp23032.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u9A8iaeY15991260; Mon, 10 Oct 2016 08:44:36 GMT Received: from b01ledav002.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id BF75112404E; Mon, 10 Oct 2016 04:44:36 -0400 (EDT) Received: from birb.localdomain (unknown [9.81.212.138]) by b01ledav002.gho.pok.ibm.com (Postfix) with SMTP id 9575912403F; Mon, 10 Oct 2016 04:44:35 -0400 (EDT) Received: by birb.localdomain (Postfix, from userid 1000) id ECD812335203; Mon, 10 Oct 2016 19:44:24 +1100 (AEDT) From: Stewart Smith To: skiboot@lists.ozlabs.org, cclaudio@linux.vnet.ibm.com Date: Mon, 10 Oct 2016 19:44:01 +1100 X-Mailer: git-send-email 2.7.4 In-Reply-To: <1476089061-15197-1-git-send-email-stewart@linux.vnet.ibm.com> References: <1476089061-15197-1-git-send-email-stewart@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16101008-0016-0000-0000-000004E0E532 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00005885; HX=3.00000240; KW=3.00000007; PH=3.00000004; SC=3.00000186; SDB=6.00766373; UDB=6.00366538; IPR=6.00542488; BA=6.00004798; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00012933; XFM=3.00000011; UTC=2016-10-10 08:44:38 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16101008-0017-0000-0000-000033A60842 Message-Id: <1476089061-15197-21-git-send-email-stewart@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2016-10-10_05:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1609300000 definitions=main-1610100142 Subject: [Skiboot] [PATCH 20/40] libstb/tss/tpmLogMgr: add support for EV_SEPARATOR events X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.23 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" From: Claudio Carvalho The TpmLogMgr_genLogEventPcrExtend() function is used to generate EV_ACTION events that will be recorded in the event log. However, skiboot must also create and record an EV_SEPARATOR event for a clean handover to skiroot kernel. This adds the i_logType parameter to the TpmLogMgr_genLogEventPcrExtend() function, thus it can also be used to generate EV_SEPARATOR events. Signed-off-by: Claudio Carvalho Signed-off-by: Stewart Smith --- libstb/tss/tpmLogMgr.C | 3 ++- libstb/tss/tpmLogMgr.H | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/libstb/tss/tpmLogMgr.C b/libstb/tss/tpmLogMgr.C index 95f4810..063f432 100644 --- a/libstb/tss/tpmLogMgr.C +++ b/libstb/tss/tpmLogMgr.C @@ -458,6 +458,7 @@ namespace TRUSTEDBOOT TPM_Alg_Id i_algId_2, const uint8_t* i_digest_2, size_t i_digestSize_2, + uint32_t i_logType, const char* i_logMsg) { TCG_PCR_EVENT2 eventLog; @@ -472,7 +473,7 @@ namespace TRUSTEDBOOT memset(&eventLog, 0, sizeof(eventLog)); eventLog.pcrIndex = i_pcr; - eventLog.eventType = EV_ACTION; + eventLog.eventType = i_logType; // Update digest information eventLog.digests.count = 1; diff --git a/libstb/tss/tpmLogMgr.H b/libstb/tss/tpmLogMgr.H index 26b8604..21cd3ba 100644 --- a/libstb/tss/tpmLogMgr.H +++ b/libstb/tss/tpmLogMgr.H @@ -210,6 +210,7 @@ namespace TRUSTEDBOOT * @param[in] i_algId_2 Algorithm to use * @param[in] i_digest_2 Digest value to write to PCR, NULL if not used * @param[in] i_digestSize_2 Byte size of i_digest array + * @param[in] i_logType Event type * @param[in] i_logMsg Null terminated Log message * * @return TCG_PCR_EVENT2 PCR event log @@ -221,6 +222,7 @@ namespace TRUSTEDBOOT TPM_Alg_Id i_algId_2, const uint8_t* i_digest_2, size_t i_digestSize_2, + uint32_t i_logType, const char* i_logMsg); #ifdef __HOSTBOOT_MODULE /**