From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga06.intel.com (mga06.intel.com []) by mx.groups.io with SMTP id smtpd.web10.14640.1596185686866351555 for ; Fri, 31 Jul 2020 01:54:50 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=fail (domain: intel.com, ip: , mailfrom: qi1.zhang@intel.com) IronPort-SDR: xgcIpnI/wEdW/teowhKrg/KsF2zIlLy2cQpQsvzQg9IAyxUrqpmmsjNRwTrXzQ0FrPyt0Ynyha LXsJP9Sr6/KQ== X-IronPort-AV: E=McAfee;i="6000,8403,9698"; a="213281369" X-IronPort-AV: E=Sophos;i="5.75,417,1589266800"; d="scan'208";a="213281369" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Jul 2020 01:54:50 -0700 IronPort-SDR: i6yJxB7PoPvSZ2Yo8KMbaTd/d+8cnKTZQKcYtJ5BTjOZ4RVAsesjnFcyUM43Z0hPga9Z/cwaQs 1tQHr5yDuLpA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,417,1589266800"; d="scan'208";a="490953543" Received: from shwdesssddpdqi.ccr.corp.intel.com ([10.239.9.10]) by fmsmga006.fm.intel.com with ESMTP; 31 Jul 2020 01:54:48 -0700 From: "Qi Zhang" To: devel@edk2.groups.io Cc: Jiewen Yao , Jian J Wang , Hao A Wu , Qi Zhang Subject: [PATCH 2/9] MdeModulePkg/NullTpmMeasurementLib: Add new API. Date: Fri, 31 Jul 2020 16:54:30 +0800 Message-Id: <20200731085437.16070-3-qi1.zhang@intel.com> X-Mailer: git-send-email 2.26.2.windows.1 In-Reply-To: <20200731085437.16070-1-qi1.zhang@intel.com> References: <20200731085437.16070-1-qi1.zhang@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Jiewen Yao REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2376 Cc: Jiewen Yao Cc: Jian J Wang Cc: Hao A Wu Cc: Qi Zhang Signed-off-by: Jiewen Yao --- .../TpmMeasurementLibNull.c | 61 ++++++++++++++++++- .../TpmMeasurementLibNull.inf | 6 +- 2 files changed, 63 insertions(+), 4 deletions(-) diff --git a/MdeModulePkg/Library/TpmMeasurementLibNull/TpmMeasurementLibNu= ll.c b/MdeModulePkg/Library/TpmMeasurementLibNull/TpmMeasurementLibNull.c index b9c5b68de8..2ce38d8258 100644 --- a/MdeModulePkg/Library/TpmMeasurementLibNull/TpmMeasurementLibNull.c +++ b/MdeModulePkg/Library/TpmMeasurementLibNull/TpmMeasurementLibNull.c @@ -1,11 +1,13 @@ /** @file=0D This library is used by other modules to measure data to TPM.=0D =0D -Copyright (c) 2015, Intel Corporation. All rights reserved.
=0D +Copyright (c) 2015 - 2020, Intel Corporation. All rights reserved.
=0D SPDX-License-Identifier: BSD-2-Clause-Patent=0D =0D **/=0D =0D +#include =0D +=0D /**=0D Tpm measure and log data, and extend the measurement result into a speci= fic PCR.=0D =0D @@ -37,3 +39,60 @@ TpmMeasureAndLogData ( //=0D return EFI_SUCCESS;=0D }=0D +=0D +/**=0D + Mesure a FirmwareBlob.=0D +=0D + @param[in] Descrption Description for this FirmwareBlob.=0D + @param[in] FirmwareBlobBase Base address of this FirmwareBlob.=0D + @param[in] FirmwareBlobLength Size in bytes of this FirmwareBlob.= =0D +=0D + @retval EFI_SUCCESS Operation completed successfully.=0D + @retval EFI_UNSUPPORTED TPM device not available.=0D + @retval EFI_OUT_OF_RESOURCES Out of memory.=0D + @retval EFI_DEVICE_ERROR The operation was unsuccessful.=0D +*/=0D +EFI_STATUS=0D +EFIAPI=0D +MeasureFirmwareBlob (=0D + IN UINT32 PcrIndex,=0D + IN CHAR8 *Description OPTIONAL,=0D + IN EFI_PHYSICAL_ADDRESS FirmwareBlobBase,=0D + IN UINT64 FirmwareBlobLength=0D + )=0D +{=0D + //=0D + // Do nothing, just return EFI_SUCCESS.=0D + //=0D + return EFI_SUCCESS;=0D +}=0D +=0D +/**=0D + Mesure a HandoffTable.=0D +=0D + @param[in] PcrIndex PcrIndex of the measurment.=0D + @param[in] Descrption Description for this HandoffTable.=0D + @param[in] TableGuid GUID of this HandoffTable.=0D + @param[in] TableAddress Base address of this HandoffTable.=0D + @param[in] TableLength Size in bytes of this HandoffTable.= =0D +=0D + @retval EFI_SUCCESS Operation completed successfully.=0D + @retval EFI_UNSUPPORTED TPM device not available.=0D + @retval EFI_OUT_OF_RESOURCES Out of memory.=0D + @retval EFI_DEVICE_ERROR The operation was unsuccessful.=0D +*/=0D +EFI_STATUS=0D +EFIAPI=0D +MeasureHandoffTable (=0D + IN UINT32 PcrIndex,=0D + IN CHAR8 *Description OPTIONAL,=0D + IN EFI_GUID *TableGuid,=0D + IN VOID *TableAddress,=0D + IN UINTN TableLength=0D + )=0D +{=0D + //=0D + // Do nothing, just return EFI_SUCCESS.=0D + //=0D + return EFI_SUCCESS;=0D +}=0D diff --git a/MdeModulePkg/Library/TpmMeasurementLibNull/TpmMeasurementLibNu= ll.inf b/MdeModulePkg/Library/TpmMeasurementLibNull/TpmMeasurementLibNull.i= nf index 61abcfa2ec..1db2c0d6a7 100644 --- a/MdeModulePkg/Library/TpmMeasurementLibNull/TpmMeasurementLibNull.inf +++ b/MdeModulePkg/Library/TpmMeasurementLibNull/TpmMeasurementLibNull.inf @@ -1,7 +1,7 @@ ## @file=0D # Provides NULL TPM measurement function.=0D #=0D -# Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.
=0D +# Copyright (c) 2015 - 2020, Intel Corporation. All rights reserved.
=0D # SPDX-License-Identifier: BSD-2-Clause-Patent=0D #=0D ##=0D @@ -10,9 +10,9 @@ INF_VERSION =3D 0x00010005=0D BASE_NAME =3D TpmMeasurementLibNull=0D FILE_GUID =3D 6DFD6E9F-9278-48D8-8F45-B6CFF2C2B69C= =0D - MODULE_TYPE =3D UEFI_DRIVER=0D + MODULE_TYPE =3D BASE=0D VERSION_STRING =3D 1.0=0D - LIBRARY_CLASS =3D TpmMeasurementLib|DXE_DRIVER DXE_RUNT= IME_DRIVER DXE_SMM_DRIVER UEFI_APPLICATION UEFI_DRIVER=0D + LIBRARY_CLASS =3D TpmMeasurementLib=0D MODULE_UNI_FILE =3D TpmMeasurementLibNull.uni=0D =0D #=0D --=20 2.26.2.windows.1