TianoCore EDK2 master
|
#include <IndustryStandard/TcgStorageCore.h>
Go to the source code of this file.
Data Structures | |
struct | TCG_CREATE_STRUCT |
struct | TCG_PARSE_STRUCT |
struct | TCG_TOKEN |
Macros | |
#define | ERROR_CHECK(arg) |
#define | METHOD_STATUS_ERROR_CHECK(arg, failRet) |
#define | NULL_CHECK(arg) |
Typedefs | |
typedef BOOLEAN(EFIAPI * | TCG_LEVEL0_ENUM_CALLBACK) (const TCG_LEVEL0_DISCOVERY_HEADER *DiscoveryHeader, TCG_LEVEL0_FEATURE_DESCRIPTOR_HEADER *Feature, UINTN FeatureSize, VOID *Context) |
Enumerations | |
enum | TCG_RESULT { TcgResultSuccess , TcgResultFailure , TcgResultFailureNullPointer , TcgResultFailureZeroSize , TcgResultFailureInvalidAction , TcgResultFailureBufferTooSmall , TcgResultFailureEndBuffer , TcgResultFailureInvalidType } |
Functions | |
TCG_RESULT EFIAPI | TcgInitTcgCreateStruct (TCG_CREATE_STRUCT *CreateStruct, VOID *Buffer, UINT32 BufferSize) |
TCG_RESULT EFIAPI | TcgStartComPacket (TCG_CREATE_STRUCT *CreateStruct, UINT16 ComId, UINT16 ComIdExtension) |
TCG_RESULT EFIAPI | TcgStartPacket (TCG_CREATE_STRUCT *CreateStruct, UINT32 Tsn, UINT32 Hsn, UINT32 SeqNumber, UINT16 AckType, UINT32 Ack) |
TCG_RESULT EFIAPI | TcgStartSubPacket (TCG_CREATE_STRUCT *CreateStruct, UINT16 Kind) |
TCG_RESULT EFIAPI | TcgEndSubPacket (TCG_CREATE_STRUCT *CreateStruct) |
TCG_RESULT EFIAPI | TcgEndPacket (TCG_CREATE_STRUCT *CreateStruct) |
TCG_RESULT EFIAPI | TcgEndComPacket (TCG_CREATE_STRUCT *CreateStruct, UINT32 *Size) |
TCG_RESULT EFIAPI | TcgAddRawByte (TCG_CREATE_STRUCT *CreateStruct, UINT8 Byte) |
TCG_RESULT EFIAPI | TcgAddByteSequence (TCG_CREATE_STRUCT *CreateStruct, const VOID *Data, UINT32 DataSize, BOOLEAN Continued) |
TCG_RESULT EFIAPI | TcgAddInteger (TCG_CREATE_STRUCT *CreateStruct, const VOID *Data, UINT32 DataSize, BOOLEAN SignedInteger) |
TCG_RESULT EFIAPI | TcgAddUINT8 (TCG_CREATE_STRUCT *CreateStruct, UINT8 Value) |
TCG_RESULT EFIAPI | TcgAddUINT16 (TCG_CREATE_STRUCT *CreateStruct, UINT16 Value) |
TCG_RESULT EFIAPI | TcgAddUINT32 (TCG_CREATE_STRUCT *CreateStruct, UINT32 Value) |
TCG_RESULT EFIAPI | TcgAddUINT64 (TCG_CREATE_STRUCT *CreateStruct, UINT64 Value) |
TCG_RESULT EFIAPI | TcgAddBOOLEAN (TCG_CREATE_STRUCT *CreateStruct, BOOLEAN Value) |
TCG_RESULT EFIAPI | TcgAddTcgUid (TCG_CREATE_STRUCT *CreateStruct, TCG_UID Uid) |
TCG_RESULT EFIAPI | TcgAddStartList (TCG_CREATE_STRUCT *CreateStruct) |
TCG_RESULT EFIAPI | TcgAddEndList (TCG_CREATE_STRUCT *CreateStruct) |
TCG_RESULT EFIAPI | TcgAddStartName (TCG_CREATE_STRUCT *CreateStruct) |
TCG_RESULT EFIAPI | TcgAddEndName (TCG_CREATE_STRUCT *CreateStruct) |
TCG_RESULT EFIAPI | TcgAddCall (TCG_CREATE_STRUCT *CreateStruct) |
TCG_RESULT EFIAPI | TcgAddEndOfData (TCG_CREATE_STRUCT *CreateStruct) |
TCG_RESULT EFIAPI | TcgAddEndOfSession (TCG_CREATE_STRUCT *CreateStruct) |
TCG_RESULT EFIAPI | TcgAddStartTransaction (TCG_CREATE_STRUCT *CreateStruct) |
TCG_RESULT EFIAPI | TcgAddEndTransaction (TCG_CREATE_STRUCT *CreateStruct) |
TCG_RESULT EFIAPI | TcgInitTcgParseStruct (TCG_PARSE_STRUCT *ParseStruct, const VOID *Buffer, UINT32 BufferSize) |
TCG_RESULT EFIAPI | TcgGetNextToken (TCG_PARSE_STRUCT *ParseStruct, TCG_TOKEN *TcgToken) |
TCG_RESULT EFIAPI | TcgGetNextTokenType (TCG_PARSE_STRUCT *ParseStruct, TCG_TOKEN_TYPE Type) |
TCG_RESULT EFIAPI | TcgGetAtomInfo (const TCG_TOKEN *TcgToken, UINT32 *HeaderLength, UINT32 *DataLength, UINT8 *ByteOrInt, UINT8 *SignOrCont) |
UINT8 *EFIAPI | TcgGetTokenByteSequence (const TCG_TOKEN *TcgToken, UINT32 *Length) |
TCG_RESULT EFIAPI | TcgGetTokenUINT64 (const TCG_TOKEN *TcgToken, UINT64 *Value) |
TCG_RESULT EFIAPI | TcgGetNextUINT8 (TCG_PARSE_STRUCT *ParseStruct, UINT8 *Value) |
TCG_RESULT EFIAPI | TcgGetNextUINT16 (TCG_PARSE_STRUCT *ParseStruct, UINT16 *Value) |
TCG_RESULT EFIAPI | TcgGetNextUINT32 (TCG_PARSE_STRUCT *ParseStruct, UINT32 *Value) |
TCG_RESULT EFIAPI | TcgGetNextUINT64 (TCG_PARSE_STRUCT *ParseStruct, UINT64 *Value) |
TCG_RESULT EFIAPI | TcgGetNextBOOLEAN (TCG_PARSE_STRUCT *ParseStruct, BOOLEAN *Value) |
TCG_RESULT EFIAPI | TcgGetNextTcgUid (TCG_PARSE_STRUCT *ParseStruct, TCG_UID *Uid) |
TCG_RESULT EFIAPI | TcgGetNextByteSequence (TCG_PARSE_STRUCT *ParseStruct, const VOID **Data, UINT32 *Length) |
TCG_RESULT EFIAPI | TcgGetNextStartList (TCG_PARSE_STRUCT *ParseStruct) |
TCG_RESULT EFIAPI | TcgGetNextEndList (TCG_PARSE_STRUCT *ParseStruct) |
TCG_RESULT EFIAPI | TcgGetNextStartName (TCG_PARSE_STRUCT *ParseStruct) |
TCG_RESULT EFIAPI | TcgGetNextEndName (TCG_PARSE_STRUCT *ParseStruct) |
TCG_RESULT EFIAPI | TcgGetNextCall (TCG_PARSE_STRUCT *ParseStruct) |
TCG_RESULT EFIAPI | TcgGetNextEndOfData (TCG_PARSE_STRUCT *ParseStruct) |
TCG_RESULT EFIAPI | TcgGetNextEndOfSession (TCG_PARSE_STRUCT *ParseStruct) |
TCG_RESULT EFIAPI | TcgGetNextStartTransaction (TCG_PARSE_STRUCT *ParseStruct) |
TCG_RESULT EFIAPI | TcgGetNextEndTransaction (TCG_PARSE_STRUCT *ParseStruct) |
TCG_RESULT EFIAPI | TcgStartMethodCall (TCG_CREATE_STRUCT *CreateStruct, TCG_UID InvokingId, TCG_UID MethodId) |
TCG_RESULT EFIAPI | TcgStartParameters (TCG_CREATE_STRUCT *CreateStruct) |
TCG_RESULT EFIAPI | TcgEndParameters (TCG_CREATE_STRUCT *CreateStruct) |
TCG_RESULT EFIAPI | TcgEndMethodCall (TCG_CREATE_STRUCT *CreateStruct) |
TCG_RESULT EFIAPI | TcgCreateStartSession (TCG_CREATE_STRUCT *CreateStruct, UINT32 *Size, UINT16 ComId, UINT16 ComIdExtension, UINT32 HostSessionId, TCG_UID SpId, BOOLEAN Write, UINT32 HostChallengeLength, const VOID *HostChallenge, TCG_UID HostSigningAuthority) |
TCG_RESULT EFIAPI | TcgCreateSetCPin (TCG_CREATE_STRUCT *CreateStruct, UINT32 *Size, UINT16 ComId, UINT16 ComIdExtension, UINT32 TperSession, UINT32 HostSession, TCG_UID SidRow, const VOID *Password, UINT32 PasswordSize) |
TCG_RESULT EFIAPI | TcgSetAuthorityEnabled (TCG_CREATE_STRUCT *CreateStruct, UINT32 *Size, UINT16 ComId, UINT16 ComIdExtension, UINT32 TperSession, UINT32 HostSession, TCG_UID AuthorityUid, BOOLEAN Enabled) |
TCG_RESULT EFIAPI | TcgCreateEndSession (TCG_CREATE_STRUCT *CreateStruct, UINT32 *Size, UINT16 ComId, UINT16 ComIdExtension, UINT32 HostSessionId, UINT32 TpSessionId) |
CHAR8 *EFIAPI | TcgTokenTypeString (TCG_TOKEN_TYPE Type) |
TCG_RESULT EFIAPI | TcgGetMethodStatus (const TCG_PARSE_STRUCT *ParseStruct, UINT8 *MethodStatus) |
CHAR8 *EFIAPI | TcgMethodStatusString (UINT8 MethodStatus) |
TCG_RESULT EFIAPI | TcgGetComIds (const TCG_PARSE_STRUCT *ParseStruct, UINT16 *ComId, UINT16 *ComIdExtension) |
TCG_RESULT EFIAPI | TcgCheckComIds (const TCG_PARSE_STRUCT *ParseStruct, UINT16 ExpectedComId, UINT16 ExpectedComIdExtension) |
TCG_RESULT EFIAPI | TcgParseSyncSession (const TCG_PARSE_STRUCT *ParseStruct, UINT16 ComId, UINT16 ComIdExtension, UINT32 HostSessionId, UINT32 *TperSessionId) |
TCG_RESULT EFIAPI | TcgCreateSetAce (TCG_CREATE_STRUCT *CreateStruct, UINT32 *Size, UINT16 ComId, UINT16 ComIdExtension, UINT32 TperSession, UINT32 HostSession, TCG_UID AceRow, TCG_UID Authority1, BOOLEAN LogicalOperator, TCG_UID Authority2) |
BOOLEAN EFIAPI | TcgEnumLevel0Discovery (const TCG_LEVEL0_DISCOVERY_HEADER *DiscoveryHeader, TCG_LEVEL0_ENUM_CALLBACK Callback, VOID *Context) |
TCG_LEVEL0_FEATURE_DESCRIPTOR_HEADER *EFIAPI | TcgGetFeature (const TCG_LEVEL0_DISCOVERY_HEADER *DiscoveryHeader, UINT16 FeatureCode, UINTN *FeatureSize) |
BOOLEAN EFIAPI | TcgIsProtocolSupported (const TCG_SUPPORTED_SECURITY_PROTOCOLS *ProtocolList, UINT16 Protocol) |
BOOLEAN EFIAPI | TcgIsLocked (const TCG_LEVEL0_DISCOVERY_HEADER *Discovery) |
Public API for the Tcg Core library to perform the lowest level TCG Data encoding.
(TCG Storage Architecture Core Specification, Version 2.01, Revision 1.00, https://trustedcomputinggroup.org/tcg-storage-architecture-core-specification/)
Check http://trustedcomputinggroup.org for latest specification updates.
Copyright (c) 2016 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file TcgStorageCoreLib.h.
#define ERROR_CHECK | ( | arg | ) |
Definition at line 19 of file TcgStorageCoreLib.h.
#define METHOD_STATUS_ERROR_CHECK | ( | arg, | |
failRet | |||
) |
Definition at line 28 of file TcgStorageCoreLib.h.
#define NULL_CHECK | ( | arg | ) |
Definition at line 34 of file TcgStorageCoreLib.h.
typedef BOOLEAN(EFIAPI * TCG_LEVEL0_ENUM_CALLBACK) (const TCG_LEVEL0_DISCOVERY_HEADER *DiscoveryHeader, TCG_LEVEL0_FEATURE_DESCRIPTOR_HEADER *Feature, UINTN FeatureSize, VOID *Context) |
Definition at line 919 of file TcgStorageCoreLib.h.
enum TCG_RESULT |
Tcg result codes.
The result code indicates if the Tcg function call was successful or not
Definition at line 49 of file TcgStorageCoreLib.h.
TCG_RESULT EFIAPI TcgAddBOOLEAN | ( | TCG_CREATE_STRUCT * | CreateStruct, |
BOOLEAN | Value | ||
) |
Adds a BOOLEAN to the Data structure.
[in/out] | CreateStruct Structure used to add the integer | |
[in] | Value | BOOLEAN Value to add |
Definition at line 672 of file TcgStorageCore.c.
TCG_RESULT EFIAPI TcgAddByteSequence | ( | TCG_CREATE_STRUCT * | CreateStruct, |
const VOID * | Data, | ||
UINT32 | DataSize, | ||
BOOLEAN | Continued | ||
) |
Adds the Data parameter as a byte sequence to the Data structure.
[in/out] | CreateStruct Structure used to add the byte sequence | |
[in] | Data | Byte sequence that will be encoded and copied into Data structure |
[in] | DataSize | Length of Data provided |
[in] | Continued | TRUE if byte sequence is continued or FALSE if the Data contains the entire byte sequence to be encoded |
Definition at line 529 of file TcgStorageCore.c.
TCG_RESULT EFIAPI TcgAddCall | ( | TCG_CREATE_STRUCT * | CreateStruct | ) |
Adds a Call token to the Data structure.
[in/out] | CreateStruct Structure used to add the token |
Add end call.
[in/out] | CreateStruct Structure used to add the integer |
return | the action result. |
Definition at line 777 of file TcgStorageCore.c.
TCG_RESULT EFIAPI TcgAddEndList | ( | TCG_CREATE_STRUCT * | CreateStruct | ) |
Adds an End List token to the Data structure.
[in/out] | CreateStruct Structure used to add the token |
Add end list.
[in/out] | CreateStruct Structure used to add the integer |
return | the action result. |
Definition at line 726 of file TcgStorageCore.c.
TCG_RESULT EFIAPI TcgAddEndName | ( | TCG_CREATE_STRUCT * | CreateStruct | ) |
Adds an End Name token to the Data structure.
[in/out] | CreateStruct Structure used to add the token |
Add end name.
[in/out] | CreateStruct Structure used to add the integer |
return | the action result. |
Definition at line 760 of file TcgStorageCore.c.
TCG_RESULT EFIAPI TcgAddEndOfData | ( | TCG_CREATE_STRUCT * | CreateStruct | ) |
Adds an End of Data token to the Data structure.
[in/out] | CreateStruct Structure used to add the token |
Add end of data.
[in/out] | CreateStruct Structure used to add the integer |
return | the action result. |
Definition at line 794 of file TcgStorageCore.c.
TCG_RESULT EFIAPI TcgAddEndOfSession | ( | TCG_CREATE_STRUCT * | CreateStruct | ) |
Adds an End of Session token to the Data structure.
[in/out] | CreateStruct Structure used to add the token |
Add end of session.
[in/out] | CreateStruct Structure used to add the integer |
return | the action result. |
Definition at line 811 of file TcgStorageCore.c.
TCG_RESULT EFIAPI TcgAddEndTransaction | ( | TCG_CREATE_STRUCT * | CreateStruct | ) |
Adds an End Transaction token to the Data structure.
[in/out] | CreateStruct Structure used to add the token |
Add end transaction.
[in/out] | CreateStruct Structure used to add the integer |
return | the action result. |
Definition at line 845 of file TcgStorageCore.c.
TCG_RESULT EFIAPI TcgAddInteger | ( | TCG_CREATE_STRUCT * | CreateStruct, |
const VOID * | Data, | ||
UINT32 | DataSize, | ||
BOOLEAN | SignedInteger | ||
) |
Adds an arbitrary-Length integer to the Data structure.
The integer will be encoded using the shortest possible atom.
[in/out] | CreateStruct Structure used to add the integer | |
[in] | Data | Integer in host byte order that will be encoded and copied into Data structure |
[in] | DataSize | Length in bytes of the Data provided |
[in] | SignedInteger | TRUE if the integer is signed or FALSE if the integer is unsigned |
Definition at line 552 of file TcgStorageCore.c.
TCG_RESULT EFIAPI TcgAddRawByte | ( | TCG_CREATE_STRUCT * | CreateStruct, |
UINT8 | Byte | ||
) |
Adds a single raw token byte to the Data structure.
[in/out] | CreateStruct Structure used to add the byte | |
[in] | Byte | Byte to add |
Definition at line 422 of file TcgStorageCore.c.
TCG_RESULT EFIAPI TcgAddStartList | ( | TCG_CREATE_STRUCT * | CreateStruct | ) |
Adds a Start List token to the Data structure.
[in/out] | CreateStruct Structure used to add the token |
Add start list.
[in/out] | CreateStruct Structure used to add the integer |
return | the action result. |
Definition at line 709 of file TcgStorageCore.c.
TCG_RESULT EFIAPI TcgAddStartName | ( | TCG_CREATE_STRUCT * | CreateStruct | ) |
Adds a Start Name token to the Data structure.
[in/out] | CreateStruct Structure used to add the token |
Add start name.
[in/out] | CreateStruct Structure used to add the integer |
return | the action result. |
Definition at line 743 of file TcgStorageCore.c.
TCG_RESULT EFIAPI TcgAddStartTransaction | ( | TCG_CREATE_STRUCT * | CreateStruct | ) |
Adds a Start Transaction token to the Data structure.
[in/out] | CreateStruct Structure used to add the token |
Add start transaction.
[in/out] | CreateStruct Structure used to add the integer |
return | the action result. |
Definition at line 828 of file TcgStorageCore.c.
TCG_RESULT EFIAPI TcgAddTcgUid | ( | TCG_CREATE_STRUCT * | CreateStruct, |
TCG_UID | Uid | ||
) |
Add tcg uid info.
[in/out] | CreateStruct Structure used to add the integer |
Uid | Input uid info. |
return | the action result. |
Definition at line 691 of file TcgStorageCore.c.
TCG_RESULT EFIAPI TcgAddUINT16 | ( | TCG_CREATE_STRUCT * | CreateStruct, |
UINT16 | Value | ||
) |
Adds a 16-bit unsigned integer to the Data structure.
[in/out] | CreateStruct Structure used to add the integer | |
[in] | Value | Integer Value to add |
Definition at line 619 of file TcgStorageCore.c.
TCG_RESULT EFIAPI TcgAddUINT32 | ( | TCG_CREATE_STRUCT * | CreateStruct, |
UINT32 | Value | ||
) |
Adds a 32-bit unsigned integer to the Data structure.
[in/out] | CreateStruct Structure used to add the integer | |
[in] | Value | Integer Value to add |
Definition at line 637 of file TcgStorageCore.c.
TCG_RESULT EFIAPI TcgAddUINT64 | ( | TCG_CREATE_STRUCT * | CreateStruct, |
UINT64 | Value | ||
) |
Adds a 64-bit unsigned integer to the Data structure.
[in/out] | CreateStruct Structure used to add the integer | |
[in] | Value | Integer Value to add |
Definition at line 655 of file TcgStorageCore.c.
TCG_RESULT EFIAPI TcgAddUINT8 | ( | TCG_CREATE_STRUCT * | CreateStruct, |
UINT8 | Value | ||
) |
Adds an 8-bit unsigned integer to the Data structure.
[in/out] | CreateStruct Structure used to add the integer | |
[in] | Value | Integer Value to add |
Definition at line 601 of file TcgStorageCore.c.
TCG_RESULT EFIAPI TcgCheckComIds | ( | const TCG_PARSE_STRUCT * | ParseStruct, |
UINT16 | ExpectedComId, | ||
UINT16 | ExpectedComIdExtension | ||
) |
Checks if the ComIDs of the response match the expected values.
[in] | ParseStruct | Structure used to parse received TCG response |
[in] | ExpectedComId | Expected comID |
[in] | ExpectedComIdExtension | Expected extended comID |
Definition at line 224 of file TcgStorageUtil.c.
TCG_RESULT EFIAPI TcgCreateEndSession | ( | TCG_CREATE_STRUCT * | CreateStruct, |
UINT32 * | Size, | ||
UINT16 | ComId, | ||
UINT16 | ComIdExtension, | ||
UINT32 | HostSessionId, | ||
UINT32 | TpSessionId | ||
) |
Creates ComPacket with EndSession. This assumes a start session has already been opened.
[in/out] | CreateStruct Structure used to add Endsession | |
[in/out] | Size Describes the size of the entire ComPacket (header and payload). Filled out by function. | |
[in] | ComId | ComID for the ComPacket |
[in] | ComIdExtension | Extended ComID for the ComPacket |
[in] | HostSessionId | Host Session ID for the Packet |
[in] | TpSessionId | Tper Session ID for the Packet |
Definition at line 493 of file TcgStorageUtil.c.
TCG_RESULT EFIAPI TcgCreateSetAce | ( | TCG_CREATE_STRUCT * | CreateStruct, |
UINT32 * | Size, | ||
UINT16 | ComId, | ||
UINT16 | ComIdExtension, | ||
UINT32 | TperSession, | ||
UINT32 | HostSession, | ||
TCG_UID | AceRow, | ||
TCG_UID | Authority1, | ||
BOOLEAN | LogicalOperator, | ||
TCG_UID | Authority2 | ||
) |
Create set ace.
CreateStruct | Input create structure. |
Size | size info. |
ComId | ComId info. |
ComIdExtension | ComId extension info. |
TperSession | Tper session data. |
HostSession | Host session data. |
AceRow | Ace row info. |
Authority1 | Authority 1 info. |
LogicalOperator | Logical operator info. |
Authority2 | Authority 2 info. |
Return | the action result. |
Definition at line 659 of file TcgStorageUtil.c.
TCG_RESULT EFIAPI TcgCreateSetCPin | ( | TCG_CREATE_STRUCT * | CreateStruct, |
UINT32 * | Size, | ||
UINT16 | ComId, | ||
UINT16 | ComIdExtension, | ||
UINT32 | TperSession, | ||
UINT32 | HostSession, | ||
TCG_UID | SidRow, | ||
const VOID * | Password, | ||
UINT32 | PasswordSize | ||
) |
Creates ComPacket with a Method call that sets the PIN column for the row specified. This assumes a start session has already been opened with the desired SP.
[in/out] | CreateStruct Structure used to add method call. | |
[in/out] | Size Describes the size of the entire ComPacket (header and payload). Filled out by function. | |
[in] | ComId | ComID for the ComPacket |
[in] | ComIdExtension | Extended ComID for the ComPacket |
[in] | TperSession | Tper Session ID for the Packet |
[in] | HostSession | Host Session ID for the Packet |
[in] | SidRow | UID of row of current SP to set PIN column |
[in] | Password | value of PIN to set |
[in] | PasswordSize | Size of PIN |
Definition at line 576 of file TcgStorageUtil.c.
TCG_RESULT EFIAPI TcgCreateStartSession | ( | TCG_CREATE_STRUCT * | CreateStruct, |
UINT32 * | Size, | ||
UINT16 | ComId, | ||
UINT16 | ComIdExtension, | ||
UINT32 | HostSessionId, | ||
TCG_UID | SpId, | ||
BOOLEAN | Write, | ||
UINT32 | HostChallengeLength, | ||
const VOID * | HostChallenge, | ||
TCG_UID | HostSigningAuthority | ||
) |
Adds Start Session call to the data structure. This creates the entire ComPacket structure and returns the size of the entire compacket in the size parameter.
[in/out] | CreateStruct Structure used to add the start session call | |
[in/out] | Size Describes the size of the entire ComPacket (header and payload). Filled out by function. | |
[in] | ComId | ComID for the ComPacket |
[in] | ComIdExtension | Extended ComID for the ComPacket |
[in] | HostSessionId | Host Session ID |
[in] | SpId | Security Provider to start session with |
[in] | Write | Write option for start session. TRUE = start session requests write access |
[in] | HostChallengeLength | Length of the host challenge. Length should be 0 if hostChallenge is NULL |
[in] | HostChallenge | Host challenge for Host Signing Authority. If NULL, then no Host Challenge shall be sent. |
[in] | HostSigningAuthority | Host Signing Authority used for start session. If NULL, then no Host Signing Authority shall be sent. |
Definition at line 358 of file TcgStorageUtil.c.
TCG_RESULT EFIAPI TcgEndComPacket | ( | TCG_CREATE_STRUCT * | CreateStruct, |
UINT32 * | Size | ||
) |
Ends the ComPacket in the Data structure and ret
[in/out] | CreateStruct Structure used to end the Tcg ComPacket |
[in/out] | Size Describes the Size of the entire ComPacket (Header and payload). Filled out by function. |
Definition at line 299 of file TcgStorageCore.c.
TCG_RESULT EFIAPI TcgEndMethodCall | ( | TCG_CREATE_STRUCT * | CreateStruct | ) |
Adds END Data token and method list.
CreateStruct | The input create structure. |
Definition at line 156 of file TcgStorageUtil.c.
TCG_RESULT EFIAPI TcgEndPacket | ( | TCG_CREATE_STRUCT * | CreateStruct | ) |
Ends the current Packet in the Data structure.
[in/out] | CreateStruct Structure used to end the current Tcg Packet |
Definition at line 269 of file TcgStorageCore.c.
TCG_RESULT EFIAPI TcgEndParameters | ( | TCG_CREATE_STRUCT * | CreateStruct | ) |
Adds END LIST token.
CreateStruct | The input create structure. |
Definition at line 130 of file TcgStorageUtil.c.
TCG_RESULT EFIAPI TcgEndSubPacket | ( | TCG_CREATE_STRUCT * | CreateStruct | ) |
Ends the current SubPacket in the Data structure. This function will also perform the 4-byte padding required for Subpackets.
[in/out] | CreateStruct Structure used to end the current Tcg SubPacket |
Definition at line 220 of file TcgStorageCore.c.
BOOLEAN EFIAPI TcgEnumLevel0Discovery | ( | const TCG_LEVEL0_DISCOVERY_HEADER * | DiscoveryHeader, |
TCG_LEVEL0_ENUM_CALLBACK | Callback, | ||
VOID * | Context | ||
) |
Enum level 0 discovery.
DiscoveryHeader | Discovery header. |
Callback | Callback function. |
Context | The context for the function. |
return | true if the callback return TRUE, else return FALSE. |
Definition at line 723 of file TcgStorageUtil.c.
TCG_RESULT EFIAPI TcgGetAtomInfo | ( | const TCG_TOKEN * | TcgToken, |
UINT32 * | HeaderLength, | ||
UINT32 * | DataLength, | ||
UINT8 * | ByteOrInt, | ||
UINT8 * | SignOrCont | ||
) |
Get atom info.
TcgToken | Input token info. |
HeaderLength | return the header length. |
DataLength | return the data length. |
ByteOrInt | return the atom Type. |
SignOrCont | return the sign or count info. |
return | the action result. |
Definition at line 1101 of file TcgStorageCore.c.
TCG_RESULT EFIAPI TcgGetComIds | ( | const TCG_PARSE_STRUCT * | ParseStruct, |
UINT16 * | ComId, | ||
UINT16 * | ComIdExtension | ||
) |
Retrieves the comID and Extended comID of the ComPacket in the Tcg response. It is intended to be used to confirm the received Tcg response is intended for user that received it.
[in] | ParseStruct | Structure used to parse received TCG response. |
[in/out] | ComId comID retrieved from received ComPacket. | |
[in/out] | ComIdExtension Extended comID retrieved from received ComPacket |
Definition at line 193 of file TcgStorageUtil.c.
TCG_LEVEL0_FEATURE_DESCRIPTOR_HEADER *EFIAPI TcgGetFeature | ( | const TCG_LEVEL0_DISCOVERY_HEADER * | DiscoveryHeader, |
UINT16 | FeatureCode, | ||
UINTN * | FeatureSize | ||
) |
Get Feature code from the header.
DiscoveryHeader | The discovery header. |
FeatureCode | return the Feature code. |
FeatureSize | return the Feature size. |
return | the Feature code data. |
Definition at line 829 of file TcgStorageUtil.c.
TCG_RESULT EFIAPI TcgGetMethodStatus | ( | const TCG_PARSE_STRUCT * | ParseStruct, |
UINT8 * | MethodStatus | ||
) |
Returns the method status of the current subpacket. Does not affect the current position in the ComPacket. In other words, it can be called whenever you have a valid SubPacket.
[in/out] | ParseStruct Structure used to parse received TCG response |
[in/out] | MethodStatus Method status retrieved of the current SubPacket |
Definition at line 253 of file TcgStorageUtil.c.
TCG_RESULT EFIAPI TcgGetNextBOOLEAN | ( | TCG_PARSE_STRUCT * | ParseStruct, |
BOOLEAN * | Value | ||
) |
Get next specify value.
ParseStruct | Input parse structure. |
Value | Return value. |
return | the action result. |
Definition at line 1403 of file TcgStorageCore.c.
TCG_RESULT EFIAPI TcgGetNextByteSequence | ( | TCG_PARSE_STRUCT * | ParseStruct, |
const VOID ** | Data, | ||
UINT32 * | Length | ||
) |
Get next byte sequence.
ParseStruct | Input parse structure. |
Data | return the data. |
Length | return the length. |
return | the action result. |
Definition at line 1474 of file TcgStorageCore.c.
TCG_RESULT EFIAPI TcgGetNextCall | ( | TCG_PARSE_STRUCT * | ParseStruct | ) |
Get next call.
ParseStruct | Input parse structure. |
return | the action result. |
Definition at line 1599 of file TcgStorageCore.c.
TCG_RESULT EFIAPI TcgGetNextEndList | ( | TCG_PARSE_STRUCT * | ParseStruct | ) |
Get next end list.
ParseStruct | Input parse structure. |
return | the action result. |
Definition at line 1548 of file TcgStorageCore.c.
TCG_RESULT EFIAPI TcgGetNextEndName | ( | TCG_PARSE_STRUCT * | ParseStruct | ) |
Get next end name.
ParseStruct | Input parse structure. |
return | the action result. |
Definition at line 1582 of file TcgStorageCore.c.
TCG_RESULT EFIAPI TcgGetNextEndOfData | ( | TCG_PARSE_STRUCT * | ParseStruct | ) |
Get next end data.
ParseStruct | Input parse structure. |
return | the action result. |
Definition at line 1616 of file TcgStorageCore.c.
TCG_RESULT EFIAPI TcgGetNextEndOfSession | ( | TCG_PARSE_STRUCT * | ParseStruct | ) |
Get next end of session.
ParseStruct | Input parse structure. |
return | the action result. |
Definition at line 1633 of file TcgStorageCore.c.
TCG_RESULT EFIAPI TcgGetNextEndTransaction | ( | TCG_PARSE_STRUCT * | ParseStruct | ) |
Get next end transaction.
ParseStruct | Input parse structure. |
return | the action result. |
Definition at line 1667 of file TcgStorageCore.c.
TCG_RESULT EFIAPI TcgGetNextStartList | ( | TCG_PARSE_STRUCT * | ParseStruct | ) |
Get next start list.
ParseStruct | Input parse structure. |
return | the action result. |
Definition at line 1531 of file TcgStorageCore.c.
TCG_RESULT EFIAPI TcgGetNextStartName | ( | TCG_PARSE_STRUCT * | ParseStruct | ) |
Get next start name.
ParseStruct | Input parse structure. |
return | the action result. |
Definition at line 1565 of file TcgStorageCore.c.
TCG_RESULT EFIAPI TcgGetNextStartTransaction | ( | TCG_PARSE_STRUCT * | ParseStruct | ) |
Get next start transaction.
ParseStruct | Input parse structure. |
return | the action result. |
Definition at line 1650 of file TcgStorageCore.c.
TCG_RESULT EFIAPI TcgGetNextTcgUid | ( | TCG_PARSE_STRUCT * | ParseStruct, |
TCG_UID * | Uid | ||
) |
Get next tcg uid info.
ParseStruct | Input parse structure. |
Uid | Get the uid info. |
return | the action result. |
Definition at line 1436 of file TcgStorageCore.c.
TCG_RESULT EFIAPI TcgGetNextToken | ( | TCG_PARSE_STRUCT * | ParseStruct, |
TCG_TOKEN * | TcgToken | ||
) |
Get next token info.
ParseStruct | Input parse structure info. |
TcgToken | return the tcg token info. |
return | the action result. |
Definition at line 933 of file TcgStorageCore.c.
TCG_RESULT EFIAPI TcgGetNextTokenType | ( | TCG_PARSE_STRUCT * | ParseStruct, |
TCG_TOKEN_TYPE | Type | ||
) |
Get next token Type.
ParseStruct | Input parse structure. |
Type | Input the type need to check. |
return | the action result. |
Definition at line 1505 of file TcgStorageCore.c.
TCG_RESULT EFIAPI TcgGetNextUINT16 | ( | TCG_PARSE_STRUCT * | ParseStruct, |
UINT16 * | Value | ||
) |
Get next specify value.
ParseStruct | Input parse structure. |
Value | Return value. |
return | the action result. |
Definition at line 1314 of file TcgStorageCore.c.
TCG_RESULT EFIAPI TcgGetNextUINT32 | ( | TCG_PARSE_STRUCT * | ParseStruct, |
UINT32 * | Value | ||
) |
Get next specify value.
ParseStruct | Input parse structure. |
Value | Return value. |
return | the action result. |
Definition at line 1347 of file TcgStorageCore.c.
TCG_RESULT EFIAPI TcgGetNextUINT64 | ( | TCG_PARSE_STRUCT * | ParseStruct, |
UINT64 * | Value | ||
) |
Get next specify value.
ParseStruct | Input parse structure. |
Value | Return value. |
return | the action result. |
Definition at line 1380 of file TcgStorageCore.c.
TCG_RESULT EFIAPI TcgGetNextUINT8 | ( | TCG_PARSE_STRUCT * | ParseStruct, |
UINT8 * | Value | ||
) |
Get next specify value.
ParseStruct | Input parse structure. |
Value | Return value. |
return | the action result. |
Definition at line 1281 of file TcgStorageCore.c.
UINT8 *EFIAPI TcgGetTokenByteSequence | ( | const TCG_TOKEN * | TcgToken, |
UINT32 * | Length | ||
) |
Get token byte sequence.
TcgToken | Input token info. |
Length | Input the length info. |
Return | the value data. |
Definition at line 1243 of file TcgStorageCore.c.
TCG_RESULT EFIAPI TcgGetTokenUINT64 | ( | const TCG_TOKEN * | TcgToken, |
UINT64 * | Value | ||
) |
Get token specified value.
TcgToken | Input token info. |
Value | return the value. |
return | the action result. |
Definition at line 1180 of file TcgStorageCore.c.
TCG_RESULT EFIAPI TcgInitTcgCreateStruct | ( | TCG_CREATE_STRUCT * | CreateStruct, |
VOID * | Buffer, | ||
UINT32 | BufferSize | ||
) |
Required to be called before calling any other Tcg functions with the TCG_CREATE_STRUCT. Initializes the packet variables to NULL. Additionally, the buffer will be memset.
[in/out] | CreateStruct Structure to initialize | |
[in] | Buffer | Buffer allocated by client of library. It will contain the Tcg encoded packet. This cannot be null. |
[in] | BufferSize | Size of buffer provided. It cannot be 0. |
Required to be called before calling any other Tcg functions with the TCG_CREATE_STRUCT. Initializes the packet variables to NULL. Additionally, the buffer will be memset.
[in/out] | CreateStruct Structure to initialize | |
[in] | Buffer | Buffer allocated by client of library. It will contain the Tcg encoded packet. This cannot be null. |
[in] | BufferSize | Size of buffer provided. It cannot be 0. |
Return | the action result. |
Definition at line 28 of file TcgStorageCore.c.
TCG_RESULT EFIAPI TcgInitTcgParseStruct | ( | TCG_PARSE_STRUCT * | ParseStruct, |
const VOID * | Buffer, | ||
UINT32 | BufferSize | ||
) |
Initial the tcg parse structure.
ParseStruct | Input parse structure. |
Buffer | Input buffer data. |
BufferSize | Input buffer size. |
return | the action result. |
Definition at line 864 of file TcgStorageCore.c.
BOOLEAN EFIAPI TcgIsLocked | ( | const TCG_LEVEL0_DISCOVERY_HEADER * | Discovery | ) |
Determines if the Locking Feature "Locked" bit is set in the level 0 discovery response.
[in] | Discovery | Level 0 discovery response |
Check whether lock or not.
Discovery |
TRUE | if lock, FALSE if not lock. |
Definition at line 892 of file TcgStorageUtil.c.
BOOLEAN EFIAPI TcgIsProtocolSupported | ( | const TCG_SUPPORTED_SECURITY_PROTOCOLS * | ProtocolList, |
UINT16 | Protocol | ||
) |
Determines if the protocol provided is part of the provided supported protocol list.
[in] | ProtocolList | Supported protocol list to investigate |
[in] | Protocol | Protocol value to determine if supported |
Definition at line 859 of file TcgStorageUtil.c.
CHAR8 *EFIAPI TcgMethodStatusString | ( | UINT8 | MethodStatus | ) |
Returns a human-readable string representing a method status return code.
[in] | MethodStatus | Method status to translate to a string |
return | the string info. |
Definition at line 31 of file TcgStorageUtil.c.
TCG_RESULT EFIAPI TcgParseSyncSession | ( | const TCG_PARSE_STRUCT * | ParseStruct, |
UINT16 | ComId, | ||
UINT16 | ComIdExtension, | ||
UINT32 | HostSessionId, | ||
UINT32 * | TperSessionId | ||
) |
Parses the Sync Session response contained in the parseStruct to retrieve Tper session ID. If the Sync Session response parameters do not match the comID, extended ComID and host session ID then a failure is returned.
[in/out] | ParseStruct Structure used to parse received TCG response, contains Sync Session response. | |
[in] | ComId | Expected ComID that is compared to actual ComID of response |
[in] | ComIdExtension | Expected Extended ComID that is compared to actual Extended ComID of response |
[in] | HostSessionId | Expected Host Session ID that is compared to actual Host Session ID of response |
[in/out] | TperSessionId Tper Session ID retrieved from the Sync Session response. |
Definition at line 418 of file TcgStorageUtil.c.
TCG_RESULT EFIAPI TcgSetAuthorityEnabled | ( | TCG_CREATE_STRUCT * | CreateStruct, |
UINT32 * | Size, | ||
UINT16 | ComId, | ||
UINT16 | ComIdExtension, | ||
UINT32 | TperSession, | ||
UINT32 | HostSession, | ||
TCG_UID | AuthorityUid, | ||
BOOLEAN | Enabled | ||
) |
Creates ComPacket with a Method call that sets the "Enabled" column for the row specified using the value specified. This assumes a start session has already been opened with the desired SP.
[in/out] | CreateStruct Structure used to add method call | |
[in/out] | Size Describes the size of the entire ComPacket (header and payload). Filled out by function. | |
[in] | ComId | ComID for the ComPacket |
[in] | ComIdExtension | Extended ComID for the ComPacket |
[in] | TperSession | Tper Session ID for the Packet |
[in] | HostSession | Host Session ID for the Packet |
[in] | AuthorityUid | Authority UID to modify the "Enabled" column for |
[in] | Enabled | Value to set the "Enabled" column to |
Definition at line 617 of file TcgStorageUtil.c.
TCG_RESULT EFIAPI TcgStartComPacket | ( | TCG_CREATE_STRUCT * | CreateStruct, |
UINT16 | ComId, | ||
UINT16 | ComIdExtension | ||
) |
Encodes the ComPacket header to the data structure.
[in/out] | CreateStruct Structure to initialize | |
[in] | ComId | ComID of the Tcg ComPacket. |
[in] | ComIdExtension | ComID Extension of the Tcg ComPacket. |
Definition at line 63 of file TcgStorageCore.c.
TCG_RESULT EFIAPI TcgStartMethodCall | ( | TCG_CREATE_STRUCT * | CreateStruct, |
TCG_UID | InvokingId, | ||
TCG_UID | MethodId | ||
) |
Adds call token and method Header (invoking id, and method id).
CreateStruct | The input create structure. |
InvokingId | Invoking id. |
MethodId | Method id. |
adds call token and method Header (invoking id, and method id).
CreateStruct | The input create structure. |
InvokingId | Invoking id. |
MethodId | Method id. |
Definition at line 72 of file TcgStorageUtil.c.
TCG_RESULT EFIAPI TcgStartPacket | ( | TCG_CREATE_STRUCT * | CreateStruct, |
UINT32 | Tsn, | ||
UINT32 | Hsn, | ||
UINT32 | SeqNumber, | ||
UINT16 | AckType, | ||
UINT32 | Ack | ||
) |
Starts a new ComPacket in the Data structure.
[in/out] | CreateStruct Structure used to add Tcg Packet | |
[in] | Tsn | Packet Tper session number |
[in] | Hsn | Packet Host session number |
[in] | SeqNumber | Packet Sequence Number |
[in] | AckType | Packet Acknowledge Type |
[in] | Ack | Packet Acknowledge |
Definition at line 112 of file TcgStorageCore.c.
TCG_RESULT EFIAPI TcgStartParameters | ( | TCG_CREATE_STRUCT * | CreateStruct | ) |
Adds START LIST token.
CreateStruct | The input create structure. |
Definition at line 104 of file TcgStorageUtil.c.
TCG_RESULT EFIAPI TcgStartSubPacket | ( | TCG_CREATE_STRUCT * | CreateStruct, |
UINT16 | Kind | ||
) |
Starts a new SubPacket in the Data structure.
[in/out] | CreateStruct Structure used to start Tcg SubPacket | |
[in] | Kind | SubPacket kind |
Definition at line 170 of file TcgStorageCore.c.
CHAR8 *EFIAPI TcgTokenTypeString | ( | TCG_TOKEN_TYPE | Type | ) |
Retrieves human-readable token type name.
[in] | Type | Token type to retrieve |
Return the toke type string info.
Type | Input the type info. |
Return | the string for this type. |
Definition at line 314 of file TcgStorageUtil.c.