esys_types.h
/* SPDX-License-Identifier: BSD-2-Clause */
/*******************************************************************************
* Copyright 2017-2018, Fraunhofer SIT sponsored by Infineon Technologies AG
* All rights reserved.
*******************************************************************************/
#ifndef ESYS_TYPES_H
#define ESYS_TYPES_H
#define ESYS_MAX_SIZE_METADATA 3072
typedef UINT32 TSS2_ESYS_RC;
#ifndef TSS2_RC_SUCCESS
#define TSS2_RC_SUCCESS 0
#endif
typedef UINT32 IESYSC_RESOURCE_TYPE_CONSTANT;
#define IESYSC_KEY_RSRC 1
#define IESYSC_NV_RSRC 2
#define IESYSC_SESSION_RSRC 3
#define IESYSC_DEGRADED_SESSION_RSRC 4
#define IESYSC_WITHOUT_MISC_RSRC 0
typedef UINT32 IESYSC_PARAM_ENCRYPT;
#define ENCRYPT 1
#define NO_ENCRYPT 0
typedef UINT32 IESYSC_PARAM_DECRYPT;
#define DECRYPT 1
#define NO_DECRYPT 0
typedef UINT32 IESYSC_TYPE_POLICY_AUTH;
#define POLICY_PASSWORD 2
#define POLICY_AUTH 1
#define NO_POLICY_AUTH 0
typedef struct {
TPM2B_NAME bound_entity;
TPM2B_ENCRYPTED_SECRET encryptedSalt;
TPM2B_DATA salt;
TPMT_SYM_DEF symmetric;
TPMI_ALG_HASH authHash;
TPM2B_DIGEST sessionKey;
TPM2_SE sessionType;
TPMA_SESSION sessionAttributes;
TPMA_SESSION origSessionAttributes;
TPM2B_NONCE nonceCaller;
TPM2B_NONCE nonceTPM;
IESYSC_PARAM_ENCRYPT encrypt;
IESYSC_PARAM_DECRYPT decrypt;
IESYSC_TYPE_POLICY_AUTH type_policy_session;
UINT16 sizeSessionValue;
BYTE sessionValue [2*sizeof(TPMU_HA)];
UINT16 sizeHmacValue;
} IESYS_SESSION;
typedef UINT32 IESYSC_RESOURCE_TYPE;
typedef union {
TPM2B_PUBLIC rsrc_key_pub;
TPM2B_NV_PUBLIC rsrc_nv_pub;
IESYS_SESSION rsrc_session;
TPMS_EMPTY rsrc_empty;
} IESYS_RSRC_UNION;
typedef struct {
TPM2_HANDLE handle;
TPM2B_NAME name;
IESYSC_RESOURCE_TYPE rsrcType;
IESYS_RSRC_UNION misc;
} IESYS_RESOURCE;
typedef struct {
UINT16 size;
IESYS_RESOURCE data;
} IESYS_METADATA;
typedef struct {
UINT32 reserved;
TPM2B_CONTEXT_DATA tpmContext;
IESYS_METADATA esysMetadata;
} IESYS_CONTEXT_DATA;
#endif /* ESYS_TYPES_H */
IESYS_RESOURCE::handle
TPM2_HANDLE handle
Definition esys_types.h:87
IESYS_SESSION::sessionType
TPM2_SE sessionType
Definition esys_types.h:58
IESYS_SESSION::type_policy_session
IESYSC_TYPE_POLICY_AUTH type_policy_session
Definition esys_types.h:65
IESYS_SESSION::decrypt
IESYSC_PARAM_DECRYPT decrypt
Definition esys_types.h:64
IESYS_SESSION::origSessionAttributes
TPMA_SESSION origSessionAttributes
Definition esys_types.h:60
IESYS_SESSION::sizeSessionValue
UINT16 sizeSessionValue
Definition esys_types.h:66
IESYS_SESSION::bound_entity
TPM2B_NAME bound_entity
Definition esys_types.h:52
IESYS_SESSION::encrypt
IESYSC_PARAM_ENCRYPT encrypt
Definition esys_types.h:63
IESYS_CONTEXT_DATA::reserved
UINT32 reserved
Definition esys_types.h:104
IESYS_SESSION::sessionAttributes
TPMA_SESSION sessionAttributes
Definition esys_types.h:59
IESYS_SESSION::symmetric
TPMT_SYM_DEF symmetric
Definition esys_types.h:55
IESYS_RESOURCE::rsrcType
IESYSC_RESOURCE_TYPE rsrcType
Definition esys_types.h:89
IESYS_SESSION::authHash
TPMI_ALG_HASH authHash
Definition esys_types.h:56
IESYS_RSRC_UNION::rsrc_nv_pub
TPM2B_NV_PUBLIC rsrc_nv_pub
Definition esys_types.h:79
IESYS_SESSION::sessionValue
BYTE sessionValue[2 *sizeof(TPMU_HA)]
Definition esys_types.h:67
IESYS_METADATA::size
UINT16 size
Definition esys_types.h:96
IESYS_RSRC_UNION::rsrc_key_pub
TPM2B_PUBLIC rsrc_key_pub
Definition esys_types.h:78
IESYS_SESSION::sessionKey
TPM2B_DIGEST sessionKey
Definition esys_types.h:57
IESYS_RSRC_UNION::rsrc_empty
TPMS_EMPTY rsrc_empty
Definition esys_types.h:81
IESYS_RESOURCE::name
TPM2B_NAME name
Definition esys_types.h:88
IESYS_SESSION::nonceCaller
TPM2B_NONCE nonceCaller
Definition esys_types.h:61
IESYS_SESSION::nonceTPM
TPM2B_NONCE nonceTPM
Definition esys_types.h:62
IESYS_CONTEXT_DATA::tpmContext
TPM2B_CONTEXT_DATA tpmContext
Definition esys_types.h:105
IESYS_SESSION::sizeHmacValue
UINT16 sizeHmacValue
Definition esys_types.h:68
IESYS_RSRC_UNION::rsrc_session
IESYS_SESSION rsrc_session
Definition esys_types.h:80
IESYS_CONTEXT_DATA::esysMetadata
IESYS_METADATA esysMetadata
Definition esys_types.h:106
IESYS_METADATA::data
IESYS_RESOURCE data
Definition esys_types.h:97
IESYS_RESOURCE::misc
IESYS_RSRC_UNION misc
Definition esys_types.h:90
IESYS_SESSION::encryptedSalt
TPM2B_ENCRYPTED_SECRET encryptedSalt
Definition esys_types.h:53
IESYS_SESSION::salt
TPM2B_DATA salt
Definition esys_types.h:54
IESYSC_TYPE_POLICY_AUTH
UINT32 IESYSC_TYPE_POLICY_AUTH
Definition esys_types.h:43
IESYSC_PARAM_ENCRYPT
UINT32 IESYSC_PARAM_ENCRYPT
Definition esys_types.h:31
IESYSC_PARAM_DECRYPT
UINT32 IESYSC_PARAM_DECRYPT
Definition esys_types.h:37
IESYSC_RESOURCE_TYPE
UINT32 IESYSC_RESOURCE_TYPE
Definition esys_types.h:73
IESYSC_RESOURCE_TYPE_CONSTANT
UINT32 IESYSC_RESOURCE_TYPE_CONSTANT
Definition esys_types.h:22
IESYS_CONTEXT_DATA
Definition esys_types.h:103
IESYS_METADATA
Definition esys_types.h:95
IESYS_RESOURCE
Definition esys_types.h:86
IESYS_SESSION
Definition esys_types.h:51
IESYS_RSRC_UNION
Definition esys_types.h:77