1 /*
2  * Copyright 2015 The Chromium OS Authors. All rights reserved.
3  * Use of this source code is governed by a BSD-style license that can be
4  * found in the LICENSE file.
5  *
6  * The origin of this file is
7  * https://github.com/tianocore/edk2.git:MdePkg/Include/IndustryStandard/Tpm20.h
8  * published under BSD license. It can not be copied as is, as it collides
9  * with some of the definitions of this package.
10  */
11 
12 #ifndef __TPM2_TPM_TYPES_H
13 #define __TPM2_TPM_TYPES_H
14 
15 #include "Capabilities.h"
16 #include "Implementation.h"
17 typedef UINT32 TPM_SPEC;
18 
19 #include "tpm_types.h"
20 
21 /*
22  * The below enum is just a pile of all return codes defined in functions in
23  * part 4 of the spec.
24  *
25  * TODO: map these properly into Format-One error reporting.
26  */
27 enum {
28   RC_ActivateCredential_credentialBlob = 0,
29   RC_ActivateCredential_keyHandle = 0,
30   RC_ActivateCredential_secret = 0,
31   RC_CertifyCreation_creationTicket = 0,
32   RC_CertifyCreation_inScheme = 0,
33   RC_CertifyCreation_signHandle = 0,
34   RC_Certify_inScheme = 0,
35   RC_Certify_signHandle = 0,
36   RC_ClockSet_newTime = 0,
37   RC_Commit_P1 = 0,
38   RC_Commit_s2 = 0,
39   RC_Commit_signHandle = 0,
40   RC_Commit_y2 = 0,
41   RC_ContextLoad_context = 0,
42   RC_CreatePrimary_inPublic = 0,
43   RC_CreatePrimary_inSensitive = 0,
44   RC_Create_inPublic = 0,
45   RC_Create_inSensitive = 0,
46   RC_Create_parentHandle = 0,
47   RC_Duplicate_encryptionKeyIn = 0,
48   RC_Duplicate_newParentHandle = 0,
49   RC_Duplicate_objectHandle = 0,
50   RC_Duplicate_symmetricAlg = 0,
51   RC_ECC_Parameters_curveID = 0,
52   RC_ECDH_KeyGen_keyHandle = 0,
53   RC_ECDH_ZGen_keyHandle = 0,
54   RC_ECDH_ZGen_inPoint = 0,
55   RC_EncryptDecrypt_inData = 0,
56   RC_EncryptDecrypt_ivIn = 0,
57   RC_EncryptDecrypt_keyHandle = 0,
58   RC_EncryptDecrypt_mode = 0,
59   RC_EventSequenceComplete_sequenceHandle = 0,
60   RC_EvictControl_objectHandle = 0,
61   RC_EvictControl_persistentHandle = 0,
62   RC_GetCapability_property = 0,
63   RC_GetCommandAuditDigest_signHandle = 0,
64   RC_GetCommandAuditDigest_inScheme = 0,
65   RC_GetSessionAuditDigest_inScheme = 0,
66   RC_GetSessionAuditDigest_sessionHandle = 0,
67   RC_GetSessionAuditDigest_signHandle = 0,
68   RC_GetTime_inScheme = 0,
69   RC_GetTime_signHandle = 0,
70   RC_HMAC_handle = 0,
71   RC_HMAC_hashAlg = 0,
72   RC_HMAC_Start_handle = 0,
73   RC_HMAC_Start_hashAlg = 0,
74   RC_HierarchyChangeAuth_newAuth = 0,
75   RC_Import_duplicate = 0,
76   RC_Import_encryptionKey = 0,
77   RC_Import_inSymSeed = 0,
78   RC_Import_objectPublic = 0,
79   RC_Import_parentHandle = 0,
80   RC_IncrementalSelfTest_toTest = 0,
81   RC_Load_inPrivate = 0,
82   RC_Load_inPublic = 0,
83   RC_Load_parentHandle = 0,
84   RC_LoadExternal_hierarchy = 0,
85   RC_LoadExternal_inPublic = 0,
86   RC_MakeCredential_credential = 0,
87   RC_MakeCredential_handle = 0,
88   RC_NV_Certify_signHandle = 0,
89   RC_NV_Certify_inScheme = 0,
90   RC_NV_ChangeAuth_newAuth = 0,
91   RC_NV_DefineSpace_auth = 0,
92   RC_NV_DefineSpace_authHandle = 0,
93   RC_NV_DefineSpace_publicInfo = 0,
94   RC_NV_Extend_nvIndex = 0,
95   RC_NV_Increment_nvIndex = 0,
96   RC_NV_ReadLock_nvIndex = 0,
97   RC_NV_SetBits_nvIndex = 0,
98   RC_NV_UndefineSpace_nvIndex = 0,
99   RC_NV_UndefineSpaceSpecial_nvIndex = 0,
100   RC_NV_WriteLock_nvIndex = 0,
101   RC_ObjectChangeAuth_newAuth = 0,
102   RC_ObjectChangeAuth_objectHandle = 0,
103   RC_ObjectChangeAuth_parentHandle = 0,
104   RC_PCR_SetAuthPolicy_authPolicy = 0,
105   RC_PCR_SetAuthPolicy_pcrNum = 0,
106   RC_PolicyAuthorize_approvedPolicy = 0,
107   RC_PolicyAuthorize_checkTicket = 0,
108   RC_PolicyAuthorize_keySign = 0,
109   RC_PolicyCommandCode_code = 0,
110   RC_PolicyCpHash_cpHashA = 0,
111   RC_PolicyLocality_locality = 0,
112   RC_PolicyNV_operandB = 0,
113   RC_PolicyNameHash_nameHash = 0,
114   RC_PolicyNvWritten_writtenSet = 0,
115   RC_PolicyOR_pHashList = 0,
116   RC_PolicyPCR_pcrDigest = 0,
117   RC_PolicySecret_cpHashA = 0,
118   RC_PolicySecret_expiration = 0,
119   RC_PolicySecret_nonceTPM = 0,
120   RC_PolicySigned_auth = 0,
121   RC_PolicySigned_cpHashA = 0,
122   RC_PolicySigned_expiration = 0,
123   RC_PolicySigned_nonceTPM = 0,
124   RC_PolicyTicket_cpHashA = 0,
125   RC_PolicyTicket_policySession = 0,
126   RC_PolicyTicket_ticket = 0,
127   RC_PolicyTicket_timeout = 0,
128   RC_Quote_inScheme = 0,
129   RC_Quote_signHandle = 0,
130   RC_RSA_Decrypt_inScheme = 0,
131   RC_RSA_Decrypt_keyHandle = 0,
132   RC_RSA_Decrypt_label = 0,
133   RC_RSA_Encrypt_inScheme = 0,
134   RC_RSA_Encrypt_keyHandle = 0,
135   RC_RSA_Encrypt_label = 0,
136   RC_Rewrap_inDuplicate = 0,
137   RC_Rewrap_inSymSeed = 0,
138   RC_Rewrap_newParent = 0,
139   RC_Rewrap_oldParent = 0,
140   RC_SequenceComplete_sequenceHandle = 0,
141   RC_SequenceUpdate_sequenceHandle = 0,
142   RC_SetCommandCodeAuditStatus_auditAlg = 0,
143   RC_SetPrimaryPolicy_authPolicy = 0,
144   RC_Shutdown_shutdownType = 0,
145   RC_Sign_digest = 0,
146   RC_Sign_inScheme = 0,
147   RC_Sign_keyHandle = 0,
148   RC_Sign_validation = 0,
149   RC_StartAuthSession_bind = 0,
150   RC_StartAuthSession_encryptedSalt = 0,
151   RC_StartAuthSession_nonceCaller = 0,
152   RC_StartAuthSession_symmetric = 0,
153   RC_StartAuthSession_tpmKey = 0,
154   RC_Startup_startupType = 0,
155   RC_Unseal_itemHandle = 0,
156   RC_VerifySignature_keyHandle = 0,
157   RC_VerifySignature_signature = 0,
158   RC_ZGen_2Phase_counter = 0,
159   RC_ZGen_2Phase_inQeB = 0,
160   RC_ZGen_2Phase_inQsB = 0,
161   RC_ZGen_2Phase_inScheme = 0,
162   RC_ZGen_2Phase_keyA = 0,
163 };
164 
165 #endif  // __TPM2_TPM_TYPES_H
166