]> git.proxmox.com Git - mirror_edk2.git/blobdiff - SecurityPkg/Include/Library/Tpm2CommandLib.h
SecurityPkg: Fix spelling errors
[mirror_edk2.git] / SecurityPkg / Include / Library / Tpm2CommandLib.h
index 699270f127a14d1a9d88e70a77fcd929c3af0976..ce381e786b2c275fd500112ef94d7521bdf5009e 100644 (file)
@@ -1,14 +1,8 @@
 /** @file\r
   This library is used by other modules to send TPM2 command.\r
 \r
-Copyright (c) 2013 - 2016, Intel Corporation. All rights reserved. <BR>\r
-This program and the accompanying materials\r
-are licensed and made available under the terms and conditions of the BSD License\r
-which accompanies this distribution.  The full text of the license may be found at\r
-http://opensource.org/licenses/bsd-license.php\r
-\r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved. <BR>\r
+SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
 \r
@@ -25,7 +19,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
   @param[in]  HashAlg           The hash algorithm to use for the hash sequence\r
                                 An Event sequence starts if this is TPM_ALG_NULL.\r
   @param[out] SequenceHandle    A handle to reference the sequence\r
\r
+\r
   @retval EFI_SUCCESS      Operation completed successfully.\r
   @retval EFI_DEVICE_ERROR Unexpected device behavior.\r
 **/\r
@@ -43,7 +37,7 @@ Tpm2HashSequenceStart (
 \r
   @param[in] SequenceHandle    Handle for the sequence object\r
   @param[in] Buffer            Data to be added to hash\r
\r
+\r
   @retval EFI_SUCCESS      Operation completed successfully.\r
   @retval EFI_DEVICE_ERROR Unexpected device behavior.\r
 **/\r
@@ -64,7 +58,7 @@ Tpm2SequenceUpdate (
   @param[in]  SequenceHandle    Authorization for the sequence\r
   @param[in]  Buffer            Data to be added to the Event\r
   @param[out] Results           List of digests computed for the PCR\r
\r
+\r
   @retval EFI_SUCCESS      Operation completed successfully.\r
   @retval EFI_DEVICE_ERROR Unexpected device behavior.\r
 **/\r
@@ -83,7 +77,7 @@ Tpm2EventSequenceComplete (
   @param[in]  SequenceHandle    Authorization for the sequence\r
   @param[in]  Buffer            Data to be added to the hash/HMAC\r
   @param[out] Result            The returned HMAC or digest in a sized buffer\r
\r
+\r
   @retval EFI_SUCCESS      Operation completed successfully.\r
   @retval EFI_DEVICE_ERROR Unexpected device behavior.\r
 **/\r
@@ -166,7 +160,7 @@ Tpm2SetPrimaryPolicy (
 \r
   @param[in] AuthHandle        TPM_RH_LOCKOUT or TPM_RH_PLATFORM+{PP}\r
   @param[in] AuthSession       Auth Session context\r
\r
+\r
   @retval EFI_SUCCESS      Operation completed successfully.\r
   @retval EFI_DEVICE_ERROR Unexpected device behavior.\r
 **/\r
@@ -316,7 +310,7 @@ Tpm2DictionaryAttackParameters (
   @param[in]  NvIndex            The NV Index.\r
   @param[out] NvPublic           The public area of the index.\r
   @param[out] NvName             The Name of the nvIndex.\r
-  \r
+\r
   @retval EFI_SUCCESS            Operation completed successfully.\r
   @retval EFI_DEVICE_ERROR       The command was unsuccessful.\r
 **/\r
@@ -337,7 +331,7 @@ Tpm2NvReadPublic (
   @param[in]  AuthSession        Auth Session context\r
   @param[in]  Auth               The authorization data.\r
   @param[in]  NvPublic           The public area of the index.\r
-  \r
+\r
   @retval EFI_SUCCESS            Operation completed successfully.\r
   @retval EFI_DEVICE_ERROR       The command was unsuccessful.\r
   @retval EFI_ALREADY_STARTED    The command was returned successfully, but NvIndex is already defined.\r
@@ -357,7 +351,7 @@ Tpm2NvDefineSpace (
   @param[in]  AuthHandle         TPM_RH_OWNER or TPM_RH_PLATFORM+{PP}.\r
   @param[in]  NvIndex            The NV Index.\r
   @param[in]  AuthSession        Auth Session context\r
-  \r
+\r
   @retval EFI_SUCCESS            Operation completed successfully.\r
   @retval EFI_DEVICE_ERROR       The command was unsuccessful.\r
   @retval EFI_NOT_FOUND          The command was returned successfully, but NvIndex is not found.\r
@@ -379,7 +373,7 @@ Tpm2NvUndefineSpace (
   @param[in]     Size               Number of bytes to read.\r
   @param[in]     Offset             Byte offset into the area.\r
   @param[in,out] OutData            The data read.\r
-  \r
+\r
   @retval EFI_SUCCESS            Operation completed successfully.\r
   @retval EFI_DEVICE_ERROR       The command was unsuccessful.\r
   @retval EFI_NOT_FOUND          The command was returned successfully, but NvIndex is not found.\r
@@ -403,7 +397,7 @@ Tpm2NvRead (
   @param[in]  AuthSession        Auth Session context\r
   @param[in]  InData             The data to write.\r
   @param[in]  Offset             The offset into the NV Area.\r
-  \r
+\r
   @retval EFI_SUCCESS            Operation completed successfully.\r
   @retval EFI_DEVICE_ERROR       The command was unsuccessful.\r
   @retval EFI_NOT_FOUND          The command was returned successfully, but NvIndex is not found.\r
@@ -521,7 +515,7 @@ Tpm2PcrEvent (
   @param[out] PcrUpdateCounter   The current value of the PCR update counter.\r
   @param[out] PcrSelectionOut    The PCR in the returned list.\r
   @param[out] PcrValues          The contents of the PCR indicated in pcrSelect.\r
-  \r
+\r
   @retval EFI_SUCCESS            Operation completed successfully.\r
   @retval EFI_DEVICE_ERROR       The command was unsuccessful.\r
 **/\r
@@ -544,7 +538,7 @@ Tpm2PcrRead (
   @param[out] MaxPCR             maximum number of PCR that may be in a bank\r
   @param[out] SizeNeeded         number of octets required to satisfy the request\r
   @param[out] SizeAvailable      Number of octets available. Computed before the allocation\r
-  \r
+\r
   @retval EFI_SUCCESS            Operation completed successfully.\r
   @retval EFI_DEVICE_ERROR       The command was unsuccessful.\r
 **/\r
@@ -580,25 +574,25 @@ Tpm2PcrAllocateBanks (
 /**\r
   This command returns various information regarding the TPM and its current state.\r
 \r
-  The capability parameter determines the category of data returned. The property parameter \r
-  selects the first value of the selected category to be returned. If there is no property \r
+  The capability parameter determines the category of data returned. The property parameter\r
+  selects the first value of the selected category to be returned. If there is no property\r
   that corresponds to the value of property, the next higher value is returned, if it exists.\r
-  The moreData parameter will have a value of YES if there are more values of the requested \r
+  The moreData parameter will have a value of YES if there are more values of the requested\r
   type that were not returned.\r
-  If no next capability exists, the TPM will return a zero-length list and moreData will have \r
+  If no next capability exists, the TPM will return a zero-length list and moreData will have\r
   a value of NO.\r
 \r
-  NOTE: \r
-  To simplify this function, leave returned CapabilityData for caller to unpack since there are \r
+  NOTE:\r
+  To simplify this function, leave returned CapabilityData for caller to unpack since there are\r
   many capability categories and only few categories will be used in firmware. It means the caller\r
-  need swap the byte order for the feilds in CapabilityData.\r
+  need swap the byte order for the fields in CapabilityData.\r
 \r
   @param[in]  Capability         Group selection; determines the format of the response.\r
-  @param[in]  Property           Further definition of information. \r
+  @param[in]  Property           Further definition of information.\r
   @param[in]  PropertyCount      Number of properties of the indicated type to return.\r
   @param[out] MoreData           Flag to indicate if there are more values of this type.\r
   @param[out] CapabilityData     The capability data.\r
-  \r
+\r
   @retval EFI_SUCCESS            Operation completed successfully.\r
   @retval EFI_DEVICE_ERROR       The command was unsuccessful.\r
 **/\r
@@ -618,7 +612,7 @@ Tpm2GetCapability (
   This function parse the value got from TPM2_GetCapability and return the Family.\r
 \r
   @param[out] Family             The Family of TPM. (a 4-octet character string)\r
-  \r
+\r
   @retval EFI_SUCCESS            Operation completed successfully.\r
   @retval EFI_DEVICE_ERROR       The command was unsuccessful.\r
 **/\r
@@ -634,7 +628,7 @@ Tpm2GetCapabilityFamily (
   This function parse the value got from TPM2_GetCapability and return the TPM manufacture ID.\r
 \r
   @param[out] ManufactureId      The manufacture ID of TPM.\r
-  \r
+\r
   @retval EFI_SUCCESS            Operation completed successfully.\r
   @retval EFI_DEVICE_ERROR       The command was unsuccessful.\r
 **/\r
@@ -651,7 +645,7 @@ Tpm2GetCapabilityManufactureID (
 \r
   @param[out] FirmwareVersion1   The FirmwareVersion1.\r
   @param[out] FirmwareVersion2   The FirmwareVersion2.\r
-  \r
+\r
   @retval EFI_SUCCESS            Operation completed successfully.\r
   @retval EFI_DEVICE_ERROR       The command was unsuccessful.\r
 **/\r
@@ -669,7 +663,7 @@ Tpm2GetCapabilityFirmwareVersion (
 \r
   @param[out] MaxCommandSize     The maximum value for commandSize in a command.\r
   @param[out] MaxResponseSize    The maximum value for responseSize in a command.\r
-  \r
+\r
   @retval EFI_SUCCESS            Operation completed successfully.\r
   @retval EFI_DEVICE_ERROR       The command was unsuccessful.\r
 **/\r
@@ -682,12 +676,12 @@ Tpm2GetCapabilityMaxCommandResponseSize (
 \r
 /**\r
   This command returns Returns a list of TPMS_ALG_PROPERTIES. Each entry is an\r
-  algorithm ID and a set of properties of the algorithm. \r
+  algorithm ID and a set of properties of the algorithm.\r
 \r
   This function parse the value got from TPM2_GetCapability and return the list.\r
 \r
   @param[out] AlgList      List of algorithm.\r
-  \r
+\r
   @retval EFI_SUCCESS            Operation completed successfully.\r
   @retval EFI_DEVICE_ERROR       The command was unsuccessful.\r
 **/\r
@@ -703,7 +697,7 @@ Tpm2GetCapabilitySupportedAlg (
   This function parse the value got from TPM2_GetCapability and return the LockoutCounter.\r
 \r
   @param[out] LockoutCounter     The LockoutCounter of TPM.\r
-  \r
+\r
   @retval EFI_SUCCESS            Operation completed successfully.\r
   @retval EFI_DEVICE_ERROR       The command was unsuccessful.\r
 **/\r
@@ -719,7 +713,7 @@ Tpm2GetCapabilityLockoutCounter (
   This function parse the value got from TPM2_GetCapability and return the LockoutInterval.\r
 \r
   @param[out] LockoutInterval    The LockoutInterval of TPM.\r
-  \r
+\r
   @retval EFI_SUCCESS            Operation completed successfully.\r
   @retval EFI_DEVICE_ERROR       The command was unsuccessful.\r
 **/\r
@@ -736,7 +730,7 @@ Tpm2GetCapabilityLockoutInterval (
 \r
   @param[out] InputBufferSize    The InputBufferSize of TPM.\r
                                  the maximum size of a parameter (typically, a TPM2B_MAX_BUFFER)\r
-  \r
+\r
   @retval EFI_SUCCESS            Operation completed successfully.\r
   @retval EFI_DEVICE_ERROR       The command was unsuccessful.\r
 **/\r
@@ -752,7 +746,7 @@ Tpm2GetCapabilityInputBufferSize (
   This function parse the value got from TPM2_GetCapability and return the PcrSelection.\r
 \r
   @param[out] Pcrs    The Pcr Selection\r
-  \r
+\r
   @retval EFI_SUCCESS            Operation completed successfully.\r
   @retval EFI_DEVICE_ERROR       The command was unsuccessful.\r
 **/\r
@@ -786,7 +780,7 @@ Tpm2GetCapabilitySupportedAndActivePcrs(
   This function parse the value got from TPM2_GetCapability and return the AlgorithmSet.\r
 \r
   @param[out] AlgorithmSet    The AlgorithmSet of TPM.\r
-  \r
+\r
   @retval EFI_SUCCESS            Operation completed successfully.\r
   @retval EFI_DEVICE_ERROR       The command was unsuccessful.\r
 **/\r
@@ -843,7 +837,7 @@ Tpm2SetAlgorithmSet (
   @param[in]  AuthHash           Hash algorithm to use for the session.\r
   @param[out] SessionHandle      Handle for the newly created session.\r
   @param[out] NonceTPM           The initial nonce from the TPM, used in the computation of the sessionKey.\r
-  \r
+\r
   @retval EFI_SUCCESS            Operation completed successfully.\r
   @retval EFI_DEVICE_ERROR       The command was unsuccessful.\r
 **/\r
@@ -865,7 +859,7 @@ Tpm2StartAuthSession (
   This command causes all context associated with a loaded object or session to be removed from TPM memory.\r
 \r
   @param[in]  FlushHandle        The handle of the item to flush.\r
-  \r
+\r
   @retval EFI_SUCCESS            Operation completed successfully.\r
   @retval EFI_DEVICE_ERROR       The command was unsuccessful.\r
 **/\r
@@ -879,7 +873,7 @@ Tpm2FlushContext (
   This command includes a secret-based authorization to a policy.\r
   The caller proves knowledge of the secret value using an authorization\r
   session using the authValue associated with authHandle.\r
-  \r
+\r
   @param[in]  AuthHandle         Handle for an entity providing the authorization\r
   @param[in]  PolicySession      Handle for the policy session being extended.\r
   @param[in]  AuthSession        Auth Session context\r
@@ -889,7 +883,7 @@ Tpm2FlushContext (
   @param[in]  Expiration         Time when authorization will expire, measured in seconds from the time that nonceTPM was generated.\r
   @param[out] Timeout            Time value used to indicate to the TPM when the ticket expires.\r
   @param[out] PolicyTicket       A ticket that includes a value indicating when the authorization expires.\r
-  \r
+\r
   @retval EFI_SUCCESS            Operation completed successfully.\r
   @retval EFI_DEVICE_ERROR       The command was unsuccessful.\r
 **/\r
@@ -915,7 +909,7 @@ Tpm2PolicySecret (
 \r
   @param[in] PolicySession      Handle for the policy session being extended.\r
   @param[in] HashList           the list of hashes to check for a match.\r
-  \r
+\r
   @retval EFI_SUCCESS            Operation completed successfully.\r
   @retval EFI_DEVICE_ERROR       The command was unsuccessful.\r
 **/\r
@@ -931,7 +925,7 @@ Tpm2PolicyOR (
 \r
   @param[in]  PolicySession      Handle for the policy session being extended.\r
   @param[in]  Code               The allowed commandCode.\r
-  \r
+\r
   @retval EFI_SUCCESS            Operation completed successfully.\r
   @retval EFI_DEVICE_ERROR       The command was unsuccessful.\r
 **/\r
@@ -948,7 +942,7 @@ Tpm2PolicyCommandCode (
 \r
   @param[in]  PolicySession      Handle for the policy session.\r
   @param[out] PolicyHash         the current value of the policyHash of policySession.\r
-  \r
+\r
   @retval EFI_SUCCESS            Operation completed successfully.\r
   @retval EFI_DEVICE_ERROR       The command was unsuccessful.\r
 **/\r
@@ -959,6 +953,26 @@ Tpm2PolicyGetDigest (
      OUT  TPM2B_DIGEST              *PolicyHash\r
   );\r
 \r
+/**\r
+  This command allows access to the public area of a loaded object.\r
+\r
+  @param[in]  ObjectHandle            TPM handle of an object\r
+  @param[out] OutPublic               Structure containing the public area of an object\r
+  @param[out] Name                    Name of the object\r
+  @param[out] QualifiedName           The Qualified Name of the object\r
+\r
+  @retval EFI_SUCCESS      Operation completed successfully.\r
+  @retval EFI_DEVICE_ERROR Unexpected device behavior.\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+Tpm2ReadPublic (\r
+  IN  TPMI_DH_OBJECT            ObjectHandle,\r
+  OUT TPM2B_PUBLIC              *OutPublic,\r
+  OUT TPM2B_NAME                *Name,\r
+  OUT TPM2B_NAME                *QualifiedName\r
+  );\r
+\r
 //\r
 // Help function\r
 //\r
@@ -1038,7 +1052,7 @@ IsHashAlgSupportedInHashAlgorithmMask(
 /**\r
   Copy TPML_DIGEST_VALUES into a buffer\r
 \r
-  @param[in,out] Buffer             Buffer to hold TPML_DIGEST_VALUES.\r
+  @param[in,out] Buffer             Buffer to hold copied TPML_DIGEST_VALUES compact binary.\r
   @param[in]     DigestList         TPML_DIGEST_VALUES to be copied.\r
   @param[in]     HashAlgorithmMask  HASH bits corresponding to the desired digests to copy.\r
 \r