1 /********************************************************************************/
2 /*										*/
3 /*			  Command and Response Parameter Structures		*/
4 /*			     Written by Ken Goldman				*/
5 /*		       IBM Thomas J. Watson Research Center			*/
6 /*										*/
7 /*  Licenses and Notices							*/
8 /*										*/
9 /*  1. Copyright Licenses:							*/
10 /*										*/
11 /*  - Trusted Computing Group (TCG) grants to the user of the source code in	*/
12 /*    this specification (the "Source Code") a worldwide, irrevocable, 		*/
13 /*    nonexclusive, royalty free, copyright license to reproduce, create 	*/
14 /*    derivative works, distribute, display and perform the Source Code and	*/
15 /*    derivative works thereof, and to grant others the rights granted herein.	*/
16 /*										*/
17 /*  - The TCG grants to the user of the other parts of the specification 	*/
18 /*    (other than the Source Code) the rights to reproduce, distribute, 	*/
19 /*    display, and perform the specification solely for the purpose of 		*/
20 /*    developing products based on such documents.				*/
21 /*										*/
22 /*  2. Source Code Distribution Conditions:					*/
23 /*										*/
24 /*  - Redistributions of Source Code must retain the above copyright licenses, 	*/
25 /*    this list of conditions and the following disclaimers.			*/
26 /*										*/
27 /*  - Redistributions in binary form must reproduce the above copyright 	*/
28 /*    licenses, this list of conditions	and the following disclaimers in the 	*/
29 /*    documentation and/or other materials provided with the distribution.	*/
30 /*										*/
31 /*  3. Disclaimers:								*/
32 /*										*/
33 /*  - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF	*/
34 /*  LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH	*/
35 /*  RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES)	*/
36 /*  THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE.		*/
37 /*  Contact TCG Administration (admin@trustedcomputinggroup.org) for 		*/
38 /*  information on specification licensing rights available through TCG 	*/
39 /*  membership agreements.							*/
40 /*										*/
41 /*  - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED 	*/
42 /*    WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR 	*/
43 /*    FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR 		*/
44 /*    NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY 		*/
45 /*    OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE.		*/
46 /*										*/
47 /*  - Without limitation, TCG and its members and licensors disclaim all 	*/
48 /*    liability, including liability for infringement of any proprietary 	*/
49 /*    rights, relating to use of information in this specification and to the	*/
50 /*    implementation of this specification, and TCG disclaims all liability for	*/
51 /*    cost of procurement of substitute goods or services, lost profits, loss 	*/
52 /*    of use, loss of data or any incidental, consequential, direct, indirect, 	*/
53 /*    or special damages, whether under contract, tort, warranty or otherwise, 	*/
54 /*    arising in any way out of use or reliance upon this specification or any 	*/
55 /*    information herein.							*/
56 /*										*/
57 /*  (c) Copyright IBM Corp. and others, 2012-2019				*/
58 /*										*/
59 /********************************************************************************/
60 
61 /* TPM and TSS share thses structures */
62 
63 #ifndef PARAMETERS_H
64 #define PARAMETERS_H
65 
66 #include "TPM_Types.h"
67 
68 #include "ActivateCredential_fp.h"
69 #include "CertifyCreation_fp.h"
70 #include "Certify_fp.h"
71 #include "CertifyX509_fp.h"
72 #include "ChangeEPS_fp.h"
73 #include "ChangePPS_fp.h"
74 #include "ClearControl_fp.h"
75 #include "Clear_fp.h"
76 #include "ClockRateAdjust_fp.h"
77 #include "ClockSet_fp.h"
78 #include "Commit_fp.h"
79 #include "ContextLoad_fp.h"
80 #include "ContextSave_fp.h"
81 #include "CreatePrimary_fp.h"
82 #include "Create_fp.h"
83 #include "CreateLoaded_fp.h"
84 #include "DictionaryAttackLockReset_fp.h"
85 #include "DictionaryAttackParameters_fp.h"
86 #include "Duplicate_fp.h"
87 #include "ECC_Parameters_fp.h"
88 #include "ECDH_KeyGen_fp.h"
89 #include "ECDH_ZGen_fp.h"
90 #include "EC_Ephemeral_fp.h"
91 #include "EncryptDecrypt_fp.h"
92 #include "EncryptDecrypt2_fp.h"
93 #include "EventSequenceComplete_fp.h"
94 #include "EvictControl_fp.h"
95 #include "FlushContext_fp.h"
96 #include "GetCapability_fp.h"
97 #include "GetCommandAuditDigest_fp.h"
98 #include "GetRandom_fp.h"
99 #include "GetSessionAuditDigest_fp.h"
100 #include "GetTestResult_fp.h"
101 #include "GetTime_fp.h"
102 #include "HMAC_Start_fp.h"
103 #include "HMAC_fp.h"
104 #include "HashSequenceStart_fp.h"
105 #include "Hash_fp.h"
106 #include "HierarchyChangeAuth_fp.h"
107 #include "HierarchyControl_fp.h"
108 #include "Import_fp.h"
109 #include "IncrementalSelfTest_fp.h"
110 #include "LoadExternal_fp.h"
111 #include "Load_fp.h"
112 #include "MakeCredential_fp.h"
113 #include "NV_Certify_fp.h"
114 #include "NV_ChangeAuth_fp.h"
115 #include "NV_DefineSpace_fp.h"
116 #include "NV_Extend_fp.h"
117 #include "NV_GlobalWriteLock_fp.h"
118 #include "NV_Increment_fp.h"
119 #include "NV_ReadLock_fp.h"
120 #include "NV_ReadPublic_fp.h"
121 #include "NV_Read_fp.h"
122 #include "NV_SetBits_fp.h"
123 #include "NV_UndefineSpaceSpecial_fp.h"
124 #include "NV_UndefineSpace_fp.h"
125 #include "NV_WriteLock_fp.h"
126 #include "NV_Write_fp.h"
127 #include "ObjectChangeAuth_fp.h"
128 #include "PCR_Allocate_fp.h"
129 #include "PCR_Event_fp.h"
130 #include "PCR_Extend_fp.h"
131 #include "PCR_Read_fp.h"
132 #include "PCR_Reset_fp.h"
133 #include "PCR_SetAuthPolicy_fp.h"
134 #include "PCR_SetAuthValue_fp.h"
135 #include "PP_Commands_fp.h"
136 #include "PolicyAuthValue_fp.h"
137 #include "PolicyAuthorize_fp.h"
138 #include "PolicyCommandCode_fp.h"
139 #include "PolicyCounterTimer_fp.h"
140 #include "PolicyCpHash_fp.h"
141 #include "PolicyDuplicationSelect_fp.h"
142 #include "PolicyGetDigest_fp.h"
143 #include "PolicyLocality_fp.h"
144 #include "PolicyNV_fp.h"
145 #include "PolicyAuthorizeNV_fp.h"
146 #include "PolicyNvWritten_fp.h"
147 #include "PolicyNameHash_fp.h"
148 #include "PolicyOR_fp.h"
149 #include "PolicyPCR_fp.h"
150 #include "PolicyPassword_fp.h"
151 #include "PolicyPhysicalPresence_fp.h"
152 #include "PolicyRestart_fp.h"
153 #include "PolicySecret_fp.h"
154 #include "PolicySigned_fp.h"
155 #include "PolicyTemplate_fp.h"
156 #include "PolicyTicket_fp.h"
157 #include "Quote_fp.h"
158 #include "RSA_Decrypt_fp.h"
159 #include "RSA_Encrypt_fp.h"
160 #include "ReadClock_fp.h"
161 #include "ReadPublic_fp.h"
162 #include "Rewrap_fp.h"
163 #include "SelfTest_fp.h"
164 #include "SequenceComplete_fp.h"
165 #include "SequenceUpdate_fp.h"
166 #include "SetAlgorithmSet_fp.h"
167 #include "SetCommandCodeAuditStatus_fp.h"
168 #include "SetPrimaryPolicy_fp.h"
169 #include "Shutdown_fp.h"
170 #include "Sign_fp.h"
171 #include "StartAuthSession_fp.h"
172 #include "Startup_fp.h"
173 #include "StirRandom_fp.h"
174 #include "TestParms_fp.h"
175 #include "Unseal_fp.h"
176 #include "VerifySignature_fp.h"
177 #include "ZGen_2Phase_fp.h"
178 #include "NTC_fp.h"
179 
180 #include <ibmtss/Parameters12.h>
181 
182 typedef union {
183     ActivateCredential_In         ActivateCredential;
184     CertifyCreation_In            CertifyCreation;
185     Certify_In                    Certify;
186     ChangeEPS_In                  ChangeEPS;
187     ChangePPS_In                  ChangePPS;
188     ClearControl_In               ClearControl;
189     Clear_In                      Clear;
190     ClockRateAdjust_In            ClockRateAdjust;
191     ClockSet_In                   ClockSet;
192     Commit_In                     Commit;
193     ContextLoad_In                ContextLoad;
194     ContextSave_In                ContextSave;
195     CreatePrimary_In              CreatePrimary;
196     Create_In                     Create;
197     DictionaryAttackLockReset_In  DictionaryAttackLockReset;
198     DictionaryAttackParameters_In DictionaryAttackParameters;
199     Duplicate_In                  Duplicate;
200     ECC_Parameters_In             ECC_Parameters;
201     ECDH_KeyGen_In                ECDH_KeyGen;
202     ECDH_ZGen_In                  ECDH_ZGen;
203     EC_Ephemeral_In               EC_Ephemeral;
204     EncryptDecrypt_In             EncryptDecrypt;
205     EventSequenceComplete_In      EventSequenceComplete;
206     EvictControl_In               EvictControl;
207     FlushContext_In               FlushContext;
208     GetCapability_In              GetCapability;
209     GetCommandAuditDigest_In      GetCommandAuditDigest;
210     GetRandom_In                  GetRandom;
211     GetSessionAuditDigest_In      GetSessionAuditDigest;
212     GetTime_In                    GetTime;
213     HMAC_In                       HMAC;
214     HMAC_Start_In                 HMAC_Start;
215     HashSequenceStart_In          HashSequenceStart;
216     Hash_In                       Hash;
217     HierarchyChangeAuth_In        HierarchyChangeAuth;
218     HierarchyControl_In           HierarchyControl;
219     Import_In                     Import;
220     IncrementalSelfTest_In        IncrementalSelfTest;
221     LoadExternal_In               LoadExternal;
222     Load_In                       Load;
223     MakeCredential_In             MakeCredential;
224     NV_Certify_In                 NV_Certify;
225     NV_ChangeAuth_In              NV_ChangeAuth;
226     NV_DefineSpace_In             NV_DefineSpace;
227     NV_Extend_In                  NV_Extend;
228     NV_GlobalWriteLock_In         NV_GlobalWriteLock;
229     NV_Increment_In               NV_Increment;
230     NV_ReadLock_In                NV_ReadLock;
231     NV_ReadPublic_In              NV_ReadPublic;
232     NV_Read_In                    NV_Read;
233     NV_SetBits_In                 NV_SetBits;
234     NV_UndefineSpaceSpecial_In    NV_UndefineSpaceSpecial;
235     NV_UndefineSpace_In           NV_UndefineSpace;
236     NV_WriteLock_In               NV_WriteLock;
237     NV_Write_In                   NV_Write;
238     ObjectChangeAuth_In           ObjectChangeAuth;
239     PCR_Allocate_In               PCR_Allocate;
240     PCR_Event_In                  PCR_Event;
241     PCR_Extend_In                 PCR_Extend;
242     PCR_Read_In                   PCR_Read;
243     PCR_Reset_In                  PCR_Reset;
244     PCR_SetAuthPolicy_In          PCR_SetAuthPolicy;
245     PCR_SetAuthValue_In           PCR_SetAuthValue;
246     PP_Commands_In                PP_Commands;
247     PolicyAuthValue_In            PolicyAuthValue;
248     PolicyAuthorize_In            PolicyAuthorize;
249     PolicyCommandCode_In          PolicyCommandCode;
250     PolicyCounterTimer_In         PolicyCounterTimer;
251     PolicyCpHash_In               PolicyCpHash;
252     PolicyDuplicationSelect_In    PolicyDuplicationSelect;
253     PolicyGetDigest_In            PolicyGetDigest;
254     PolicyLocality_In             PolicyLocality;
255     PolicyNV_In                   PolicyNV;
256     PolicyAuthorizeNV_In          PolicyAuthorizeNV;
257     PolicyNameHash_In             PolicyNameHash;
258     PolicyOR_In                   PolicyOR;
259     PolicyPCR_In                  PolicyPCR;
260     PolicyPassword_In             PolicyPassword;
261     PolicyPhysicalPresence_In     PolicyPhysicalPresence;
262     PolicyRestart_In              PolicyRestart;
263     PolicySecret_In               PolicySecret;
264     PolicySigned_In               PolicySigned;
265     PolicyTicket_In               PolicyTicket;
266     Quote_In                      Quote;
267     RSA_Decrypt_In                RSA_Decrypt;
268     RSA_Encrypt_In                RSA_Encrypt;
269     ReadPublic_In                 ReadPublic;
270     Rewrap_In                     Rewrap;
271     SelfTest_In                   SelfTest;
272     SequenceComplete_In           SequenceComplete;
273     SequenceUpdate_In             SequenceUpdate;
274     SetAlgorithmSet_In            SetAlgorithmSet;
275     SetCommandCodeAuditStatus_In  SetCommandCodeAuditStatus;
276     SetPrimaryPolicy_In           SetPrimaryPolicy;
277     Shutdown_In                   Shutdown;
278     Sign_In                       Sign;
279     StartAuthSession_In           StartAuthSession;
280     Startup_In                    Startup;
281     StirRandom_In                 StirRandom;
282     TestParms_In                  TestParms;
283     Unseal_In                     Unseal;
284     VerifySignature_In            VerifySignature;
285     ZGen_2Phase_In                ZGen_2Phase;
286 
287     ActivateIdentity_In		ActivateIdentity;
288     CreateWrapKey_In		CreateWrapKey;
289     CreateEndorsementKeyPair_In	CreateEndorsementKeyPair;
290     Extend_In			Extend;
291     FlushSpecific_In		FlushSpecific;
292     GetCapability12_In		GetCapability12;
293     MakeIdentity_In		MakeIdentity;
294     NV_DefineSpace12_In		NV_DefineSpace12;
295     NV_ReadValue_In		NV_ReadValue;
296     NV_ReadValueAuth_In		NV_ReadValueAuth;
297     NV_WriteValue_In		NV_WriteValue;
298     NV_WriteValueAuth_In	NV_WriteValueAuth;
299     OSAP_In			OSAP;
300     OwnerReadInternalPub_In	OwnerReadInternalPub;
301     OwnerSetDisable_In		OwnerSetDisable;
302     LoadKey2_In			LoadKey2;
303     PcrRead12_In		PcrRead12;
304     PCR_Reset12_In		PCR_Reset12;
305     Quote2_In			Quote2;
306     ReadPubek_In		ReadPubek;
307     Sign12_In			Sign12;
308     Startup12_In		Startup12;
309     TakeOwnership_In		TakeOwnership;
310 } COMMAND_PARAMETERS;
311 
312 typedef union
313 {
314     ActivateCredential_Out         ActivateCredential;
315     CertifyCreation_Out            CertifyCreation;
316     Certify_Out                    Certify;
317     Commit_Out                     Commit;
318     ContextLoad_Out                ContextLoad;
319     ContextSave_Out                ContextSave;
320     CreatePrimary_Out              CreatePrimary;
321     Create_Out                     Create;
322     Duplicate_Out                  Duplicate;
323     ECC_Parameters_Out             ECC_Parameters;
324     ECDH_KeyGen_Out                ECDH_KeyGen;
325     ECDH_ZGen_Out                  ECDH_ZGen;
326     EC_Ephemeral_Out               EC_Ephemeral;
327     EncryptDecrypt_Out             EncryptDecrypt;
328     EventSequenceComplete_Out      EventSequenceComplete;
329     GetCapability_Out              GetCapability;
330     GetCommandAuditDigest_Out      GetCommandAuditDigest;
331     GetRandom_Out                  GetRandom;
332     GetSessionAuditDigest_Out      GetSessionAuditDigest;
333     GetTestResult_Out              GetTestResult;
334     GetTime_Out                    GetTime;
335     HMAC_Out                       HMAC;
336     HMAC_Start_Out                 HMAC_Start;
337     HashSequenceStart_Out          HashSequenceStart;
338     Hash_Out                       Hash;
339     Import_Out                     Import;
340     IncrementalSelfTest_Out        IncrementalSelfTest;
341     LoadExternal_Out               LoadExternal;
342     Load_Out                       Load;
343     MakeCredential_Out             MakeCredential;
344     NV_Certify_Out                 NV_Certify;
345     NV_ReadPublic_Out              NV_ReadPublic;
346     NV_Read_Out                    NV_Read;
347     ObjectChangeAuth_Out           ObjectChangeAuth;
348     PCR_Allocate_Out               PCR_Allocate;
349     PCR_Event_Out                  PCR_Event;
350     PCR_Read_Out                   PCR_Read;
351     PolicyGetDigest_Out            PolicyGetDigest;
352     PolicySecret_Out               PolicySecret;
353     PolicySigned_Out               PolicySigned;
354     Quote_Out                      Quote;
355     RSA_Decrypt_Out                RSA_Decrypt;
356     RSA_Encrypt_Out                RSA_Encrypt;
357     ReadClock_Out                  ReadClock;
358     ReadPublic_Out                 ReadPublic;
359     Rewrap_Out                     Rewrap;
360     SequenceComplete_Out           SequenceComplete;
361     Sign_Out                       Sign;
362     StartAuthSession_Out           StartAuthSession;
363     Unseal_Out                     Unseal;
364     VerifySignature_Out            VerifySignature;
365     ZGen_2Phase_Out                ZGen_2Phase;
366 
367     ActivateIdentity_Out		ActivateIdentity;
368     CreateWrapKey_Out			CreateWrapKey;
369     CreateEndorsementKeyPair_Out	CreateEndorsementKeyPair;
370     Extend_Out				Extend;
371     GetCapability12_Out			GetCapability12;
372     MakeIdentity_Out			MakeIdentity;
373     NV_ReadValue_Out			NV_ReadValue;
374     NV_ReadValueAuth_Out		NV_ReadValueAuth;
375     OIAP_Out				OIAP;
376     OSAP_Out				OSAP;
377     OwnerReadInternalPub_Out		OwnerReadInternalPub;
378     LoadKey2_Out			LoadKey2;
379     PcrRead12_Out			PcrRead12;
380     Quote2_Out				Quote2;
381     ReadPubek_Out			ReadPubek;
382     Sign12_Out				Sign12;
383     TakeOwnership_Out			TakeOwnership;
384 } RESPONSE_PARAMETERS;
385 
386 #endif
387