SecurityPkg: Clean up source files
1. Do not use tab characters 2. No trailing white space in one line 3. All files must end with CRLF Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com>
This commit is contained in:
@@ -48,25 +48,25 @@ typedef struct {
|
||||
/**
|
||||
This command returns various information regarding the TPM and its current state.
|
||||
|
||||
The capability parameter determines the category of data returned. The property parameter
|
||||
selects the first value of the selected category to be returned. If there is no property
|
||||
The capability parameter determines the category of data returned. The property parameter
|
||||
selects the first value of the selected category to be returned. If there is no property
|
||||
that corresponds to the value of property, the next higher value is returned, if it exists.
|
||||
The moreData parameter will have a value of YES if there are more values of the requested
|
||||
The moreData parameter will have a value of YES if there are more values of the requested
|
||||
type that were not returned.
|
||||
If no next capability exists, the TPM will return a zero-length list and moreData will have
|
||||
If no next capability exists, the TPM will return a zero-length list and moreData will have
|
||||
a value of NO.
|
||||
|
||||
NOTE:
|
||||
To simplify this function, leave returned CapabilityData for caller to unpack since there are
|
||||
NOTE:
|
||||
To simplify this function, leave returned CapabilityData for caller to unpack since there are
|
||||
many capability categories and only few categories will be used in firmware. It means the caller
|
||||
need swap the byte order for the feilds in CapabilityData.
|
||||
|
||||
@param[in] Capability Group selection; determines the format of the response.
|
||||
@param[in] Property Further definition of information.
|
||||
@param[in] Property Further definition of information.
|
||||
@param[in] PropertyCount Number of properties of the indicated type to return.
|
||||
@param[out] MoreData Flag to indicate if there are more values of this type.
|
||||
@param[out] CapabilityData The capability data.
|
||||
|
||||
|
||||
@retval EFI_SUCCESS Operation completed successfully.
|
||||
@retval EFI_DEVICE_ERROR The command was unsuccessful.
|
||||
**/
|
||||
@@ -95,10 +95,10 @@ Tpm2GetCapability (
|
||||
SendBuffer.Capability = SwapBytes32 (Capability);
|
||||
SendBuffer.Property = SwapBytes32 (Property);
|
||||
SendBuffer.PropertyCount = SwapBytes32 (PropertyCount);
|
||||
|
||||
|
||||
SendBufferSize = (UINT32) sizeof (SendBuffer);
|
||||
SendBuffer.Header.paramSize = SwapBytes32 (SendBufferSize);
|
||||
|
||||
|
||||
//
|
||||
// send Tpm command
|
||||
//
|
||||
@@ -128,7 +128,7 @@ Tpm2GetCapability (
|
||||
// Does not unpack all possiable property here, the caller should unpack it and note the byte order.
|
||||
//
|
||||
CopyMem (CapabilityData, &RecvBuffer.CapabilityData, RecvBufferSize - sizeof (TPM2_RESPONSE_HEADER) - sizeof (UINT8));
|
||||
|
||||
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -138,7 +138,7 @@ Tpm2GetCapability (
|
||||
This function parse the value got from TPM2_GetCapability and return the Family.
|
||||
|
||||
@param[out] Family The Family of TPM. (a 4-octet character string)
|
||||
|
||||
|
||||
@retval EFI_SUCCESS Operation completed successfully.
|
||||
@retval EFI_DEVICE_ERROR The command was unsuccessful.
|
||||
**/
|
||||
@@ -150,13 +150,13 @@ Tpm2GetCapabilityFamily (
|
||||
{
|
||||
TPMS_CAPABILITY_DATA TpmCap;
|
||||
TPMI_YES_NO MoreData;
|
||||
EFI_STATUS Status;
|
||||
EFI_STATUS Status;
|
||||
|
||||
Status = Tpm2GetCapability (
|
||||
TPM_CAP_TPM_PROPERTIES,
|
||||
TPM_PT_FAMILY_INDICATOR,
|
||||
1,
|
||||
&MoreData,
|
||||
TPM_CAP_TPM_PROPERTIES,
|
||||
TPM_PT_FAMILY_INDICATOR,
|
||||
1,
|
||||
&MoreData,
|
||||
&TpmCap
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
@@ -173,7 +173,7 @@ Tpm2GetCapabilityFamily (
|
||||
This function parse the value got from TPM2_GetCapability and return the TPM manufacture ID.
|
||||
|
||||
@param[out] ManufactureId The manufacture ID of TPM.
|
||||
|
||||
|
||||
@retval EFI_SUCCESS Operation completed successfully.
|
||||
@retval EFI_DEVICE_ERROR The command was unsuccessful.
|
||||
**/
|
||||
@@ -185,13 +185,13 @@ Tpm2GetCapabilityManufactureID (
|
||||
{
|
||||
TPMS_CAPABILITY_DATA TpmCap;
|
||||
TPMI_YES_NO MoreData;
|
||||
EFI_STATUS Status;
|
||||
EFI_STATUS Status;
|
||||
|
||||
Status = Tpm2GetCapability (
|
||||
TPM_CAP_TPM_PROPERTIES,
|
||||
TPM_PT_MANUFACTURER,
|
||||
1,
|
||||
&MoreData,
|
||||
TPM_CAP_TPM_PROPERTIES,
|
||||
TPM_PT_MANUFACTURER,
|
||||
1,
|
||||
&MoreData,
|
||||
&TpmCap
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
@@ -209,7 +209,7 @@ Tpm2GetCapabilityManufactureID (
|
||||
|
||||
@param[out] FirmwareVersion1 The FirmwareVersion1.
|
||||
@param[out] FirmwareVersion2 The FirmwareVersion2.
|
||||
|
||||
|
||||
@retval EFI_SUCCESS Operation completed successfully.
|
||||
@retval EFI_DEVICE_ERROR The command was unsuccessful.
|
||||
**/
|
||||
@@ -222,13 +222,13 @@ Tpm2GetCapabilityFirmwareVersion (
|
||||
{
|
||||
TPMS_CAPABILITY_DATA TpmCap;
|
||||
TPMI_YES_NO MoreData;
|
||||
EFI_STATUS Status;
|
||||
EFI_STATUS Status;
|
||||
|
||||
Status = Tpm2GetCapability (
|
||||
TPM_CAP_TPM_PROPERTIES,
|
||||
TPM_PT_FIRMWARE_VERSION_1,
|
||||
1,
|
||||
&MoreData,
|
||||
TPM_CAP_TPM_PROPERTIES,
|
||||
TPM_PT_FIRMWARE_VERSION_1,
|
||||
1,
|
||||
&MoreData,
|
||||
&TpmCap
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
@@ -237,10 +237,10 @@ Tpm2GetCapabilityFirmwareVersion (
|
||||
*FirmwareVersion1 = SwapBytes32 (TpmCap.data.tpmProperties.tpmProperty->value);
|
||||
|
||||
Status = Tpm2GetCapability (
|
||||
TPM_CAP_TPM_PROPERTIES,
|
||||
TPM_PT_FIRMWARE_VERSION_2,
|
||||
1,
|
||||
&MoreData,
|
||||
TPM_CAP_TPM_PROPERTIES,
|
||||
TPM_PT_FIRMWARE_VERSION_2,
|
||||
1,
|
||||
&MoreData,
|
||||
&TpmCap
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
@@ -258,7 +258,7 @@ Tpm2GetCapabilityFirmwareVersion (
|
||||
|
||||
@param[out] MaxCommandSize The maximum value for commandSize in a command.
|
||||
@param[out] MaxResponseSize The maximum value for responseSize in a command.
|
||||
|
||||
|
||||
@retval EFI_SUCCESS Operation completed successfully.
|
||||
@retval EFI_DEVICE_ERROR The command was unsuccessful.
|
||||
**/
|
||||
@@ -274,10 +274,10 @@ Tpm2GetCapabilityMaxCommandResponseSize (
|
||||
EFI_STATUS Status;
|
||||
|
||||
Status = Tpm2GetCapability (
|
||||
TPM_CAP_TPM_PROPERTIES,
|
||||
TPM_PT_MAX_COMMAND_SIZE,
|
||||
1,
|
||||
&MoreData,
|
||||
TPM_CAP_TPM_PROPERTIES,
|
||||
TPM_PT_MAX_COMMAND_SIZE,
|
||||
1,
|
||||
&MoreData,
|
||||
&TpmCap
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
@@ -287,10 +287,10 @@ Tpm2GetCapabilityMaxCommandResponseSize (
|
||||
*MaxCommandSize = SwapBytes32 (TpmCap.data.tpmProperties.tpmProperty->value);
|
||||
|
||||
Status = Tpm2GetCapability (
|
||||
TPM_CAP_TPM_PROPERTIES,
|
||||
TPM_PT_MAX_RESPONSE_SIZE,
|
||||
1,
|
||||
&MoreData,
|
||||
TPM_CAP_TPM_PROPERTIES,
|
||||
TPM_PT_MAX_RESPONSE_SIZE,
|
||||
1,
|
||||
&MoreData,
|
||||
&TpmCap
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
@@ -298,17 +298,17 @@ Tpm2GetCapabilityMaxCommandResponseSize (
|
||||
}
|
||||
|
||||
*MaxResponseSize = SwapBytes32 (TpmCap.data.tpmProperties.tpmProperty->value);
|
||||
return EFI_SUCCESS;
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
This command returns Returns a list of TPMS_ALG_PROPERTIES. Each entry is an
|
||||
algorithm ID and a set of properties of the algorithm.
|
||||
algorithm ID and a set of properties of the algorithm.
|
||||
|
||||
This function parse the value got from TPM2_GetCapability and return the list.
|
||||
|
||||
@param[out] AlgList List of algorithm.
|
||||
|
||||
|
||||
@retval EFI_SUCCESS Operation completed successfully.
|
||||
@retval EFI_DEVICE_ERROR The command was unsuccessful.
|
||||
**/
|
||||
@@ -322,24 +322,24 @@ Tpm2GetCapabilitySupportedAlg (
|
||||
TPMI_YES_NO MoreData;
|
||||
UINTN Index;
|
||||
EFI_STATUS Status;
|
||||
|
||||
|
||||
Status = Tpm2GetCapability (
|
||||
TPM_CAP_ALGS,
|
||||
1,
|
||||
MAX_CAP_ALGS,
|
||||
&MoreData,
|
||||
TPM_CAP_ALGS,
|
||||
1,
|
||||
MAX_CAP_ALGS,
|
||||
&MoreData,
|
||||
&TpmCap
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
|
||||
|
||||
CopyMem (AlgList, &TpmCap.data.algorithms, sizeof (TPML_ALG_PROPERTY));
|
||||
|
||||
AlgList->count = SwapBytes32 (AlgList->count);
|
||||
if (AlgList->count > MAX_CAP_ALGS) {
|
||||
DEBUG ((DEBUG_ERROR, "Tpm2GetCapabilitySupportedAlg - AlgList->count error %x\n", AlgList->count));
|
||||
return EFI_DEVICE_ERROR;
|
||||
return EFI_DEVICE_ERROR;
|
||||
}
|
||||
|
||||
for (Index = 0; Index < AlgList->count; Index++) {
|
||||
@@ -356,7 +356,7 @@ Tpm2GetCapabilitySupportedAlg (
|
||||
This function parse the value got from TPM2_GetCapability and return the LockoutCounter.
|
||||
|
||||
@param[out] LockoutCounter The LockoutCounter of TPM.
|
||||
|
||||
|
||||
@retval EFI_SUCCESS Operation completed successfully.
|
||||
@retval EFI_DEVICE_ERROR The command was unsuccessful.
|
||||
**/
|
||||
@@ -368,13 +368,13 @@ Tpm2GetCapabilityLockoutCounter (
|
||||
{
|
||||
TPMS_CAPABILITY_DATA TpmCap;
|
||||
TPMI_YES_NO MoreData;
|
||||
EFI_STATUS Status;
|
||||
EFI_STATUS Status;
|
||||
|
||||
Status = Tpm2GetCapability (
|
||||
TPM_CAP_TPM_PROPERTIES,
|
||||
TPM_PT_LOCKOUT_COUNTER,
|
||||
1,
|
||||
&MoreData,
|
||||
TPM_CAP_TPM_PROPERTIES,
|
||||
TPM_PT_LOCKOUT_COUNTER,
|
||||
1,
|
||||
&MoreData,
|
||||
&TpmCap
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
@@ -391,7 +391,7 @@ Tpm2GetCapabilityLockoutCounter (
|
||||
This function parse the value got from TPM2_GetCapability and return the LockoutInterval.
|
||||
|
||||
@param[out] LockoutInterval The LockoutInterval of TPM.
|
||||
|
||||
|
||||
@retval EFI_SUCCESS Operation completed successfully.
|
||||
@retval EFI_DEVICE_ERROR The command was unsuccessful.
|
||||
**/
|
||||
@@ -403,13 +403,13 @@ Tpm2GetCapabilityLockoutInterval (
|
||||
{
|
||||
TPMS_CAPABILITY_DATA TpmCap;
|
||||
TPMI_YES_NO MoreData;
|
||||
EFI_STATUS Status;
|
||||
EFI_STATUS Status;
|
||||
|
||||
Status = Tpm2GetCapability (
|
||||
TPM_CAP_TPM_PROPERTIES,
|
||||
TPM_PT_LOCKOUT_INTERVAL,
|
||||
1,
|
||||
&MoreData,
|
||||
TPM_CAP_TPM_PROPERTIES,
|
||||
TPM_PT_LOCKOUT_INTERVAL,
|
||||
1,
|
||||
&MoreData,
|
||||
&TpmCap
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
@@ -427,7 +427,7 @@ Tpm2GetCapabilityLockoutInterval (
|
||||
|
||||
@param[out] InputBufferSize The InputBufferSize of TPM.
|
||||
the maximum size of a parameter (typically, a TPM2B_MAX_BUFFER)
|
||||
|
||||
|
||||
@retval EFI_SUCCESS Operation completed successfully.
|
||||
@retval EFI_DEVICE_ERROR The command was unsuccessful.
|
||||
**/
|
||||
@@ -439,13 +439,13 @@ Tpm2GetCapabilityInputBufferSize (
|
||||
{
|
||||
TPMS_CAPABILITY_DATA TpmCap;
|
||||
TPMI_YES_NO MoreData;
|
||||
EFI_STATUS Status;
|
||||
EFI_STATUS Status;
|
||||
|
||||
Status = Tpm2GetCapability (
|
||||
TPM_CAP_TPM_PROPERTIES,
|
||||
TPM_PT_INPUT_BUFFER,
|
||||
1,
|
||||
&MoreData,
|
||||
TPM_CAP_TPM_PROPERTIES,
|
||||
TPM_PT_INPUT_BUFFER,
|
||||
1,
|
||||
&MoreData,
|
||||
&TpmCap
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
@@ -462,7 +462,7 @@ Tpm2GetCapabilityInputBufferSize (
|
||||
This function parse the value got from TPM2_GetCapability and return the PcrSelection.
|
||||
|
||||
@param[out] Pcrs The Pcr Selection
|
||||
|
||||
|
||||
@retval EFI_SUCCESS Operation completed successfully.
|
||||
@retval EFI_DEVICE_ERROR The command was unsuccessful.
|
||||
**/
|
||||
@@ -478,10 +478,10 @@ Tpm2GetCapabilityPcrs (
|
||||
UINTN Index;
|
||||
|
||||
Status = Tpm2GetCapability (
|
||||
TPM_CAP_PCRS,
|
||||
0,
|
||||
1,
|
||||
&MoreData,
|
||||
TPM_CAP_PCRS,
|
||||
0,
|
||||
1,
|
||||
&MoreData,
|
||||
&TpmCap
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
@@ -605,7 +605,7 @@ Tpm2GetCapabilitySupportedAndActivePcrs (
|
||||
This function parse the value got from TPM2_GetCapability and return the AlgorithmSet.
|
||||
|
||||
@param[out] AlgorithmSet The AlgorithmSet of TPM.
|
||||
|
||||
|
||||
@retval EFI_SUCCESS Operation completed successfully.
|
||||
@retval EFI_DEVICE_ERROR The command was unsuccessful.
|
||||
**/
|
||||
@@ -617,13 +617,13 @@ Tpm2GetCapabilityAlgorithmSet (
|
||||
{
|
||||
TPMS_CAPABILITY_DATA TpmCap;
|
||||
TPMI_YES_NO MoreData;
|
||||
EFI_STATUS Status;
|
||||
EFI_STATUS Status;
|
||||
|
||||
Status = Tpm2GetCapability (
|
||||
TPM_CAP_TPM_PROPERTIES,
|
||||
TPM_PT_ALGORITHM_SET,
|
||||
1,
|
||||
&MoreData,
|
||||
TPM_CAP_TPM_PROPERTIES,
|
||||
TPM_PT_ALGORITHM_SET,
|
||||
1,
|
||||
&MoreData,
|
||||
&TpmCap
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/** @file
|
||||
Implement TPM2 Context related command.
|
||||
|
||||
Copyright (c) 2014, Intel Corporation. All rights reserved. <BR>
|
||||
Copyright (c) 2014 - 2018, Intel Corporation. All rights reserved. <BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@@ -36,7 +36,7 @@ typedef struct {
|
||||
This command causes all context associated with a loaded object or session to be removed from TPM memory.
|
||||
|
||||
@param[in] FlushHandle The handle of the item to flush.
|
||||
|
||||
|
||||
@retval EFI_SUCCESS Operation completed successfully.
|
||||
@retval EFI_DEVICE_ERROR The command was unsuccessful.
|
||||
**/
|
||||
@@ -59,7 +59,7 @@ Tpm2FlushContext (
|
||||
SendBuffer.Header.commandCode = SwapBytes32(TPM_CC_FlushContext);
|
||||
|
||||
SendBuffer.FlushHandle = SwapBytes32 (FlushHandle);
|
||||
|
||||
|
||||
SendBufferSize = (UINT32) sizeof (SendBuffer);
|
||||
SendBuffer.Header.paramSize = SwapBytes32 (SendBufferSize);
|
||||
|
||||
|
@@ -87,7 +87,7 @@ typedef struct {
|
||||
@param[in] Expiration Time when authorization will expire, measured in seconds from the time that nonceTPM was generated.
|
||||
@param[out] Timeout Time value used to indicate to the TPM when the ticket expires.
|
||||
@param[out] PolicyTicket A ticket that includes a value indicating when the authorization expires.
|
||||
|
||||
|
||||
@retval EFI_SUCCESS Operation completed successfully.
|
||||
@retval EFI_DEVICE_ERROR The command was unsuccessful.
|
||||
**/
|
||||
@@ -120,7 +120,7 @@ Tpm2PolicySecret (
|
||||
SendBuffer.Header.commandCode = SwapBytes32(TPM_CC_PolicySecret);
|
||||
SendBuffer.AuthHandle = SwapBytes32 (AuthHandle);
|
||||
SendBuffer.PolicySession = SwapBytes32 (PolicySession);
|
||||
|
||||
|
||||
//
|
||||
// Add in Auth session
|
||||
//
|
||||
@@ -148,7 +148,7 @@ Tpm2PolicySecret (
|
||||
Buffer += sizeof(UINT16);
|
||||
CopyMem (Buffer, PolicyRef->buffer, PolicyRef->size);
|
||||
Buffer += PolicyRef->size;
|
||||
|
||||
|
||||
WriteUnaligned32 ((UINT32 *)Buffer, SwapBytes32((UINT32)Expiration));
|
||||
Buffer += sizeof(UINT32);
|
||||
|
||||
@@ -220,7 +220,7 @@ Done:
|
||||
|
||||
@param[in] PolicySession Handle for the policy session being extended.
|
||||
@param[in] HashList the list of hashes to check for a match.
|
||||
|
||||
|
||||
@retval EFI_SUCCESS Operation completed successfully.
|
||||
@retval EFI_DEVICE_ERROR The command was unsuccessful.
|
||||
**/
|
||||
@@ -285,7 +285,7 @@ Tpm2PolicyOR (
|
||||
|
||||
@param[in] PolicySession Handle for the policy session being extended.
|
||||
@param[in] Code The allowed commandCode.
|
||||
|
||||
|
||||
@retval EFI_SUCCESS Operation completed successfully.
|
||||
@retval EFI_DEVICE_ERROR The command was unsuccessful.
|
||||
**/
|
||||
@@ -341,7 +341,7 @@ Tpm2PolicyCommandCode (
|
||||
|
||||
@param[in] PolicySession Handle for the policy session.
|
||||
@param[out] PolicyHash the current value of the policyHash of policySession.
|
||||
|
||||
|
||||
@retval EFI_SUCCESS Operation completed successfully.
|
||||
@retval EFI_DEVICE_ERROR The command was unsuccessful.
|
||||
**/
|
||||
|
@@ -97,7 +97,7 @@ CopyAuthSessionCommand (
|
||||
UINT8 *Buffer;
|
||||
|
||||
Buffer = (UINT8 *)AuthSessionOut;
|
||||
|
||||
|
||||
//
|
||||
// Add in Auth session
|
||||
//
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/** @file
|
||||
Implement TPM2 Hierarchy related command.
|
||||
|
||||
Copyright (c) 2013 - 2016, Intel Corporation. All rights reserved. <BR>
|
||||
Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved. <BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@@ -214,7 +214,7 @@ Done:
|
||||
|
||||
@param[in] AuthHandle TPM_RH_LOCKOUT or TPM_RH_PLATFORM+{PP}
|
||||
@param[in] AuthSession Auth Session context
|
||||
|
||||
|
||||
@retval EFI_SUCCESS Operation completed successfully.
|
||||
@retval EFI_DEVICE_ERROR Unexpected device behavior.
|
||||
**/
|
||||
@@ -455,8 +455,8 @@ Tpm2HierarchyChangeAuth (
|
||||
// Call the TPM
|
||||
//
|
||||
Status = Tpm2SubmitCommand (
|
||||
CmdSize,
|
||||
(UINT8 *)&Cmd,
|
||||
CmdSize,
|
||||
(UINT8 *)&Cmd,
|
||||
&ResultBufSize,
|
||||
ResultBuf
|
||||
);
|
||||
@@ -553,8 +553,8 @@ Tpm2ChangeEPS (
|
||||
// Call the TPM
|
||||
//
|
||||
Status = Tpm2SubmitCommand (
|
||||
CmdSize,
|
||||
(UINT8 *)&Cmd,
|
||||
CmdSize,
|
||||
(UINT8 *)&Cmd,
|
||||
&ResultBufSize,
|
||||
ResultBuf
|
||||
);
|
||||
@@ -651,8 +651,8 @@ Tpm2ChangePPS (
|
||||
// Call the TPM
|
||||
//
|
||||
Status = Tpm2SubmitCommand (
|
||||
CmdSize,
|
||||
(UINT8 *)&Cmd,
|
||||
CmdSize,
|
||||
(UINT8 *)&Cmd,
|
||||
&ResultBufSize,
|
||||
ResultBuf
|
||||
);
|
||||
@@ -759,8 +759,8 @@ Tpm2HierarchyControl (
|
||||
// Call the TPM
|
||||
//
|
||||
Status = Tpm2SubmitCommand (
|
||||
CmdSize,
|
||||
(UINT8 *)&Cmd,
|
||||
CmdSize,
|
||||
(UINT8 *)&Cmd,
|
||||
&ResultBufSize,
|
||||
ResultBuf
|
||||
);
|
||||
|
@@ -120,16 +120,16 @@ Tpm2PcrExtend (
|
||||
// Add in Auth session
|
||||
//
|
||||
Buffer = (UINT8 *)&Cmd.AuthSessionPcr;
|
||||
|
||||
|
||||
// sessionInfoSize
|
||||
SessionInfoSize = CopyAuthSessionCommand (NULL, Buffer);
|
||||
Buffer += SessionInfoSize;
|
||||
Cmd.AuthorizationSize = SwapBytes32(SessionInfoSize);
|
||||
|
||||
|
||||
//Digest Count
|
||||
WriteUnaligned32 ((UINT32 *)Buffer, SwapBytes32(Digests->count));
|
||||
Buffer += sizeof(UINT32);
|
||||
|
||||
|
||||
//Digest
|
||||
for (Index = 0; Index < Digests->count; Index++) {
|
||||
WriteUnaligned16 ((UINT16 *)Buffer, SwapBytes16(Digests->digests[Index].hashAlg));
|
||||
@@ -241,7 +241,7 @@ Tpm2PcrEvent (
|
||||
|
||||
CopyMem (Buffer, EventData->buffer, EventData->size);
|
||||
Buffer += EventData->size;
|
||||
|
||||
|
||||
CmdSize = (UINT32)((UINTN)Buffer - (UINTN)&Cmd);
|
||||
Cmd.Header.paramSize = SwapBytes32(CmdSize);
|
||||
|
||||
@@ -311,7 +311,7 @@ Tpm2PcrEvent (
|
||||
@param[out] PcrUpdateCounter The current value of the PCR update counter.
|
||||
@param[out] PcrSelectionOut The PCR in the returned list.
|
||||
@param[out] PcrValues The contents of the PCR indicated in pcrSelect.
|
||||
|
||||
|
||||
@retval EFI_SUCCESS Operation completed successfully.
|
||||
@retval EFI_DEVICE_ERROR The command was unsuccessful.
|
||||
**/
|
||||
@@ -338,7 +338,7 @@ Tpm2PcrRead (
|
||||
//
|
||||
SendBuffer.Header.tag = SwapBytes16(TPM_ST_NO_SESSIONS);
|
||||
SendBuffer.Header.commandCode = SwapBytes32(TPM_CC_PCR_Read);
|
||||
|
||||
|
||||
SendBuffer.PcrSelectionIn.count = SwapBytes32(PcrSelectionIn->count);
|
||||
for (Index = 0; Index < PcrSelectionIn->count; Index++) {
|
||||
SendBuffer.PcrSelectionIn.pcrSelections[Index].hash = SwapBytes16(PcrSelectionIn->pcrSelections[Index].hash);
|
||||
@@ -442,7 +442,7 @@ Tpm2PcrRead (
|
||||
@param[out] MaxPCR maximum number of PCR that may be in a bank
|
||||
@param[out] SizeNeeded number of octets required to satisfy the request
|
||||
@param[out] SizeAvailable Number of octets available. Computed before the allocation
|
||||
|
||||
|
||||
@retval EFI_SUCCESS Operation completed successfully.
|
||||
@retval EFI_DEVICE_ERROR The command was unsuccessful.
|
||||
**/
|
||||
@@ -509,8 +509,8 @@ Tpm2PcrAllocate (
|
||||
// Call the TPM
|
||||
//
|
||||
Status = Tpm2SubmitCommand (
|
||||
CmdSize,
|
||||
(UINT8 *)&Cmd,
|
||||
CmdSize,
|
||||
(UINT8 *)&Cmd,
|
||||
&ResultBufSize,
|
||||
ResultBuf
|
||||
);
|
||||
@@ -566,7 +566,7 @@ Done:
|
||||
@param[in] PlatformAuth platform auth value. NULL means no platform auth change.
|
||||
@param[in] SupportedPCRBanks Supported PCR banks
|
||||
@param[in] PCRBanks PCR banks
|
||||
|
||||
|
||||
@retval EFI_SUCCESS Operation completed successfully.
|
||||
**/
|
||||
EFI_STATUS
|
||||
@@ -692,4 +692,4 @@ Tpm2PcrAllocateBanks (
|
||||
Done:
|
||||
ZeroMem(&LocalAuthSession.hmac, sizeof(LocalAuthSession.hmac));
|
||||
return Status;
|
||||
}
|
||||
}
|
||||
|
@@ -162,7 +162,7 @@ typedef struct {
|
||||
@param[in] NvIndex The NV Index.
|
||||
@param[out] NvPublic The public area of the index.
|
||||
@param[out] NvName The Name of the nvIndex.
|
||||
|
||||
|
||||
@retval EFI_SUCCESS Operation completed successfully.
|
||||
@retval EFI_DEVICE_ERROR The command was unsuccessful.
|
||||
@retval EFI_NOT_FOUND The command was returned successfully, but NvIndex is not found.
|
||||
@@ -192,7 +192,7 @@ Tpm2NvReadPublic (
|
||||
SendBuffer.Header.commandCode = SwapBytes32(TPM_CC_NV_ReadPublic);
|
||||
|
||||
SendBuffer.NvIndex = SwapBytes32 (NvIndex);
|
||||
|
||||
|
||||
SendBufferSize = (UINT32) sizeof (SendBuffer);
|
||||
SendBuffer.Header.paramSize = SwapBytes32 (SendBufferSize);
|
||||
|
||||
@@ -265,7 +265,7 @@ Tpm2NvReadPublic (
|
||||
|
||||
CopyMem (NvName->name, (UINT8 *)&RecvBuffer + sizeof(TPM2_RESPONSE_HEADER) + sizeof(UINT16) + NvPublicSize + sizeof(UINT16), NvNameSize);
|
||||
NvName->size = NvNameSize;
|
||||
|
||||
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -278,7 +278,7 @@ Tpm2NvReadPublic (
|
||||
@param[in] AuthSession Auth Session context
|
||||
@param[in] Auth The authorization data.
|
||||
@param[in] NvPublic The public area of the index.
|
||||
|
||||
|
||||
@retval EFI_SUCCESS Operation completed successfully.
|
||||
@retval EFI_DEVICE_ERROR The command was unsuccessful.
|
||||
@retval EFI_ALREADY_STARTED The command was returned successfully, but NvIndex is already defined.
|
||||
@@ -414,7 +414,7 @@ Done:
|
||||
@param[in] AuthHandle TPM_RH_OWNER or TPM_RH_PLATFORM+{PP}.
|
||||
@param[in] NvIndex The NV Index.
|
||||
@param[in] AuthSession Auth Session context
|
||||
|
||||
|
||||
@retval EFI_SUCCESS Operation completed successfully.
|
||||
@retval EFI_DEVICE_ERROR The command was unsuccessful.
|
||||
@retval EFI_NOT_FOUND The command was returned successfully, but NvIndex is not found.
|
||||
@@ -521,7 +521,7 @@ Done:
|
||||
@param[in] Size Number of bytes to read.
|
||||
@param[in] Offset Byte offset into the area.
|
||||
@param[in,out] OutData The data read.
|
||||
|
||||
|
||||
@retval EFI_SUCCESS Operation completed successfully.
|
||||
@retval EFI_DEVICE_ERROR The command was unsuccessful.
|
||||
@retval EFI_NOT_FOUND The command was returned successfully, but NvIndex is not found.
|
||||
@@ -648,7 +648,7 @@ Tpm2NvRead (
|
||||
}
|
||||
|
||||
CopyMem (OutData->buffer, &RecvBuffer.Data.buffer, OutData->size);
|
||||
|
||||
|
||||
Done:
|
||||
//
|
||||
// Clear AuthSession Content
|
||||
@@ -666,7 +666,7 @@ Done:
|
||||
@param[in] AuthSession Auth Session context
|
||||
@param[in] InData The data to write.
|
||||
@param[in] Offset The offset into the NV Area.
|
||||
|
||||
|
||||
@retval EFI_SUCCESS Operation completed successfully.
|
||||
@retval EFI_DEVICE_ERROR The command was unsuccessful.
|
||||
@retval EFI_NOT_FOUND The command was returned successfully, but NvIndex is not found.
|
||||
|
@@ -90,7 +90,7 @@ typedef struct {
|
||||
@param[in] HashAlg The hash algorithm to use for the hash sequence
|
||||
An Event sequence starts if this is TPM_ALG_NULL.
|
||||
@param[out] SequenceHandle A handle to reference the sequence
|
||||
|
||||
|
||||
@retval EFI_SUCCESS Operation completed successfully.
|
||||
@retval EFI_DEVICE_ERROR Unexpected device behavior.
|
||||
**/
|
||||
@@ -178,7 +178,7 @@ Tpm2HashSequenceStart (
|
||||
|
||||
@param[in] SequenceHandle Handle for the sequence object
|
||||
@param[in] Buffer Data to be added to hash
|
||||
|
||||
|
||||
@retval EFI_SUCCESS Operation completed successfully.
|
||||
@retval EFI_DEVICE_ERROR Unexpected device behavior.
|
||||
**/
|
||||
@@ -277,7 +277,7 @@ Tpm2SequenceUpdate (
|
||||
@param[in] SequenceHandle Authorization for the sequence
|
||||
@param[in] Buffer Data to be added to the Event
|
||||
@param[out] Results List of digests computed for the PCR
|
||||
|
||||
|
||||
@retval EFI_SUCCESS Operation completed successfully.
|
||||
@retval EFI_DEVICE_ERROR Unexpected device behavior.
|
||||
**/
|
||||
@@ -408,7 +408,7 @@ Tpm2EventSequenceComplete (
|
||||
@param[in] SequenceHandle Authorization for the sequence
|
||||
@param[in] Buffer Data to be added to the hash/HMAC
|
||||
@param[out] Result The returned HMAC or digest in a sized buffer
|
||||
|
||||
|
||||
@retval EFI_SUCCESS Operation completed successfully.
|
||||
@retval EFI_DEVICE_ERROR Unexpected device behavior.
|
||||
**/
|
||||
|
@@ -53,7 +53,7 @@ typedef struct {
|
||||
@param[in] AuthHash Hash algorithm to use for the session.
|
||||
@param[out] SessionHandle Handle for the newly created session.
|
||||
@param[out] NonceTPM The initial nonce from the TPM, used in the computation of the sessionKey.
|
||||
|
||||
|
||||
@retval EFI_SUCCESS Operation completed successfully.
|
||||
@retval EFI_DEVICE_ERROR The command was unsuccessful.
|
||||
**/
|
||||
@@ -136,7 +136,7 @@ Tpm2StartAuthSession (
|
||||
|
||||
WriteUnaligned16 ((UINT16 *)Buffer, SwapBytes16 (AuthHash));
|
||||
Buffer += sizeof(UINT16);
|
||||
|
||||
|
||||
SendBufferSize = (UINT32) ((UINTN)Buffer - (UINTN)&SendBuffer);
|
||||
SendBuffer.Header.paramSize = SwapBytes32 (SendBufferSize);
|
||||
|
||||
|
Reference in New Issue
Block a user