mirror of
https://github.com/Dasharo/edk2-upstream.git
synced 2026-06-13 19:16:19 -07:00
TcgTpmPkg,.pytool,.azurepipelines: introduce TpmLib
TpmLib is used to implemnataion of fTPM (software based TPM) using
TCG TPM 2.0 Reference Implementation Library[0].
To build this library:
- Add TpmPlatformFunction.c is bridge layer connecting
platform layer of TCG TPM v2.0 Reference library like
__plat_XXX functions to call correspondant functions in PlatformTpmLib.
- Copy tpm_radix.h and override this header.
Since TCG TPM 2.0 reference library V184 defines IS_ALIGNED() macro
in tpm_radix.h but this makes a duplication on Base.h and
causes a build failure.
- Make a symbolic link files for openssl library and standard headres
files which cousumed TCG TPM 2.0 Reference Library[0].
Continuous-integration-options: PatchCheck.ignore-multi-package
Link: https://github.com/TrustedComputingGroup/TPM [0]
Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
This commit is contained in:
@@ -99,6 +99,11 @@ jobs:
|
||||
Build.Pkgs: 'ArmVirtPkg,EmulatorPkg,OvmfPkg'
|
||||
Build.Targets: 'NO-TARGET'
|
||||
Build.Archlist: ${{ parameters.arch_list }}
|
||||
${{ if eq(parameters.tool_chain_tag, 'GCC') }}:
|
||||
TARGET_TCGTPM_AARCH64_GCC_ONLY:
|
||||
Build.Pkgs: 'TcgTpmPkg'
|
||||
Build.Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT'
|
||||
Build.Archlist: 'AARCH64'
|
||||
|
||||
workspace:
|
||||
clean: all
|
||||
|
||||
@@ -90,7 +90,8 @@ class Settings(CiBuildSettingsManager, UpdateSettingsManager, SetupSettingsManag
|
||||
"OvmfPkg",
|
||||
"RedfishPkg",
|
||||
"SourceLevelDebugPkg",
|
||||
"UefiPayloadPkg"
|
||||
"UefiPayloadPkg",
|
||||
"TcgTpmPkg"
|
||||
)
|
||||
|
||||
def GetArchitecturesSupported(self):
|
||||
@@ -209,6 +210,8 @@ class Settings(CiBuildSettingsManager, UpdateSettingsManager, SetupSettingsManag
|
||||
"CryptoPkg/Library/MbedTlsLib/mbedtls", False))
|
||||
rs.append(RequiredSubmodule(
|
||||
"SecurityPkg/DeviceSecurity/SpdmLib/libspdm", False))
|
||||
rs.append(RequiredSubmodule(
|
||||
"TcgTpmPkg/Library/TpmLib/TPM", False))
|
||||
return rs
|
||||
|
||||
def GetName(self):
|
||||
|
||||
@@ -0,0 +1,146 @@
|
||||
/** @file
|
||||
TpmLib to call Tcg TPM reference code.
|
||||
|
||||
Copyright (c) 2025, Arm Limited. All rights reserved.<BR>
|
||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
|
||||
**/
|
||||
|
||||
#pragma once
|
||||
|
||||
/**
|
||||
Execute TPM command.
|
||||
|
||||
This function calls ExecuteCommand() in Tcg TPM reference code.
|
||||
See the detail ExecuteCommand()'s comment.
|
||||
|
||||
@param [in] RequestSize Request Buffer Size
|
||||
@param [in] Request Request Buffer
|
||||
@param [in, out] ResponseSize Response Buffer Size
|
||||
@param [in, out] Response Response Buffer
|
||||
|
||||
@return EFI_SUCCESS Success to exectue requested command
|
||||
But need to check the result of
|
||||
command execution in Response.
|
||||
@return EFI_INVALID_PARAMETER Invalid parameters.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
TpmLibExecuteCommand (
|
||||
IN UINT32 RequestSize,
|
||||
IN UINT8 *Request,
|
||||
IN OUT UINT32 *ResponseSize,
|
||||
IN OUT UINT8 **Response
|
||||
);
|
||||
|
||||
/**
|
||||
Initailize TPM.
|
||||
|
||||
This function calls _TPM_Init() in Tcg TPM reference code.
|
||||
|
||||
**/
|
||||
VOID
|
||||
EFIAPI
|
||||
TpmLibTpmInit (
|
||||
VOID
|
||||
);
|
||||
|
||||
/**
|
||||
This indication from the TPM interface indicates the start of
|
||||
an H-CRTM measurement sequence. On receipt of this indication,
|
||||
the TPM will initialize an H-CRTM Event Sequence context
|
||||
|
||||
This function calls _TPM_Hash_Start() in Tcg TPM reference code.
|
||||
|
||||
**/
|
||||
VOID
|
||||
EFIAPI
|
||||
TpmLibTpmHashStart (
|
||||
VOID
|
||||
);
|
||||
|
||||
/**
|
||||
This indication from the TPM interface indicates arrival of
|
||||
one or more octets of data that are to be included in the H-CRTM
|
||||
Event Sequence sequence context created by the _TPM_Hash_Start indication.
|
||||
The context holds data for each hash algorithm for
|
||||
each PCR bank implemented on the TPM.
|
||||
If no H-CRTM Event Sequence context exists, this indication is discarded
|
||||
and no other action is performed.
|
||||
|
||||
This function calls _TPM_Hash_Data() in Tcg TPM reference code.
|
||||
|
||||
@param [in] DataSize Size of data to be extend
|
||||
@param [in] Data Data Buffer
|
||||
|
||||
**/
|
||||
VOID
|
||||
EFIAPI
|
||||
TpmLibTpmHashData (
|
||||
IN UINT32 DataSize,
|
||||
IN UINT8 *Data
|
||||
);
|
||||
|
||||
/**
|
||||
This indication from the TPM interface indicates
|
||||
the end of the H-CRTM measurement. This indication is discarded and
|
||||
no other action performed if the TPM does not contain
|
||||
an H-CRTM Event Sequence context.
|
||||
|
||||
This function calls _TPM_Hash_End() in Tcg TPM reference code.
|
||||
|
||||
**/
|
||||
VOID
|
||||
EFIAPI
|
||||
TpmLibTpmHashEnd (
|
||||
VOID
|
||||
);
|
||||
|
||||
/**
|
||||
This is called when TPM's NV storage isn't initailized only
|
||||
(PlatformTpmLibNVNeedsManufacture() return FALSE) otherwise,
|
||||
TPM's NV storage is cleared all.
|
||||
|
||||
Before calling this, PlatformTpmLibNVEnable() must be called.
|
||||
|
||||
This function calls TPM_Manufacture() in Tcg TPM reference code.
|
||||
|
||||
@return -2 NV System not available
|
||||
@return -1 FAILURE - System is incorrectly compiled.
|
||||
@return 0 success
|
||||
|
||||
**/
|
||||
INT32
|
||||
EFIAPI
|
||||
TpmLibTpmManufacture (
|
||||
VOID
|
||||
);
|
||||
|
||||
/**
|
||||
Get current locality.
|
||||
|
||||
This function calls _plat__LocalityGet() in Tcg TPM reference code.
|
||||
|
||||
@return Locality Current locality.
|
||||
|
||||
**/
|
||||
UINT8
|
||||
EFIAPI
|
||||
TpmLibGetLocality (
|
||||
VOID
|
||||
);
|
||||
|
||||
/**
|
||||
Set current locality.
|
||||
|
||||
See the detail _plat__LocalitySet()'s comment.
|
||||
|
||||
@param [in] Locality
|
||||
|
||||
**/
|
||||
VOID
|
||||
EFIAPI
|
||||
TpmLibSetLocality (
|
||||
IN UINT8 Locality
|
||||
);
|
||||
@@ -0,0 +1,242 @@
|
||||
/** @file
|
||||
TpmLib to call Tcg TPM reference code to implement core fTPM function.
|
||||
|
||||
Here is a sample infrastructure using TpmLib in AARCH64:
|
||||
|
||||
Normal world | Secure World
|
||||
-----------------------------|------------------------------
|
||||
|
|
||||
+--------------+ | +-----------+ +----------+
|
||||
| Tcg2Dxe | | | FtpmSmm |<---->| TpmLib |
|
||||
+--------------+ | +-----------+ +----------+
|
||||
| | | |
|
||||
| | | +------------------+
|
||||
| | | | PlatformTpmLib |
|
||||
| | | +------------------+
|
||||
| | |
|
||||
| | +------------------+
|
||||
| | | StandaloneMmCpu |
|
||||
| | +------------------+
|
||||
| | |
|
||||
| | |
|
||||
| | |
|
||||
+----------------------+ | +----------------------------+
|
||||
| Tpm2InstanceFfaLib |<---------->| StandaloneMmCoreEntryPoint |
|
||||
+----------------------+ . | (Misc Service) |
|
||||
. +----------------------------+
|
||||
.
|
||||
Communicate via CRB over FF-A [0]
|
||||
|
||||
- TpmLib is fTPM itself so it handles the TPM command.
|
||||
- PlatformTpmLib is used for platform specific functions
|
||||
- required by TpmLib (i.e) Nv storage operation, time operation and etc
|
||||
- FtpmSmm (or like) is a frontEnd driver which recevie TPM request
|
||||
and deliver this request to TpmLib to hanlde the request.
|
||||
|
||||
Copyright (c) 2024, Arm Limited. All rights reserved.<BR>
|
||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
|
||||
**/
|
||||
#include <Uefi/UefiBaseType.h>
|
||||
#include <Library/BaseLib.h>
|
||||
#include <Library/BaseMemoryLib.h>
|
||||
#include <Library/PlatformTpmLib.h>
|
||||
|
||||
#include <TpmConfiguration/TpmBuildSwitches.h>
|
||||
#include <CompilerDependencies.h>
|
||||
#include <ExecCommand_fp.h>
|
||||
#include <Manufacture_fp.h>
|
||||
#include <_TPM_Init_fp.h>
|
||||
#include <platform_interface/tpm_to_platform_interface.h>
|
||||
|
||||
/**
|
||||
Execute TPM command.
|
||||
|
||||
This function calls ExecuteCommand() in Tcg TPM reference code.
|
||||
See the detail ExecuteCommand()'s comment.
|
||||
|
||||
@param [in] RequestSize Request Buffer Size
|
||||
@param [in] Request Request Buffer
|
||||
@param [in, out] ResponseSize Response Buffer Size
|
||||
@param [in, out] Response Response Buffer
|
||||
|
||||
@return EFI_SUCCESS Success to exectue requested command
|
||||
But need to check the result of
|
||||
command execution in Response.
|
||||
@return EFI_INVALID_PARAMETER Invalid parameters.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
TpmLibExecuteCommand (
|
||||
IN UINT32 RequestSize, // IN: command buffer size
|
||||
IN UINT8 *Request, // IN: command buffer
|
||||
IN OUT UINT32 *ResponseSize, // IN/OUT: response buffer size
|
||||
IN OUT UINT8 **Response // IN/OUT: response buffer
|
||||
)
|
||||
{
|
||||
if ((Request == NULL) || (RequestSize == 0) ||
|
||||
(Response == NULL) || (ResponseSize == NULL) ||
|
||||
(*Response == NULL) || (*ResponseSize == 0))
|
||||
{
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
ExecuteCommand (
|
||||
RequestSize,
|
||||
Request,
|
||||
ResponseSize,
|
||||
Response
|
||||
);
|
||||
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
Initailize TPM.
|
||||
|
||||
This function calls _TPM_Init() in Tcg TPM reference code.
|
||||
|
||||
**/
|
||||
VOID
|
||||
EFIAPI
|
||||
TpmLibTpmInit (
|
||||
VOID
|
||||
)
|
||||
{
|
||||
_TPM_Init ();
|
||||
}
|
||||
|
||||
/**
|
||||
This indication from the TPM interface indicates the start of
|
||||
an H-CRTM measurement sequence. On receipt of this indication,
|
||||
the TPM will initialize an H-CRTM Event Sequence context
|
||||
|
||||
This function calls _TPM_Hash_Start() in Tcg TPM reference code.
|
||||
|
||||
**/
|
||||
VOID
|
||||
EFIAPI
|
||||
TpmLibTpmHashStart (
|
||||
VOID
|
||||
)
|
||||
{
|
||||
_TPM_Hash_Start ();
|
||||
}
|
||||
|
||||
/**
|
||||
This indication from the TPM interface indicates arrival of
|
||||
one or more octets of data that are to be included in the H-CRTM
|
||||
Event Sequence sequence context created by the _TPM_Hash_Start indication.
|
||||
The context holds data for each hash algorithm for
|
||||
each PCR bank implemented on the TPM.
|
||||
If no H-CRTM Event Sequence context exists, this indication is discarded
|
||||
and no other action is performed.
|
||||
|
||||
This function calls _TPM_Hash_Data() in Tcg TPM reference code.
|
||||
|
||||
@param [in] DataSize Size of data to be extend
|
||||
@param [in] Data Data Buffer
|
||||
|
||||
**/
|
||||
VOID
|
||||
EFIAPI
|
||||
TpmLibTpmHashData (
|
||||
IN UINT32 DataSize,
|
||||
IN UINT8 *Data
|
||||
)
|
||||
{
|
||||
_TPM_Hash_Data (DataSize, Data);
|
||||
}
|
||||
|
||||
/**
|
||||
This indication from the TPM interface indicates
|
||||
the end of the H-CRTM measurement. This indication is discarded and
|
||||
no other action performed if the TPM does not contain
|
||||
an H-CRTM Event Sequence context.
|
||||
|
||||
This function calls _TPM_Hash_End() in Tcg TPM reference code.
|
||||
|
||||
**/
|
||||
VOID
|
||||
EFIAPI
|
||||
TpmLibTpmHashEnd (
|
||||
VOID
|
||||
)
|
||||
{
|
||||
_TPM_Hash_End ();
|
||||
}
|
||||
|
||||
/**
|
||||
This is called when TPM's NV storage isn't initailized only
|
||||
(PlatformTpmLibNVNeedsManufacture() return FALSE) otherwise,
|
||||
TPM's NV storage is cleared all.
|
||||
|
||||
Before calling this, PlatformTpmLibNVEnable() must be called.
|
||||
|
||||
This function calls TPM_Manufacture() in Tcg TPM reference code.
|
||||
|
||||
@return -2 NV System not available
|
||||
@return -1 FAILURE - System is incorrectly compiled.
|
||||
@return 0 success
|
||||
|
||||
**/
|
||||
INT32
|
||||
EFIAPI
|
||||
TpmLibTpmManufacture (
|
||||
VOID
|
||||
)
|
||||
{
|
||||
return TPM_Manufacture (1);
|
||||
}
|
||||
|
||||
/**
|
||||
Get current locality.
|
||||
|
||||
This function calls _plat__LocalityGet() in Tcg TPM reference code.
|
||||
|
||||
@return Locality Current locality.
|
||||
|
||||
**/
|
||||
UINT8
|
||||
EFIAPI
|
||||
TpmLibGetLocality (
|
||||
VOID
|
||||
)
|
||||
{
|
||||
return _plat__LocalityGet ();
|
||||
}
|
||||
|
||||
/**
|
||||
Set current locality.
|
||||
|
||||
|
||||
This function calls _plat__LocalitySet() in Tcg TPM reference code.
|
||||
|
||||
@param [in] Locality
|
||||
|
||||
**/
|
||||
VOID
|
||||
EFIAPI
|
||||
TpmLibSetLocality (
|
||||
IN UINT8 Locality
|
||||
)
|
||||
{
|
||||
_plat__LocalitySet (Locality);
|
||||
}
|
||||
|
||||
/**
|
||||
Constructor for TpmLib.
|
||||
|
||||
@return EFI_SUCCESS Success
|
||||
@return Others Error
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
TpmLibConstructor (
|
||||
VOID
|
||||
)
|
||||
{
|
||||
return PlatformTpmLibInit ();
|
||||
}
|
||||
@@ -0,0 +1,281 @@
|
||||
## @file
|
||||
# This module for building TPM Reference Library for fTPM.
|
||||
#
|
||||
# Copyright (c) 2025, Arm Limited. All rights reserved.<BR>
|
||||
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
#
|
||||
##
|
||||
|
||||
[Defines]
|
||||
INF_VERSION = 0x00010005
|
||||
BASE_NAME = TpmLib
|
||||
MODULE_UNI_FILE = TpmLib.uni
|
||||
FILE_GUID = fb2db358-1da3-11ef-8859-2f704f58e30f
|
||||
MODULE_TYPE = BASE
|
||||
VERSION_STRING = 1.0
|
||||
LIBRARY_CLASS = TpmLib
|
||||
CONSTRUCTOR = TpmLibConstructor
|
||||
|
||||
DEFINE TPM_LIB_PATH = TPM/TPMCmd/tpm/src
|
||||
DEFINE TPM_CRYPTOLIB_PATH = TPM/TPMCmd/tpm/cryptolibs
|
||||
DEFINE TPM_PLAT_PATH = TPM/TPMCmd/Platform/src
|
||||
DEFINE TPM_CONF_PATH = TPM/TPMCmd/TpmConfiguration
|
||||
DEFINE TPM_LIB_OPTIONS_INCLUDE = -include ./TpmLibCompileOptions.h
|
||||
DEFINE TPM_LIB_WARNING_SUPRESS_GCC = -Wno-unused-function -Wno-implicit-fallthrough -Wno-cast-align -Wno-cast-function-type -Wno-missing-braces -Wno-sign-compare -Wno-suggest-attribute=noreturn -Wno-switch-default -Wno-implicit-function-declaration -Wno-unused-value
|
||||
|
||||
#
|
||||
# VALID_ARCHITECTURES = AARCH64
|
||||
#
|
||||
|
||||
[Sources]
|
||||
Include/TpmConfiguration/TpmBuildSwitches.h
|
||||
Include/TpmConfiguration/TpmProfile_Common.h
|
||||
Include/TpmConfiguration/TpmProfile_Misc.h
|
||||
Ossl/BnToOsslMath.c
|
||||
Ossl/TpmToOsslSupport.c
|
||||
TpmLibCompileOptions.h
|
||||
TpmLib.c
|
||||
TpmPlatformFunctions.c
|
||||
$(TPM_LIB_PATH)/X509/X509_ECC.c
|
||||
$(TPM_LIB_PATH)/X509/X509_RSA.c
|
||||
$(TPM_LIB_PATH)/X509/TpmASN1.c
|
||||
$(TPM_LIB_PATH)/X509/X509_spt.c
|
||||
$(TPM_LIB_PATH)/command/Asymmetric/ECC_Decrypt.c
|
||||
$(TPM_LIB_PATH)/command/Asymmetric/ECC_Encrypt.c
|
||||
$(TPM_LIB_PATH)/command/Asymmetric/ECC_Parameters.c
|
||||
$(TPM_LIB_PATH)/command/Asymmetric/ECDH_KeyGen.c
|
||||
$(TPM_LIB_PATH)/command/Asymmetric/ECDH_ZGen.c
|
||||
$(TPM_LIB_PATH)/command/Asymmetric/EC_Ephemeral.c
|
||||
$(TPM_LIB_PATH)/command/Asymmetric/RSA_Decrypt.c
|
||||
$(TPM_LIB_PATH)/command/Asymmetric/RSA_Encrypt.c
|
||||
$(TPM_LIB_PATH)/command/Asymmetric/ZGen_2Phase.c
|
||||
$(TPM_LIB_PATH)/command/AttachedComponent/AC_GetCapability.c
|
||||
$(TPM_LIB_PATH)/command/AttachedComponent/AC_Send.c
|
||||
$(TPM_LIB_PATH)/command/AttachedComponent/AC_spt.c
|
||||
$(TPM_LIB_PATH)/command/AttachedComponent/Policy_AC_SendSelect.c
|
||||
$(TPM_LIB_PATH)/command/Attestation/Attest_spt.c
|
||||
$(TPM_LIB_PATH)/command/Attestation/Certify.c
|
||||
$(TPM_LIB_PATH)/command/Attestation/CertifyCreation.c
|
||||
$(TPM_LIB_PATH)/command/Attestation/CertifyX509.c
|
||||
$(TPM_LIB_PATH)/command/Attestation/GetCommandAuditDigest.c
|
||||
$(TPM_LIB_PATH)/command/Attestation/GetSessionAuditDigest.c
|
||||
$(TPM_LIB_PATH)/command/Attestation/GetTime.c
|
||||
$(TPM_LIB_PATH)/command/Attestation/Quote.c
|
||||
$(TPM_LIB_PATH)/command/Capability/GetCapability.c
|
||||
$(TPM_LIB_PATH)/command/Capability/SetCapability.c
|
||||
$(TPM_LIB_PATH)/command/Capability/TestParms.c
|
||||
$(TPM_LIB_PATH)/command/ClockTimer/ACT_SetTimeout.c
|
||||
$(TPM_LIB_PATH)/command/ClockTimer/ACT_spt.c
|
||||
$(TPM_LIB_PATH)/command/ClockTimer/ClockRateAdjust.c
|
||||
$(TPM_LIB_PATH)/command/ClockTimer/ClockSet.c
|
||||
$(TPM_LIB_PATH)/command/ClockTimer/ReadClock.c
|
||||
$(TPM_LIB_PATH)/command/CommandAudit/SetCommandCodeAuditStatus.c
|
||||
$(TPM_LIB_PATH)/command/Context/ContextLoad.c
|
||||
$(TPM_LIB_PATH)/command/Context/ContextSave.c
|
||||
$(TPM_LIB_PATH)/command/Context/Context_spt.c
|
||||
$(TPM_LIB_PATH)/command/Context/EvictControl.c
|
||||
$(TPM_LIB_PATH)/command/Context/FlushContext.c
|
||||
$(TPM_LIB_PATH)/command/DA/DictionaryAttackParameters.c
|
||||
$(TPM_LIB_PATH)/command/DA/DictionaryAttackLockReset.c
|
||||
$(TPM_LIB_PATH)/command/Duplication/Duplicate.c
|
||||
$(TPM_LIB_PATH)/command/Duplication/Import.c
|
||||
$(TPM_LIB_PATH)/command/Duplication/Rewrap.c
|
||||
$(TPM_LIB_PATH)/command/EA/PolicyAuthValue.c
|
||||
$(TPM_LIB_PATH)/command/EA/PolicyAuthorize.c
|
||||
$(TPM_LIB_PATH)/command/EA/PolicyAuthorizeNV.c
|
||||
$(TPM_LIB_PATH)/command/EA/PolicyCapability.c
|
||||
$(TPM_LIB_PATH)/command/EA/PolicyCommandCode.c
|
||||
$(TPM_LIB_PATH)/command/EA/PolicyCounterTimer.c
|
||||
$(TPM_LIB_PATH)/command/EA/PolicyCpHash.c
|
||||
$(TPM_LIB_PATH)/command/EA/PolicyDuplicationSelect.c
|
||||
$(TPM_LIB_PATH)/command/EA/PolicyGetDigest.c
|
||||
$(TPM_LIB_PATH)/command/EA/PolicyLocality.c
|
||||
$(TPM_LIB_PATH)/command/EA/PolicyNV.c
|
||||
$(TPM_LIB_PATH)/command/EA/PolicyNameHash.c
|
||||
$(TPM_LIB_PATH)/command/EA/PolicyNvWritten.c
|
||||
$(TPM_LIB_PATH)/command/EA/PolicyOR.c
|
||||
$(TPM_LIB_PATH)/command/EA/PolicyPCR.c
|
||||
$(TPM_LIB_PATH)/command/EA/PolicyParameters.c
|
||||
$(TPM_LIB_PATH)/command/EA/PolicyPassword.c
|
||||
$(TPM_LIB_PATH)/command/EA/PolicyPhysicalPresence.c
|
||||
$(TPM_LIB_PATH)/command/EA/PolicySecret.c
|
||||
$(TPM_LIB_PATH)/command/EA/PolicySigned.c
|
||||
$(TPM_LIB_PATH)/command/EA/PolicyTemplate.c
|
||||
$(TPM_LIB_PATH)/command/EA/PolicyTicket.c
|
||||
$(TPM_LIB_PATH)/command/EA/PolicyTransportSPDM.c
|
||||
$(TPM_LIB_PATH)/command/EA/Policy_spt.c
|
||||
$(TPM_LIB_PATH)/command/Ecdaa/Commit.c
|
||||
$(TPM_LIB_PATH)/command/FieldUpgrade/FieldUpgradeData.c
|
||||
$(TPM_LIB_PATH)/command/FieldUpgrade/FieldUpgradeStart.c
|
||||
$(TPM_LIB_PATH)/command/FieldUpgrade/FirmwareRead.c
|
||||
$(TPM_LIB_PATH)/command/HashHMAC/EventSequenceComplete.c
|
||||
$(TPM_LIB_PATH)/command/HashHMAC/HMAC_Start.c
|
||||
$(TPM_LIB_PATH)/command/HashHMAC/HashSequenceStart.c
|
||||
$(TPM_LIB_PATH)/command/HashHMAC/MAC_Start.c
|
||||
$(TPM_LIB_PATH)/command/HashHMAC/SequenceComplete.c
|
||||
$(TPM_LIB_PATH)/command/HashHMAC/SequenceUpdate.c
|
||||
$(TPM_LIB_PATH)/command/Hierarchy/ChangeEPS.c
|
||||
$(TPM_LIB_PATH)/command/Hierarchy/ChangePPS.c
|
||||
$(TPM_LIB_PATH)/command/Hierarchy/Clear.c
|
||||
$(TPM_LIB_PATH)/command/Hierarchy/HierarchyControl.c
|
||||
$(TPM_LIB_PATH)/command/Hierarchy/CreatePrimary.c
|
||||
$(TPM_LIB_PATH)/command/Hierarchy/HierarchyChangeAuth.c
|
||||
$(TPM_LIB_PATH)/command/Hierarchy/ClearControl.c
|
||||
$(TPM_LIB_PATH)/command/Hierarchy/ReadOnlyControl.c
|
||||
$(TPM_LIB_PATH)/command/Hierarchy/SetPrimaryPolicy.c
|
||||
$(TPM_LIB_PATH)/command/Misc/PP_Commands.c
|
||||
$(TPM_LIB_PATH)/command/Misc/SetAlgorithmSet.c
|
||||
$(TPM_LIB_PATH)/command/NVStorage/NV_Certify.c
|
||||
$(TPM_LIB_PATH)/command/NVStorage/NV_ChangeAuth.c
|
||||
$(TPM_LIB_PATH)/command/NVStorage/NV_DefineSpace.c
|
||||
$(TPM_LIB_PATH)/command/NVStorage/NV_DefineSpace2.c
|
||||
$(TPM_LIB_PATH)/command/NVStorage/NV_Extend.c
|
||||
$(TPM_LIB_PATH)/command/NVStorage/NV_GlobalWriteLock.c
|
||||
$(TPM_LIB_PATH)/command/NVStorage/NV_Increment.c
|
||||
$(TPM_LIB_PATH)/command/NVStorage/NV_Read.c
|
||||
$(TPM_LIB_PATH)/command/NVStorage/NV_ReadLock.c
|
||||
$(TPM_LIB_PATH)/command/NVStorage/NV_ReadPublic.c
|
||||
$(TPM_LIB_PATH)/command/NVStorage/NV_ReadPublic2.c
|
||||
$(TPM_LIB_PATH)/command/NVStorage/NV_SetBits.c
|
||||
$(TPM_LIB_PATH)/command/NVStorage/NV_UndefineSpace.c
|
||||
$(TPM_LIB_PATH)/command/NVStorage/NV_UndefineSpaceSpecial.c
|
||||
$(TPM_LIB_PATH)/command/NVStorage/NV_Write.c
|
||||
$(TPM_LIB_PATH)/command/NVStorage/NV_WriteLock.c
|
||||
$(TPM_LIB_PATH)/command/NVStorage/NV_spt.c
|
||||
$(TPM_LIB_PATH)/command/Object/ActivateCredential.c
|
||||
$(TPM_LIB_PATH)/command/Object/Create.c
|
||||
$(TPM_LIB_PATH)/command/Object/CreateLoaded.c
|
||||
$(TPM_LIB_PATH)/command/Object/Load.c
|
||||
$(TPM_LIB_PATH)/command/Object/LoadExternal.c
|
||||
$(TPM_LIB_PATH)/command/Object/MakeCredential.c
|
||||
$(TPM_LIB_PATH)/command/Object/ObjectChangeAuth.c
|
||||
$(TPM_LIB_PATH)/command/Object/Object_spt.c
|
||||
$(TPM_LIB_PATH)/command/Object/ReadPublic.c
|
||||
$(TPM_LIB_PATH)/command/Object/Unseal.c
|
||||
$(TPM_LIB_PATH)/command/PCR/PCR_Allocate.c
|
||||
$(TPM_LIB_PATH)/command/PCR/PCR_Event.c
|
||||
$(TPM_LIB_PATH)/command/PCR/PCR_Extend.c
|
||||
$(TPM_LIB_PATH)/command/PCR/PCR_Read.c
|
||||
$(TPM_LIB_PATH)/command/PCR/PCR_Reset.c
|
||||
$(TPM_LIB_PATH)/command/PCR/PCR_SetAuthValue.c
|
||||
$(TPM_LIB_PATH)/command/PCR/PCR_SetAuthPolicy.c
|
||||
$(TPM_LIB_PATH)/command/Random/GetRandom.c
|
||||
$(TPM_LIB_PATH)/command/Random/StirRandom.c
|
||||
$(TPM_LIB_PATH)/command/Session/PolicyRestart.c
|
||||
$(TPM_LIB_PATH)/command/Session/StartAuthSession.c
|
||||
$(TPM_LIB_PATH)/command/Signature/Sign.c
|
||||
$(TPM_LIB_PATH)/command/Signature/VerifySignature.c
|
||||
$(TPM_LIB_PATH)/command/Startup/Shutdown.c
|
||||
$(TPM_LIB_PATH)/command/Startup/Startup.c
|
||||
$(TPM_LIB_PATH)/command/Symmetric/EncryptDecrypt.c
|
||||
$(TPM_LIB_PATH)/command/Symmetric/EncryptDecrypt2.c
|
||||
$(TPM_LIB_PATH)/command/Symmetric/EncryptDecrypt_spt.c
|
||||
$(TPM_LIB_PATH)/command/Symmetric/HMAC.c
|
||||
$(TPM_LIB_PATH)/command/Symmetric/Hash.c
|
||||
$(TPM_LIB_PATH)/command/Symmetric/MAC.c
|
||||
$(TPM_LIB_PATH)/command/Testing/GetTestResult.c
|
||||
$(TPM_LIB_PATH)/command/Testing/IncrementalSelfTest.c
|
||||
$(TPM_LIB_PATH)/command/Testing/SelfTest.c
|
||||
$(TPM_LIB_PATH)/crypt/AlgorithmTests.c
|
||||
$(TPM_LIB_PATH)/crypt/CryptCmac.c
|
||||
$(TPM_LIB_PATH)/crypt/CryptEccCrypt.c
|
||||
$(TPM_LIB_PATH)/crypt/CryptEccData.c
|
||||
$(TPM_LIB_PATH)/crypt/CryptEccKeyExchange.c
|
||||
$(TPM_LIB_PATH)/crypt/CryptEccMain.c
|
||||
$(TPM_LIB_PATH)/crypt/CryptEccSignature.c
|
||||
$(TPM_LIB_PATH)/crypt/CryptHash.c
|
||||
$(TPM_LIB_PATH)/crypt/CryptPrime.c
|
||||
$(TPM_LIB_PATH)/crypt/CryptPrimeSieve.c
|
||||
$(TPM_LIB_PATH)/crypt/CryptRand.c
|
||||
$(TPM_LIB_PATH)/crypt/CryptRsa.c
|
||||
$(TPM_LIB_PATH)/crypt/CryptSelfTest.c
|
||||
$(TPM_LIB_PATH)/crypt/CryptSmac.c
|
||||
$(TPM_LIB_PATH)/crypt/CryptSym.c
|
||||
$(TPM_LIB_PATH)/crypt/CryptUtil.c
|
||||
$(TPM_LIB_PATH)/crypt/RsaKeyCache.c
|
||||
$(TPM_LIB_PATH)/crypt/PrimeData.c
|
||||
$(TPM_LIB_PATH)/crypt/Ticket.c
|
||||
$(TPM_LIB_PATH)/crypt/ecc/TpmEcc_Signature_ECDAA.c
|
||||
$(TPM_LIB_PATH)/crypt/ecc/TpmEcc_Signature_ECDSA.c
|
||||
$(TPM_LIB_PATH)/crypt/ecc/TpmEcc_Signature_SM2.c
|
||||
$(TPM_LIB_PATH)/crypt/ecc/TpmEcc_Signature_Schnorr.c
|
||||
$(TPM_LIB_PATH)/crypt/ecc/TpmEcc_Signature_Util.c
|
||||
$(TPM_LIB_PATH)/crypt/ecc/TpmEcc_Util.c
|
||||
$(TPM_LIB_PATH)/crypt/math/TpmMath_Debug.c
|
||||
$(TPM_LIB_PATH)/crypt/math/TpmMath_Util.c
|
||||
$(TPM_LIB_PATH)/events/_TPM_Hash_Data.c
|
||||
$(TPM_LIB_PATH)/events/_TPM_Hash_End.c
|
||||
$(TPM_LIB_PATH)/events/_TPM_Hash_Start.c
|
||||
$(TPM_LIB_PATH)/events/_TPM_Init.c
|
||||
$(TPM_LIB_PATH)/main/CommandDispatcher.c
|
||||
$(TPM_LIB_PATH)/main/ExecCommand.c
|
||||
$(TPM_LIB_PATH)/main/SessionProcess.c
|
||||
$(TPM_LIB_PATH)/subsystem/CommandAudit.c
|
||||
$(TPM_LIB_PATH)/subsystem/DA.c
|
||||
$(TPM_LIB_PATH)/subsystem/Hierarchy.c
|
||||
$(TPM_LIB_PATH)/subsystem/NvDynamic.c
|
||||
$(TPM_LIB_PATH)/subsystem/NvReserved.c
|
||||
$(TPM_LIB_PATH)/subsystem/Object.c
|
||||
$(TPM_LIB_PATH)/subsystem/PCR.c
|
||||
$(TPM_LIB_PATH)/subsystem/PP.c
|
||||
$(TPM_LIB_PATH)/subsystem/Session.c
|
||||
$(TPM_LIB_PATH)/subsystem/Time.c
|
||||
$(TPM_LIB_PATH)/support/AlgorithmCap.c
|
||||
$(TPM_LIB_PATH)/support/Bits.c
|
||||
$(TPM_LIB_PATH)/support/CommandCodeAttributes.c
|
||||
$(TPM_LIB_PATH)/support/Entity.c
|
||||
$(TPM_LIB_PATH)/support/Global.c
|
||||
$(TPM_LIB_PATH)/support/Handle.c
|
||||
$(TPM_LIB_PATH)/support/IoBuffers.c
|
||||
$(TPM_LIB_PATH)/support/Locality.c
|
||||
$(TPM_LIB_PATH)/support/Manufacture.c
|
||||
$(TPM_LIB_PATH)/support/Marshal.c
|
||||
$(TPM_LIB_PATH)/support/MathOnByteBuffers.c
|
||||
$(TPM_LIB_PATH)/support/Memory.c
|
||||
$(TPM_LIB_PATH)/support/Power.c
|
||||
$(TPM_LIB_PATH)/support/PropertyCap.c
|
||||
$(TPM_LIB_PATH)/support/Response.c
|
||||
$(TPM_LIB_PATH)/support/ResponseCodeProcessing.c
|
||||
$(TPM_LIB_PATH)/support/SecChannel.c
|
||||
$(TPM_LIB_PATH)/support/TableDrivenMarshal.c
|
||||
$(TPM_LIB_PATH)/support/TableMarshalData.c
|
||||
$(TPM_LIB_PATH)/support/TpmFail.c
|
||||
$(TPM_LIB_PATH)/support/TpmSizeChecks.c
|
||||
|
||||
$(TPM_CONF_PATH)/TpmVendorCommandHandlers/Vendor_TCG_Test.c
|
||||
|
||||
$(TPM_CRYPTOLIB_PATH)/TpmBigNum/BnConvert.c
|
||||
$(TPM_CRYPTOLIB_PATH)/TpmBigNum/BnEccConstants.c
|
||||
$(TPM_CRYPTOLIB_PATH)/TpmBigNum/BnMath.c
|
||||
$(TPM_CRYPTOLIB_PATH)/TpmBigNum/BnMemory.c
|
||||
$(TPM_CRYPTOLIB_PATH)/TpmBigNum/BnUtil.c
|
||||
$(TPM_CRYPTOLIB_PATH)/TpmBigNum/TpmBigNumThunks.c
|
||||
|
||||
# using some plat functions as they are.
|
||||
$(TPM_PLAT_PATH)/Cancel.c
|
||||
$(TPM_PLAT_PATH)/Init.c
|
||||
$(TPM_PLAT_PATH)/LocalityPlat.c
|
||||
$(TPM_PLAT_PATH)/NVVirtual.c
|
||||
$(TPM_PLAT_PATH)/PPPlat.c
|
||||
$(TPM_PLAT_PATH)/PlatformACT.c
|
||||
$(TPM_PLAT_PATH)/PlatformData.c
|
||||
$(TPM_PLAT_PATH)/PlatformPcr.c
|
||||
$(TPM_PLAT_PATH)/PowerPlat.c
|
||||
$(TPM_PLAT_PATH)/SelfTest.c
|
||||
|
||||
[Packages]
|
||||
CryptoPkg/CryptoPkg.dec
|
||||
MdePkg/MdePkg.dec
|
||||
TcgTpmPkg/TcgTpmPkg.dec
|
||||
|
||||
[LibraryClasses]
|
||||
BaseLib
|
||||
BaseCryptLib
|
||||
DebugLib
|
||||
RngLib
|
||||
OpensslLib
|
||||
PlatformTpmLib
|
||||
|
||||
[BuildOptions]
|
||||
GCC:*_*_*_CC_FLAGS = -DGCC
|
||||
GCC:*_*_*_CC_FLAGS = $(TPM_LIB_OPTIONS_INCLUDE) $(TPM_LIB_WARNING_SUPRESS_GCC)
|
||||
File diff suppressed because it is too large
Load Diff
@@ -11,7 +11,16 @@
|
||||
"LicenseCheck": {
|
||||
"IgnoreFiles": [
|
||||
# These files and directories are copied from TCG TPM v2.0 reference libraries
|
||||
"Library/TpmLib/Include/TpmConfiguration/TpmBuildSwitches.h"
|
||||
"Library/TpmLib/Include/TpmConfiguration/TpmBuildSwitches.h",
|
||||
"Library/TpmLib/Include/TpmConfiguration/TpmProfile_Common.h",
|
||||
"Library/TpmLib/Include/TpmConfiguration/TpmProfile_Misc.h",
|
||||
"Library/TpmLib/Include/Ossl/BnToOsslMath.h",
|
||||
"Library/TpmLib/Include/Ossl/TpmToOsslHash.h",
|
||||
"Library/TpmLib/Include/Ossl/TpmToOsslSym.h",
|
||||
"Library/TpmLib/Ossl/BnToOsslMath.c",
|
||||
"Library/TpmLib/Ossl/TpmToOsslSupport.c",
|
||||
"Library/TpmLib/TPM",
|
||||
"Private/Include"
|
||||
]
|
||||
},
|
||||
"EccCheck": {
|
||||
@@ -25,7 +34,17 @@
|
||||
"IgnoreFiles": [
|
||||
# These files and directories are related for TCG TPM v2.0 reference libraries
|
||||
"Library/TpmLib/Include/TpmConfiguration/TpmBuildSwitches.h",
|
||||
"Library/TpmLib/TpmLibCompileOptions.h"
|
||||
"Library/TpmLib/Include/TpmConfiguration/TpmProfile_Common.h",
|
||||
"Library/TpmLib/Include/TpmConfiguration/TpmProfile_Misc.h",
|
||||
"Library/TpmLib/Include/Ossl/BnToOsslMath.h",
|
||||
"Library/TpmLib/Include/Ossl/TpmToOsslHash.h",
|
||||
"Library/TpmLib/Include/Ossl/TpmToOsslSym.h",
|
||||
"Library/TpmLib/Ossl/BnToOsslMath.c",
|
||||
"Library/TpmLib/Ossl/TpmToOsslSupport.c",
|
||||
"Library/TpmLib/TpmLibCompileOptions.h",
|
||||
"Library/TpmLib/TpmPlatformFunctions.c",
|
||||
"Library/TpmLib/TPM",
|
||||
"Private/Include"
|
||||
]
|
||||
},
|
||||
"CompilerPlugin": {
|
||||
@@ -39,9 +58,10 @@
|
||||
},
|
||||
"DependencyCheck": {
|
||||
"AcceptableDependencies": [
|
||||
"CryptoPkg/CryptoPkg.dec",
|
||||
"MdePkg/MdePkg.dec",
|
||||
"MdeModulePkg/MdeModulePkg.dec",
|
||||
"CryptoPkg/CryptoPkg.dec",
|
||||
"TcgTpmPkg/TcgTpmPkg.dec"
|
||||
],
|
||||
# For host based unit tests
|
||||
"AcceptableDependencies-HOST_APPLICATION":[],
|
||||
@@ -74,7 +94,46 @@
|
||||
# options defined in .pytool/Plugin/UncrustifyCheck
|
||||
"UncrustifyCheck": {
|
||||
"IgnoreFiles": [
|
||||
"Library/TpmLib/Include/TpmConfiguration/TpmBuildSwitches.h"
|
||||
# These files and directories are related for TCG TPM v2.0 reference libraries
|
||||
"Library/TpmLib/Include/TpmConfiguration/TpmBuildSwitches.h",
|
||||
"Library/TpmLib/Include/TpmConfiguration/TpmProfile_Common.h",
|
||||
"Library/TpmLib/Include/TpmConfiguration/TpmProfile_Misc.h",
|
||||
"Library/TpmLib/Include/Ossl/BnToOsslMath.h",
|
||||
"Library/TpmLib/Include/Ossl/TpmToOsslHash.h",
|
||||
"Library/TpmLib/Include/Ossl/TpmToOsslSym.h",
|
||||
"Library/TpmLib/Ossl/BnToOsslMath.c",
|
||||
"Library/TpmLib/Ossl/TpmToOsslSupport.c",
|
||||
"Library/TpmLib/TpmLibCompileOptions.h",
|
||||
"Library/TpmLib/TpmPlatformFunctions.c",
|
||||
"Private/Include/Standard/CrtLibSupport.h",
|
||||
"Private/Include/Standard/arpa/inet.h",
|
||||
"Private/Include/Standard/arpa/nameser.h",
|
||||
"Private/Include/Standard/assert.h",
|
||||
"Private/Include/Standard/ctype.h",
|
||||
"Private/Include/Standard/errno.h",
|
||||
"Private/Include/Standard/fcntl.h",
|
||||
"Private/Include/Standard/inttypes.h",
|
||||
"Private/Include/Standard/limits.h",
|
||||
"Private/Include/Standard/memory.h",
|
||||
"Private/Include/Standard/netinet/in.h",
|
||||
"Private/Include/Standard/stdarg.h",
|
||||
"Private/Include/Standard/stddef.h",
|
||||
"Private/Include/Standard/stdint.h",
|
||||
"Private/Include/Standard/stdio.h",
|
||||
"Private/Include/Standard/stdlib.h",
|
||||
"Private/Include/Standard/string.h",
|
||||
"Private/Include/Standard/strings.h",
|
||||
"Private/Include/Standard/stubs-32.h",
|
||||
"Private/Include/Standard/sys/param.h",
|
||||
"Private/Include/Standard/sys/shm.h",
|
||||
"Private/Include/Standard/sys/socket.h",
|
||||
"Private/Include/Standard/sys/syscall.h",
|
||||
"Private/Include/Standard/sys/time.h",
|
||||
"Private/Include/Standard/sys/types.h",
|
||||
"Private/Include/Standard/sys/utsname.h",
|
||||
"Private/Include/Standard/syslog.h",
|
||||
"Private/Include/Standard/time.h",
|
||||
"Private/Include/Standard/unistd.h"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,8 +22,25 @@
|
||||
Include
|
||||
|
||||
[Includes.Common.Private]
|
||||
Private/Include/Standard
|
||||
Library/TpmLib/Include
|
||||
Library/TpmLib/TPM/TPMCmd/tpm/include
|
||||
Library/TpmLib/TPM/TPMCmd/tpm/include/tpm_public
|
||||
Library/TpmLib/TPM/TPMCmd/tpm/include/tpm_public/prototypes
|
||||
Library/TpmLib/TPM/TPMCmd/tpm/include/private
|
||||
Library/TpmLib/TPM/TPMCmd/tpm/include/private/prototypes
|
||||
Library/TpmLib/TPM/TPMCmd/tpm/include/platform_interface/prototypes
|
||||
Library/TpmLib/TPM/TPMCmd/tpm/cryptolibs/Ossl/include
|
||||
Library/TpmLib/TPM/TPMCmd/tpm/cryptolibs/common/include
|
||||
Library/TpmLib/TPM/TPMCmd/tpm/cryptolibs/TpmBigNum/include
|
||||
Library/TpmLib/TPM/TPMCmd/Platform/include
|
||||
Library/TpmLib/TPM/TPMCmd/TpmConfiguration
|
||||
|
||||
[LibraryClasses]
|
||||
## @libraryclass Provides some API for implement software Based vTPM.
|
||||
#
|
||||
TpmLib|Include/Library/TpmLib.h
|
||||
|
||||
## @libraryclass Provides platform specific APIs used by TpmLib.
|
||||
#
|
||||
PlatformTpmLib|Include/Library/PlatformTpmLib.h
|
||||
|
||||
@@ -84,6 +84,7 @@
|
||||
#
|
||||
# Build verification of all library instances
|
||||
#
|
||||
TcgTpmPkg/Library/TpmLib/TpmLib.inf
|
||||
TcgTpmPkg/Library/PlatformTpmNullLib/PlatformTpmNullLib.inf
|
||||
|
||||
[BuildOptions]
|
||||
|
||||
Reference in New Issue
Block a user