ifapi_policy_types.h
/* SPDX-License-Identifier: BSD-2-Clause */
/*******************************************************************************
* Copyright 2018-2019, Fraunhofer SIT sponsored by Infineon Technologies AG
* All rights reserved.
******************************************************************************/
#ifndef IFAPI_POLICY_TYPES_H
#define IFAPI_POLICY_TYPES_H
#include "tss2_tpm2_types.h"
#include "fapi_types.h"
typedef UINT32 TPMI_POLICYTYPE;
#define POLICYELEMENTS 0
#define POLICYOR 1
#define POLICYSIGNED 2
#define POLICYSECRET 3
#define POLICYPCR 4
#define POLICYLOCALITY 5
#define POLICYNV 6
#define POLICYCOUNTERTIMER 7
#define POLICYCOMMANDCODE 8
#define POLICYPHYSICALPRESENCE 9
#define POLICYCPHASH 10
#define POLICYNAMEHASH 11
#define POLICYDUPLICATIONSELECT 12
#define POLICYAUTHORIZE 13
#define POLICYAUTHVALUE 14
#define POLICYPASSWORD 15
#define POLICYNVWRITTEN 16
#define POLICYTEMPLATE 17
#define POLICYAUTHORIZENV 18
#define POLICYACTION 19
typedef struct {
TPM2B_NONCE nonceTPM;
TPM2B_DIGEST cpHashA;
TPM2B_NONCE policyRef;
INT32 expiration;
TPMT_SIGNATURE auth;
TPM2B_NAME publicKey;
char *publicKeyHint;
char *keyPath;
TPMT_PUBLIC keyPublic;
char *keyPEM;
TPMI_ALG_HASH keyPEMhashAlg;
TPMT_RSA_SCHEME rsaScheme;
TPMT_SIGNATURE signature_tpm;
} TPMS_POLICYSIGNED;
typedef struct {
TPM2B_NONCE nonceTPM;
TPM2B_DIGEST cpHashA;
TPM2B_NONCE policyRef;
INT32 expiration;
char *objectPath;
TPM2B_NAME objectName;
} TPMS_POLICYSECRET;
typedef struct {
TPMA_LOCALITY locality;
} TPMS_POLICYLOCALITY;
typedef struct {
char *nvPath;
TPMI_RH_NV_INDEX nvIndex;
TPMS_NV_PUBLIC nvPublic;
TPMI_RH_NV_AUTH authHandle;
TPM2B_OPERAND operandB;
UINT16 offset;
TPM2_EO operation;
} TPMS_POLICYNV;
typedef struct {
TPM2B_OPERAND operandB;
UINT16 offset;
TPM2_EO operation;
} TPMS_POLICYCOUNTERTIMER;
typedef struct {
TPM2_CC code;
} TPMS_POLICYCOMMANDCODE;
typedef struct {
} TPMS_POLICYPHYSICALPRESENCE;
typedef struct {
TPM2B_DIGEST cpHash;
} TPMS_POLICYCPHASH;
typedef struct {
UINT32 count;
UINT32 i;
TPM2B_NAME objectNames[3];
char *namePaths[3];
TPM2B_DIGEST nameHash;
} TPMS_POLICYNAMEHASH;
typedef struct {
TPM2B_NAME objectName;
TPM2B_NAME newParentName;
TPMI_YES_NO includeObject;
char *newParentPath;
TPMT_PUBLIC newParentPublic;
} TPMS_POLICYDUPLICATIONSELECT;
typedef struct {
char *type;
TPMT_PUBLIC key;
TPM2B_NONCE policyRef;
TPMT_SIGNATURE signature;
TPMI_ALG_HASH hashAlg;
UINT8_ARY pemSignature;
char *keyPEM;
TPMT_RSA_SCHEME rsaScheme;
} TPMS_POLICYAUTHORIZATION;
typedef struct policy_object_node POLICY_OBJECT;
typedef struct {
TPM2B_DIGEST approvedPolicy;
TPM2B_NONCE policyRef;
TPM2B_NAME keyName;
TPMT_TK_VERIFIED checkTicket;
char *keyPath;
TPMT_PUBLIC keyPublic;
char *keyPEM;
TPMI_ALG_HASH keyPEMhashAlg;
TPMT_RSA_SCHEME rsaScheme;
TPMT_SIGNATURE signature;
} TPMS_POLICYAUTHORIZE;
typedef struct {
} TPMS_POLICYAUTHVALUE;
typedef struct {
} TPMS_POLICYPASSWORD;
typedef struct {
TPMI_YES_NO writtenSet;
} TPMS_POLICYNVWRITTEN;
typedef struct {
TPM2B_DIGEST templateHash;
TPM2B_PUBLIC templatePublic;
} TPMS_POLICYTEMPLATE;
typedef struct {
char *nvPath;
TPMS_NV_PUBLIC nvPublic;
TPM2B_DIGEST policy;
TPMT_HA nv_policy;
uint8_t *policy_buffer;
} TPMS_POLICYAUTHORIZENV;
typedef struct {
char *action;
} TPMS_POLICYACTION;
typedef struct {
struct TPML_PCRVALUES *pcrs;
TPMS_PCR_SELECT currentPCRs;
TPML_PCR_SELECTION currentPCRandBanks;
} TPMS_POLICYPCR;
typedef struct TPML_POLICYAUTHORIZATIONS {
UINT32 count;
TPMS_POLICYAUTHORIZATION authorizations[];
} TPML_POLICYAUTHORIZATIONS;
typedef struct TPML_POLICYELEMENTS TPML_POLICYELEMENTS;
typedef struct {
char *name;
char *description;
TPML_DIGEST_VALUES policyDigests;
struct TPML_POLICYELEMENTS *policy;
} TPMS_POLICYBRANCH;
typedef struct TPML_POLICYBRANCHES {
UINT32 count;
TPMS_POLICYBRANCH authorizations[];
} TPML_POLICYBRANCHES;
typedef struct {
struct TPML_POLICYBRANCHES *branches;
} TPMS_POLICYOR;
typedef union {
TPMS_POLICYOR PolicyOr;
TPMS_POLICYSIGNED PolicySigned;
TPMS_POLICYSECRET PolicySecret;
TPMS_POLICYPCR PolicyPCR;
TPMS_POLICYLOCALITY PolicyLocality;
TPMS_POLICYNV PolicyNV;
TPMS_POLICYCOUNTERTIMER PolicyCounterTimer;
TPMS_POLICYCOMMANDCODE PolicyCommandCode;
TPMS_POLICYPHYSICALPRESENCE PolicyPhysicalPresence;
TPMS_POLICYCPHASH PolicyCpHash;
TPMS_POLICYNAMEHASH PolicyNameHash;
TPMS_POLICYDUPLICATIONSELECT PolicyDuplicationSelect;
TPMS_POLICYAUTHORIZE PolicyAuthorize;
TPMS_POLICYAUTHVALUE PolicyAuthValue;
TPMS_POLICYPASSWORD PolicyPassword;
TPMS_POLICYNVWRITTEN PolicyNvWritten;
TPMS_POLICYTEMPLATE PolicyTemplate;
TPMS_POLICYAUTHORIZENV PolicyAuthorizeNv;
TPMS_POLICYACTION PolicyAction;
} TPMU_POLICYELEMENT;
typedef struct {
TPMI_POLICYTYPE type;
TPML_DIGEST_VALUES policyDigests;
TPMU_POLICYELEMENT element;
} TPMT_POLICYELEMENT;
struct TPML_POLICYELEMENTS {
UINT32 count;
TPMT_POLICYELEMENT elements[];
};
typedef struct TPMS_POLICY {
char *description;
TPML_DIGEST_VALUES policyDigests;
struct TPML_POLICYAUTHORIZATIONS *policyAuthorizations;
struct TPML_POLICYELEMENTS *policy;
} TPMS_POLICY;
#endif /* IFAPI_POLICY_TYPES_H */
TPML_POLICYAUTHORIZATIONS
Definition ifapi_policy_types.h:205
TPML_POLICYAUTHORIZATIONS::count
UINT32 count
Definition ifapi_policy_types.h:206
TPML_POLICYAUTHORIZATIONS::authorizations
TPMS_POLICYAUTHORIZATION authorizations[]
Definition ifapi_policy_types.h:207
TPML_POLICYBRANCHES
Definition ifapi_policy_types.h:223
TPML_POLICYBRANCHES::authorizations
TPMS_POLICYBRANCH authorizations[]
Definition ifapi_policy_types.h:225
TPML_POLICYBRANCHES::count
UINT32 count
Definition ifapi_policy_types.h:224
TPML_POLICYELEMENTS
Definition ifapi_policy_types.h:268
TPML_POLICYELEMENTS::count
UINT32 count
Definition ifapi_policy_types.h:269
TPML_POLICYELEMENTS::elements
TPMT_POLICYELEMENT elements[]
Definition ifapi_policy_types.h:270
TPMS_POLICYACTION
Definition ifapi_policy_types.h:191
TPMS_POLICYACTION::action
char * action
Definition ifapi_policy_types.h:192
TPMS_POLICYAUTHORIZATION
Definition ifapi_policy_types.h:128
TPMS_POLICYAUTHORIZATION::type
char * type
Definition ifapi_policy_types.h:129
TPMS_POLICYAUTHORIZATION::key
TPMT_PUBLIC key
Definition ifapi_policy_types.h:130
TPMS_POLICYAUTHORIZATION::policyRef
TPM2B_NONCE policyRef
Definition ifapi_policy_types.h:131
TPMS_POLICYAUTHORIZATION::signature
TPMT_SIGNATURE signature
Definition ifapi_policy_types.h:132
TPMS_POLICYAUTHORIZE
Definition ifapi_policy_types.h:143
TPMS_POLICYAUTHORIZE::rsaScheme
TPMT_RSA_SCHEME rsaScheme
Definition ifapi_policy_types.h:152
TPMS_POLICYAUTHORIZE::checkTicket
TPMT_TK_VERIFIED checkTicket
Definition ifapi_policy_types.h:147
TPMS_POLICYAUTHORIZE::policyRef
TPM2B_NONCE policyRef
Definition ifapi_policy_types.h:145
TPMS_POLICYAUTHORIZE::keyPublic
TPMT_PUBLIC keyPublic
Definition ifapi_policy_types.h:149
TPMS_POLICYAUTHORIZE::keyPath
char * keyPath
Definition ifapi_policy_types.h:148
TPMS_POLICYAUTHORIZE::keyName
TPM2B_NAME keyName
Definition ifapi_policy_types.h:146
TPMS_POLICYAUTHORIZE::approvedPolicy
TPM2B_DIGEST approvedPolicy
Definition ifapi_policy_types.h:144
TPMS_POLICYAUTHORIZE::keyPEM
char * keyPEM
Definition ifapi_policy_types.h:150
TPMS_POLICYAUTHORIZE::keyPEMhashAlg
TPMI_ALG_HASH keyPEMhashAlg
Definition ifapi_policy_types.h:151
TPMS_POLICYAUTHORIZENV
Definition ifapi_policy_types.h:181
TPMS_POLICYAUTHORIZENV::policy
TPM2B_DIGEST policy
Definition ifapi_policy_types.h:184
TPMS_POLICYAUTHORIZENV::nvPath
char * nvPath
Definition ifapi_policy_types.h:182
TPMS_POLICYAUTHORIZENV::nv_policy
TPMT_HA nv_policy
Definition ifapi_policy_types.h:185
TPMS_POLICYAUTHORIZENV::nvPublic
TPMS_NV_PUBLIC nvPublic
Definition ifapi_policy_types.h:183
TPMS_POLICYAUTHVALUE
Definition ifapi_policy_types.h:158
TPMS_POLICYBRANCH
Definition ifapi_policy_types.h:214
TPMS_POLICYBRANCH::policy
struct TPML_POLICYELEMENTS * policy
Definition ifapi_policy_types.h:218
TPMS_POLICYBRANCH::name
char * name
Definition ifapi_policy_types.h:215
TPMS_POLICYBRANCH::description
char * description
Definition ifapi_policy_types.h:216
TPMS_POLICYCOMMANDCODE
Definition ifapi_policy_types.h:91
TPMS_POLICYCOMMANDCODE::code
TPM2_CC code
Definition ifapi_policy_types.h:92
TPMS_POLICYCOUNTERTIMER
Definition ifapi_policy_types.h:83
TPMS_POLICYCOUNTERTIMER::operandB
TPM2B_OPERAND operandB
Definition ifapi_policy_types.h:84
TPMS_POLICYCOUNTERTIMER::operation
TPM2_EO operation
Definition ifapi_policy_types.h:86
TPMS_POLICYCOUNTERTIMER::offset
UINT16 offset
Definition ifapi_policy_types.h:85
TPMS_POLICYCPHASH
Definition ifapi_policy_types.h:102
TPMS_POLICYCPHASH::cpHash
TPM2B_DIGEST cpHash
Definition ifapi_policy_types.h:103
TPMS_POLICYDUPLICATIONSELECT
Definition ifapi_policy_types.h:118
TPMS_POLICYDUPLICATIONSELECT::newParentPath
char * newParentPath
Definition ifapi_policy_types.h:122
TPMS_POLICYDUPLICATIONSELECT::newParentName
TPM2B_NAME newParentName
Definition ifapi_policy_types.h:120
TPMS_POLICYDUPLICATIONSELECT::newParentPublic
TPMT_PUBLIC newParentPublic
Definition ifapi_policy_types.h:123
TPMS_POLICYDUPLICATIONSELECT::includeObject
TPMI_YES_NO includeObject
Definition ifapi_policy_types.h:121
TPMS_POLICYDUPLICATIONSELECT::objectName
TPM2B_NAME objectName
Definition ifapi_policy_types.h:119
TPMS_POLICY
Definition ifapi_policy_types.h:275
TPMS_POLICY::policy
struct TPML_POLICYELEMENTS * policy
Definition ifapi_policy_types.h:279
TPMS_POLICY::policyAuthorizations
struct TPML_POLICYAUTHORIZATIONS * policyAuthorizations
Definition ifapi_policy_types.h:278
TPMS_POLICY::description
char * description
Definition ifapi_policy_types.h:276
TPMS_POLICY::policyDigests
TPML_DIGEST_VALUES policyDigests
Definition ifapi_policy_types.h:277
TPMS_POLICYLOCALITY
Definition ifapi_policy_types.h:65
TPMS_POLICYLOCALITY::locality
TPMA_LOCALITY locality
Definition ifapi_policy_types.h:66
TPMS_POLICYNAMEHASH
Definition ifapi_policy_types.h:108
TPMS_POLICYNAMEHASH::objectNames
TPM2B_NAME objectNames[3]
Definition ifapi_policy_types.h:111
TPMS_POLICYNAMEHASH::i
UINT32 i
Definition ifapi_policy_types.h:110
TPMS_POLICYNAMEHASH::count
UINT32 count
Definition ifapi_policy_types.h:109
TPMS_POLICYNAMEHASH::nameHash
TPM2B_DIGEST nameHash
Definition ifapi_policy_types.h:113
TPMS_POLICYNAMEHASH::namePaths
char * namePaths[3]
Definition ifapi_policy_types.h:112
TPMS_POLICYNV
Definition ifapi_policy_types.h:71
TPMS_POLICYNV::operandB
TPM2B_OPERAND operandB
Definition ifapi_policy_types.h:76
TPMS_POLICYNV::authHandle
TPMI_RH_NV_AUTH authHandle
Definition ifapi_policy_types.h:75
TPMS_POLICYNV::nvPath
char * nvPath
Definition ifapi_policy_types.h:72
TPMS_POLICYNV::operation
TPM2_EO operation
Definition ifapi_policy_types.h:78
TPMS_POLICYNV::nvPublic
TPMS_NV_PUBLIC nvPublic
Definition ifapi_policy_types.h:74
TPMS_POLICYNV::nvIndex
TPMI_RH_NV_INDEX nvIndex
Definition ifapi_policy_types.h:73
TPMS_POLICYNV::offset
UINT16 offset
Definition ifapi_policy_types.h:77
TPMS_POLICYNVWRITTEN
Definition ifapi_policy_types.h:168
TPMS_POLICYNVWRITTEN::writtenSet
TPMI_YES_NO writtenSet
Definition ifapi_policy_types.h:169
TPMS_POLICYOR
Definition ifapi_policy_types.h:230
TPMS_POLICYOR::branches
struct TPML_POLICYBRANCHES * branches
Definition ifapi_policy_types.h:231
TPMS_POLICYPASSWORD
Definition ifapi_policy_types.h:163
TPMS_POLICYPCR
Definition ifapi_policy_types.h:197
TPMS_POLICYPCR::currentPCRandBanks
TPML_PCR_SELECTION currentPCRandBanks
Definition ifapi_policy_types.h:200
TPMS_POLICYPCR::currentPCRs
TPMS_PCR_SELECT currentPCRs
Definition ifapi_policy_types.h:199
TPMS_POLICYPCR::pcrs
struct TPML_PCRVALUES * pcrs
Definition ifapi_policy_types.h:198
TPMS_POLICYPHYSICALPRESENCE
Definition ifapi_policy_types.h:97
TPMS_POLICYSECRET
Definition ifapi_policy_types.h:54
TPMS_POLICYSECRET::cpHashA
TPM2B_DIGEST cpHashA
Definition ifapi_policy_types.h:56
TPMS_POLICYSECRET::policyRef
TPM2B_NONCE policyRef
Definition ifapi_policy_types.h:57
TPMS_POLICYSECRET::objectPath
char * objectPath
Definition ifapi_policy_types.h:59
TPMS_POLICYSECRET::nonceTPM
TPM2B_NONCE nonceTPM
Definition ifapi_policy_types.h:55
TPMS_POLICYSECRET::objectName
TPM2B_NAME objectName
Definition ifapi_policy_types.h:60
TPMS_POLICYSECRET::expiration
INT32 expiration
Definition ifapi_policy_types.h:58
TPMS_POLICYSIGNED
Definition ifapi_policy_types.h:36
TPMS_POLICYSIGNED::rsaScheme
TPMT_RSA_SCHEME rsaScheme
Definition ifapi_policy_types.h:48
TPMS_POLICYSIGNED::cpHashA
TPM2B_DIGEST cpHashA
Definition ifapi_policy_types.h:38
TPMS_POLICYSIGNED::policyRef
TPM2B_NONCE policyRef
Definition ifapi_policy_types.h:39
TPMS_POLICYSIGNED::keyPublic
TPMT_PUBLIC keyPublic
Definition ifapi_policy_types.h:45
TPMS_POLICYSIGNED::keyPath
char * keyPath
Definition ifapi_policy_types.h:44
TPMS_POLICYSIGNED::nonceTPM
TPM2B_NONCE nonceTPM
Definition ifapi_policy_types.h:37
TPMS_POLICYSIGNED::publicKey
TPM2B_NAME publicKey
Definition ifapi_policy_types.h:42
TPMS_POLICYSIGNED::auth
TPMT_SIGNATURE auth
Definition ifapi_policy_types.h:41
TPMS_POLICYSIGNED::keyPEM
char * keyPEM
Definition ifapi_policy_types.h:46
TPMS_POLICYSIGNED::keyPEMhashAlg
TPMI_ALG_HASH keyPEMhashAlg
Definition ifapi_policy_types.h:47
TPMS_POLICYSIGNED::publicKeyHint
char * publicKeyHint
Definition ifapi_policy_types.h:43
TPMS_POLICYSIGNED::expiration
INT32 expiration
Definition ifapi_policy_types.h:40
TPMS_POLICYTEMPLATE
Definition ifapi_policy_types.h:174
TPMS_POLICYTEMPLATE::templatePublic
TPM2B_PUBLIC templatePublic
Definition ifapi_policy_types.h:176
TPMS_POLICYTEMPLATE::templateHash
TPM2B_DIGEST templateHash
Definition ifapi_policy_types.h:175
TPMT_POLICYELEMENT
Definition ifapi_policy_types.h:260
TPMT_POLICYELEMENT::element
TPMU_POLICYELEMENT element
Definition ifapi_policy_types.h:263
TPMT_POLICYELEMENT::type
TPMI_POLICYTYPE type
Definition ifapi_policy_types.h:261
TPMT_POLICYELEMENT::policyDigests
TPML_DIGEST_VALUES policyDigests
Definition ifapi_policy_types.h:262
UINT8_ARY
Definition fapi_types.h:15
policy_object_node
Definition ifapi_policy_execute.h:44
TPMU_POLICYELEMENT
Definition ifapi_policy_types.h:236
TPMU_POLICYELEMENT::PolicyCommandCode
TPMS_POLICYCOMMANDCODE PolicyCommandCode
Definition ifapi_policy_types.h:244
TPMU_POLICYELEMENT::PolicyPCR
TPMS_POLICYPCR PolicyPCR
Definition ifapi_policy_types.h:240
TPMU_POLICYELEMENT::PolicyNV
TPMS_POLICYNV PolicyNV
Definition ifapi_policy_types.h:242
TPMU_POLICYELEMENT::PolicyAuthValue
TPMS_POLICYAUTHVALUE PolicyAuthValue
Definition ifapi_policy_types.h:250
TPMU_POLICYELEMENT::PolicySigned
TPMS_POLICYSIGNED PolicySigned
Definition ifapi_policy_types.h:238
TPMU_POLICYELEMENT::PolicyAuthorize
TPMS_POLICYAUTHORIZE PolicyAuthorize
Definition ifapi_policy_types.h:249
TPMU_POLICYELEMENT::PolicyLocality
TPMS_POLICYLOCALITY PolicyLocality
Definition ifapi_policy_types.h:241
TPMU_POLICYELEMENT::PolicyCounterTimer
TPMS_POLICYCOUNTERTIMER PolicyCounterTimer
Definition ifapi_policy_types.h:243
TPMU_POLICYELEMENT::PolicyOr
TPMS_POLICYOR PolicyOr
Definition ifapi_policy_types.h:237
TPMU_POLICYELEMENT::PolicyCpHash
TPMS_POLICYCPHASH PolicyCpHash
Definition ifapi_policy_types.h:246
TPMU_POLICYELEMENT::PolicySecret
TPMS_POLICYSECRET PolicySecret
Definition ifapi_policy_types.h:239
TPMU_POLICYELEMENT::PolicyDuplicationSelect
TPMS_POLICYDUPLICATIONSELECT PolicyDuplicationSelect
Definition ifapi_policy_types.h:248
TPMU_POLICYELEMENT::PolicyAuthorizeNv
TPMS_POLICYAUTHORIZENV PolicyAuthorizeNv
Definition ifapi_policy_types.h:254
TPMU_POLICYELEMENT::PolicyPassword
TPMS_POLICYPASSWORD PolicyPassword
Definition ifapi_policy_types.h:251
TPMU_POLICYELEMENT::PolicyPhysicalPresence
TPMS_POLICYPHYSICALPRESENCE PolicyPhysicalPresence
Definition ifapi_policy_types.h:245
TPMU_POLICYELEMENT::PolicyAction
TPMS_POLICYACTION PolicyAction
Definition ifapi_policy_types.h:255
TPMU_POLICYELEMENT::PolicyNvWritten
TPMS_POLICYNVWRITTEN PolicyNvWritten
Definition ifapi_policy_types.h:252
TPMU_POLICYELEMENT::PolicyTemplate
TPMS_POLICYTEMPLATE PolicyTemplate
Definition ifapi_policy_types.h:253
TPMU_POLICYELEMENT::PolicyNameHash
TPMS_POLICYNAMEHASH PolicyNameHash
Definition ifapi_policy_types.h:247