Security: Add SecTpmMeasurementLibTdx

SecTpmMeasurementLitTdx is an instance of TpmMeasurementLib. It is
designed to used in a Td guest. This lib measures and logs data, and
extendx the measurement result into a specific RTMR.

SecTpmMeasurementLibTdx is a refactored lib of
OvmfPkg/Library/SecMeasurementLibTdx and it just copies
GetMappedRtmrIndex/TdxMeasureAndLogData from that lib. At the end of
this patch-set SecMeasurementLibTdx will be deleted.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Signed-off-by: Min Xu <min.m.xu@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
This commit is contained in:
Min M Xu
2022-06-05 09:02:46 +08:00
committed by mergify[bot]
parent 4f89e4b3e8
commit 2818fda9bc
3 changed files with 212 additions and 0 deletions

View File

@@ -0,0 +1,34 @@
## @file
# Provides RTMR based measurement functions for Intel Tdx guest.
#
# This library provides TpmMeasureAndLogData() in a TDX guest to measure and log data, and
# extend the measurement result into a specific RTMR.
#
# Copyright (c) 2022, Intel Corporation. All rights reserved.<BR>
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
##
[Defines]
INF_VERSION = 0x00010005
BASE_NAME = SecTpmMeasurementLibTdx
FILE_GUID = 1aeb641c-0324-47bd-b29d-e59671fc4106
MODULE_TYPE = BASE
VERSION_STRING = 1.0
LIBRARY_CLASS = TpmMeasurementLib|SEC
[Sources]
SecTpmMeasurementLibTdx.c
[Packages]
CryptoPkg/CryptoPkg.dec
MdeModulePkg/MdeModulePkg.dec
MdePkg/MdePkg.dec
SecurityPkg/SecurityPkg.dec
[Guids]
gCcEventEntryHobGuid
[LibraryClasses]
BaseLib
HashLib