diff options
author | Liming Gao <liming.gao@intel.com> | 2018-06-27 21:13:09 +0800 |
---|---|---|
committer | Liming Gao <liming.gao@intel.com> | 2018-06-28 11:19:50 +0800 |
commit | b3548d32ddb553a9e95503457c66d11462622d16 (patch) | |
tree | 58d9148d8298dcc8ea64e5515ada87c433f6be2a /SecurityPkg/Library/Tpm2CommandLib/Tpm2Capability.c | |
parent | 5a702acd3df099307d9bae0725f97b52b4895382 (diff) | |
download | edk2-b3548d32ddb553a9e95503457c66d11462622d16.zip edk2-b3548d32ddb553a9e95503457c66d11462622d16.tar.gz edk2-b3548d32ddb553a9e95503457c66d11462622d16.tar.bz2 |
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>
Diffstat (limited to 'SecurityPkg/Library/Tpm2CommandLib/Tpm2Capability.c')
-rw-r--r-- | SecurityPkg/Library/Tpm2CommandLib/Tpm2Capability.c | 162 |
1 files changed, 81 insertions, 81 deletions
diff --git a/SecurityPkg/Library/Tpm2CommandLib/Tpm2Capability.c b/SecurityPkg/Library/Tpm2CommandLib/Tpm2Capability.c index b11a8ac..734cea7 100644 --- a/SecurityPkg/Library/Tpm2CommandLib/Tpm2Capability.c +++ b/SecurityPkg/Library/Tpm2CommandLib/Tpm2Capability.c @@ -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)) {
|