From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mx.groups.io with SMTP id smtpd.web10.6818.1597198445079778837 for ; Tue, 11 Aug 2020 19:14:05 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=OYDdpj3K; spf=pass (domain: intel.com, ip: 192.55.52.93, mailfrom: jian.j.wang@intel.com) IronPort-SDR: y0J1xDJROwODVY1rZDNpddBVYNUgVUffV7MR4RCGujy0Sw2QKJaEtk4u0vnc3GzEGH7ZbJvi+K KTdQnIosxjVQ== X-IronPort-AV: E=McAfee;i="6000,8403,9710"; a="151538728" X-IronPort-AV: E=Sophos;i="5.76,302,1592895600"; d="scan'208";a="151538728" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Aug 2020 19:14:04 -0700 IronPort-SDR: 4+k/LhUEb+LqGxGMscEWy7u6EbJPoctWTqVW1MC4MH/xzek3KHFY+zOuvpnI8v0HYqnIhVqFxj TgD/v4WjZnkQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,302,1592895600"; d="scan'208";a="290883552" Received: from fmsmsx603-2.cps.intel.com (HELO fmsmsx603.amr.corp.intel.com) ([10.18.84.213]) by orsmga003.jf.intel.com with ESMTP; 11 Aug 2020 19:14:03 -0700 Received: from fmsmsx607.amr.corp.intel.com (10.18.126.87) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Tue, 11 Aug 2020 19:14:03 -0700 Received: from FMSEDG002.ED.cps.intel.com (10.1.192.134) by fmsmsx607.amr.corp.intel.com (10.18.126.87) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1713.5 via Frontend Transport; Tue, 11 Aug 2020 19:14:03 -0700 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.108) by edgegateway.intel.com (192.55.55.69) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 11 Aug 2020 19:14:03 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dBIJUAyng6M4k7RJ1xZ5Om981L6GMi5h0u45v8c7K23d4m32hl/MBzARSYxRNXNoZKfEYGJ2U3Iz/GbaDZ3dM1TIVec8DrUitt0UEOERVjBe0Hu0amsGHNevKBDmcTt6GHdBYzOoAtdt7RpzvA3yFUAsT48p6g2SoYPmXwKuCqrk9VkXDEDMafXx4InSCmL1Fx/dh+b+Cs1o9sqEKGStMzXA1bSx+FRGuMaIUkSd92bUKBSzw4kMX+iHowxa/7QuVj1jXzgsqr+VJxy550lmHo/3+xqPRsgVqJnh5W0bPw3osV+xhULvKBPAZLJbp++h0XSboi8+qNfgHbRA9efLFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=zokc4gZworoIX+Y7GBZt/klYw9jrs3YjTDQWF7oiMEU=; b=msAAFTXjJlPhFSrGfTNK2WPo0RnBstRGXMWPpO0tqcsoKqXn278FWUo0xJaS7gF8AUscmNaqwBC20tP7b/7iScHwa5/1xbpcNcPWLqCLO+E33Kc2bqypGPCmpYw0fOR4uj3hNBgcScI23ZYSqZISaOEML9ypvwQ7rneajOc76epMvNpitFaJxC8sATFDRmr7f/qzevAbvGrnn++huuq1HY/scBVOkkYUqzaeCkS1RogLl+wDxjbgre6MrSkHKwc3mJORfIGJcNA5+9SaoMtxX9hPGscg+qH5+q+69LBOyEW2HQKZR8QnUpo+IXy20DRIE1qU3IGpFiCNGjCcm89REA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=zokc4gZworoIX+Y7GBZt/klYw9jrs3YjTDQWF7oiMEU=; b=OYDdpj3K/Wjhb77hA/3ppXkYLXPBmdfDjIzWavliONecIYkDJSJra+Vq5D9kAiFiCa14B/JHCN9MHQWW8WZFuhHwdAwMA7pgxp5OPvJxabk9N2BdChAMQwVkKOQeUJeTFgMJrURPmPUaX+8pxaRkz9BiEuYYiwZ0kagB3FAyTpg= Received: from SN6PR11MB3312.namprd11.prod.outlook.com (2603:10b6:805:c8::14) by SA0PR11MB4654.namprd11.prod.outlook.com (2603:10b6:806:98::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3283.15; Wed, 12 Aug 2020 02:14:01 +0000 Received: from SN6PR11MB3312.namprd11.prod.outlook.com ([fe80::bc48:4db0:9666:124e]) by SN6PR11MB3312.namprd11.prod.outlook.com ([fe80::bc48:4db0:9666:124e%7]) with mapi id 15.20.3261.024; Wed, 12 Aug 2020 02:14:01 +0000 From: "Wang, Jian J" To: "Zhang, Qi1" , "devel@edk2.groups.io" CC: "Yao, Jiewen" Subject: Re: [PATCH v2 4/9] SecurityPkg/PeiTpmMeasurementLib: Add new API. Thread-Topic: [PATCH v2 4/9] SecurityPkg/PeiTpmMeasurementLib: Add new API. Thread-Index: AQHWa4lNMhNlkLHoyES/s1V6NcZgiqkzxSEQ Date: Wed, 12 Aug 2020 02:14:01 +0000 Message-ID: References: <20200806003342.17866-1-qi1.zhang@intel.com> <20200806003342.17866-5-qi1.zhang@intel.com> In-Reply-To: <20200806003342.17866-5-qi1.zhang@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNDAyOTZmMTItOWE1NC00ZDhiLWI1YTUtZTNiZDY3MjcwNGU0IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoicTRydXZZcVBiaDY2V3VUYVk5TmxkaG84NGVBV1ZjajZJdDdIb0VRWjB3WSs0OGxLbEpvbm9nSlpzdXRDenpkaiJ9 dlp-reaction: no-action dlp-version: 11.5.1.3 dlp-product: dlpe-windows x-ctpclassification: CTP_NT authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [192.198.147.203] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 2e77a88b-721f-46b4-3372-08d83e656150 x-ms-traffictypediagnostic: SA0PR11MB4654: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:595; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: wMZDRLj2ChzA4x52gT5Hm5ZNALIIcWJZ2dUhelfZwz3NVfk6U4dKV5L4cznjsjbk/U/N8iUtQnMAqtusCFue9zm7sucoadkTRvg+hmBYW4MTpEqgy66Og9y+jhGRga1P+bXHMH/4p7RTwFGyo5m5cTJBGuWOfmhDuW7+RhEAxWfbsv+bBT98T5+Gjjoy9q+5COxvbI/XQsW92+xBt1KePqc76vca1Nanb51ctAgKPMqukT13m329elSv8WTzgfqhWPHP3QZEPtvnJ98NMYvLQhzo1ZkIT9NLNMIFay33znPdwl+GL3Ubb1smUVF9RSwUzDFyJNsxg7PbzRSnRAVjb7f0Xr2QvGKpTYPZ4Iy6OctWQmKboubU/bU7/WuHGJ5z5ojIrhBMP7R+EHxhRX7qCA== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR11MB3312.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(39860400002)(376002)(396003)(366004)(136003)(346002)(19627235002)(7696005)(33656002)(4326008)(966005)(52536014)(5660300002)(15650500001)(110136005)(8936002)(316002)(2906002)(186003)(6506007)(478600001)(86362001)(9686003)(53546011)(66446008)(83380400001)(26005)(71200400001)(8676002)(66476007)(55016002)(76116006)(64756008)(66946007)(66556008)(107886003);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: nAQuxHD9kqvxf+GjxNFINMnQAOddOFsfrjlqgucJ66KXoX7PI/QAdbZ/P9CxjbzFng6TBeSQRWAasuEjz/0ROgz0JCriFoHzvnviCdsp1rvJY0JXZs5TfeBICcx5EBC+sEk4fddmrg67Ewithlnzdx/CwGGWxvTC0JHnuxac7fA6sa3kYVi5qHkfJL2s0dpECfOnahUlHrCDugn5FT0LabhUY9z5FKy/D1s3Co6neaTSNWjbHRNfXmlU8xhxk80jA3awOKu2Z4u+Kt/D3hiJUBLI3ju5CMM5HIuKLHp0eVBT5d5SjviY8qHDV2FdX9bA5Vjve/21dyyFw3ftOyu/ZuGpDcYpBGvYb2QzKgDXv0Yw28zCLdOun3X5U2iM4+UEYhz8v717ML52+Sqif+jw43DO7BDGQK/pjB9MtCjEEFAFbSPFnejncDOrqTCNSBPf3mLDCEmSdI5Sky/GWrLP5b35sjh7h6dqGNdD8zNDPqkSSbDiSMxKOei8KY+vU3okGR5S6s6qaLlxF/VnxY10M1pYvx7aQkLs1gQ0UYWuKDntD9n0+6veX/xIgAzDgg1Rvw0X5T4JHM+uqWtPqAD3dA3Yd/qXjIkdifG7Oa1Adw3vvdFilJjv033Jn8lIpQLzO4lr8XWtNhTuTvOeMmEd2w== MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SN6PR11MB3312.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2e77a88b-721f-46b4-3372-08d83e656150 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Aug 2020 02:14:01.7000 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 0sGAQQmWqBuBfE09SZJsNw4e0Qtn4WcV01mOFl95tfdJF4cl4Lxkgm7ENmhrm32QjZPsSKv5Y0E/uix+3zgr5g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR11MB4654 Return-Path: jian.j.wang@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Qi, This patch is similar to patch 3. Please refer to comments in that one. Regards, Jian > -----Original Message----- > From: Zhang, Qi1 > Sent: Thursday, August 06, 2020 8:34 AM > To: devel@edk2.groups.io > Cc: Yao, Jiewen ; Wang, Jian J ; > Zhang, Qi1 > Subject: [PATCH v2 4/9] SecurityPkg/PeiTpmMeasurementLib: Add new API. >=20 > From: Jiewen Yao >=20 > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2376 >=20 > Cc: Jiewen Yao > Cc: Jian J Wang > Cc: Qi Zhang > Signed-off-by: Jiewen Yao > --- > .../PeiTpmMeasurementLib/EventLogRecord.c | 218 ++++++++++++++++++ > .../PeiTpmMeasurementLib.inf | 4 + > 2 files changed, 222 insertions(+) > create mode 100644 > SecurityPkg/Library/PeiTpmMeasurementLib/EventLogRecord.c >=20 > diff --git a/SecurityPkg/Library/PeiTpmMeasurementLib/EventLogRecord.c > b/SecurityPkg/Library/PeiTpmMeasurementLib/EventLogRecord.c > new file mode 100644 > index 0000000000..cececdf7b2 > --- /dev/null > +++ b/SecurityPkg/Library/PeiTpmMeasurementLib/EventLogRecord.c > @@ -0,0 +1,218 @@ > +/** @file >=20 > + This library is used by other modules to measure data to TPM. >=20 > + >=20 > +Copyright (c) 2020, Intel Corporation. All rights reserved.
>=20 > +SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > + >=20 > +**/ >=20 > + >=20 > +#include >=20 > + >=20 > +#include >=20 > +#include >=20 > +#include >=20 > +#include >=20 > +#include >=20 > +#include >=20 > +#include >=20 > + >=20 > +#include >=20 > + >=20 > +#pragma pack (1) >=20 > + >=20 > +#define PLATFORM_FIRMWARE_BLOB_DESC "Fv(XXXXXXXX-XXXX-XXXX-XXXX- > XXXXXXXXXXXX)" >=20 > +typedef struct { >=20 > + UINT8 BlobDescriptionSize; >=20 > + UINT8 > BlobDescription[sizeof(PLATFORM_FIRMWARE_BLOB_DESC)]; >=20 > + EFI_PHYSICAL_ADDRESS BlobBase; >=20 > + UINT64 BlobLength; >=20 > +} PLATFORM_FIRMWARE_BLOB2_STRUCT; >=20 > + >=20 > +#define HANDOFF_TABLE_POINTER_DESC "1234567890ABCDEF" >=20 > +typedef struct { >=20 > + UINT8 TableDescriptionSize; >=20 > + UINT8 > TableDescription[sizeof(HANDOFF_TABLE_POINTER_DESC)]; >=20 > + UINT64 NumberOfTables; >=20 > + EFI_CONFIGURATION_TABLE TableEntry[1]; >=20 > +} HANDOFF_TABLE_POINTERS2_STRUCT; >=20 > + >=20 > +#pragma pack () >=20 > + >=20 > +/** >=20 > + Get the FvName from the FV header. >=20 > + >=20 > + Causion: The FV is untrusted input. >=20 > + >=20 > + @param[in] FvBase Base address of FV image. >=20 > + @param[in] FvLength Length of FV image. >=20 > + >=20 > + @return FvName pointer >=20 > + @retval NULL FvName is NOT found >=20 > +**/ >=20 > +VOID * >=20 > +TpmMeasurementGetFvName ( >=20 > + IN EFI_PHYSICAL_ADDRESS FvBase, >=20 > + IN UINT64 FvLength >=20 > + ) >=20 > +{ >=20 > + EFI_FIRMWARE_VOLUME_HEADER *FvHeader; >=20 > + EFI_FIRMWARE_VOLUME_EXT_HEADER *FvExtHeader; >=20 > + >=20 > + if (FvBase >=3D MAX_ADDRESS) { >=20 > + return NULL; >=20 > + } >=20 > + if (FvLength >=3D MAX_ADDRESS - FvBase) { >=20 > + return NULL; >=20 > + } >=20 > + if (FvLength < sizeof(EFI_FIRMWARE_VOLUME_HEADER)) { >=20 > + return NULL; >=20 > + } >=20 > + >=20 > + FvHeader =3D (EFI_FIRMWARE_VOLUME_HEADER *)(UINTN)FvBase; >=20 > + if (FvHeader->Signature !=3D EFI_FVH_SIGNATURE) { >=20 > + return NULL; >=20 > + } >=20 > + if (FvHeader->ExtHeaderOffset < sizeof(EFI_FIRMWARE_VOLUME_HEADER)) { >=20 > + return NULL; >=20 > + } >=20 > + if (FvHeader->ExtHeaderOffset + > sizeof(EFI_FIRMWARE_VOLUME_EXT_HEADER) > FvLength) { >=20 > + return NULL; >=20 > + } >=20 > + FvExtHeader =3D (EFI_FIRMWARE_VOLUME_EXT_HEADER *)(UINTN)(FvBase + > FvHeader->ExtHeaderOffset); >=20 > + >=20 > + return &FvExtHeader->FvName; >=20 > +} >=20 > + >=20 > +/** >=20 > + Mesure a FirmwareBlob. >=20 > + >=20 > + @param[in] PcrIndex PcrIndex of the measurment. >=20 > + @param[in] Descrption Description for this FirmwareBlob. >=20 > + @param[in] FirmwareBlobBase Base address of this FirmwareBlob. >=20 > + @param[in] FirmwareBlobLength Size in bytes of this FirmwareBlob= . >=20 > + >=20 > + @retval EFI_SUCCESS Operation completed successfully. >=20 > + @retval EFI_UNSUPPORTED TPM device not available. >=20 > + @retval EFI_OUT_OF_RESOURCES Out of memory. >=20 > + @retval EFI_DEVICE_ERROR The operation was unsuccessful. >=20 > +*/ >=20 > +EFI_STATUS >=20 > +EFIAPI >=20 > +MeasureFirmwareBlob ( >=20 > + IN UINT32 PcrIndex, >=20 > + IN CHAR8 *Description OPTIONAL, >=20 > + IN EFI_PHYSICAL_ADDRESS FirmwareBlobBase, >=20 > + IN UINT64 FirmwareBlobLength >=20 > + ) >=20 > +{ >=20 > + EFI_PLATFORM_FIRMWARE_BLOB FvBlob; >=20 > + PLATFORM_FIRMWARE_BLOB2_STRUCT FvBlob2; >=20 > + VOID *FvName; >=20 > + UINT32 EventType; >=20 > + VOID *EventLog; >=20 > + UINT32 EventLogSize; >=20 > + EFI_STATUS Status; >=20 > + >=20 > + FvName =3D TpmMeasurementGetFvName (FirmwareBlobBase, > FirmwareBlobLength); >=20 > + >=20 > + if (((Description !=3D NULL) || (FvName !=3D NULL)) && >=20 > + (PcdGet32(PcdTcgPfpMeasurementRevision) >=3D > TCG_EfiSpecIDEventStruct_SPEC_ERRATA_TPM2_REV_105)) { >=20 > + ZeroMem (&FvBlob2, sizeof(FvBlob2)); >=20 > + if (Description !=3D NULL) { >=20 > + AsciiSPrint((CHAR8*)FvBlob2.BlobDescription, > sizeof(FvBlob2.BlobDescription), "%a", Description); >=20 > + } else { >=20 > + AsciiSPrint((CHAR8*)FvBlob2.BlobDescription, > sizeof(FvBlob2.BlobDescription), "Fv(%g)", FvName); >=20 > + } >=20 > + >=20 > + FvBlob2.BlobDescriptionSize =3D sizeof(FvBlob2.BlobDescription); >=20 > + FvBlob2.BlobBase =3D FirmwareBlobBase; >=20 > + FvBlob2.BlobLength =3D FirmwareBlobLength; >=20 > + >=20 > + EventType =3D EV_EFI_PLATFORM_FIRMWARE_BLOB2; >=20 > + EventLog =3D &FvBlob2; >=20 > + EventLogSize =3D sizeof(FvBlob2); >=20 > + } else { >=20 > + FvBlob.BlobBase =3D FirmwareBlobBase; >=20 > + FvBlob.BlobLength =3D FirmwareBlobLength; >=20 > + >=20 > + EventType =3D EV_EFI_PLATFORM_FIRMWARE_BLOB; >=20 > + EventLog =3D &FvBlob; >=20 > + EventLogSize =3D sizeof(FvBlob); >=20 > + } >=20 > + >=20 > + Status =3D TpmMeasureAndLogData ( >=20 > + PcrIndex, >=20 > + EventType, >=20 > + EventLog, >=20 > + EventLogSize, >=20 > + (VOID*)(UINTN)FirmwareBlobBase, >=20 > + FirmwareBlobLength >=20 > + ); >=20 > + >=20 > + return Status; >=20 > +} >=20 > + >=20 > +/** >=20 > + Mesure a HandoffTable. >=20 > + >=20 > + @param[in] PcrIndex PcrIndex of the measurment. >=20 > + @param[in] Descrption Description for this HandoffTable. >=20 > + @param[in] TableGuid GUID of this HandoffTable. >=20 > + @param[in] TableAddress Base address of this HandoffTable. >=20 > + @param[in] TableLength Size in bytes of this HandoffTable= . >=20 > + >=20 > + @retval EFI_SUCCESS Operation completed successfully. >=20 > + @retval EFI_UNSUPPORTED TPM device not available. >=20 > + @retval EFI_OUT_OF_RESOURCES Out of memory. >=20 > + @retval EFI_DEVICE_ERROR The operation was unsuccessful. >=20 > +*/ >=20 > +EFI_STATUS >=20 > +EFIAPI >=20 > +MeasureHandoffTable ( >=20 > + IN UINT32 PcrIndex, >=20 > + IN CHAR8 *Description OPTIONAL, >=20 > + IN EFI_GUID *TableGuid, >=20 > + IN VOID *TableAddress, >=20 > + IN UINTN TableLength >=20 > + ) >=20 > +{ >=20 > + EFI_HANDOFF_TABLE_POINTERS HandoffTables; >=20 > + HANDOFF_TABLE_POINTERS2_STRUCT HandoffTables2; >=20 > + UINT32 EventType; >=20 > + VOID *EventLog; >=20 > + UINT32 EventLogSize; >=20 > + EFI_STATUS Status; >=20 > + >=20 > + if ((Description !=3D NULL) && >=20 > + (PcdGet32(PcdTcgPfpMeasurementRevision) >=3D > TCG_EfiSpecIDEventStruct_SPEC_ERRATA_TPM2_REV_105)) { >=20 > + ZeroMem (&HandoffTables2, sizeof(HandoffTables2)); >=20 > + AsciiSPrint((CHAR8*)HandoffTables2.TableDescription, > sizeof(HandoffTables2.TableDescription), "%a", Description); >=20 > + >=20 > + HandoffTables2.TableDescriptionSize =3D > sizeof(HandoffTables2.TableDescription); >=20 > + HandoffTables2.NumberOfTables =3D 1; >=20 > + CopyGuid (&(HandoffTables2.TableEntry[0].VendorGuid), TableGuid); >=20 > + HandoffTables2.TableEntry[0].VendorTable =3D TableAddress; >=20 > + >=20 > + EventType =3D EV_EFI_HANDOFF_TABLES2; >=20 > + EventLog =3D &HandoffTables2; >=20 > + EventLogSize =3D sizeof(HandoffTables2); >=20 > + } else { >=20 > + HandoffTables.NumberOfTables =3D 1; >=20 > + CopyGuid (&(HandoffTables.TableEntry[0].VendorGuid), TableGuid); >=20 > + HandoffTables.TableEntry[0].VendorTable =3D TableAddress; >=20 > + >=20 > + EventType =3D EV_EFI_HANDOFF_TABLES; >=20 > + EventLog =3D &HandoffTables; >=20 > + EventLogSize =3D sizeof(HandoffTables); >=20 > + } >=20 > + >=20 > + Status =3D TpmMeasureAndLogData ( >=20 > + PcrIndex, >=20 > + EventType, >=20 > + EventLog, >=20 > + EventLogSize, >=20 > + TableAddress, >=20 > + TableLength >=20 > + ); >=20 > + return Status; >=20 > +} >=20 > diff --git > a/SecurityPkg/Library/PeiTpmMeasurementLib/PeiTpmMeasurementLib.inf > b/SecurityPkg/Library/PeiTpmMeasurementLib/PeiTpmMeasurementLib.inf > index 6625d0fd01..489353af2e 100644 > --- a/SecurityPkg/Library/PeiTpmMeasurementLib/PeiTpmMeasurementLib.inf > +++ b/SecurityPkg/Library/PeiTpmMeasurementLib/PeiTpmMeasurementLib.inf > @@ -26,6 +26,7 @@ >=20 >=20 > [Sources] >=20 > PeiTpmMeasurementLib.c >=20 > + EventLogRecord.c >=20 >=20 >=20 > [Packages] >=20 > MdePkg/MdePkg.dec >=20 > @@ -45,6 +46,9 @@ > [Ppis] >=20 > gEdkiiTcgPpiGuid #= # CONSUMES >=20 >=20 >=20 > +[Pcd] >=20 > + gEfiMdeModulePkgTokenSpaceGuid.PcdTcgPfpMeasurementRevision #= # > CONSUMES >=20 > + >=20 > [Depex] >=20 > gEfiPeiMasterBootModePpiGuid AND >=20 > gEfiTpmDeviceSelectedGuid >=20 > -- > 2.26.2.windows.1