From nobody Sun Apr 28 06:45:30 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+62694+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+62694+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1594913467; cv=none; d=zohomail.com; s=zohoarc; b=AkkOT7iB61JMyLGsypjsx4+LQgvF3PHpZhpzQpL8nhCdKf9e29KC1tLUhAG1SRIamtcbMF6tzmV2wkOyHPmX1a2F6/FsY65H3bLrRyY4/6ZDV1uM2SNWLau+GLxeJBa0R5cbtL0HXDhmHfDrIlKD6SRFXeERXvhUDjdggYYb72E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1594913467; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=hh/4wOnaCjSGx8kP2A4x6gRaCZF/OChbMSabyALru+s=; b=M0LC/N7CRadoZjcKMFC1Y5A3t9xzWJLoEx0FEhGLpZoEeOIulxSFvjAs+mnqUw+JxojUOucM6o0y3RZRthC+MqmWpd4kAwdGTWfe4N3AvRUb9jsAl6VmjGv5NEtmDJnPqCAI+/w9N//9DojYtD9X9YJzrbSKkoFXynHCXszf22Y= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+62694+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 159491346701322.585249643327643; Thu, 16 Jul 2020 08:31:07 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id y0iSYY1788612xAxvhoec8yM; Thu, 16 Jul 2020 08:31:06 -0700 X-Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mx.groups.io with SMTP id smtpd.web12.10674.1594885481587756541 for ; Thu, 16 Jul 2020 00:44:41 -0700 IronPort-SDR: jHOl6veKgKLjcDsTzr44ASF2e3U65CSGRjPmmWRqwaFYABjCVG+XsOOhlmLcoL9QDPLkrDtlMF OQjwosvd8mYA== X-IronPort-AV: E=McAfee;i="6000,8403,9683"; a="214071688" X-IronPort-AV: E=Sophos;i="5.75,358,1589266800"; d="scan'208";a="214071688" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Jul 2020 00:44:41 -0700 IronPort-SDR: 68yA31ePKjCUmeiYyXRMne3uNedenlNysifb5p8qvY9QkNYRS88fTXp/y2VaRyazzJqksqCEUM WzyH5xrPxaJA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,358,1589266800"; d="scan'208";a="430407238" X-Received: from shwdesssddpdqi.ccr.corp.intel.com ([10.239.9.10]) by orsmga004.jf.intel.com with ESMTP; 16 Jul 2020 00:44:39 -0700 From: Qi Zhang To: devel@edk2.groups.io Cc: Jiewen Yao , Jian J Wang , Chao Zhang , Qi Zhang Subject: [edk2-devel] [PATCH v2 1/7] SecurityPkg/TcgPpi: Add TcgPpi header file. Date: Thu, 16 Jul 2020 15:44:23 +0800 Message-Id: <20200716074430.9675-2-qi1.zhang@intel.com> In-Reply-To: <20200716074430.9675-1-qi1.zhang@intel.com> References: <20200716074430.9675-1-qi1.zhang@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,qi1.zhang@intel.com X-Gm-Message-State: Ol35dF3vLCi2pmdEngNmWigYx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1594913466; bh=n5sGsPSxDtVzv8olb46KGvU1S39PrJjF107AiRGGtOg=; h=Cc:Date:From:Reply-To:Subject:To; b=YxDtNQIN+tOZrbXlDqXPHXi99YBF2oG2Ieg8yqXst+CcetIk+cCV3taHfK+B+9r/w6f 5/fzyaQJUEp1vnXv68LyyRiIboNHKC8NB+ayuld++IeVBZSEQaFnY314+LR1hy9EX2TcV DkB9znbs/W53BljWMJ6xwZrk7ZiNKA26mKY= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" From: Jiewen Yao REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2841 Cc: Jiewen Yao Cc: Jian J Wang Cc: Chao Zhang Cc: Qi Zhang Signed-off-by: Jiewen Yao --- SecurityPkg/Include/Ppi/Tcg.h | 52 +++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 SecurityPkg/Include/Ppi/Tcg.h diff --git a/SecurityPkg/Include/Ppi/Tcg.h b/SecurityPkg/Include/Ppi/Tcg.h new file mode 100644 index 0000000000..2725a4ca71 --- /dev/null +++ b/SecurityPkg/Include/Ppi/Tcg.h @@ -0,0 +1,52 @@ +/** @file + TCG PPI services. + +Copyright (c) 2020, Intel Corporation. All rights reserved.
+SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#ifndef _TCG_PPI_H_ +#define _TCG_PPI_H_ + +#include + +typedef struct _EDKII_TCG_PPI EDKII_TCG_PPI; + +/** + Tpm measure and log data, and extend the measurement result into a speci= fic PCR. + + @param[in] This Indicates the calling context + @param[in] Flags Bitmap providing additional information + @param[in] HashData Physical address of the start of the data = buffer + to be hashed, extended, and logged. + @param[in] HashDataLen The length, in bytes, of the buffer refere= nced by HashData. + @param[in] NewEventHdr Pointer to a TCG_PCR_EVENT_HDR data struct= ure. + @param[in] NewEventData Pointer to the new event data. + + @retval EFI_SUCCESS Operation completed successfully. + @retval EFI_UNSUPPORTED TPM device not available. + @retval EFI_OUT_OF_RESOURCES Out of memory. + @retval EFI_DEVICE_ERROR The operation was unsuccessful. +**/ +typedef +EFI_STATUS +(EFIAPI *EDKII_TCG_HASH_LOG_EXTEND_EVENT)( + IN EDKII_TCG_PPI *This, + IN UINT64 Flags, + IN UINT8 *HashData, + IN UINTN HashDataLen, + IN TCG_PCR_EVENT_HDR *NewEventHdr, + IN UINT8 *NewEventData + ); + +/// +/// The EFI_TCG Protocol abstracts TCG activity. +/// +struct _EDKII_TCG_PPI { + EDKII_TCG_HASH_LOG_EXTEND_EVENT HashLogExtendEvent; +}; + +extern EFI_GUID gEdkiiTcgPpiGuid; + +#endif --=20 2.26.2.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#62694): https://edk2.groups.io/g/devel/message/62694 Mute This Topic: https://groups.io/mt/75544077/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Sun Apr 28 06:45:30 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+62695+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+62695+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1594913467; cv=none; d=zohomail.com; s=zohoarc; b=MgCZ6xHsMMhqHoLsXpvOuDQTRgMtgQSJc6L/UM9l2ET7CuM+VY5AzOPoCCiQM48ekNuexoONJIIfKiACiTnzK5yft2z8AW0drIuw2Ms3OuLlYJFnn/bbvJBTPSKIcXTCD8gVFawO+ZadR68UTNMyVFRVEF8Bn7rlovvvawh0/v0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1594913467; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=rxIY71pgFsG8suSyWp00ZkX3xzKCfpw1mzobzvLnYhk=; b=c/Tu1KQ/7+D0ndBdgOFBcRI2BHJr9svJ+NG0/BBY6ORHQ/KSP7Gg14jIrf6Xh3IcVRtR4aMRj1AvyIOC2FS8P0rPa2pfJGwpDefTNNO3yxjH61tEhsHhdkVYy1CtZqr19MHbw/zjAfPJLFzwcEvRMxlUzRqZx8jvGxiDNgFcIcI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+62695+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1594913467530861.4573865244548; Thu, 16 Jul 2020 08:31:07 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id 1HMhYY1788612xUAsUIP9GZN; Thu, 16 Jul 2020 08:31:07 -0700 X-Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mx.groups.io with SMTP id smtpd.web12.10675.1594885483457594320 for ; Thu, 16 Jul 2020 00:44:44 -0700 IronPort-SDR: +bqrJzD0wbH3Oyp2RL7Cvk0Nyxz8YcJPhuatEGWQYRYF1NcZ+4nMcin3cA2K/Tuvsz5IzEeZe+ mBOFy04f2i5A== X-IronPort-AV: E=McAfee;i="6000,8403,9683"; a="214071691" X-IronPort-AV: E=Sophos;i="5.75,358,1589266800"; d="scan'208";a="214071691" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Jul 2020 00:44:42 -0700 IronPort-SDR: Zi3pzdNkTgDBY0ww3DkkETzbNW5vIRJbsONesVFf5Udi3XOsLUEHyP4ppuRNd+dzcPt2Gj1no+ 138YHt+rP/tg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,358,1589266800"; d="scan'208";a="430407243" X-Received: from shwdesssddpdqi.ccr.corp.intel.com ([10.239.9.10]) by orsmga004.jf.intel.com with ESMTP; 16 Jul 2020 00:44:41 -0700 From: Qi Zhang To: devel@edk2.groups.io Cc: Jiewen Yao , Jian J Wang , Chao Zhang Subject: [edk2-devel] [PATCH v2 2/7] SecurityPkg/dec: Add TcgPpi. Date: Thu, 16 Jul 2020 15:44:24 +0800 Message-Id: <20200716074430.9675-3-qi1.zhang@intel.com> In-Reply-To: <20200716074430.9675-1-qi1.zhang@intel.com> References: <20200716074430.9675-1-qi1.zhang@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,qi1.zhang@intel.com X-Gm-Message-State: 11hVJqR3LzyYWe6ODhpgMDLYx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1594913467; bh=ALPEyQ/+W8N0K88MXp/kJ3IZcpiTjYjP5OSbWUf0G1A=; h=Cc:Date:From:Reply-To:Subject:To; b=i+YLWgo53guiorzPQVCZraVWsr+glprOO/erUQqKpUylC/Pwg6fXz2zzNccz5I+1PKX fTL/UocTi9xKc88zVLH3Q/FJGjoneSgfi5zp9Djbfa+WKXSoduBtowXqg1Ci60z21ynlG ZK/3wScBrGPOqHMhUkSrkvh47wksxCv5eYc= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" From: Jiewen Yao REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2841 Cc: Jiewen Yao Cc: Jian J Wang Cc: Chao Zhang Signed-off-by: Jiewen Yao --- SecurityPkg/SecurityPkg.dec | 3 +++ 1 file changed, 3 insertions(+) diff --git a/SecurityPkg/SecurityPkg.dec b/SecurityPkg/SecurityPkg.dec index 79d46308ad..42fc48cc1f 100644 --- a/SecurityPkg/SecurityPkg.dec +++ b/SecurityPkg/SecurityPkg.dec @@ -203,6 +203,9 @@ ## Include/Ppi/FirmwareVolumeInfoStoredHashFv.h gEdkiiPeiFirmwareVolumeInfoStoredHashFvPpiGuid =3D {0x7f5e4e31, 0x81b1, = 0x47e5, { 0x9e, 0x21, 0x1e, 0x4b, 0x5b, 0xc2, 0xf6, 0x1d } } =20 + ## Include/Ppi/Tcg.h + gEdkiiTcgPpiGuid =3D {0x57a13b87, 0x133d, 0x4bf3, { 0xbf, 0xf1, 0x1b, 0x= ca, 0xc7, 0x17, 0x6c, 0xf1 } } + # # [Error.gEfiSecurityPkgTokenSpaceGuid] # 0x80000001 | Invalid value provided. --=20 2.26.2.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#62695): https://edk2.groups.io/g/devel/message/62695 Mute This Topic: https://groups.io/mt/75544078/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Sun Apr 28 06:45:30 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+62696+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+62696+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1594913468; cv=none; d=zohomail.com; s=zohoarc; b=DmL2h6IwCZn6bomo1/UFIHlJmhOkvpiQEraP3dNNEG0hkmazFpcon2BVlLZ4FT8XTqOv4SiuADaRcoDgryyHNvGCxhoMTS4IZrMWMIyK9BQlXrGbiWyWMUWTqABxyn5vDZgJ3gl3yzJ1zKJxzePGoq37tHnQZG1+pgVETyxT/1U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1594913468; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=ynKdoQyzMWOpmhkx2jOT1+hafocqMOMUlWNVg6QOmeI=; b=cuqU3PuJQfBzKA/XIHBzxgWqLiHoBFeoYPQIiDQR8RVJcU87LXc6YcylcSmOLvTeKNdmba4yFJNsJcfMxoyId/IL29EirKxa1/DppYNbm17BID0CY53HjKJeaz2P7f74BZBJn4aDjHlYBh+yobp5g6a8BYr54cNudsbWhSs87W0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+62696+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1594913468848549.9035229172916; Thu, 16 Jul 2020 08:31:08 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id UZw0YY1788612x8WanJ6wY9p; Thu, 16 Jul 2020 08:31:08 -0700 X-Received: from mga07.intel.com (mga07.intel.com []) by mx.groups.io with SMTP id smtpd.web12.10675.1594885483457594320 for ; Thu, 16 Jul 2020 00:44:45 -0700 IronPort-SDR: 2WAHKN7TgUyWyxhQJjdq6h6MyRAIlXY+dUrI6Gl6tMACoIXX1IAwAhzXWp36vgrGsofY4N//UG ExZdQhtafoRA== X-IronPort-AV: E=McAfee;i="6000,8403,9683"; a="214071693" X-IronPort-AV: E=Sophos;i="5.75,358,1589266800"; d="scan'208";a="214071693" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Jul 2020 00:44:44 -0700 IronPort-SDR: XBJPlJRtEavmMyDAK12bZOEK/elkqyf4wUhGZqOI4dtaWnx7sYhZGYrc3Oorc41IvQDV68jp3y 4TWD1A5GuNbw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,358,1589266800"; d="scan'208";a="430407249" X-Received: from shwdesssddpdqi.ccr.corp.intel.com ([10.239.9.10]) by orsmga004.jf.intel.com with ESMTP; 16 Jul 2020 00:44:42 -0700 From: Qi Zhang To: devel@edk2.groups.io Cc: Jiewen Yao , Jian J Wang , Chao Zhang , Qi Zhang , Rahul Kumar Subject: [edk2-devel] [PATCH v2 3/7] SecurityPkg/Tcg: Add TcgPpi Date: Thu, 16 Jul 2020 15:44:25 +0800 Message-Id: <20200716074430.9675-4-qi1.zhang@intel.com> In-Reply-To: <20200716074430.9675-1-qi1.zhang@intel.com> References: <20200716074430.9675-1-qi1.zhang@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,qi1.zhang@intel.com X-Gm-Message-State: FdKrqvOhsn25vxX0f7CIu4bQx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1594913468; bh=zUB7+YwpVWkMuO9AgAgfFb7Hq3q2IwZvn5497d6ddTI=; h=Cc:Date:From:Reply-To:Subject:To; b=UBhD/1rpeHHYSl+9W3owPvNdlwwToWWlNwcJrq6wbdx6aAs9y3s1WdZnUWOEd7wX36W SDJv0Z4NRWZGj+D38xkgtr2/VfkyFHkUxt7dMIKQ0fluUTQhVgNYKfmDZUPnOuebCi4li UfmH/0q0BcqEdxNrtTHPC2XRsVKiTb5ZBnY= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" From: Jiewen Yao REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2841 Cc: Jiewen Yao Cc: Jian J Wang Cc: Chao Zhang Cc: Qi Zhang Cc: Rahul Kumar Signed-off-by: Jiewen Yao --- SecurityPkg/Tcg/TcgPei/TcgPei.c | 61 ++++++++++++++++++++++++++++--- SecurityPkg/Tcg/TcgPei/TcgPei.inf | 3 +- 2 files changed, 58 insertions(+), 6 deletions(-) diff --git a/SecurityPkg/Tcg/TcgPei/TcgPei.c b/SecurityPkg/Tcg/TcgPei/TcgPe= i.c index a9a808c9ec..2533388849 100644 --- a/SecurityPkg/Tcg/TcgPei/TcgPei.c +++ b/SecurityPkg/Tcg/TcgPei/TcgPei.c @@ -1,7 +1,7 @@ /** @file Initialize TPM device and measure FVs before handing off control to DXE. =20 -Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.
+Copyright (c) 2005 - 2020, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ @@ -17,6 +17,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #include #include #include +#include =20 #include #include @@ -51,6 +52,45 @@ EFI_PEI_PPI_DESCRIPTOR mTpmInitializationDonePpiList = =3D { NULL }; =20 +/** + Do a hash operation on a data buffer, extend a specific TPM PCR with the= hash result, + and build a GUIDed HOB recording the event which will be passed to the D= XE phase and + added into the Event Log. + + @param[in] This Indicates the calling context + @param[in] Flags Bitmap providing additional information. + @param[in] HashData Physical address of the start of the data = buffer + to be hashed, extended, and logged. + @param[in] HashDataLen The length, in bytes, of the buffer refere= nced by HashData. + @param[in] NewEventHdr Pointer to a TCG_PCR_EVENT_HDR data struct= ure. + @param[in] NewEventData Pointer to the new event data. + + @retval EFI_SUCCESS Operation completed successfully. + @retval EFI_OUT_OF_RESOURCES No enough memory to log the new event. + @retval EFI_DEVICE_ERROR The command was unsuccessful. + +**/ +EFI_STATUS +EFIAPI +HashLogExtendEvent ( + IN EDKII_TCG_PPI *This, + IN UINT64 Flags, + IN UINT8 *HashData, + IN UINTN HashDataLen, + IN TCG_PCR_EVENT_HDR *NewEventHdr, + IN UINT8 *NewEventData + ); + +EDKII_TCG_PPI mEdkiiTcgPpi =3D { + HashLogExtendEvent +}; + +EFI_PEI_PPI_DESCRIPTOR mTcgPpiList =3D { + EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST, + &gEdkiiTcgPpiGuid, + &mEdkiiTcgPpi +}; + // // Number of firmware blobs to grow by each time we run out of room // @@ -243,7 +283,8 @@ TpmCommHashAll ( and build a GUIDed HOB recording the event which will be passed to the D= XE phase and added into the Event Log. =20 - @param[in] PeiServices Describes the list of possible PEI Service= s. + @param[in] This Indicates the calling context. + @param[in] Flags Bitmap providing additional information. @param[in] HashData Physical address of the start of the data = buffer to be hashed, extended, and logged. @param[in] HashDataLen The length, in bytes, of the buffer refere= nced by HashData. @@ -256,8 +297,10 @@ TpmCommHashAll ( =20 **/ EFI_STATUS +EFIAPI HashLogExtendEvent ( - IN EFI_PEI_SERVICES **PeiServices, + IN EDKII_TCG_PPI *This, + IN UINT64 Flags, IN UINT8 *HashData, IN UINTN HashDataLen, IN TCG_PCR_EVENT_HDR *NewEventHdr, @@ -346,7 +389,8 @@ MeasureCRTMVersion ( TcgEventHdr.EventSize =3D (UINT32) StrSize((CHAR16*)PcdGetPtr (PcdFirmwa= reVersionString)); =20 return HashLogExtendEvent ( - PeiServices, + &mEdkiiTcgPpi, + 0, (UINT8*)PcdGetPtr (PcdFirmwareVersionString), TcgEventHdr.EventSize, &TcgEventHdr, @@ -415,7 +459,8 @@ MeasureFvImage ( TcgEventHdr.EventSize =3D sizeof (FvBlob); =20 Status =3D HashLogExtendEvent ( - (EFI_PEI_SERVICES **) GetPeiServicesTablePointer(), + &mEdkiiTcgPpi, + 0, (UINT8*) (UINTN) FvBlob.BlobBase, (UINTN) FvBlob.BlobLength, &TcgEventHdr, @@ -744,6 +789,12 @@ PeimEntryMP ( Status =3D PeiServicesNotifyPpi (&mNotifyList[0]); ASSERT_EFI_ERROR (Status); =20 + // + // install Tcg Services + // + Status =3D PeiServicesInstallPpi (&mTcgPpiList); + ASSERT_EFI_ERROR (Status); + return Status; } =20 diff --git a/SecurityPkg/Tcg/TcgPei/TcgPei.inf b/SecurityPkg/Tcg/TcgPei/Tcg= Pei.inf index c0bff6e85e..4ab4edd657 100644 --- a/SecurityPkg/Tcg/TcgPei/TcgPei.inf +++ b/SecurityPkg/Tcg/TcgPei/TcgPei.inf @@ -4,7 +4,7 @@ # This module will initialize TPM device, measure reported FVs and BIOS v= ersion. # This module may also lock TPM physical presence and physicalPresenceLif= etimeLock. # -# Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
+# Copyright (c) 2006 - 2020, Intel Corporation. All rights reserved.
# SPDX-License-Identifier: BSD-2-Clause-Patent # ## @@ -67,6 +67,7 @@ gPeiTpmInitializedPpiGuid ## S= OMETIMES_PRODUCES gPeiTpmInitializationDonePpiGuid ## P= RODUCES gEfiEndOfPeiSignalPpiGuid ## S= OMETIMES_CONSUMES ## NOTIFY + gEdkiiTcgPpiGuid ## P= RODUCES =20 [Pcd] gEfiSecurityPkgTokenSpaceGuid.PcdPhysicalPresenceLifetimeLock ## S= OMETIMES_CONSUMES --=20 2.26.2.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#62696): https://edk2.groups.io/g/devel/message/62696 Mute This Topic: https://groups.io/mt/75544079/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Sun Apr 28 06:45:30 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+62697+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+62697+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1594913467; cv=none; d=zohomail.com; s=zohoarc; b=M7H3zeTdNDYyIPEkBmTk7Y9fYmQ5+SHmP43J1iOETj8sT8qsShKMBUO9PPiehKIl5qwzfZ3BnOkWkddheN9yKj+iP4knRsEALny8yDWlX9SgLLXV08zppkcqkxU5JRcQjnYc9HO0VQpqT4wAnTe3VeQDj/ddwNBeujnjC7YIZSw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1594913467; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=H95nB5ZBekxcFdSfSnrx/J1FLn2ZeHO9RgZVWkm0BaA=; b=ebNDg07igkQjauR7XhsBZ2d0QsAi7hDmKf7aD2Ha22CA4oYFsQhphN3C1aemGUoyQ9wXG0dyk4XYrx3ljmsQTF5PQgMxp+Xt+pX9GxfBDT4r73nm5u8esAZEwmRtMFv7oYjACTGnpMKWuSDPgFNdAT/7k6kI+o+sM6Q8TbsuZ/o= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+62697+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 159491346796920.607163033028655; Thu, 16 Jul 2020 08:31:07 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id 46QiYY1788612xELoBI5JOdc; Thu, 16 Jul 2020 08:31:07 -0700 X-Received: from mga07.intel.com (mga07.intel.com []) by mx.groups.io with SMTP id smtpd.web12.10675.1594885483457594320 for ; Thu, 16 Jul 2020 00:44:47 -0700 IronPort-SDR: IKRkd0eEHB51uX3LdoiSC5Eclm1dRy4CGFTV6Gw5kSu2h9yxH/xthCrdYyOh+4aO4jrG3BdZQH h5+gL3XFMu/g== X-IronPort-AV: E=McAfee;i="6000,8403,9683"; a="214071699" X-IronPort-AV: E=Sophos;i="5.75,358,1589266800"; d="scan'208";a="214071699" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Jul 2020 00:44:46 -0700 IronPort-SDR: K2bfM8YRK5XfsMXqQ2uibfJli+5iTJ+jxoaPDnWgLnOgBV7zEyXvSBtUYTT3NRWGrTH/q3bzQW fh7mNqJwjk8w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,358,1589266800"; d="scan'208";a="430407258" X-Received: from shwdesssddpdqi.ccr.corp.intel.com ([10.239.9.10]) by orsmga004.jf.intel.com with ESMTP; 16 Jul 2020 00:44:44 -0700 From: Qi Zhang To: devel@edk2.groups.io Cc: Jiewen Yao , Jian J Wang , Chao Zhang , Qi Zhang , Rahul Kumar Subject: [edk2-devel] [PATCH v2 4/7] SecurityPkg/Tcg2: Add TcgPpi Date: Thu, 16 Jul 2020 15:44:26 +0800 Message-Id: <20200716074430.9675-5-qi1.zhang@intel.com> In-Reply-To: <20200716074430.9675-1-qi1.zhang@intel.com> References: <20200716074430.9675-1-qi1.zhang@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,qi1.zhang@intel.com X-Gm-Message-State: tyiBZYJSmX3ecmjqD4O5Bxn7x1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1594913467; bh=Sp3iNatda+iAaJEv9nXJ5tS1I1Ntw7nqnsnbJ5Ofig4=; h=Cc:Date:From:Reply-To:Subject:To; b=pkSdtNF9plQ/GgpIneZKbhml55uIfI5HR19YKljlxYPg6Xg4+jm9aSkSdGZNqb1XSy0 Sp7BXXaknp7h8eza3RmAmRPT8ivUt9LpBCSG5fy1vt7epZf2h5AzM2JBPVdjWAU45FN6T uIbqhESeiuv5r/pAzlv/ONRMxbHxi03ftfQ= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" From: Jiewen Yao REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2841 Cc: Jiewen Yao Cc: Jian J Wang Cc: Chao Zhang Cc: Qi Zhang Cc: Rahul Kumar Signed-off-by: Jiewen Yao --- SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.c | 100 +++++++++++++++++++++------- SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.inf | 3 +- 2 files changed, 78 insertions(+), 25 deletions(-) diff --git a/SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.c b/SecurityPkg/Tcg/Tcg2Pei/Tc= g2Pei.c index 19b8e4b318..8114de45c7 100644 --- a/SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.c +++ b/SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.c @@ -1,7 +1,7 @@ /** @file Initialize TPM2 device and measure FVs before handing off control to DXE. =20 -Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.
+Copyright (c) 2015 - 2020, Intel Corporation. All rights reserved.
Copyright (c) 2017, Microsoft Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent =20 @@ -17,6 +17,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #include #include #include +#include =20 #include #include @@ -66,6 +67,45 @@ EFI_PEI_PPI_DESCRIPTOR mTpmInitializationDonePpiList = =3D { NULL }; =20 +/** + Do a hash operation on a data buffer, extend a specific TPM PCR with the= hash result, + and build a GUIDed HOB recording the event which will be passed to the D= XE phase and + added into the Event Log. + + @param[in] This Indicates the calling context + @param[in] Flags Bitmap providing additional information. + @param[in] HashData Physical address of the start of the data = buffer + to be hashed, extended, and logged. + @param[in] HashDataLen The length, in bytes, of the buffer refere= nced by HashData. + @param[in] NewEventHdr Pointer to a TCG_PCR_EVENT_HDR data struct= ure. + @param[in] NewEventData Pointer to the new event data. + + @retval EFI_SUCCESS Operation completed successfully. + @retval EFI_OUT_OF_RESOURCES No enough memory to log the new event. + @retval EFI_DEVICE_ERROR The command was unsuccessful. + +**/ +EFI_STATUS +EFIAPI +HashLogExtendEvent ( + IN EDKII_TCG_PPI *This, + IN UINT64 Flags, + IN UINT8 *HashData, + IN UINTN HashDataLen, + IN TCG_PCR_EVENT_HDR *NewEventHdr, + IN UINT8 *NewEventData + ); + +EDKII_TCG_PPI mEdkiiTcgPpi =3D { + HashLogExtendEvent +}; + +EFI_PEI_PPI_DESCRIPTOR mTcgPpiList =3D { + EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST, + &gEdkiiTcgPpiGuid, + &mEdkiiTcgPpi +}; + // // Number of firmware blobs to grow by each time we run out of room // @@ -375,6 +415,7 @@ LogHashEvent ( and build a GUIDed HOB recording the event which will be passed to the D= XE phase and added into the Event Log. =20 + @param[in] This Indicates the calling context @param[in] Flags Bitmap providing additional information. @param[in] HashData Physical address of the start of the data = buffer to be hashed, extended, and logged. @@ -388,7 +429,9 @@ LogHashEvent ( =20 **/ EFI_STATUS +EFIAPI HashLogExtendEvent ( + IN EDKII_TCG_PPI *This, IN UINT64 Flags, IN UINT8 *HashData, IN UINTN HashDataLen, @@ -403,16 +446,23 @@ HashLogExtendEvent ( return EFI_DEVICE_ERROR; } =20 - Status =3D HashAndExtend ( - NewEventHdr->PCRIndex, - HashData, - HashDataLen, + if(Flags & EFI_TCG2_PRE_HASH) { + ZeroMem (&DigestList, sizeof(DigestList)); + CopyMem(&DigestList, HashData, sizeof(DigestList)); + Status =3D Tpm2PcrExtend( + 0, &DigestList ); + } else { + Status =3D HashAndExtend ( + NewEventHdr->PCRIndex, + HashData, + HashDataLen, + &DigestList + ); + } if (!EFI_ERROR (Status)) { - if ((Flags & EFI_TCG2_EXTEND_ONLY) =3D=3D 0) { - Status =3D LogHashEvent (&DigestList, NewEventHdr, NewEventData); - } + Status =3D LogHashEvent (&DigestList, NewEventHdr, NewEventData); } =20 if (Status =3D=3D EFI_DEVICE_ERROR) { @@ -452,6 +502,7 @@ MeasureCRTMVersion ( TcgEventHdr.EventSize =3D (UINT32) StrSize((CHAR16*)PcdGetPtr (PcdFirmwa= reVersionString)); =20 return HashLogExtendEvent ( + &mEdkiiTcgPpi, 0, (UINT8*)PcdGetPtr (PcdFirmwareVersionString), TcgEventHdr.EventSize, @@ -651,27 +702,22 @@ MeasureFvImage ( // FV pre-hash algos comply with current TPM hash requirement // Skip hashing step in measure, only extend DigestList to PCR and log= event // - Status =3D Tpm2PcrExtend( - 0, - &DigestList + Status =3D HashLogExtendEvent ( + &mEdkiiTcgPpi, + EFI_TCG2_PRE_HASH, + (UINT8*) &DigestList, // HashData + (UINTN) sizeof(DigestList), // HashDataLen + &TcgEventHdr, // EventHdr + EventData // EventData ); - - if (!EFI_ERROR(Status)) { - Status =3D LogHashEvent (&DigestList, &TcgEventHdr, EventData); - DEBUG ((DEBUG_INFO, "The pre-hashed FV which is extended & logged b= y Tcg2Pei starts at: 0x%x\n", FvBase)); - DEBUG ((DEBUG_INFO, "The pre-hashed FV which is extended & logged b= y Tcg2Pei has the size: 0x%x\n", FvLength)); - } else if (Status =3D=3D EFI_DEVICE_ERROR) { - BuildGuidHob (&gTpmErrorHobGuid,0); - REPORT_STATUS_CODE ( - EFI_ERROR_CODE | EFI_ERROR_MINOR, - (PcdGet32 (PcdStatusCodeSubClassTpmDevice) | EFI_P_EC_INTERFACE_ER= ROR) - ); - } + DEBUG ((DEBUG_INFO, "The pre-hashed FV which is extended & logged by T= cg2Pei starts at: 0x%x\n", FvBase)); + DEBUG ((DEBUG_INFO, "The pre-hashed FV which is extended & logged by T= cg2Pei has the size: 0x%x\n", FvLength)); } else { // // Hash the FV, extend digest to the TPM and log TCG event // Status =3D HashLogExtendEvent ( + &mEdkiiTcgPpi, 0, (UINT8*) (UINTN) FvBase, // HashData (UINTN) FvLength, // HashDataLen @@ -866,6 +912,12 @@ PeimEntryMP ( Status =3D PeiServicesNotifyPpi (&mNotifyList[0]); ASSERT_EFI_ERROR (Status); =20 + // + // install Tcg Services + // + Status =3D PeiServicesInstallPpi (&mTcgPpiList); + ASSERT_EFI_ERROR (Status); + return Status; } =20 @@ -893,7 +945,7 @@ MeasureSeparatorEventWithError ( TcgEvent.PCRIndex =3D PCRIndex; TcgEvent.EventType =3D EV_SEPARATOR; TcgEvent.EventSize =3D (UINT32)sizeof (EventData); - return HashLogExtendEvent(0,(UINT8 *)&EventData, TcgEvent.EventSize, &Tc= gEvent,(UINT8 *)&EventData); + return HashLogExtendEvent(&mEdkiiTcgPpi, 0, (UINT8 *)&EventData, TcgEven= t.EventSize, &TcgEvent,(UINT8 *)&EventData); } =20 /** diff --git a/SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.inf b/SecurityPkg/Tcg/Tcg2Pei/= Tcg2Pei.inf index 3d361e8859..f64b29f1ae 100644 --- a/SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.inf +++ b/SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.inf @@ -8,7 +8,7 @@ # # This module will initialize TPM device, measure reported FVs and BIOS v= ersion. # -# Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.
+# Copyright (c) 2015 - 2020, Intel Corporation. All rights reserved.
# Copyright (c) 2017, Microsoft Corporation. All rights reserved.
# SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -72,6 +72,7 @@ gPeiTpmInitializationDonePpiGuid ## = PRODUCES gEfiEndOfPeiSignalPpiGuid ## = SOMETIMES_CONSUMES ## NOTIFY gEdkiiPeiFirmwareVolumeInfoPrehashedFvPpiGuid ## = SOMETIMES_CONSUMES + gEdkiiTcgPpiGuid ## = PRODUCES =20 [Pcd] gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString ## = SOMETIMES_CONSUMES --=20 2.26.2.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#62697): https://edk2.groups.io/g/devel/message/62697 Mute This Topic: https://groups.io/mt/75544080/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Sun Apr 28 06:45:30 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+62698+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+62698+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1594913466; cv=none; d=zohomail.com; s=zohoarc; b=UQ1oOioVxu93qwTb+wlTMkyAvklg/wEhDEL/KQND/N+o5ozXYeUV7mInQk1KdgF5XImOcXEoo3j4UzwZ6CtFCmHOQtyVJyLa3dvxwKZTnVhGPk8WBIdLyzVVd7fF4Zm+t4xU9UuY73hHtMZvrpB8Oyr/bj6xTx8uKErnrI0gKeo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1594913466; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=X3aIUOkppcbGsDwL1/MNu/Fw8gBzSL+H5OFkABlf9LA=; b=jGsjqwa7svVXBe415XIACDFfpH/I0Jy5U4e2tnj+S3VqEL9MnjYvLzPefXTET2317OYpCoDu3Vk5Pk3GmhsuxdVp+SZbnMGZ2pd6zLQe0G28jRUflu16X+zm7RxXFq2urnmPkehTf9yf4QoxJxXnkXD+er9OJOdo3Ay/Ky0eJEo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+62698+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1594913466890108.486373236075; Thu, 16 Jul 2020 08:31:06 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id Zga4YY1788612xwcA3iXNKF7; Thu, 16 Jul 2020 08:31:06 -0700 X-Received: from mga07.intel.com (mga07.intel.com []) by mx.groups.io with SMTP id smtpd.web12.10675.1594885483457594320 for ; Thu, 16 Jul 2020 00:44:49 -0700 IronPort-SDR: FatnA/H1jL8AD0DCDGuq+FhNg50GymgI8l1uGoiOOKnmlE1GFKHJuFHr1+jH72DhtafdtQUH9Y M8tOMezaKNmQ== X-IronPort-AV: E=McAfee;i="6000,8403,9683"; a="214071702" X-IronPort-AV: E=Sophos;i="5.75,358,1589266800"; d="scan'208";a="214071702" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Jul 2020 00:44:48 -0700 IronPort-SDR: PiKSjaumt9KqkCsHTx88WTOlKfxqxc0Fy6QhrUKYW9GuIW3lq0cyOd7dgqbkpuLKwmpqs7pPJ2 ig5kLXkV2CWg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,358,1589266800"; d="scan'208";a="430407264" X-Received: from shwdesssddpdqi.ccr.corp.intel.com ([10.239.9.10]) by orsmga004.jf.intel.com with ESMTP; 16 Jul 2020 00:44:46 -0700 From: Qi Zhang To: devel@edk2.groups.io Cc: Jiewen Yao , Jian J Wang , Chao Zhang , Qi Zhang Subject: [edk2-devel] [PATCH v2 5/7] SecurityPkg/PeiTpmMeasurementLib: Add PEI instance. Date: Thu, 16 Jul 2020 15:44:27 +0800 Message-Id: <20200716074430.9675-6-qi1.zhang@intel.com> In-Reply-To: <20200716074430.9675-1-qi1.zhang@intel.com> References: <20200716074430.9675-1-qi1.zhang@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,qi1.zhang@intel.com X-Gm-Message-State: Me12zI3iDCiqcr1TaP9I2Xkcx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1594913466; bh=uwjh3fMvBxotelYWsduycs4DtINXi7EBI86pHli26WU=; h=Cc:Date:From:Reply-To:Subject:To; b=mxT+5XQrrKYimllwXAPH+uPtP+k7ARDrEiIrhYJ8B2tt3W/ovHNK65ozVkqvn5Kjfre rLFCR2SXMQBSZDfwAa5iLbFTN2k0BmcoYrJhIiDZhXepJcWGJIYWfhXNwjeftz6DsYWt6 simWotETsJdIEomBLccMOKQ35BT3+w/raVc= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" From: Jiewen Yao REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2841 Cc: Jiewen Yao Cc: Jian J Wang Cc: Chao Zhang Cc: Qi Zhang Signed-off-by: Jiewen Yao --- .../PeiTpmMeasurementLib.c | 74 +++++++++++++++++++ .../PeiTpmMeasurementLib.inf | 50 +++++++++++++ .../PeiTpmMeasurementLib.uni | 17 +++++ 3 files changed, 141 insertions(+) create mode 100644 SecurityPkg/Library/PeiTpmMeasurementLib/PeiTpmMeasurem= entLib.c create mode 100644 SecurityPkg/Library/PeiTpmMeasurementLib/PeiTpmMeasurem= entLib.inf create mode 100644 SecurityPkg/Library/PeiTpmMeasurementLib/PeiTpmMeasurem= entLib.uni diff --git a/SecurityPkg/Library/PeiTpmMeasurementLib/PeiTpmMeasurementLib.= c b/SecurityPkg/Library/PeiTpmMeasurementLib/PeiTpmMeasurementLib.c new file mode 100644 index 0000000000..1a590e0c9e --- /dev/null +++ b/SecurityPkg/Library/PeiTpmMeasurementLib/PeiTpmMeasurementLib.c @@ -0,0 +1,74 @@ +/** @file + This library is used by other modules to measure data to TPM. + +Copyright (c) 2020, Intel Corporation. All rights reserved.
+SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include + +#include +#include +#include +#include +#include +#include + +#include +#include + +/** + Tpm measure and log data, and extend the measurement result into a speci= fic PCR. + + @param[in] PcrIndex PCR Index. + @param[in] EventType Event type. + @param[in] EventLog Measurement event log. + @param[in] LogLen Event log length in bytes. + @param[in] HashData The start of the data buffer to be hashed, = extended. + @param[in] HashDataLen The length, in bytes, of the buffer referen= ced by HashData + + @retval EFI_SUCCESS Operation completed successfully. + @retval EFI_UNSUPPORTED TPM device not available. + @retval EFI_OUT_OF_RESOURCES Out of memory. + @retval EFI_DEVICE_ERROR The operation was unsuccessful. +**/ +EFI_STATUS +EFIAPI +TpmMeasureAndLogData ( + IN UINT32 PcrIndex, + IN UINT32 EventType, + IN VOID *EventLog, + IN UINT32 LogLen, + IN VOID *HashData, + IN UINT64 HashDataLen + ) +{ + EFI_STATUS Status; + EDKII_TCG_PPI *TcgPpi; + TCG_PCR_EVENT_HDR TcgEventHdr; + + Status =3D PeiServicesLocatePpi( + &gEdkiiTcgPpiGuid, + 0, + NULL, + (VOID**)&TcgPpi + ); + if (EFI_ERROR(Status)) { + return Status; + } + + TcgEventHdr.PCRIndex =3D PcrIndex; + TcgEventHdr.EventType =3D EventType; + TcgEventHdr.EventSize =3D LogLen; + + Status =3D TcgPpi->HashLogExtendEvent ( + TcgPpi, + 0, + HashData, + (UINTN)HashDataLen, + &TcgEventHdr, + EventLog + ); + return Status; +} diff --git a/SecurityPkg/Library/PeiTpmMeasurementLib/PeiTpmMeasurementLib.= inf b/SecurityPkg/Library/PeiTpmMeasurementLib/PeiTpmMeasurementLib.inf new file mode 100644 index 0000000000..6625d0fd01 --- /dev/null +++ b/SecurityPkg/Library/PeiTpmMeasurementLib/PeiTpmMeasurementLib.inf @@ -0,0 +1,50 @@ +## @file +# Provides TPM measurement functions for TPM1.2 and TPM 2.0 +# +# This library provides TpmMeasureAndLogData() to measure and log data, a= nd +# extend the measurement result into a specific PCR. +# +# Copyright (c) 2020, Intel Corporation. All rights reserved.
+# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + +[Defines] + INF_VERSION =3D 0x00010005 + BASE_NAME =3D PeiTpmMeasurementLib + FILE_GUID =3D 9A62C49D-C45A-4322-9F3C-45958DF0056B + MODULE_TYPE =3D PEIM + VERSION_STRING =3D 1.0 + LIBRARY_CLASS =3D TpmMeasurementLib|PEIM + MODULE_UNI_FILE =3D PeiTpmMeasurementLib.uni + +# +# The following information is for reference only and not required by the = build tools. +# +# VALID_ARCHITECTURES =3D IA32 X64 +# + +[Sources] + PeiTpmMeasurementLib.c + +[Packages] + MdePkg/MdePkg.dec + MdeModulePkg/MdeModulePkg.dec + SecurityPkg/SecurityPkg.dec + +[LibraryClasses] + BaseLib + BaseMemoryLib + HobLib + DebugLib + PcdLib + PrintLib + PeiServicesLib + PeiServicesTablePointerLib + +[Ppis] + gEdkiiTcgPpiGuid ## = CONSUMES + +[Depex] + gEfiPeiMasterBootModePpiGuid AND + gEfiTpmDeviceSelectedGuid diff --git a/SecurityPkg/Library/PeiTpmMeasurementLib/PeiTpmMeasurementLib.= uni b/SecurityPkg/Library/PeiTpmMeasurementLib/PeiTpmMeasurementLib.uni new file mode 100644 index 0000000000..7b4341b449 --- /dev/null +++ b/SecurityPkg/Library/PeiTpmMeasurementLib/PeiTpmMeasurementLib.uni @@ -0,0 +1,17 @@ +// /** @file +// Provides TPM measurement functions for TPM1.2 and TPM 2.0 +// +// This library provides TpmMeasureAndLogData() to to measure and log data= , and +// extend the measurement result into a specific PCR. +// +// Copyright (c) 2020, Intel Corporation. All rights reserved.
+// +// SPDX-License-Identifier: BSD-2-Clause-Patent +// +// **/ + + +#string STR_MODULE_ABSTRACT #language en-US "Provides TPM meas= urement functions for TPM1.2 and TPM 2.0" + +#string STR_MODULE_DESCRIPTION #language en-US "This library prov= ides TpmMeasureAndLogData() to to measure and log data, and extend the meas= urement result into a specific PCR." + --=20 2.26.2.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#62698): https://edk2.groups.io/g/devel/message/62698 Mute This Topic: https://groups.io/mt/75544081/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Sun Apr 28 06:45:30 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+62699+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+62699+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1594913468; cv=none; d=zohomail.com; s=zohoarc; b=T3L+bTDuiKDnC4nqtiPyUpMFn+JBcByyWF8d3S+/uC4/umHW4VqONO8FiThu1PLhscenDViI7QFllUl4/bJYUzLfO/Bk/haLuoiCpn5TuRnCbUeEO4Hv2ns2YXyV3gQS941ebOU78Fjeyy/F+/O53HJaYW1EwRxTkyoC3EvjuP0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1594913468; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=VuFwCEdpW/VY047DQ4GvlnE2PE8jZpQKoij2uzvQAXc=; b=DaYjUNYKzQCoADK57zJ1YDqBj3ZVEYMQ4M/YcEWvHCj5HW/A9T8CwLTsIKP8YKTtKV5hSdTNUmg+jYbYRwKfnQgY88L4bl3UUZ34dF6MwFeuyPQF73Qge1SCef9owAdecA4f16mAQBEwO4sWo9V8rLOhIgJfDQG+eiZ8NW1KBgI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+62699+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 159491346844991.58058201791187; Thu, 16 Jul 2020 08:31:08 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id oUcSYY1788612x8hLUq5O03z; Thu, 16 Jul 2020 08:31:08 -0700 X-Received: from mga07.intel.com (mga07.intel.com []) by mx.groups.io with SMTP id smtpd.web12.10675.1594885483457594320 for ; Thu, 16 Jul 2020 00:44:50 -0700 IronPort-SDR: Lq5tUUyrmKFs/PDEZJL7yKzYF6qf+JlfBtGt3vHAuYS7kNObrdP7icYKIcd3unIfFJSMhLZkcn xMC6H9hVe91A== X-IronPort-AV: E=McAfee;i="6000,8403,9683"; a="214071703" X-IronPort-AV: E=Sophos;i="5.75,358,1589266800"; d="scan'208";a="214071703" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Jul 2020 00:44:50 -0700 IronPort-SDR: CEkCac+uJXGGCFERYDgseybdasmD5p4WCLt6sHJwmUWPjQm2DrFsVdciiJKZj8Bc2BPDvkD2eq Ofcb455mjVPA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,358,1589266800"; d="scan'208";a="430407272" X-Received: from shwdesssddpdqi.ccr.corp.intel.com ([10.239.9.10]) by orsmga004.jf.intel.com with ESMTP; 16 Jul 2020 00:44:48 -0700 From: Qi Zhang To: devel@edk2.groups.io Cc: Jiewen Yao , Jian J Wang , Chao Zhang , Qi Zhang Subject: [edk2-devel] [PATCH v2 6/7] SecurityPkg/dsc: Add PeiTpmMeasurementLib. Date: Thu, 16 Jul 2020 15:44:28 +0800 Message-Id: <20200716074430.9675-7-qi1.zhang@intel.com> In-Reply-To: <20200716074430.9675-1-qi1.zhang@intel.com> References: <20200716074430.9675-1-qi1.zhang@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,qi1.zhang@intel.com X-Gm-Message-State: nbmkC5pocH3jMAijxSKfBClmx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1594913468; bh=bUsHZP01OIzZ9aYKiaVcZpQb7rimG4eyg04wt99Y5gM=; h=Cc:Date:From:Reply-To:Subject:To; b=uWkV1Vl++KH1eWs4zyUbzWZVHGwiOEsDHWtrasL4RmJQRUrTLOgNJYDABdaNH0RkTUC vY01V1bCc0c6K5XRYa8XRLxIfzGM1wpnoU1DP/esGuUlnFO0aElFsEJst0CWzSX3nP/EP Kz6Siz+u0yrCllG4Euna5qsILeGzmTjT9TU= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" From: Jiewen Yao REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2841 Cc: Jiewen Yao Cc: Jian J Wang Cc: Chao Zhang Cc: Qi Zhang Signed-off-by: Jiewen Yao --- SecurityPkg/SecurityPkg.dsc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/SecurityPkg/SecurityPkg.dsc b/SecurityPkg/SecurityPkg.dsc index 53fce05353..28effe3eda 100644 --- a/SecurityPkg/SecurityPkg.dsc +++ b/SecurityPkg/SecurityPkg.dsc @@ -1,7 +1,7 @@ ## @file # Security Module Package for All Architectures. # -# Copyright (c) 2009 - 2019, Intel Corporation. All rights reserved.
+# Copyright (c) 2009 - 2020, Intel Corporation. All rights reserved.
# (C) Copyright 2015-2020 Hewlett Packard Enterprise Development LP
# SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -96,6 +96,7 @@ Tpm12DeviceLib|SecurityPkg/Library/Tpm12DeviceLibDTpm/Tpm12DeviceLibDTpm= .inf Tpm2DeviceLib|SecurityPkg/Library/Tpm2DeviceLibDTpm/Tpm2DeviceLibDTpm.inf Tcg2PhysicalPresenceLib|SecurityPkg/Library/PeiTcg2PhysicalPresenceLib/P= eiTcg2PhysicalPresenceLib.inf + TpmMeasurementLib|SecurityPkg/Library/PeiTpmMeasurementLib/PeiTpmMeasure= mentLib.inf RngLib|MdePkg/Library/BaseRngLib/BaseRngLib.inf =20 [LibraryClasses.common.DXE_DRIVER] @@ -234,6 +235,7 @@ SecurityPkg/Library/FmpAuthenticationLibPkcs7/FmpAuthenticationLibPkcs7.= inf SecurityPkg/Library/FmpAuthenticationLibRsa2048Sha256/FmpAuthenticationL= ibRsa2048Sha256.inf =20 + SecurityPkg/Library/PeiTpmMeasurementLib/PeiTpmMeasurementLib.inf SecurityPkg/Library/DxeTpmMeasurementLib/DxeTpmMeasurementLib.inf SecurityPkg/Library/PlatformSecureLibNull/PlatformSecureLibNull.inf SecurityPkg/Library/Tcg2PpVendorLibNull/Tcg2PpVendorLibNull.inf --=20 2.26.2.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#62699): https://edk2.groups.io/g/devel/message/62699 Mute This Topic: https://groups.io/mt/75544082/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Sun Apr 28 06:45:30 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+62700+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+62700+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1594913469; cv=none; d=zohomail.com; s=zohoarc; b=E0HPnln/ffThmZaxJUgVRCnM/lrYuCz9x04Ag5zc9f0V//CnqpugEAr8ZR75xP9jq4Voclx2iVVmBlD9gVgn8BHFy7xcne4HGNLuGwUhWbp005By73aob4/5pJw+n7zHQjiyvXcULjGfNtDZLcsXVDQ/K1gafAUrxyMe46qIAm4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1594913469; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=lWab5zPeKrMl9TOQBzic59unN6ADi0S3bh2i0s7ctoI=; b=SvMNnVkhop7hRo06ShTA3u0EMdR+YlesfUSIOfIH7diV8hIeThUptrQMJe23mD94+ut8ytkb4GMkSGgvIkQkRQGxhnQ7Pz4Gpp3XfrZj9se5Bslhr9CCdmn8hww0yGl27tRIIXZPxTcr3e17a9c9oi0+PGSxXVclr6Bq7+r7iOQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+62700+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1594913469292811.2674392200875; Thu, 16 Jul 2020 08:31:09 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id nNK8YY1788612xsD5q5Y52Cg; Thu, 16 Jul 2020 08:31:09 -0700 X-Received: from mga07.intel.com (mga07.intel.com []) by mx.groups.io with SMTP id smtpd.web12.10675.1594885483457594320 for ; Thu, 16 Jul 2020 00:44:53 -0700 IronPort-SDR: R6T17uICG+oPz1jssXs4Gys0dxOJI2HwsBasOL1gjGpHr5HPzFlqSCtE3D5+AK8UzDsjmv42Ut MCW/4NO8AmyA== X-IronPort-AV: E=McAfee;i="6000,8403,9683"; a="214071709" X-IronPort-AV: E=Sophos;i="5.75,358,1589266800"; d="scan'208";a="214071709" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Jul 2020 00:44:52 -0700 IronPort-SDR: 6M6QzpF+pSyTWKUEhGbik/Gi43WuOn/RpV5rz+FiAZVuyqj8q///esR0w0PWTr8MO32OIhrc6S GHUjODVOCAkg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,358,1589266800"; d="scan'208";a="430407279" X-Received: from shwdesssddpdqi.ccr.corp.intel.com ([10.239.9.10]) by orsmga004.jf.intel.com with ESMTP; 16 Jul 2020 00:44:50 -0700 From: Qi Zhang To: devel@edk2.groups.io Cc: Qi Zhang , Michael D Kinney , Liming Gao , Jiewen Yao Subject: [edk2-devel] [PATCH v2 7/7] MdePkg/Tcg2Protocol: define Flag EFI_TCG2_PRE_HASH Date: Thu, 16 Jul 2020 15:44:29 +0800 Message-Id: <20200716074430.9675-8-qi1.zhang@intel.com> In-Reply-To: <20200716074430.9675-1-qi1.zhang@intel.com> References: <20200716074430.9675-1-qi1.zhang@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,qi1.zhang@intel.com X-Gm-Message-State: AUdVhfozbPKZWZipZQQDKJUhx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1594913469; bh=Co/YyByDc0ZIq1ldPT1l9KcYrdVum4YPi9n3xpelLTw=; h=Cc:Date:From:Reply-To:Subject:To; b=nlRuNIG38MAvpLdpgx4DA/COhQJ186vxMuya0E/3bRmTnoVIbWnbEFKonUzquFQU3wY aO4+E+YgUvV+GKNr7A0NQSegSJfoD8wJFG66CjGDAoGKE4qVxdiLezc/JVDC6Gx8TucYg lUFA/KTxABquclSOheKaondX4d7MK0OW4nI= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2841 Cc: Michael D Kinney Cc: Liming Gao Cc: Jiewen Yao Cc: Qi Zhang Signed-off-by: Qi Zhang --- MdePkg/Include/Protocol/Tcg2Protocol.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/MdePkg/Include/Protocol/Tcg2Protocol.h b/MdePkg/Include/Protoc= ol/Tcg2Protocol.h index 5ef13cc607..4659802251 100644 --- a/MdePkg/Include/Protocol/Tcg2Protocol.h +++ b/MdePkg/Include/Protocol/Tcg2Protocol.h @@ -98,6 +98,10 @@ typedef struct tdEFI_TCG2_BOOT_SERVICE_CAPABILITY { // #define EFI_TCG2_EXTEND_ONLY 0x0000000000000001 // +// This bit is shall be set when HashData is the pre-hash digest. +// +#define EFI_TCG2_PRE_HASH 0x0000000000000010 +// // This bit shall be set when the intent is to measure a PE/COFF image. // #define PE_COFF_IMAGE 0x0000000000000010 --=20 2.26.2.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#62700): https://edk2.groups.io/g/devel/message/62700 Mute This Topic: https://groups.io/mt/75544083/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-