1 /********************************************************************************/
2 /*										*/
3 /*			     Command Print Utilities				*/
4 /*			     Written by Ken Goldman				*/
5 /*		       IBM Thomas J. Watson Research Center			*/
6 /*										*/
7 /* (c) Copyright IBM Corporation 2018 - 2019.					*/
8 /*										*/
9 /* All rights reserved.								*/
10 /* 										*/
11 /* Redistribution and use in source and binary forms, with or without		*/
12 /* modification, are permitted provided that the following conditions are	*/
13 /* met:										*/
14 /* 										*/
15 /* Redistributions of source code must retain the above copyright notice,	*/
16 /* this list of conditions and the following disclaimer.			*/
17 /* 										*/
18 /* Redistributions in binary form must reproduce the above copyright		*/
19 /* notice, this list of conditions and the following disclaimer in the		*/
20 /* documentation and/or other materials provided with the distribution.		*/
21 /* 										*/
22 /* Neither the names of the IBM Corporation nor the names of its		*/
23 /* contributors may be used to endorse or promote products derived from		*/
24 /* this software without specific prior written permission.			*/
25 /* 										*/
26 /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS		*/
27 /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT		*/
28 /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR	*/
29 /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT		*/
30 /* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,	*/
31 /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT		*/
32 /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,	*/
33 /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY	*/
34 /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT		*/
35 /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE	*/
36 /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.		*/
37 /********************************************************************************/
38 
39 #include <stdint.h>
40 #include <stdio.h>
41 #include <inttypes.h>
42 
43 #include <ibmtss/tssprintcmd.h>
44 
ActivateCredential_In_Print(ActivateCredential_In * in,unsigned int indent)45 void ActivateCredential_In_Print(ActivateCredential_In *in, unsigned int indent)
46 {
47     printf("%*s" "TPM2_ActivateCredential\n", indent, "");
48     TSS_TPM_HANDLE_Print("activateHandle", in->activateHandle, indent);
49     TSS_TPM_HANDLE_Print("keyHandle", in->keyHandle, indent);
50     TSS_TPM2B_Print("credentialBlob", indent, &in->credentialBlob.b);
51     TSS_TPM2B_Print("TPM2B_ENCRYPTED_SECRET secret", indent, &in->secret.b);
52     return;
53 }
CertifyCreation_In_Print(CertifyCreation_In * in,unsigned int indent)54 void CertifyCreation_In_Print(CertifyCreation_In *in, unsigned int indent)
55 {
56     printf("%*s" "TPM2_CertifyCreation\n", indent, "");
57     TSS_TPM_HANDLE_Print("signHandle", in->signHandle, indent);
58     TSS_TPM_HANDLE_Print("objectHandle", in->objectHandle, indent);
59     TSS_TPM2B_Print("qualifyingData", indent, &in->qualifyingData.b);
60     TSS_TPM2B_Print("creationHash", indent, &in->creationHash.b);
61     printf("%*s" "inScheme\n", indent, "");
62     TSS_TPMT_SIG_SCHEME_Print(&in->inScheme, indent);
63     printf("%*s" "creationTicket\n", indent, "");
64     TSS_TPMT_TK_CREATION_Print(&in->creationTicket, indent+2);
65     return;
66 }
Certify_In_Print(Certify_In * in,unsigned int indent)67 void Certify_In_Print(Certify_In *in, unsigned int indent)
68 {
69     printf("%*s" "TPM2_Certify\n", indent, "");
70     TSS_TPM_HANDLE_Print("objectHandle", in->objectHandle, indent);
71     TSS_TPM_HANDLE_Print("signHandle", in->signHandle, indent);
72     TSS_TPM2B_Print("qualifyingData", indent, &in->qualifyingData.b);
73     printf("%*s" "inScheme\n", indent, "");
74     TSS_TPMT_SIG_SCHEME_Print(&in->inScheme, indent);
75     return;
76 }
CertifyX509_In_Print(CertifyX509_In * in,unsigned int indent)77 void CertifyX509_In_Print(CertifyX509_In *in, unsigned int indent)
78 {
79     printf("%*s" "TPM2_CertifyX509\n", indent, "");
80     TSS_TPM_HANDLE_Print("objectHandle", in->objectHandle, indent);
81     TSS_TPM_HANDLE_Print("signHandle", in->signHandle, indent);
82     TSS_TPM2B_Print("reserved", indent, &in->reserved.b);
83     printf("%*s" "inScheme\n", indent, "");
84     TSS_TPMT_SIG_SCHEME_Print(&in->inScheme, indent);
85     TSS_TPM2B_Print("partialCertificate", indent, &in->partialCertificate.b);
86     return;
87 }
ChangeEPS_In_Print(ChangeEPS_In * in,unsigned int indent)88 void ChangeEPS_In_Print(ChangeEPS_In *in, unsigned int indent)
89 {
90     printf("%*s" "TPM2_ChangeEPS\n", indent, "");
91     TSS_TPM_HANDLE_Print("authHandle", in->authHandle, indent);
92     return;
93 }
ChangePPS_In_Print(ChangePPS_In * in,unsigned int indent)94 void ChangePPS_In_Print(ChangePPS_In *in, unsigned int indent)
95 {
96     printf("%*s" "TPM2_ChangePPS\n", indent, "");
97     TSS_TPM_HANDLE_Print("authHandle", in->authHandle, indent);
98     return;
99 }
ClearControl_In_Print(ClearControl_In * in,unsigned int indent)100 void ClearControl_In_Print(ClearControl_In *in, unsigned int indent)
101 {
102     printf("%*s" "TPM2_ClearControl\n", indent, "");
103     TSS_TPM_HANDLE_Print("auth", in->auth, indent);
104     TSS_TPMI_YES_NO_Print("disable", in->disable, indent);
105     return;
106 }
Clear_In_Print(Clear_In * in,unsigned int indent)107 void Clear_In_Print(Clear_In *in, unsigned int indent)
108 {
109     printf("%*s" "TPM2_Clear\n", indent, "");
110     TSS_TPM_HANDLE_Print("authHandle", in->authHandle, indent);
111     return;
112 }
ClockRateAdjust_In_Print(ClockRateAdjust_In * in,unsigned int indent)113 void ClockRateAdjust_In_Print(ClockRateAdjust_In *in, unsigned int indent)
114 {
115     printf("%*s" "TPM2_ClockRateAdjust\n", indent, "");
116     TSS_TPM_HANDLE_Print("auth", in->auth, indent);
117     TSS_TPM_CLOCK_ADJUST_Print("rateAdjust", in->rateAdjust, indent);
118     return;
119 }
ClockSet_In_Print(ClockSet_In * in,unsigned int indent)120 void ClockSet_In_Print(ClockSet_In *in, unsigned int indent)
121 {
122     printf("%*s" "TPM2_ClockSet\n", indent, "");
123     TSS_TPM_HANDLE_Print("auth", in->auth, indent);
124     printf("%*s" "newTime %"PRIu64"\n", indent, "", in->newTime);
125     return;
126 }
Commit_In_Print(Commit_In * in,unsigned int indent)127 void Commit_In_Print(Commit_In *in, unsigned int indent)
128 {
129     printf("%*s" "TPM2_Commit\n", indent, "");
130     TSS_TPM_HANDLE_Print("signHandle", in->signHandle, indent);
131     TSS_TPM2B_ECC_POINT_Print("P1", &in->P1, indent);
132     TSS_TPM2B_Print("s2", indent, &in->s2.b);
133     TSS_TPM2B_Print("y2", indent, &in->y2.b);
134     return;
135 }
ContextLoad_In_Print(ContextLoad_In * in,unsigned int indent)136 void ContextLoad_In_Print(ContextLoad_In *in, unsigned int indent)
137 {
138     printf("%*s" "TPM2_ContextLoad\n", indent, "");
139     TSS_TPMS_CONTEXT_Print(&in->context, indent);
140     return;
141 }
ContextSave_In_Print(ContextSave_In * in,unsigned int indent)142 void ContextSave_In_Print(ContextSave_In *in, unsigned int indent)
143 {
144     printf("%*s" "TPM2_ContextSave\n", indent, "");
145     TSS_TPM_HANDLE_Print("saveHandle", in->saveHandle, indent);
146     return;
147 }
Create_In_Print(Create_In * in,unsigned int indent)148 void Create_In_Print(Create_In *in, unsigned int indent)
149 {
150     printf("%*s" "TPM2_Create\n", indent, "");
151     TSS_TPM_HANDLE_Print("parentHandle", in->parentHandle, indent);
152     TSS_TPM2B_SENSITIVE_CREATE_Print("inSensitive", &in->inSensitive, indent);
153     TSS_TPM2B_PUBLIC_Print("inPublic", &in->inPublic, indent);
154     TSS_TPM2B_Print("outsideInfo", indent, &in->outsideInfo.b);
155     TSS_TPML_PCR_SELECTION_Print(&in->creationPCR, indent);
156     return;
157 }
CreateLoaded_In_Print(CreateLoaded_In * in,unsigned int indent)158 void CreateLoaded_In_Print(CreateLoaded_In *in, unsigned int indent)
159 {
160     printf("%*s" "TPM2_CreateLoaded\n", indent, "");
161     TSS_TPM_HANDLE_Print("parentHandle", in->parentHandle, indent);
162     TSS_TPM2B_SENSITIVE_CREATE_Print("inSensitive", &in->inSensitive, indent);
163     TSS_TPM2B_Print("inPublic", indent, &in->inPublic.b);
164     return;
165 }
CreatePrimary_In_Print(CreatePrimary_In * in,unsigned int indent)166 void CreatePrimary_In_Print(CreatePrimary_In *in, unsigned int indent)
167 {
168     printf("%*s" "TPM2_CreatePrimary\n", indent, "");
169     TSS_TPM_HANDLE_Print("primaryHandle", in->primaryHandle, indent);
170     TSS_TPM2B_SENSITIVE_CREATE_Print("inSensitive", &in->inSensitive, indent);
171     TSS_TPM2B_PUBLIC_Print("inPublic", &in->inPublic, indent);
172     TSS_TPM2B_Print("outsideInfo", indent, &in->outsideInfo.b);
173     TSS_TPML_PCR_SELECTION_Print(&in->creationPCR, indent);
174     return;
175 }
DictionaryAttackLockReset_In_Print(DictionaryAttackLockReset_In * in,unsigned int indent)176 void DictionaryAttackLockReset_In_Print(DictionaryAttackLockReset_In *in, unsigned int indent)
177 {
178     printf("%*s" "TPM2_DictionaryAttackLockReset\n", indent, "");
179     TSS_TPM_HANDLE_Print("lockHandle", in->lockHandle, indent);
180     return;
181 }
DictionaryAttackParameters_In_Print(DictionaryAttackParameters_In * in,unsigned int indent)182 void DictionaryAttackParameters_In_Print(DictionaryAttackParameters_In *in, unsigned int indent)
183 {
184     printf("%*s" "TPM2_DictionaryAttackParameters\n", indent, "");
185     TSS_TPM_HANDLE_Print("lockHandle", in->lockHandle, indent);
186     printf("%*s" "newMaxTries %u\n", indent, "", in->newMaxTries);
187     printf("%*s" "newRecoveryTime %u\n", indent, "", in->newRecoveryTime);
188     printf("%*s" "lockoutRecovery %u\n", indent, "", in->lockoutRecovery);
189     return;
190 }
Duplicate_In_Print(Duplicate_In * in,unsigned int indent)191 void Duplicate_In_Print(Duplicate_In *in, unsigned int indent)
192 {
193     printf("%*s" "TPM2_Duplicate\n", indent, "");
194     TSS_TPM_HANDLE_Print("objectHandle", in->objectHandle, indent);
195     TSS_TPM_HANDLE_Print("newParentHandle", in->newParentHandle, indent);
196     TSS_TPM2B_Print("encryptionKeyIn", indent, &in->encryptionKeyIn.b);
197     printf("%*s" "symmetricAlg\n", indent, "");
198     TSS_TPMT_SYM_DEF_OBJECT_Print(&in->symmetricAlg, indent);
199     return;
200 }
ECC_Parameters_In_Print(ECC_Parameters_In * in,unsigned int indent)201 void ECC_Parameters_In_Print(ECC_Parameters_In *in, unsigned int indent)
202 {
203     printf("%*s" "TPM2_ECC_Parameters\n", indent, "");
204     TSS_TPMI_ECC_CURVE_Print("curveID", in->curveID, indent);
205     return;
206 }
ECDH_KeyGen_In_Print(ECDH_KeyGen_In * in,unsigned int indent)207 void ECDH_KeyGen_In_Print(ECDH_KeyGen_In *in, unsigned int indent)
208 {
209     printf("%*s" "TPM2_ECDH_KeyGen\n", indent, "");
210     TSS_TPM_HANDLE_Print("keyHandle", in->keyHandle, indent);
211     return;
212 }
ECDH_ZGen_In_Print(ECDH_ZGen_In * in,unsigned int indent)213 void ECDH_ZGen_In_Print(ECDH_ZGen_In *in, unsigned int indent)
214 {
215     printf("%*s" "TPM2_ECDH_ZGen\n", indent, "");
216     TSS_TPM_HANDLE_Print("keyHandle", in->keyHandle, indent);
217     TSS_TPM2B_ECC_POINT_Print("inPoint", &in->inPoint, indent);
218     return;
219 }
EC_Ephemeral_In_Print(EC_Ephemeral_In * in,unsigned int indent)220 void EC_Ephemeral_In_Print(EC_Ephemeral_In *in, unsigned int indent)
221 {
222     printf("%*s" "TPM2_EC_Ephemeral\n", indent, "");
223     TSS_TPMI_ECC_CURVE_Print("curveID", in->curveID, indent);
224     return;
225 }
EncryptDecrypt_In_Print(EncryptDecrypt_In * in,unsigned int indent)226 void EncryptDecrypt_In_Print(EncryptDecrypt_In *in, unsigned int indent)
227 {
228     printf("%*s" "TPM2_EncryptDecrypt\n", indent, "");
229     TSS_TPM_HANDLE_Print("keyHandle", in->keyHandle, indent);
230     TSS_TPMI_YES_NO_Print("decrypt", in->decrypt, indent);
231     TSS_TPM_ALG_ID_Print("mode", in->mode, indent);
232     TSS_TPM2B_Print("ivIn", indent, &in->ivIn.b);
233     TSS_TPM2B_Print("inData", indent, &in->inData.b);
234     return;
235 }
EncryptDecrypt2_In_Print(EncryptDecrypt2_In * in,unsigned int indent)236 void EncryptDecrypt2_In_Print(EncryptDecrypt2_In *in, unsigned int indent)
237 {
238     printf("%*s" "TPM2_EncryptDecrypt2\n", indent, "");
239     TSS_TPM_HANDLE_Print("keyHandle", in->keyHandle, indent);
240     TSS_TPM2B_Print("inData", indent, &in->inData.b);
241     TSS_TPMI_YES_NO_Print("decrypt", in->decrypt, indent);
242     TSS_TPM_ALG_ID_Print("mode", in->mode, indent);
243     TSS_TPM2B_Print("ivIn", indent, &in->ivIn.b);
244     return;
245 }
EventSequenceComplete_In_Print(EventSequenceComplete_In * in,unsigned int indent)246 void EventSequenceComplete_In_Print(EventSequenceComplete_In *in, unsigned int indent)
247 {
248     printf("%*s" "TPM2_EventSequenceComplete\n", indent, "");
249     TSS_TPM_HANDLE_Print("pcrHandle", in->pcrHandle, indent);
250     TSS_TPM_HANDLE_Print("sequenceHandle", in->sequenceHandle, indent);
251     TSS_TPM2B_Print("buffer", indent, &in->buffer.b);
252     return;
253 }
EvictControl_In_Print(EvictControl_In * in,unsigned int indent)254 void EvictControl_In_Print(EvictControl_In *in, unsigned int indent)
255 {
256     printf("%*s" "TPM2_EvictControl\n", indent, "");
257     TSS_TPM_HANDLE_Print("auth", in->auth, indent);
258     TSS_TPM_HANDLE_Print("objectHandle", in->objectHandle, indent);
259     TSS_TPM_HANDLE_Print("persistentHandle", in->persistentHandle, indent);
260     return;
261 }
FlushContext_In_Print(FlushContext_In * in,unsigned int indent)262 void FlushContext_In_Print(FlushContext_In *in, unsigned int indent)
263 {
264     printf("%*s" "TPM2_FlushContext\n", indent, "");
265     TSS_TPM_HANDLE_Print("flushHandle", in->flushHandle, indent);
266     return;
267 }
GetCapability_In_Print(GetCapability_In * in,unsigned int indent)268 void GetCapability_In_Print(GetCapability_In *in, unsigned int indent)
269 {
270     printf("%*s" "TPM2_GetCapability\n", indent, "");
271     TSS_TPM_CAP_Print("capability", in->capability, indent);
272     printf("%*s" "property %08x\n", indent, "", in->property);
273     printf("%*s" "propertyCount %u\n", indent, "", in->propertyCount);
274     return;
275 }
GetCommandAuditDigest_In_Print(GetCommandAuditDigest_In * in,unsigned int indent)276 void GetCommandAuditDigest_In_Print(GetCommandAuditDigest_In *in, unsigned int indent)
277 {
278     printf("%*s" "TPM2_GetCommandAuditDigest\n", indent, "");
279     TSS_TPM_HANDLE_Print("privacyHandle", in->privacyHandle, indent);
280     TSS_TPM_HANDLE_Print("signHandle", in->signHandle, indent);
281     TSS_TPM2B_Print("qualifyingData", indent, &in->qualifyingData.b);
282     printf("%*s" "inScheme\n", indent, "");
283     TSS_TPMT_SIG_SCHEME_Print(&in->inScheme, indent);
284     return;
285 }
GetRandom_In_Print(GetRandom_In * in,unsigned int indent)286 void GetRandom_In_Print(GetRandom_In *in, unsigned int indent)
287 {
288     printf("%*s" "TPM2_GetRandom\n", indent, "");
289     printf("%*s" "bytesRequested %u\n", indent, "", in->bytesRequested);
290     return;
291 }
GetSessionAuditDigest_In_Print(GetSessionAuditDigest_In * in,unsigned int indent)292 void GetSessionAuditDigest_In_Print(GetSessionAuditDigest_In *in, unsigned int indent)
293 {
294     printf("%*s" "TPM2_GetSessionAuditDigest\n", indent, "");
295     TSS_TPM_HANDLE_Print("privacyAdminHandle", in->privacyAdminHandle, indent);
296     TSS_TPM_HANDLE_Print("signHandle", in->signHandle, indent);
297     TSS_TPM_HANDLE_Print("sessionHandle", in->sessionHandle, indent);
298     TSS_TPM2B_Print("qualifyingData", indent, &in->qualifyingData.b);
299     printf("%*s" "inScheme\n", indent, "");
300     TSS_TPMT_SIG_SCHEME_Print(&in->inScheme, indent);
301     return;
302 }
GetTime_In_Print(GetTime_In * in,unsigned int indent)303 void GetTime_In_Print(GetTime_In *in, unsigned int indent)
304 {
305     printf("%*s" "TPM2_GetTime\n", indent, "");
306     TSS_TPM_HANDLE_Print("privacyAdminHandle", in->privacyAdminHandle, indent);
307     TSS_TPM_HANDLE_Print("signHandle", in->signHandle, indent);
308     TSS_TPM2B_Print("qualifyingData", indent, &in->qualifyingData.b);
309     printf("%*s" "inScheme\n", indent, "");
310     TSS_TPMT_SIG_SCHEME_Print(&in->inScheme, indent);
311     return;
312 }
HMAC_Start_In_Print(HMAC_Start_In * in,unsigned int indent)313 void HMAC_Start_In_Print(HMAC_Start_In *in, unsigned int indent)
314 {
315     printf("%*s" "TPM2_HMAC_Start\n", indent, "");
316     TSS_TPM_HANDLE_Print("handle", in->handle, indent);
317     TSS_TPM2B_Print("auth", indent, &in->auth.b);
318     TSS_TPM_ALG_ID_Print("hashAlg", in->hashAlg, indent);
319     return;
320 }
HMAC_In_Print(HMAC_In * in,unsigned int indent)321 void HMAC_In_Print(HMAC_In *in, unsigned int indent)
322 {
323     printf("%*s" "TPM2_HMAC\n", indent, "");
324     TSS_TPM_HANDLE_Print("handle", in->handle, indent);
325     TSS_TPM2B_Print("buffer", indent, &in->buffer.b);
326     TSS_TPM_ALG_ID_Print("hashAlg", in->hashAlg, indent);
327     return;
328 }
HashSequenceStart_In_Print(HashSequenceStart_In * in,unsigned int indent)329 void HashSequenceStart_In_Print(HashSequenceStart_In *in, unsigned int indent)
330 {
331     printf("%*s" "TPM2_HashSequenceStart\n", indent, "");
332     TSS_TPM2B_Print("auth", indent, &in->auth.b);
333     TSS_TPM_ALG_ID_Print("hashAlg", in->hashAlg, indent);
334     return;
335 }
Hash_In_Print(Hash_In * in,unsigned int indent)336 void Hash_In_Print(Hash_In *in, unsigned int indent)
337 {
338     printf("%*s" "TPM2_Hash\n", indent, "");
339     TSS_TPM2B_Print("data", indent, &in->data.b);
340     TSS_TPM_ALG_ID_Print("hashAlg", in->hashAlg, indent);
341     TSS_TPM_HANDLE_Print("hierarchy", in->hierarchy, indent);
342     return;
343 }
HierarchyChangeAuth_In_Print(HierarchyChangeAuth_In * in,unsigned int indent)344 void HierarchyChangeAuth_In_Print(HierarchyChangeAuth_In *in, unsigned int indent)
345 {
346     printf("%*s" "TPM2_HierarchyChangeAuth\n", indent, "");
347     TSS_TPM_HANDLE_Print("authHandle", in->authHandle, indent);
348     TSS_TPM2B_Print("newAuth", indent, &in->newAuth.b);
349     return;
350 }
HierarchyControl_In_Print(HierarchyControl_In * in,unsigned int indent)351 void HierarchyControl_In_Print(HierarchyControl_In *in, unsigned int indent)
352 {
353     printf("%*s" "TPM2_HierarchyControl\n", indent, "");
354     TSS_TPM_HANDLE_Print("authHandle", in->authHandle, indent);
355     TSS_TPM_HANDLE_Print("enable", in->enable, indent);
356     TSS_TPMI_YES_NO_Print("state", in->state, indent);
357     return;
358 }
Import_In_Print(Import_In * in,unsigned int indent)359 void Import_In_Print(Import_In *in, unsigned int indent)
360 {
361     printf("%*s" "TPM2_Import\n", indent, "");
362     TSS_TPM_HANDLE_Print("parentHandle", in->parentHandle, indent);
363     TSS_TPM2B_Print("encryptionKey", indent, &in->encryptionKey.b);
364     TSS_TPM2B_PUBLIC_Print("objectPublic", &in->objectPublic, indent);
365     TSS_TPM2B_Print("duplicate", indent, &in->duplicate.b);
366     TSS_TPM2B_Print("inSymSeed", indent, &in->inSymSeed.b);
367     printf("%*s" "symmetricAlg\n", indent, "");
368     TSS_TPMT_SYM_DEF_OBJECT_Print(&in->symmetricAlg, indent);
369     return;
370 }
IncrementalSelfTest_In_Print(IncrementalSelfTest_In * in,unsigned int indent)371 void IncrementalSelfTest_In_Print(IncrementalSelfTest_In *in, unsigned int indent)
372 {
373     printf("%*s" "TPM2_IncrementalSelfTest\n", indent, "");
374     TSS_TPML_ALG_Print(&in->toTest, indent);
375     return;
376 }
LoadExternal_In_Print(LoadExternal_In * in,unsigned int indent)377 void LoadExternal_In_Print(LoadExternal_In *in, unsigned int indent)
378 {
379     printf("%*s" "TPM2_LoadExternal\n", indent, "");
380     if (in->inPrivate.t.size != 0) {	/* if there is a private area */
381 	TSS_TPMT_SENSITIVE_Print(&in->inPrivate.t.sensitiveArea, indent);
382     }
383     TSS_TPM2B_PUBLIC_Print("inPublic", &in->inPublic, indent);
384     TSS_TPM_HANDLE_Print("hierarchy", in->hierarchy, indent);
385     return;
386 }
Load_In_Print(Load_In * in,unsigned int indent)387 void Load_In_Print(Load_In *in, unsigned int indent)
388 {
389     printf("%*s" "TPM2_Load\n", indent, "");
390     TSS_TPM_HANDLE_Print("parentHandle", in->parentHandle, indent);
391     TSS_TPM2B_Print("inPrivate", indent, &in->inPrivate.b);
392     TSS_TPM2B_PUBLIC_Print("inPublic", &in->inPublic, indent);
393     return;
394 }
MakeCredential_In_Print(MakeCredential_In * in,unsigned int indent)395 void MakeCredential_In_Print(MakeCredential_In *in, unsigned int indent)
396 {
397     printf("%*s" "TPM2_MakeCredential\n", indent, "");
398     TSS_TPM_HANDLE_Print("handle", in->handle, indent);
399     TSS_TPM2B_Print("credential", indent, &in->credential.b);
400     TSS_TPM2B_Print("objectName", indent, &in->objectName.b);
401     return;
402 }
403 #if 0
404 void NTC2_PreConfig_In_Print(NTC2_PreConfig_In *in, unsigned int indent)
405 {
406     printf("%*s" "TPM2_NTC2_PreConfig\n", indent, "");
407     NTC2_CFG_STRUCT preConfig;
408     return;
409 }
410 #endif
NV_Certify_In_Print(NV_Certify_In * in,unsigned int indent)411 void NV_Certify_In_Print(NV_Certify_In *in, unsigned int indent)
412 {
413     printf("%*s" "TPM2_NV_Certify\n", indent, "");
414     TSS_TPM_HANDLE_Print("signHandle", in->signHandle, indent);
415     TSS_TPM_HANDLE_Print("authHandle", in->authHandle, indent);
416     TSS_TPM_HANDLE_Print("nvIndex", in->nvIndex, indent);
417     TSS_TPM2B_Print("qualifyingData", indent, &in->qualifyingData.b);
418     printf("%*s" "inScheme\n", indent, "");
419     TSS_TPMT_SIG_SCHEME_Print(&in->inScheme, indent);
420     printf("%*s" "size %u\n", indent, "", in->size);
421     printf("%*s" "offset %u\n", indent, "", in->offset);
422     return;
423 }
NV_ChangeAuth_In_Print(NV_ChangeAuth_In * in,unsigned int indent)424 void NV_ChangeAuth_In_Print(NV_ChangeAuth_In *in, unsigned int indent)
425 {
426     printf("%*s" "TPM2_NV_ChangeAuth\n", indent, "");
427     TSS_TPM_HANDLE_Print("nvIndex", in->nvIndex, indent);
428     TSS_TPM2B_Print("newAuth", indent, &in->newAuth.b);
429     return;
430 }
NV_DefineSpace_In_Print(NV_DefineSpace_In * in,unsigned int indent)431 void NV_DefineSpace_In_Print(NV_DefineSpace_In *in, unsigned int indent)
432 {
433     printf("%*s" "TPM2_NV_DefineSpace\n", indent, "");
434     TSS_TPM_HANDLE_Print("authHandle", in->authHandle, indent);
435     TSS_TPM2B_Print("auth", indent, &in->auth.b);
436     printf("%*s" "publicInfo\n", indent, "");
437     TSS_TPM2B_NV_PUBLIC_Print(&in->publicInfo, indent);
438     return;
439 }
NV_Extend_In_Print(NV_Extend_In * in,unsigned int indent)440 void NV_Extend_In_Print(NV_Extend_In *in, unsigned int indent)
441 {
442     printf("%*s" "TPM2_NV_Extend\n", indent, "");
443     TSS_TPM_HANDLE_Print("authHandle", in->authHandle, indent);
444     TSS_TPM_HANDLE_Print("nvIndex", in->nvIndex, indent);
445     TSS_TPM2B_Print("data", indent, &in->data.b);
446     return;
447 }
NV_GlobalWriteLock_In_Print(NV_GlobalWriteLock_In * in,unsigned int indent)448 void NV_GlobalWriteLock_In_Print(NV_GlobalWriteLock_In *in, unsigned int indent)
449 {
450     printf("%*s" "TPM2_NV_GlobalWriteLock\n", indent, "");
451     TSS_TPM_HANDLE_Print("authHandle", in->authHandle, indent);
452     return;
453 }
NV_Increment_In_Print(NV_Increment_In * in,unsigned int indent)454 void NV_Increment_In_Print(NV_Increment_In *in, unsigned int indent)
455 {
456     printf("%*s" "TPM2_NV_Increment\n", indent, "");
457     TSS_TPM_HANDLE_Print("authHandle", in->authHandle, indent);
458     TSS_TPM_HANDLE_Print("nvIndex", in->nvIndex, indent);
459     return;
460 }
NV_ReadLock_In_Print(NV_ReadLock_In * in,unsigned int indent)461 void NV_ReadLock_In_Print(NV_ReadLock_In *in, unsigned int indent)
462 {
463     printf("%*s" "TPM2_NV_ReadLock\n", indent, "");
464     TSS_TPM_HANDLE_Print("authHandle", in->authHandle, indent);
465     TSS_TPM_HANDLE_Print("nvIndex", in->nvIndex, indent);
466     return;
467 }
NV_ReadPublic_In_Print(NV_ReadPublic_In * in,unsigned int indent)468 void NV_ReadPublic_In_Print(NV_ReadPublic_In *in, unsigned int indent)
469 {
470     printf("%*s" "TPM2_NV_ReadPublic\n", indent, "");
471     TSS_TPM_HANDLE_Print("nvIndex", in->nvIndex, indent);
472     return;
473 }
NV_Read_In_Print(NV_Read_In * in,unsigned int indent)474 void NV_Read_In_Print(NV_Read_In *in, unsigned int indent)
475 {
476     printf("%*s" "TPM2_NV_Read\n", indent, "");
477     TSS_TPM_HANDLE_Print("authHandle", in->authHandle, indent);
478     TSS_TPM_HANDLE_Print("nvIndex", in->nvIndex, indent);
479     printf("%*s" "size %u\n", indent, "", in->size);
480     printf("%*s" "offset %u\n", indent, "", in->offset);
481     return;
482 }
NV_SetBits_In_Print(NV_SetBits_In * in,unsigned int indent)483 void NV_SetBits_In_Print(NV_SetBits_In *in, unsigned int indent)
484 {
485     printf("%*s" "TPM2_NV_SetBits\n", indent, "");
486     TSS_TPM_HANDLE_Print("authHandle", in->authHandle, indent);
487     TSS_TPM_HANDLE_Print("nvIndex", in->nvIndex, indent);
488     printf("%*s" "bits %"PRIx64"\n", indent, "", in->bits);
489     return;
490 }
NV_UndefineSpaceSpecial_In_Print(NV_UndefineSpaceSpecial_In * in,unsigned int indent)491 void NV_UndefineSpaceSpecial_In_Print(NV_UndefineSpaceSpecial_In *in, unsigned int indent)
492 {
493     printf("%*s" "TPM2_NV_UndefineSpaceSpecial\n", indent, "");
494     TSS_TPM_HANDLE_Print("nvIndex", in->nvIndex, indent);
495     TSS_TPM_HANDLE_Print("platform", in->platform, indent);
496     return;
497 }
NV_UndefineSpace_In_Print(NV_UndefineSpace_In * in,unsigned int indent)498 void NV_UndefineSpace_In_Print(NV_UndefineSpace_In *in, unsigned int indent)
499 {
500     printf("%*s" "TPM2_NV_UndefineSpace\n", indent, "");
501     TSS_TPM_HANDLE_Print("authHandle", in->authHandle, indent);
502     TSS_TPM_HANDLE_Print("nvIndex", in->nvIndex, indent);
503     return;
504 }
NV_WriteLock_In_Print(NV_WriteLock_In * in,unsigned int indent)505 void NV_WriteLock_In_Print(NV_WriteLock_In *in, unsigned int indent)
506 {
507     printf("%*s" "TPM2_NV_WriteLock\n", indent, "");
508     TSS_TPM_HANDLE_Print("authHandle", in->authHandle, indent);
509     TSS_TPM_HANDLE_Print("nvIndex", in->nvIndex, indent);
510     return;
511 }
NV_Write_In_Print(NV_Write_In * in,unsigned int indent)512 void NV_Write_In_Print(NV_Write_In *in, unsigned int indent)
513 {
514     printf("%*s" "TPM2_NV_Write\n", indent, "");
515     TSS_TPM_HANDLE_Print("authHandle", in->authHandle, indent);
516     TSS_TPM_HANDLE_Print("nvIndex", in->nvIndex, indent);
517     TSS_TPM2B_Print("data", indent, &in->data.b);
518     printf("%*s" "offset %u\n", indent, "", in->offset);
519     return;
520 }
ObjectChangeAuth_In_Print(ObjectChangeAuth_In * in,unsigned int indent)521 void ObjectChangeAuth_In_Print(ObjectChangeAuth_In *in, unsigned int indent)
522 {
523     printf("%*s" "TPM2_ObjectChangeAuth\n", indent, "");
524     TSS_TPM_HANDLE_Print("objectHandle", in->objectHandle, indent);
525     TSS_TPM_HANDLE_Print("parentHandle", in->parentHandle, indent);
526     TSS_TPM2B_Print("newAuth", indent, &in->newAuth.b);
527     return;
528 }
PCR_Allocate_In_Print(PCR_Allocate_In * in,unsigned int indent)529 void PCR_Allocate_In_Print(PCR_Allocate_In *in, unsigned int indent)
530 {
531     printf("%*s" "TPM2_PCR_Allocate\n", indent, "");
532     TSS_TPM_HANDLE_Print("authHandle", in->authHandle, indent);
533     TSS_TPML_PCR_SELECTION_Print(&in->pcrAllocation, indent);
534     return;
535 }
PCR_Event_In_Print(PCR_Event_In * in,unsigned int indent)536 void PCR_Event_In_Print(PCR_Event_In *in, unsigned int indent)
537 {
538     printf("%*s" "TPM2_PCR_Event\n", indent, "");
539     TSS_TPM_HANDLE_Print("pcrHandle", in->pcrHandle, indent);
540     TSS_TPM2B_Print("eventData", indent, &in->eventData.b);
541     return;
542 }
PCR_Extend_In_Print(PCR_Extend_In * in,unsigned int indent)543 void PCR_Extend_In_Print(PCR_Extend_In *in, unsigned int indent)
544 {
545     printf("%*s" "TPM2_PCR_Extend\n", indent, "");
546     TSS_TPM_HANDLE_Print("pcrHandle", in->pcrHandle, indent);
547     TSS_TPML_DIGEST_VALUES_Print(&in->digests, indent);
548     return;
549 }
PCR_Read_In_Print(PCR_Read_In * in,unsigned int indent)550 void PCR_Read_In_Print(PCR_Read_In *in, unsigned int indent)
551 {
552     printf("%*s" "TPM2_PCR_Read\n", indent, "");
553     TSS_TPML_PCR_SELECTION_Print(&in->pcrSelectionIn, indent);
554     return;
555 }
PCR_Reset_In_Print(PCR_Reset_In * in,unsigned int indent)556 void PCR_Reset_In_Print(PCR_Reset_In *in, unsigned int indent)
557 {
558     printf("%*s" "TPM2_PCR_Reset\n", indent, "");
559     TSS_TPM_HANDLE_Print("pcrHandle", in->pcrHandle, indent);
560     return;
561 }
PCR_SetAuthPolicy_In_Print(PCR_SetAuthPolicy_In * in,unsigned int indent)562 void PCR_SetAuthPolicy_In_Print(PCR_SetAuthPolicy_In *in, unsigned int indent)
563 {
564     printf("%*s" "TPM2_PCR_SetAuthPolicy\n", indent, "");
565     TSS_TPM_HANDLE_Print("authHandle", in->authHandle, indent);
566     TSS_TPM2B_Print("authPolicy", indent, &in->authPolicy.b);
567     TSS_TPM_ALG_ID_Print("hashAlg", in->hashAlg, indent);
568     TSS_TPM_HANDLE_Print("pcrNum", in->pcrNum, indent);
569     return;
570 }
PCR_SetAuthValue_In_Print(PCR_SetAuthValue_In * in,unsigned int indent)571 void PCR_SetAuthValue_In_Print(PCR_SetAuthValue_In *in, unsigned int indent)
572 {
573     printf("%*s" "TPM2_PCR_SetAuthValue\n", indent, "");
574     TSS_TPM_HANDLE_Print("pcrHandle", in->pcrHandle, indent);
575     TSS_TPM2B_Print("auth", indent, &in->auth.b);
576     return;
577 }
PP_Commands_In_Print(PP_Commands_In * in,unsigned int indent)578 void PP_Commands_In_Print(PP_Commands_In *in, unsigned int indent)
579 {
580     printf("%*s" "TPM2_PP_Commands\n", indent, "");
581     TSS_TPM_HANDLE_Print("auth", in->auth, indent);
582     TSS_TPML_CC_Print(&in->setList, indent);
583     TSS_TPML_CC_Print(&in->clearList, indent);
584     return;
585 }
PolicyAuthValue_In_Print(PolicyAuthValue_In * in,unsigned int indent)586 void PolicyAuthValue_In_Print(PolicyAuthValue_In *in, unsigned int indent)
587 {
588     printf("%*s" "TPM2_PolicyAuthValue\n", indent, "");
589     TSS_TPM_HANDLE_Print("policySession", in->policySession, indent);
590     return;
591 }
PolicyAuthorizeNV_In_Print(PolicyAuthorizeNV_In * in,unsigned int indent)592 void PolicyAuthorizeNV_In_Print(PolicyAuthorizeNV_In *in, unsigned int indent)
593 {
594     printf("%*s" "TPM2_PolicyAuthorizeNV\n", indent, "");
595     TSS_TPM_HANDLE_Print("authHandle", in->authHandle, indent);
596     TSS_TPM_HANDLE_Print("nvIndex", in->nvIndex, indent);
597     TSS_TPM_HANDLE_Print("policySession", in->policySession, indent);
598     return;
599 }
PolicyAuthorize_In_Print(PolicyAuthorize_In * in,unsigned int indent)600 void PolicyAuthorize_In_Print(PolicyAuthorize_In *in, unsigned int indent)
601 {
602     printf("%*s" "TPM2_PolicyAuthorize\n", indent, "");
603     TSS_TPM_HANDLE_Print("policySession", in->policySession, indent);
604     TSS_TPM2B_Print("approvedPolicy", indent, &in->approvedPolicy.b);
605     TSS_TPM2B_Print("policyRef", indent, &in->policyRef.b);
606     TSS_TPM2B_Print("keySign", indent, &in->keySign.b);
607     printf("%*s" "checkTicket\n", indent, "");
608     TSS_TPMT_TK_VERIFIED_Print(&in->checkTicket, indent+2);
609     return;
610 }
PolicyCommandCode_In_Print(PolicyCommandCode_In * in,unsigned int indent)611 void PolicyCommandCode_In_Print(PolicyCommandCode_In *in, unsigned int indent)
612 {
613     printf("%*s" "TPM2_PolicyCommandCode\n", indent, "");
614     TSS_TPM_HANDLE_Print("policySession", in->policySession, indent);
615     TSS_TPM_CC_Print("code", in->code, indent);
616     return;
617 }
PolicyCounterTimer_In_Print(PolicyCounterTimer_In * in,unsigned int indent)618 void PolicyCounterTimer_In_Print(PolicyCounterTimer_In *in, unsigned int indent)
619 {
620     printf("%*s" "TPM2_PolicyCounterTimer\n", indent, "");
621     TSS_TPM_HANDLE_Print("policySession", in->policySession, indent);
622     TSS_TPM2B_Print("operandB", indent, &in->operandB.b);
623     printf("%*s" "offset %u\n", indent, "", in->offset);
624     TSS_TPM_EO_Print("operation", in->operation, indent);
625     return;
626 }
PolicyCpHash_In_Print(PolicyCpHash_In * in,unsigned int indent)627 void PolicyCpHash_In_Print(PolicyCpHash_In *in, unsigned int indent)
628 {
629     printf("%*s" "TPM2_PolicyCpHash\n", indent, "");
630     TSS_TPM_HANDLE_Print("policySession", in->policySession, indent);
631     TSS_TPM2B_Print("cpHashA", indent, &in->cpHashA.b);
632     return;
633 }
PolicyDuplicationSelect_In_Print(PolicyDuplicationSelect_In * in,unsigned int indent)634 void PolicyDuplicationSelect_In_Print(PolicyDuplicationSelect_In *in, unsigned int indent)
635 {
636     printf("%*s" "TPM2_PolicyDuplicationSelect\n", indent, "");
637     TSS_TPM_HANDLE_Print("policySession", in->policySession, indent);
638     TSS_TPM2B_Print("objectName", indent, &in->objectName.b);
639     TSS_TPM2B_Print("newParentName", indent, &in->newParentName.b);
640     TSS_TPMI_YES_NO_Print("includeObject", in->includeObject, indent);
641     return;
642 }
PolicyGetDigest_In_Print(PolicyGetDigest_In * in,unsigned int indent)643 void PolicyGetDigest_In_Print(PolicyGetDigest_In *in, unsigned int indent)
644 {
645     printf("%*s" "TPM2_PolicyGetDigest\n", indent, "");
646     TSS_TPM_HANDLE_Print("policySession", in->policySession, indent);
647     return;
648 }
PolicyLocality_In_Print(PolicyLocality_In * in,unsigned int indent)649 void PolicyLocality_In_Print(PolicyLocality_In *in, unsigned int indent)
650 {
651     printf("%*s" "TPM2_PolicyLocality\n", indent, "");
652     TSS_TPM_HANDLE_Print("policySession", in->policySession, indent);
653     TSS_TPMA_LOCALITY_Print(in->locality, indent);
654     return;
655 }
PolicyNV_In_Print(PolicyNV_In * in,unsigned int indent)656 void PolicyNV_In_Print(PolicyNV_In *in, unsigned int indent)
657 {
658     printf("%*s" "TPM2_PolicyNV\n", indent, "");
659     TSS_TPM_HANDLE_Print("authHandle", in->authHandle, indent);
660     TSS_TPM_HANDLE_Print("nvIndex", in->nvIndex, indent);
661     TSS_TPM_HANDLE_Print("policySession", in->policySession, indent);
662     TSS_TPM2B_Print("operandB", indent, &in->operandB.b);
663     printf("%*s" "offset %u\n", indent, "", in->offset);
664     TSS_TPM_EO_Print("operation", in->operation, indent);
665     return;
666 }
PolicyNameHash_In_Print(PolicyNameHash_In * in,unsigned int indent)667 void PolicyNameHash_In_Print(PolicyNameHash_In *in, unsigned int indent)
668 {
669     printf("%*s" "TPM2_PolicyNameHash\n", indent, "");
670     TSS_TPM_HANDLE_Print("policySession", in->policySession, indent);
671     TSS_TPM2B_Print("nameHash", indent, &in->nameHash.b);
672     return;
673 }
PolicyNvWritten_In_Print(PolicyNvWritten_In * in,unsigned int indent)674 void PolicyNvWritten_In_Print(PolicyNvWritten_In *in, unsigned int indent)
675 {
676     printf("%*s" "TPM2_PolicyNvWritten\n", indent, "");
677     TSS_TPM_HANDLE_Print("policySession", in->policySession, indent);
678     TSS_TPMI_YES_NO_Print("writtenSet", in->writtenSet, indent);
679     return;
680 }
PolicyOR_In_Print(PolicyOR_In * in,unsigned int indent)681 void PolicyOR_In_Print(PolicyOR_In *in, unsigned int indent)
682 {
683     printf("%*s" "TPM2_PolicyOR\n", indent, "");
684     TSS_TPM_HANDLE_Print("policySession", in->policySession, indent);
685     printf("%*s" "pHashList\n", indent, "");
686     TSS_TPML_DIGEST_Print(&in->pHashList, indent+2);
687     return;
688 }
PolicyPCR_In_Print(PolicyPCR_In * in,unsigned int indent)689 void PolicyPCR_In_Print(PolicyPCR_In *in, unsigned int indent)
690 {
691     printf("%*s" "TPM2_PolicyPCR\n", indent, "");
692     TSS_TPM_HANDLE_Print("policySession", in->policySession, indent);
693     TSS_TPM2B_Print("pcrDigest", indent, &in->pcrDigest.b);
694     TSS_TPML_PCR_SELECTION_Print(&in->pcrs, indent);
695     return;
696 }
PolicyPassword_In_Print(PolicyPassword_In * in,unsigned int indent)697 void PolicyPassword_In_Print(PolicyPassword_In *in, unsigned int indent)
698 {
699     printf("%*s" "TPM2_PolicyPassword\n", indent, "");
700     TSS_TPM_HANDLE_Print("policySession", in->policySession, indent);
701     return;
702 }
PolicyPhysicalPresence_In_Print(PolicyPhysicalPresence_In * in,unsigned int indent)703 void PolicyPhysicalPresence_In_Print(PolicyPhysicalPresence_In *in, unsigned int indent)
704 {
705     printf("%*s" "TPM2_PolicyPhysicalPresence\n", indent, "");
706     TSS_TPM_HANDLE_Print("policySession", in->policySession, indent);
707     return;
708 }
PolicyRestart_In_Print(PolicyRestart_In * in,unsigned int indent)709 void PolicyRestart_In_Print(PolicyRestart_In *in, unsigned int indent)
710 {
711     printf("%*s" "TPM2_PolicyRestart\n", indent, "");
712     TSS_TPM_HANDLE_Print("sessionHandle", in->sessionHandle, indent);
713     return;
714 }
PolicySecret_In_Print(PolicySecret_In * in,unsigned int indent)715 void PolicySecret_In_Print(PolicySecret_In *in, unsigned int indent)
716 {
717     printf("%*s" "TPM2_PolicySecret\n", indent, "");
718     TSS_TPM_HANDLE_Print("authHandle", in->authHandle, indent);
719     TSS_TPM_HANDLE_Print("policySession", in->policySession, indent);
720     TSS_TPM2B_Print("nonceTPM", indent, &in->nonceTPM.b);
721     TSS_TPM2B_Print("cpHashA", indent, &in->cpHashA.b);
722     TSS_TPM2B_Print("policyRef", indent, &in->policyRef.b);
723     printf("%*s" "expiration %d\n", indent, "", in->expiration);
724     return;
725 }
PolicySigned_In_Print(PolicySigned_In * in,unsigned int indent)726 void PolicySigned_In_Print(PolicySigned_In *in, unsigned int indent)
727 {
728     printf("%*s" "TPM2_PolicySigned\n", indent, "");
729     TSS_TPM_HANDLE_Print("authObject", in->authObject, indent);
730     TSS_TPM_HANDLE_Print("policySession", in->policySession, indent);
731     TSS_TPM2B_Print("nonceTPM", indent, &in->nonceTPM.b);
732     TSS_TPM2B_Print("cpHashA", indent, &in->cpHashA.b);
733     TSS_TPM2B_Print("policyRef", indent, &in->policyRef.b);
734     printf("%*s" "expiration %d\n", indent, "", in->expiration);
735     printf("%*s" "auth\n", indent, "");
736     TSS_TPMT_SIGNATURE_Print(&in->auth, indent+2);
737     return;
738 }
PolicyTemplate_In_Print(PolicyTemplate_In * in,unsigned int indent)739 void PolicyTemplate_In_Print(PolicyTemplate_In *in, unsigned int indent)
740 {
741     printf("%*s" "TPM2_PolicyTemplate\n", indent, "");
742     TSS_TPM_HANDLE_Print("policySession", in->policySession, indent);
743     TSS_TPM2B_Print("templateHash", indent, &in->templateHash.b);
744     return;
745 }
PolicyTicket_In_Print(PolicyTicket_In * in,unsigned int indent)746 void PolicyTicket_In_Print(PolicyTicket_In *in, unsigned int indent)
747 {
748     printf("%*s" "TPM2_PolicyTicket\n", indent, "");
749     TSS_TPM_HANDLE_Print("policySession", in->policySession, indent);
750     TSS_TPM2B_Print("timeout", indent, &in->timeout.b);
751     TSS_TPM2B_Print("cpHashA", indent, &in->cpHashA.b);
752     TSS_TPM2B_Print("policyRef", indent, &in->policyRef.b);
753     TSS_TPM2B_Print("authName", indent, &in->authName.b);
754     printf("%*s" "ticket\n", indent, "");
755     TSS_TPMT_TK_AUTH_Print(&in->ticket, indent+2);
756     return;
757 }
Quote_In_Print(Quote_In * in,unsigned int indent)758 void Quote_In_Print(Quote_In *in, unsigned int indent)
759 {
760     printf("%*s" "TPM2_Quote\n", indent, "");
761     TSS_TPM_HANDLE_Print("signHandle", in->signHandle, indent);
762     TSS_TPM2B_Print("qualifyingData", indent, &in->qualifyingData.b);
763     printf("%*s" "inScheme\n", indent, "");
764     TSS_TPMT_SIG_SCHEME_Print(&in->inScheme, indent);
765     TSS_TPML_PCR_SELECTION_Print(&in->PCRselect, indent);
766     return;
767 }
RSA_Decrypt_In_Print(RSA_Decrypt_In * in,unsigned int indent)768 void RSA_Decrypt_In_Print(RSA_Decrypt_In *in, unsigned int indent)
769 {
770     printf("%*s" "TPM2_RSA_Decrypt\n", indent, "");
771     TSS_TPM_HANDLE_Print("keyHandle", in->keyHandle, indent);
772     TSS_TPM2B_Print("cipherText", indent, &in->cipherText.b);
773     printf("%*s" "inScheme\n", indent, "");
774     TSS_TPMT_RSA_DECRYPT_Print(&in->inScheme, indent);
775     TSS_TPM2B_Print("label", indent, &in->label.b);
776     return;
777 }
RSA_Encrypt_In_Print(RSA_Encrypt_In * in,unsigned int indent)778 void RSA_Encrypt_In_Print(RSA_Encrypt_In *in, unsigned int indent)
779 {
780     printf("%*s" "TPM2_RSA_Encrypt\n", indent, "");
781     TSS_TPM_HANDLE_Print("keyHandle", in->keyHandle, indent);
782     TSS_TPM2B_Print("message", indent, &in->message.b);
783     printf("%*s" "inScheme\n", indent, "");
784     TSS_TPMT_RSA_DECRYPT_Print(&in->inScheme, indent);
785     TSS_TPM2B_Print("label", indent, &in->label.b);
786     return;
787 }
ReadPublic_In_Print(ReadPublic_In * in,unsigned int indent)788 void ReadPublic_In_Print(ReadPublic_In *in, unsigned int indent)
789 {
790     printf("%*s" "TPM2_ReadPublic\n", indent, "");
791     TSS_TPM_HANDLE_Print("objectHandle", in->objectHandle, indent);
792     return;
793 }
Rewrap_In_Print(Rewrap_In * in,unsigned int indent)794 void Rewrap_In_Print(Rewrap_In *in, unsigned int indent)
795 {
796     printf("%*s" "TPM2_Rewrap\n", indent, "");
797     TSS_TPM_HANDLE_Print("oldParent", in->oldParent, indent);
798     TSS_TPM_HANDLE_Print("newParent", in->newParent, indent);
799     TSS_TPM2B_Print("inDuplicate", indent, &in->inDuplicate.b);
800     TSS_TPM2B_Print("name", indent, &in->name.b);
801     TSS_TPM2B_Print("inSymSeed", indent, &in->inSymSeed.b);
802     return;
803 }
SelfTest_In_Print(SelfTest_In * in,unsigned int indent)804 void SelfTest_In_Print(SelfTest_In *in, unsigned int indent)
805 {
806     printf("%*s" "TPM2_SelfTest\n", indent, "");
807     TSS_TPMI_YES_NO_Print("fullTest", in->fullTest, indent);
808     return;
809 }
SequenceComplete_In_Print(SequenceComplete_In * in,unsigned int indent)810 void SequenceComplete_In_Print(SequenceComplete_In *in, unsigned int indent)
811 {
812     printf("%*s" "TPM2_SequenceComplete\n", indent, "");
813     TSS_TPM_HANDLE_Print("sequenceHandle", in->sequenceHandle, indent);
814     TSS_TPM2B_Print("buffer", indent, &in->buffer.b);
815     TSS_TPM_HANDLE_Print("hierarchy", in->hierarchy, indent);
816     return;
817 }
SequenceUpdate_In_Print(SequenceUpdate_In * in,unsigned int indent)818 void SequenceUpdate_In_Print(SequenceUpdate_In *in, unsigned int indent)
819 {
820     printf("%*s" "TPM2_SequenceUpdate\n", indent, "");
821     TSS_TPM_HANDLE_Print("sequenceHandle", in->sequenceHandle, indent);
822     TSS_TPM2B_Print("buffer", indent, &in->buffer.b);
823     return;
824 }
SetAlgorithmSet_In_Print(SetAlgorithmSet_In * in,unsigned int indent)825 void SetAlgorithmSet_In_Print(SetAlgorithmSet_In *in, unsigned int indent)
826 {
827     printf("%*s" "TPM2_SetAlgorithmSet\n", indent, "");
828     TSS_TPM_HANDLE_Print("authHandle", in->authHandle, indent);
829     printf("%*s" "algorithmSet %08x\n", indent, "", in->algorithmSet);
830     return;
831 }
SetCommandCodeAuditStatus_In_Print(SetCommandCodeAuditStatus_In * in,unsigned int indent)832 void SetCommandCodeAuditStatus_In_Print(SetCommandCodeAuditStatus_In *in, unsigned int indent)
833 {
834     printf("%*s" "TPM2_SetCommandCodeAuditStatus\n", indent, "");
835     TSS_TPM_HANDLE_Print("auth", in->auth, indent);
836     TSS_TPM_ALG_ID_Print("auditAlg", in->auditAlg, indent);
837     TSS_TPML_CC_Print(&in->setList, indent);
838     TSS_TPML_CC_Print(&in->clearList, indent);
839     return;
840 }
SetPrimaryPolicy_In_Print(SetPrimaryPolicy_In * in,unsigned int indent)841 void SetPrimaryPolicy_In_Print(SetPrimaryPolicy_In *in, unsigned int indent)
842 {
843     printf("%*s" "TPM2_SetPrimaryPolicy\n", indent, "");
844     TSS_TPM_HANDLE_Print("authHandle", in->authHandle, indent);
845     TSS_TPM2B_Print("authPolicy", indent, &in->authPolicy.b);
846     TSS_TPM_ALG_ID_Print("hashAlg", in->hashAlg, indent);
847     return;
848 }
Shutdown_In_Print(Shutdown_In * in,unsigned int indent)849 void Shutdown_In_Print(Shutdown_In *in, unsigned int indent)
850 {
851     printf("%*s" "TPM2_Shutdown\n", indent, "");
852     TSS_TPM_SU_Print("shutdownType", in->shutdownType, indent);
853     return;
854 }
Sign_In_Print(Sign_In * in,unsigned int indent)855 void Sign_In_Print(Sign_In *in, unsigned int indent)
856 {
857     printf("%*s" "TPM2_Sign\n", indent, "");
858     TSS_TPM_HANDLE_Print("keyHandle", in->keyHandle, indent);
859     TSS_TPM2B_Print("digest", indent, &in->digest.b);
860     printf("%*s" "inScheme\n", indent, "");
861     TSS_TPMT_SIG_SCHEME_Print(&in->inScheme, indent);
862     printf("%*s" "validation\n", indent, "");
863     TSS_TPMT_TK_HASHCHECK_Print(&in->validation, indent+2);
864     return;
865 }
StartAuthSession_In_Print(StartAuthSession_In * in,unsigned int indent)866 void StartAuthSession_In_Print(StartAuthSession_In *in, unsigned int indent)
867 {
868     printf("%*s" "TPM2_StartAuthSession\n", indent, "");
869     TSS_TPM_HANDLE_Print("tpmKey", in->tpmKey, indent);
870     TSS_TPM_HANDLE_Print("bind", in->bind, indent);
871     TSS_TPM2B_Print("nonceCaller", indent, &in->nonceCaller.b);
872     TSS_TPM2B_Print("encryptedSalt", indent, &in->encryptedSalt.b);
873     TSS_TPM_SE_Print("sessionType", in->sessionType, indent);
874     TSS_TPMT_SYM_DEF_Print(&in->symmetric, indent);
875     TSS_TPM_ALG_ID_Print("authHash", in->authHash, indent);
876     return;
877 }
Startup_In_Print(Startup_In * in,unsigned int indent)878 void Startup_In_Print(Startup_In *in, unsigned int indent)
879 {
880     printf("%*s" "TPM2_Startup\n", indent, "");
881     TSS_TPM_SU_Print("startupType", in->startupType, indent);
882     return;
883 }
StirRandom_In_Print(StirRandom_In * in,unsigned int indent)884 void StirRandom_In_Print(StirRandom_In *in, unsigned int indent)
885 {
886     printf("%*s" "TPM2_StirRandom\n", indent, "");
887     TSS_TPM2B_Print("inData", indent, &in->inData.b);
888     return;
889 }
TestParms_In_Print(TestParms_In * in,unsigned int indent)890 void TestParms_In_Print(TestParms_In *in, unsigned int indent)
891 {
892     printf("%*s" "TPM2_TestParms\n", indent, "");
893     TSS_TPMT_PUBLIC_PARMS_Print(&in->parameters, indent);
894     return;
895 }
Unseal_In_Print(Unseal_In * in,unsigned int indent)896 void Unseal_In_Print(Unseal_In *in, unsigned int indent)
897 {
898     printf("%*s" "TPM2_Unseal\n", indent, "");
899     TSS_TPM_HANDLE_Print("itemHandle", in->itemHandle, indent);
900     return;
901 }
VerifySignature_In_Print(VerifySignature_In * in,unsigned int indent)902 void VerifySignature_In_Print(VerifySignature_In *in, unsigned int indent)
903 {
904     printf("%*s" "TPM2_VerifySignature\n", indent, "");
905     TSS_TPM_HANDLE_Print("keyHandle", in->keyHandle, indent);
906     TSS_TPM2B_Print("digest", indent, &in->digest.b);
907     printf("%*s" "signature\n", indent, "");
908     TSS_TPMT_SIGNATURE_Print(&in->signature, indent);
909     return;
910 }
ZGen_2Phase_In_Print(ZGen_2Phase_In * in,unsigned int indent)911 void ZGen_2Phase_In_Print(ZGen_2Phase_In *in, unsigned int indent)
912 {
913     printf("%*s" "TPM2_ZGen_2Phase\n", indent, "");
914     TSS_TPM_HANDLE_Print("keyA", in->keyA, indent);
915     TSS_TPM2B_ECC_POINT_Print("inQsB", &in->inQsB, indent);
916     TSS_TPM2B_ECC_POINT_Print("inQsB", &in->inQeB, indent);
917     TSS_TPM_ALG_ID_Print("inScheme", in->inScheme, indent);
918     printf("%*s" "counter %u\n", indent, "", in->counter);
919     return;
920 }
921