3
* Licensed Materials - Property of IBM
5
* trousers - An open source TCG Software Stack
7
* (C) Copyright International Business Machines Corp. 2004-2006
16
#include "trousers/tss.h"
17
#include "trousers_types.h"
18
#include "spi_internal_types.h"
19
#include "spi_utils.h"
20
#include "hosttable.h"
28
TCS_OpenContext_RPC(TSS_HCONTEXT tspContext, BYTE *host, int type)
31
TCS_CONTEXT_HANDLE tcsContext;
32
struct host_table_entry *entry;
34
/* add_table_entry() will make sure an entry doesn't already exist for this tsp context */
35
if ((result = add_table_entry(tspContext, host, type, &entry)))
39
case CONNECTION_TYPE_TCP_PERSISTANT:
40
if ((result = TCS_OpenContext_RPC_TP(entry, &tcsContext)) == TSS_SUCCESS)
41
entry->tcsContext = tcsContext;
43
remove_table_entry(tspContext);
50
return TSPERR(TSS_E_INTERNAL_ERROR);
53
TSS_RESULT TCSP_GetRegisteredKeyByPublicInfo(TSS_HCONTEXT hContext,
54
TCPA_ALGORITHM_ID algID, /* in */
55
UINT32 ulPublicInfoLength, /* in */
56
BYTE * rgbPublicInfo, /* in */
57
UINT32 * keySize, BYTE ** keyBlob)
59
TSS_RESULT result = TSPERR(TSS_E_INTERNAL_ERROR);
60
struct host_table_entry *entry = get_table_entry(hContext);
63
return TSPERR(TSS_E_NO_CONNECTION);
65
switch (entry->type) {
66
case CONNECTION_TYPE_TCP_PERSISTANT:
67
result = TCSP_GetRegisteredKeyByPublicInfo_TP(entry, algID,
69
rgbPublicInfo, keySize,
76
put_table_entry(entry);
81
TSS_RESULT TCS_CloseContext(TSS_HCONTEXT hContext) /* in */
83
TSS_RESULT result = TSPERR(TSS_E_INTERNAL_ERROR);
84
struct host_table_entry *entry = get_table_entry(hContext);
87
return TSPERR(TSS_E_NO_CONNECTION);
89
switch (entry->type) {
90
case CONNECTION_TYPE_TCP_PERSISTANT:
91
if ((result = TCS_CloseContext_TP(entry, hContext)) == TSS_SUCCESS) {
93
remove_table_entry(hContext);
100
if (result != TSS_SUCCESS)
101
put_table_entry(entry);
106
TSS_RESULT TCS_FreeMemory(TSS_HCONTEXT hContext, /* in */
107
BYTE * pMemory) /* in */
109
TSS_RESULT result = TSPERR(TSS_E_INTERNAL_ERROR);
110
struct host_table_entry *entry = get_table_entry(hContext);
113
return TSPERR(TSS_E_NO_CONNECTION);
115
switch (entry->type) {
116
case CONNECTION_TYPE_TCP_PERSISTANT:
117
result = TCS_FreeMemory_TP(entry, pMemory);
123
put_table_entry(entry);
128
TSS_RESULT TCS_LogPcrEvent(TSS_HCONTEXT hContext, /* in */
129
TSS_PCR_EVENT Event, /* in */
130
UINT32 * pNumber) /* out */
132
TSS_RESULT result = TSPERR(TSS_E_INTERNAL_ERROR);
133
struct host_table_entry *entry = get_table_entry(hContext);
136
return TSPERR(TSS_E_NO_CONNECTION);
138
switch (entry->type) {
139
case CONNECTION_TYPE_TCP_PERSISTANT:
140
result = TCS_LogPcrEvent_TP(entry, Event, pNumber);
146
put_table_entry(entry);
151
TSS_RESULT TCS_GetPcrEvent(TSS_HCONTEXT hContext, /* in */
152
UINT32 PcrIndex, /* in */
153
UINT32 * pNumber, /* in, out */
154
TSS_PCR_EVENT ** ppEvent) /* out */
156
TSS_RESULT result = TSPERR(TSS_E_INTERNAL_ERROR);
157
struct host_table_entry *entry = get_table_entry(hContext);
160
return TSPERR(TSS_E_NO_CONNECTION);
162
switch (entry->type) {
163
case CONNECTION_TYPE_TCP_PERSISTANT:
165
TCS_GetPcrEvent_TP(entry, PcrIndex, pNumber, ppEvent);
171
put_table_entry(entry);
176
TSS_RESULT TCS_GetPcrEventsByPcr(TSS_HCONTEXT hContext, /* in */
177
UINT32 PcrIndex, /* in */
178
UINT32 FirstEvent, /* in */
179
UINT32 * pEventCount, /* in,out */
180
TSS_PCR_EVENT ** ppEvents) /* out */
182
TSS_RESULT result = TSPERR(TSS_E_INTERNAL_ERROR);
183
struct host_table_entry *entry = get_table_entry(hContext);
186
return TSPERR(TSS_E_NO_CONNECTION);
188
switch (entry->type) {
189
case CONNECTION_TYPE_TCP_PERSISTANT:
190
result = TCS_GetPcrEventsByPcr_TP(entry, PcrIndex, FirstEvent,
191
pEventCount, ppEvents);
197
put_table_entry(entry);
202
TSS_RESULT TCS_GetPcrEventLog(TSS_HCONTEXT hContext, /* in */
203
UINT32 * pEventCount, /* out */
204
TSS_PCR_EVENT ** ppEvents) /* out */
206
TSS_RESULT result = TSPERR(TSS_E_INTERNAL_ERROR);
207
struct host_table_entry *entry = get_table_entry(hContext);
210
return TSPERR(TSS_E_NO_CONNECTION);
212
switch (entry->type) {
213
case CONNECTION_TYPE_TCP_PERSISTANT:
214
result = TCS_GetPcrEventLog_TP(entry, pEventCount, ppEvents);
220
put_table_entry(entry);
225
TSS_RESULT TCS_RegisterKey(TSS_HCONTEXT hContext, /* in */
226
TSS_UUID WrappingKeyUUID, /* in */
227
TSS_UUID KeyUUID, /* in */
228
UINT32 cKeySize, /* in */
229
BYTE * rgbKey, /* in */
230
UINT32 cVendorData, /* in */
231
BYTE * gbVendorData) /* in */
233
TSS_RESULT result = TSPERR(TSS_E_INTERNAL_ERROR);
234
struct host_table_entry *entry = get_table_entry(hContext);
237
return TSPERR(TSS_E_NO_CONNECTION);
239
switch (entry->type) {
240
case CONNECTION_TYPE_TCP_PERSISTANT:
241
result = TCS_RegisterKey_TP(entry, WrappingKeyUUID, KeyUUID,
242
cKeySize, rgbKey, cVendorData, gbVendorData);
248
put_table_entry(entry);
253
TSS_RESULT TCSP_UnregisterKey(TSS_HCONTEXT hContext, /* in */
254
TSS_UUID KeyUUID) /* in */
256
TSS_RESULT result = TSPERR(TSS_E_INTERNAL_ERROR);
257
struct host_table_entry *entry = get_table_entry(hContext);
260
return TSPERR(TSS_E_NO_CONNECTION);
262
switch (entry->type) {
263
case CONNECTION_TYPE_TCP_PERSISTANT:
264
result = TCSP_UnregisterKey_TP(entry, KeyUUID);
270
put_table_entry(entry);
275
TSS_RESULT TCS_EnumRegisteredKeys(TSS_HCONTEXT hContext, /* in */
276
TSS_UUID * pKeyUUID, /* in */
277
UINT32 * pcKeyHierarchySize, /* out */
278
TSS_KM_KEYINFO ** ppKeyHierarchy) /* out */
280
TSS_RESULT result = TSPERR(TSS_E_INTERNAL_ERROR);
281
struct host_table_entry *entry = get_table_entry(hContext);
284
return TSPERR(TSS_E_NO_CONNECTION);
286
switch (entry->type) {
287
case CONNECTION_TYPE_TCP_PERSISTANT:
288
result = TCS_EnumRegisteredKeys_TP(entry, pKeyUUID,
289
pcKeyHierarchySize, ppKeyHierarchy);
295
put_table_entry(entry);
300
TSS_RESULT TCS_GetRegisteredKey(TSS_HCONTEXT hContext, /* in */
301
TSS_UUID KeyUUID, /* in */
302
TSS_KM_KEYINFO ** ppKeyInfo) /* out */
304
TSS_RESULT result = TSPERR(TSS_E_INTERNAL_ERROR);
305
struct host_table_entry *entry = get_table_entry(hContext);
308
return TSPERR(TSS_E_NO_CONNECTION);
310
switch (entry->type) {
311
case CONNECTION_TYPE_TCP_PERSISTANT:
312
result = TCS_GetRegisteredKey_TP(entry, KeyUUID, ppKeyInfo);
318
put_table_entry(entry);
323
TSS_RESULT TCS_GetRegisteredKeyBlob(TSS_HCONTEXT hContext, /* in */
324
TSS_UUID KeyUUID, /* in */
325
UINT32 * pcKeySize, /* out */
326
BYTE ** prgbKey) /* out */
328
TSS_RESULT result = TSPERR(TSS_E_INTERNAL_ERROR);
329
struct host_table_entry *entry = get_table_entry(hContext);
332
return TSPERR(TSS_E_NO_CONNECTION);
334
switch (entry->type) {
335
case CONNECTION_TYPE_TCP_PERSISTANT:
336
result = TCS_GetRegisteredKeyBlob_TP(entry, KeyUUID, pcKeySize,
343
put_table_entry(entry);
348
TSS_RESULT TCSP_LoadKeyByBlob(TSS_HCONTEXT hContext, /* in */
349
TCS_KEY_HANDLE hUnwrappingKey, /* in */
350
UINT32 cWrappedKeyBlobSize, /* in */
351
BYTE * rgbWrappedKeyBlob, /* in */
352
TPM_AUTH * pAuth, /* in, out */
353
TCS_KEY_HANDLE * phKeyTCSI, /* out */
354
TCS_KEY_HANDLE * phKeyHMAC) /* out */
356
TSS_RESULT result = TSPERR(TSS_E_INTERNAL_ERROR);
357
struct host_table_entry *entry = get_table_entry(hContext);
360
return TSPERR(TSS_E_NO_CONNECTION);
362
switch (entry->type) {
363
case CONNECTION_TYPE_TCP_PERSISTANT:
364
result = TCSP_LoadKeyByBlob_TP(entry, hUnwrappingKey,
365
cWrappedKeyBlobSize, rgbWrappedKeyBlob,
366
pAuth, phKeyTCSI, phKeyHMAC);
372
put_table_entry(entry);
377
TSS_RESULT TCSP_LoadKeyByUUID(TSS_HCONTEXT hContext, /* in */
378
TSS_UUID KeyUUID, /* in */
379
TCS_LOADKEY_INFO * pLoadKeyInfo, /* in, out */
380
TCS_KEY_HANDLE * phKeyTCSI) /* out */
382
TSS_RESULT result = TSPERR(TSS_E_INTERNAL_ERROR);
383
struct host_table_entry *entry = get_table_entry(hContext);
386
return TSPERR(TSS_E_NO_CONNECTION);
388
switch (entry->type) {
389
case CONNECTION_TYPE_TCP_PERSISTANT:
390
result = TCSP_LoadKeyByUUID_TP(entry, KeyUUID, pLoadKeyInfo,
397
put_table_entry(entry);
402
TSS_RESULT TCSP_EvictKey(TSS_HCONTEXT hContext, /* in */
403
TCS_KEY_HANDLE hKey) /* in */
405
TSS_RESULT result = TSPERR(TSS_E_INTERNAL_ERROR);
406
struct host_table_entry *entry = get_table_entry(hContext);
409
return TSPERR(TSS_E_NO_CONNECTION);
411
switch (entry->type) {
412
case CONNECTION_TYPE_TCP_PERSISTANT:
413
result = TCSP_EvictKey_TP(entry, hKey);
419
put_table_entry(entry);
424
TSS_RESULT TCSP_CreateWrapKey(TSS_HCONTEXT hContext, /* in */
425
TCS_KEY_HANDLE hWrappingKey, /* in */
426
TCPA_ENCAUTH KeyUsageAuth, /* in */
427
TCPA_ENCAUTH KeyMigrationAuth, /* in */
428
UINT32 keyInfoSize, /* in */
429
BYTE * keyInfo, /* in */
430
UINT32 * keyDataSize, /* out */
431
BYTE ** keyData, /* out */
432
TPM_AUTH * pAuth) /* in, out */
434
TSS_RESULT result = TSPERR(TSS_E_INTERNAL_ERROR);
435
struct host_table_entry *entry = get_table_entry(hContext);
438
return TSPERR(TSS_E_NO_CONNECTION);
440
switch (entry->type) {
441
case CONNECTION_TYPE_TCP_PERSISTANT:
442
result = TCSP_CreateWrapKey_TP(entry, hWrappingKey, KeyUsageAuth,
443
KeyMigrationAuth, keyInfoSize, keyInfo,
444
keyDataSize, keyData, pAuth);
450
put_table_entry(entry);
455
TSS_RESULT TCSP_GetPubKey(TSS_HCONTEXT hContext, /* in */
456
TCS_KEY_HANDLE hKey, /* in */
457
TPM_AUTH * pAuth, /* in, out */
458
UINT32 * pcPubKeySize, /* out */
459
BYTE ** prgbPubKey) /* out */
461
TSS_RESULT result = TSPERR(TSS_E_INTERNAL_ERROR);
462
struct host_table_entry *entry = get_table_entry(hContext);
465
return TSPERR(TSS_E_NO_CONNECTION);
467
switch (entry->type) {
468
case CONNECTION_TYPE_TCP_PERSISTANT:
469
result = TCSP_GetPubKey_TP(entry, hKey, pAuth, pcPubKeySize,
476
put_table_entry(entry);
481
TSS_RESULT TCSP_MakeIdentity(TSS_HCONTEXT hContext, /* in */
482
TCPA_ENCAUTH identityAuth, /* in */
483
TCPA_CHOSENID_HASH IDLabel_PrivCAHash, /* in */
484
UINT32 idKeyInfoSize, /* in */
485
BYTE * idKeyInfo, /* in */
486
TPM_AUTH * pSrkAuth, /* in, out */
487
TPM_AUTH * pOwnerAuth, /* in, out */
488
UINT32 * idKeySize, /* out */
489
BYTE ** idKey, /* out */
490
UINT32 * pcIdentityBindingSize, /* out */
491
BYTE ** prgbIdentityBinding, /* out */
492
UINT32 * pcEndorsementCredentialSize, /* out */
493
BYTE ** prgbEndorsementCredential, /* out */
494
UINT32 * pcPlatformCredentialSize, /* out */
495
BYTE ** prgbPlatformCredential, /* out */
496
UINT32 * pcConformanceCredentialSize, /* out */
497
BYTE ** prgbConformanceCredential) /* out */
499
TSS_RESULT result = TSPERR(TSS_E_INTERNAL_ERROR);
500
struct host_table_entry *entry = get_table_entry(hContext);
503
return TSPERR(TSS_E_NO_CONNECTION);
505
switch (entry->type) {
506
case CONNECTION_TYPE_TCP_PERSISTANT:
507
result = TCSP_MakeIdentity_TP(entry, identityAuth,
508
IDLabel_PrivCAHash, idKeyInfoSize, idKeyInfo,
509
pSrkAuth, pOwnerAuth, idKeySize, idKey,
510
pcIdentityBindingSize, prgbIdentityBinding,
511
pcEndorsementCredentialSize,
512
prgbEndorsementCredential,
513
pcPlatformCredentialSize,
514
prgbPlatformCredential,
515
pcConformanceCredentialSize,
516
prgbConformanceCredential);
522
put_table_entry(entry);
527
TSS_RESULT TCSP_SetOwnerInstall(TSS_HCONTEXT hContext, /* in */
528
TSS_BOOL state) /* in */
530
TSS_RESULT result = TSPERR(TSS_E_INTERNAL_ERROR);
531
struct host_table_entry *entry = get_table_entry(hContext);
534
return TSPERR(TSS_E_NO_CONNECTION);
536
switch (entry->type) {
537
case CONNECTION_TYPE_TCP_PERSISTANT:
538
result = TCSP_SetOwnerInstall_TP(entry, state);
544
put_table_entry(entry);
549
TSS_RESULT TCSP_TakeOwnership(TSS_HCONTEXT hContext, /* in */
550
UINT16 protocolID, /* in */
551
UINT32 encOwnerAuthSize, /* in */
552
BYTE * encOwnerAuth, /* in */
553
UINT32 encSrkAuthSize, /* in */
554
BYTE * encSrkAuth, /* in */
555
UINT32 srkInfoSize, /* in */
556
BYTE * srkInfo, /* in */
557
TPM_AUTH * ownerAuth, /* in, out */
561
TSS_RESULT result = TSPERR(TSS_E_INTERNAL_ERROR);
562
struct host_table_entry *entry = get_table_entry(hContext);
565
return TSPERR(TSS_E_NO_CONNECTION);
567
switch (entry->type) {
568
case CONNECTION_TYPE_TCP_PERSISTANT:
569
result = TCSP_TakeOwnership_TP(entry, protocolID,
570
encOwnerAuthSize, encOwnerAuth,
571
encSrkAuthSize, encSrkAuth, srkInfoSize,
572
srkInfo, ownerAuth, srkKeySize, srkKey);
578
put_table_entry(entry);
583
TSS_RESULT TCSP_OIAP(TSS_HCONTEXT hContext, /* in */
584
TCS_AUTHHANDLE * authHandle, /* out */
585
TCPA_NONCE * nonce0) /* out */
587
TSS_RESULT result = TSPERR(TSS_E_INTERNAL_ERROR);
588
struct host_table_entry *entry = get_table_entry(hContext);
591
return TSPERR(TSS_E_NO_CONNECTION);
593
switch (entry->type) {
594
case CONNECTION_TYPE_TCP_PERSISTANT:
595
result = TCSP_OIAP_TP(entry, authHandle, nonce0);
601
put_table_entry(entry);
606
TSS_RESULT TCSP_OSAP(TSS_HCONTEXT hContext, /* in */
607
TCPA_ENTITY_TYPE entityType, /* in */
608
UINT32 entityValue, /* in */
609
TCPA_NONCE nonceOddOSAP, /* in */
610
TCS_AUTHHANDLE * authHandle, /* out */
611
TCPA_NONCE * nonceEven, /* out */
612
TCPA_NONCE * nonceEvenOSAP) /* out */
614
TSS_RESULT result = TSPERR(TSS_E_INTERNAL_ERROR);
615
struct host_table_entry *entry = get_table_entry(hContext);
618
return TSPERR(TSS_E_NO_CONNECTION);
620
switch (entry->type) {
621
case CONNECTION_TYPE_TCP_PERSISTANT:
622
result = TCSP_OSAP_TP(entry, entityType, entityValue,
623
nonceOddOSAP, authHandle, nonceEven, nonceEvenOSAP);
629
put_table_entry(entry);
634
TSS_RESULT TCSP_ChangeAuth(TSS_HCONTEXT hContext, /* in */
635
TCS_KEY_HANDLE parentHandle, /* in */
636
TCPA_PROTOCOL_ID protocolID, /* in */
637
TCPA_ENCAUTH newAuth, /* in */
638
TCPA_ENTITY_TYPE entityType, /* in */
639
UINT32 encDataSize, /* in */
640
BYTE * encData, /* in */
641
TPM_AUTH * ownerAuth, /* in, out */
642
TPM_AUTH * entityAuth, /* in, out */
643
UINT32 * outDataSize, /* out */
644
BYTE ** outData) /* out */
646
TSS_RESULT result = TSPERR(TSS_E_INTERNAL_ERROR);
647
struct host_table_entry *entry = get_table_entry(hContext);
650
return TSPERR(TSS_E_NO_CONNECTION);
652
switch (entry->type) {
653
case CONNECTION_TYPE_TCP_PERSISTANT:
654
result = TCSP_ChangeAuth_TP(entry, parentHandle, protocolID, newAuth,
655
entityType, encDataSize, encData, ownerAuth,
656
entityAuth, outDataSize, outData);
662
put_table_entry(entry);
667
TSS_RESULT TCSP_ChangeAuthOwner(TSS_HCONTEXT hContext, /* in */
668
TCPA_PROTOCOL_ID protocolID, /* in */
669
TCPA_ENCAUTH newAuth, /* in */
670
TCPA_ENTITY_TYPE entityType, /* in */
671
TPM_AUTH * ownerAuth) /* in, out */
673
TSS_RESULT result = TSPERR(TSS_E_INTERNAL_ERROR);
674
struct host_table_entry *entry = get_table_entry(hContext);
677
return TSPERR(TSS_E_NO_CONNECTION);
679
switch (entry->type) {
680
case CONNECTION_TYPE_TCP_PERSISTANT:
681
result = TCSP_ChangeAuthOwner_TP(entry, protocolID, newAuth,
682
entityType, ownerAuth);
688
put_table_entry(entry);
693
TSS_RESULT TCSP_ChangeAuthAsymStart(TSS_HCONTEXT hContext, /* in */
694
TCS_KEY_HANDLE idHandle, /* in */
695
TCPA_NONCE antiReplay, /* in */
696
UINT32 KeySizeIn, /* in */
697
BYTE * KeyDataIn, /* in */
698
TPM_AUTH * pAuth, /* in, out */
699
UINT32 * KeySizeOut, /* out */
700
BYTE ** KeyDataOut, /* out */
701
UINT32 * CertifyInfoSize, /* out */
702
BYTE ** CertifyInfo, /* out */
703
UINT32 * sigSize, /* out */
704
BYTE ** sig, /* out */
705
TCS_KEY_HANDLE * ephHandle) /* out */
707
TSS_RESULT result = TSPERR(TSS_E_INTERNAL_ERROR);
708
struct host_table_entry *entry = get_table_entry(hContext);
711
return TSPERR(TSS_E_NO_CONNECTION);
713
switch (entry->type) {
714
case CONNECTION_TYPE_TCP_PERSISTANT:
715
result = TCSP_ChangeAuthAsymStart_TP(entry, idHandle, antiReplay,
716
KeySizeIn, KeyDataIn, pAuth,
717
KeySizeOut, KeyDataOut,
718
CertifyInfoSize, CertifyInfo, sigSize,
725
put_table_entry(entry);
730
TSS_RESULT TCSP_ChangeAuthAsymFinish(TSS_HCONTEXT hContext, /* in */
731
TCS_KEY_HANDLE parentHandle, /* in */
732
TCS_KEY_HANDLE ephHandle, /* in */
733
TCPA_ENTITY_TYPE entityType, /* in */
734
TCPA_HMAC newAuthLink, /* in */
735
UINT32 newAuthSize, /* in */
736
BYTE * encNewAuth, /* in */
737
UINT32 encDataSizeIn, /* in */
738
BYTE * encDataIn, /* in */
739
TPM_AUTH * ownerAuth, /* in, out */
740
UINT32 * encDataSizeOut, /* out */
741
BYTE ** encDataOut, /* out */
742
TCPA_SALT_NONCE * saltNonce, /* out */
743
TCPA_DIGEST * changeProof) /* out */
745
TSS_RESULT result = TSPERR(TSS_E_INTERNAL_ERROR);
746
struct host_table_entry *entry = get_table_entry(hContext);
749
return TSPERR(TSS_E_NO_CONNECTION);
751
switch (entry->type) {
752
case CONNECTION_TYPE_TCP_PERSISTANT:
753
result = TCSP_ChangeAuthAsymFinish_TP(entry, parentHandle,
754
ephHandle, entityType, newAuthLink,
755
newAuthSize, encNewAuth,
756
encDataSizeIn, encDataIn, ownerAuth,
757
encDataSizeOut, encDataOut, saltNonce,
764
put_table_entry(entry);
769
TSS_RESULT TCSP_TerminateHandle(TSS_HCONTEXT hContext, /* in */
770
TCS_AUTHHANDLE handle) /* in */
772
TSS_RESULT result = TSPERR(TSS_E_INTERNAL_ERROR);
773
struct host_table_entry *entry = get_table_entry(hContext);
776
return TSPERR(TSS_E_NO_CONNECTION);
778
switch (entry->type) {
779
case CONNECTION_TYPE_TCP_PERSISTANT:
780
result = TCSP_TerminateHandle_TP(entry, handle);
786
put_table_entry(entry);
791
TSS_RESULT TCSP_ActivateTPMIdentity(TSS_HCONTEXT hContext, /* in */
792
TCS_KEY_HANDLE idKey, /* in */
793
UINT32 blobSize, /* in */
794
BYTE * blob, /* in */
795
TPM_AUTH * idKeyAuth, /* in, out */
796
TPM_AUTH * ownerAuth, /* in, out */
797
UINT32 * SymmetricKeySize, /* out */
798
BYTE ** SymmetricKey) /* out */
800
TSS_RESULT result = TSPERR(TSS_E_INTERNAL_ERROR);
801
struct host_table_entry *entry = get_table_entry(hContext);
804
return TSPERR(TSS_E_NO_CONNECTION);
806
switch (entry->type) {
807
case CONNECTION_TYPE_TCP_PERSISTANT:
808
result = TCSP_ActivateTPMIdentity_TP(entry, idKey, blobSize, blob,
809
idKeyAuth, ownerAuth, SymmetricKeySize,
816
put_table_entry(entry);
821
TSS_RESULT TCSP_Extend(TSS_HCONTEXT hContext, /* in */
822
TCPA_PCRINDEX pcrNum, /* in */
823
TCPA_DIGEST inDigest, /* in */
824
TCPA_PCRVALUE * outDigest) /* out */
826
TSS_RESULT result = TSPERR(TSS_E_INTERNAL_ERROR);
827
struct host_table_entry *entry = get_table_entry(hContext);
830
return TSPERR(TSS_E_NO_CONNECTION);
832
switch (entry->type) {
833
case CONNECTION_TYPE_TCP_PERSISTANT:
834
result = TCSP_Extend_TP(entry, pcrNum, inDigest, outDigest);
840
put_table_entry(entry);
845
TSS_RESULT TCSP_PcrRead(TSS_HCONTEXT hContext, /* in */
846
TCPA_PCRINDEX pcrNum, /* in */
847
TCPA_PCRVALUE * outDigest) /* out */
849
TSS_RESULT result = TSPERR(TSS_E_INTERNAL_ERROR);
850
struct host_table_entry *entry = get_table_entry(hContext);
853
return TSPERR(TSS_E_NO_CONNECTION);
855
switch (entry->type) {
856
case CONNECTION_TYPE_TCP_PERSISTANT:
857
result = TCSP_PcrRead_TP(entry, pcrNum, outDigest);
863
put_table_entry(entry);
868
TSS_RESULT TCSP_Quote(TSS_HCONTEXT hContext, /* in */
869
TCS_KEY_HANDLE keyHandle, /* in */
870
TCPA_NONCE antiReplay, /* in */
871
UINT32 pcrDataSizeIn, /* in */
872
BYTE * pcrDataIn, /* in */
873
TPM_AUTH * privAuth, /* in, out */
874
UINT32 * pcrDataSizeOut, /* out */
875
BYTE ** pcrDataOut, /* out */
876
UINT32 * sigSize, /* out */
877
BYTE ** sig) /* out */
879
TSS_RESULT result = TSPERR(TSS_E_INTERNAL_ERROR);
880
struct host_table_entry *entry = get_table_entry(hContext);
883
return TSPERR(TSS_E_NO_CONNECTION);
885
switch (entry->type) {
886
case CONNECTION_TYPE_TCP_PERSISTANT:
887
result = TCSP_Quote_TP(entry, keyHandle, antiReplay,
888
pcrDataSizeIn, pcrDataIn, privAuth, pcrDataSizeOut,
889
pcrDataOut, sigSize, sig);
895
put_table_entry(entry);
900
TSS_RESULT TCSP_DirWriteAuth(TSS_HCONTEXT hContext, /* in */
901
TCPA_DIRINDEX dirIndex, /* in */
902
TCPA_DIRVALUE newContents, /* in */
903
TPM_AUTH * ownerAuth) /* in, out */
905
TSS_RESULT result = TSPERR(TSS_E_INTERNAL_ERROR);
906
struct host_table_entry *entry = get_table_entry(hContext);
909
return TSPERR(TSS_E_NO_CONNECTION);
911
switch (entry->type) {
912
case CONNECTION_TYPE_TCP_PERSISTANT:
913
result = TCSP_DirWriteAuth_TP(entry, dirIndex, newContents,
920
put_table_entry(entry);
925
TSS_RESULT TCSP_DirRead(TSS_HCONTEXT hContext, /* in */
926
TCPA_DIRINDEX dirIndex, /* in */
927
TCPA_DIRVALUE * dirValue) /* out */
929
TSS_RESULT result = TSPERR(TSS_E_INTERNAL_ERROR);
930
struct host_table_entry *entry = get_table_entry(hContext);
933
return TSPERR(TSS_E_NO_CONNECTION);
935
switch (entry->type) {
936
case CONNECTION_TYPE_TCP_PERSISTANT:
937
result = TCSP_DirRead_TP(entry, dirIndex, dirValue);
943
put_table_entry(entry);
948
TSS_RESULT TCSP_Seal(TSS_HCONTEXT hContext, /* in */
949
TCS_KEY_HANDLE keyHandle, /* in */
950
TCPA_ENCAUTH encAuth, /* in */
951
UINT32 pcrInfoSize, /* in */
952
BYTE * PcrInfo, /* in */
953
UINT32 inDataSize, /* in */
954
BYTE * inData, /* in */
955
TPM_AUTH * pubAuth, /* in, out */
956
UINT32 * SealedDataSize, /* out */
957
BYTE ** SealedData) /* out */
959
TSS_RESULT result = TSPERR(TSS_E_INTERNAL_ERROR);
960
struct host_table_entry *entry = get_table_entry(hContext);
963
return TSPERR(TSS_E_NO_CONNECTION);
965
switch (entry->type) {
966
case CONNECTION_TYPE_TCP_PERSISTANT:
967
result = TCSP_Seal_TP(entry, keyHandle, encAuth, pcrInfoSize,
968
PcrInfo, inDataSize, inData, pubAuth, SealedDataSize,
975
put_table_entry(entry);
980
TSS_RESULT TCSP_Unseal(TSS_HCONTEXT hContext, /* in */
981
TCS_KEY_HANDLE parentHandle, /* in */
982
UINT32 SealedDataSize, /* in */
983
BYTE * SealedData, /* in */
984
TPM_AUTH * parentAuth, /* in, out */
985
TPM_AUTH * dataAuth, /* in, out */
986
UINT32 * DataSize, /* out */
987
BYTE ** Data) /* out */
989
TSS_RESULT result = TSPERR(TSS_E_INTERNAL_ERROR);
990
struct host_table_entry *entry = get_table_entry(hContext);
993
return TSPERR(TSS_E_NO_CONNECTION);
995
switch (entry->type) {
996
case CONNECTION_TYPE_TCP_PERSISTANT:
997
result = TCSP_Unseal_TP(entry, parentHandle, SealedDataSize,
998
SealedData, parentAuth, dataAuth, DataSize, Data);
1004
put_table_entry(entry);
1009
TSS_RESULT TCSP_UnBind(TSS_HCONTEXT hContext, /* in */
1010
TCS_KEY_HANDLE keyHandle, /* in */
1011
UINT32 inDataSize, /* in */
1012
BYTE * inData, /* in */
1013
TPM_AUTH * privAuth, /* in, out */
1014
UINT32 * outDataSize, /* out */
1015
BYTE ** outData) /* out */
1017
TSS_RESULT result = TSPERR(TSS_E_INTERNAL_ERROR);
1018
struct host_table_entry *entry = get_table_entry(hContext);
1021
return TSPERR(TSS_E_NO_CONNECTION);
1023
switch (entry->type) {
1024
case CONNECTION_TYPE_TCP_PERSISTANT:
1025
result = TCSP_UnBind_TP(entry, keyHandle, inDataSize, inData,
1026
privAuth, outDataSize,
1033
put_table_entry(entry);
1038
TSS_RESULT TCSP_CreateMigrationBlob(TSS_HCONTEXT hContext, /* in */
1039
TCS_KEY_HANDLE parentHandle, /* in */
1040
TCPA_MIGRATE_SCHEME migrationType, /* in */
1041
UINT32 MigrationKeyAuthSize, /* in */
1042
BYTE * MigrationKeyAuth, /* in */
1043
UINT32 encDataSize, /* in */
1044
BYTE * encData, /* in */
1045
TPM_AUTH * parentAuth, /* in, out */
1046
TPM_AUTH * entityAuth, /* in, out */
1047
UINT32 * randomSize, /* out */
1048
BYTE ** random, /* out */
1049
UINT32 * outDataSize, /* out */
1050
BYTE ** outData) /* out */
1052
TSS_RESULT result = TSPERR(TSS_E_INTERNAL_ERROR);
1053
struct host_table_entry *entry = get_table_entry(hContext);
1056
return TSPERR(TSS_E_NO_CONNECTION);
1058
switch (entry->type) {
1059
case CONNECTION_TYPE_TCP_PERSISTANT:
1060
result = TCSP_CreateMigrationBlob_TP(entry, parentHandle,
1061
migrationType, MigrationKeyAuthSize,
1062
MigrationKeyAuth, encDataSize, encData,
1063
parentAuth, entityAuth, randomSize,
1064
random, outDataSize, outData);
1070
put_table_entry(entry);
1075
TSS_RESULT TCSP_ConvertMigrationBlob(TSS_HCONTEXT hContext, /* in */
1076
TCS_KEY_HANDLE parentHandle, /* in */
1077
UINT32 inDataSize, /* in */
1078
BYTE * inData, /* in */
1079
UINT32 randomSize, /* in */
1080
BYTE * random, /* in */
1081
TPM_AUTH * parentAuth, /* in, out */
1082
UINT32 * outDataSize, /* out */
1083
BYTE ** outData) /* out */
1085
TSS_RESULT result = TSPERR(TSS_E_INTERNAL_ERROR);
1086
struct host_table_entry *entry = get_table_entry(hContext);
1089
return TSPERR(TSS_E_NO_CONNECTION);
1091
switch (entry->type) {
1092
case CONNECTION_TYPE_TCP_PERSISTANT:
1093
result = TCSP_ConvertMigrationBlob_TP(entry, parentHandle,
1094
inDataSize, inData, randomSize,
1095
random, parentAuth, outDataSize,
1102
put_table_entry(entry);
1107
TSS_RESULT TCSP_AuthorizeMigrationKey(TSS_HCONTEXT hContext, /* in */
1108
TCPA_MIGRATE_SCHEME migrateScheme, /* in */
1109
UINT32 MigrationKeySize, /* in */
1110
BYTE * MigrationKey, /* in */
1111
TPM_AUTH * ownerAuth, /* in, out */
1112
UINT32 * MigrationKeyAuthSize, /* out */
1113
BYTE ** MigrationKeyAuth) /* out */
1115
TSS_RESULT result = TSPERR(TSS_E_INTERNAL_ERROR);
1116
struct host_table_entry *entry = get_table_entry(hContext);
1119
return TSPERR(TSS_E_NO_CONNECTION);
1121
switch (entry->type) {
1122
case CONNECTION_TYPE_TCP_PERSISTANT:
1123
result = TCSP_AuthorizeMigrationKey_TP(entry, migrateScheme,
1124
MigrationKeySize, MigrationKey,
1125
ownerAuth, MigrationKeyAuthSize,
1132
put_table_entry(entry);
1137
TSS_RESULT TCSP_CertifyKey(TSS_HCONTEXT hContext, /* in */
1138
TCS_KEY_HANDLE certHandle, /* in */
1139
TCS_KEY_HANDLE keyHandle, /* in */
1140
TCPA_NONCE antiReplay, /* in */
1141
TPM_AUTH * certAuth, /* in, out */
1142
TPM_AUTH * keyAuth, /* in, out */
1143
UINT32 * CertifyInfoSize, /* out */
1144
BYTE ** CertifyInfo, /* out */
1145
UINT32 * outDataSize, /* out */
1146
BYTE ** outData) /* out */
1148
TSS_RESULT result = TSPERR(TSS_E_INTERNAL_ERROR);
1149
struct host_table_entry *entry = get_table_entry(hContext);
1152
return TSPERR(TSS_E_NO_CONNECTION);
1154
switch (entry->type) {
1155
case CONNECTION_TYPE_TCP_PERSISTANT:
1156
result = TCSP_CertifyKey_TP(entry, certHandle, keyHandle,
1157
antiReplay, certAuth, keyAuth, CertifyInfoSize,
1158
CertifyInfo, outDataSize, outData);
1164
put_table_entry(entry);
1169
TSS_RESULT TCSP_Sign(TSS_HCONTEXT hContext, /* in */
1170
TCS_KEY_HANDLE keyHandle, /* in */
1171
UINT32 areaToSignSize, /* in */
1172
BYTE * areaToSign, /* in */
1173
TPM_AUTH * privAuth, /* in, out */
1174
UINT32 * sigSize, /* out */
1175
BYTE ** sig) /* out */
1177
TSS_RESULT result = TSPERR(TSS_E_INTERNAL_ERROR);
1178
struct host_table_entry *entry = get_table_entry(hContext);
1181
return TSPERR(TSS_E_NO_CONNECTION);
1183
switch (entry->type) {
1184
case CONNECTION_TYPE_TCP_PERSISTANT:
1185
result = TCSP_Sign_TP(entry, keyHandle, areaToSignSize,
1186
areaToSign, privAuth, sigSize, sig);
1192
put_table_entry(entry);
1197
TSS_RESULT TCSP_GetRandom(TSS_HCONTEXT hContext, /* in */
1198
UINT32 bytesRequested, /* in */
1199
BYTE ** randomBytes) /* out */
1201
TSS_RESULT result = TSPERR(TSS_E_INTERNAL_ERROR);
1202
struct host_table_entry *entry = get_table_entry(hContext);
1205
return TSPERR(TSS_E_NO_CONNECTION);
1207
switch (entry->type) {
1208
case CONNECTION_TYPE_TCP_PERSISTANT:
1209
result = TCSP_GetRandom_TP(entry, bytesRequested, randomBytes);
1215
put_table_entry(entry);
1220
TSS_RESULT TCSP_StirRandom(TSS_HCONTEXT hContext, /* in */
1221
UINT32 inDataSize, /* in */
1222
BYTE * inData) /* in */
1224
TSS_RESULT result = TSPERR(TSS_E_INTERNAL_ERROR);
1225
struct host_table_entry *entry = get_table_entry(hContext);
1228
return TSPERR(TSS_E_NO_CONNECTION);
1230
switch (entry->type) {
1231
case CONNECTION_TYPE_TCP_PERSISTANT:
1232
result = TCSP_StirRandom_TP(entry, inDataSize, inData);
1238
put_table_entry(entry);
1243
TSS_RESULT TCS_GetCapability(TSS_HCONTEXT hContext, /* in */
1244
TCPA_CAPABILITY_AREA capArea, /* in */
1245
UINT32 subCapSize, /* in */
1246
BYTE * subCap, /* in */
1247
UINT32 * respSize, /* out */
1248
BYTE ** resp) /* out */
1250
TSS_RESULT result = TSPERR(TSS_E_INTERNAL_ERROR);
1251
struct host_table_entry *entry = get_table_entry(hContext);
1254
return TSPERR(TSS_E_NO_CONNECTION);
1256
switch (entry->type) {
1257
case CONNECTION_TYPE_TCP_PERSISTANT:
1258
result = TCS_GetCapability_TP(entry, capArea, subCapSize, subCap,
1265
put_table_entry(entry);
1270
TSS_RESULT TCSP_GetCapability(TSS_HCONTEXT hContext, /* in */
1271
TCPA_CAPABILITY_AREA capArea, /* in */
1272
UINT32 subCapSize, /* in */
1273
BYTE * subCap, /* in */
1274
UINT32 * respSize, /* out */
1275
BYTE ** resp) /* out */
1277
TSS_RESULT result = TSPERR(TSS_E_INTERNAL_ERROR);
1278
struct host_table_entry *entry = get_table_entry(hContext);
1281
return TSPERR(TSS_E_NO_CONNECTION);
1283
switch (entry->type) {
1284
case CONNECTION_TYPE_TCP_PERSISTANT:
1285
result = TCSP_GetCapability_TP(entry, capArea, subCapSize, subCap,
1292
put_table_entry(entry);
1297
TSS_RESULT TCSP_GetCapabilitySigned(TSS_HCONTEXT hContext, /* in */
1298
TCS_KEY_HANDLE keyHandle, /* in */
1299
TCPA_NONCE antiReplay, /* in */
1300
TCPA_CAPABILITY_AREA capArea, /* in */
1301
UINT32 subCapSize, /* in */
1302
BYTE * subCap, /* in */
1303
TPM_AUTH * privAuth, /* in, out */
1304
TCPA_VERSION * Version, /* out */
1305
UINT32 * respSize, /* out */
1306
BYTE ** resp, /* out */
1307
UINT32 * sigSize, /* out */
1308
BYTE ** sig) /* out */
1310
TSS_RESULT result = TSPERR(TSS_E_INTERNAL_ERROR);
1311
struct host_table_entry *entry = get_table_entry(hContext);
1314
return TSPERR(TSS_E_NO_CONNECTION);
1316
switch (entry->type) {
1317
case CONNECTION_TYPE_TCP_PERSISTANT:
1318
result = TCSP_GetCapabilitySigned_TP(entry, keyHandle, antiReplay,
1319
capArea, subCapSize, subCap, privAuth,
1320
Version, respSize, resp, sigSize, sig);
1326
put_table_entry(entry);
1331
TSS_RESULT TCSP_GetCapabilityOwner(TSS_HCONTEXT hContext, /* in */
1332
TPM_AUTH * pOwnerAuth, /* out */
1333
TCPA_VERSION * pVersion, /* out */
1334
UINT32 * pNonVolatileFlags, /* out */
1335
UINT32 * pVolatileFlags) /* out */
1337
TSS_RESULT result = TSPERR(TSS_E_INTERNAL_ERROR);
1338
struct host_table_entry *entry = get_table_entry(hContext);
1341
return TSPERR(TSS_E_NO_CONNECTION);
1343
switch (entry->type) {
1344
case CONNECTION_TYPE_TCP_PERSISTANT:
1345
result = TCSP_GetCapabilityOwner_TP(entry, pOwnerAuth, pVersion,
1346
pNonVolatileFlags, pVolatileFlags);
1352
put_table_entry(entry);
1357
TSS_RESULT TCSP_CreateEndorsementKeyPair(TSS_HCONTEXT hContext, /* in */
1358
TCPA_NONCE antiReplay, /* in */
1359
UINT32 endorsementKeyInfoSize, /* in */
1360
BYTE * endorsementKeyInfo, /* in */
1361
UINT32 * endorsementKeySize, /* out */
1362
BYTE ** endorsementKey, /* out */
1363
TCPA_DIGEST * checksum) /* out */
1365
TSS_RESULT result = TSPERR(TSS_E_INTERNAL_ERROR);
1366
struct host_table_entry *entry = get_table_entry(hContext);
1369
return TSPERR(TSS_E_NO_CONNECTION);
1371
switch (entry->type) {
1372
case CONNECTION_TYPE_TCP_PERSISTANT:
1373
result = TCSP_CreateEndorsementKeyPair_TP(entry, antiReplay,
1374
endorsementKeyInfoSize,
1377
endorsementKey, checksum);
1383
put_table_entry(entry);
1388
TSS_RESULT TCSP_ReadPubek(TSS_HCONTEXT hContext, /* in */
1389
TCPA_NONCE antiReplay, /* in */
1390
UINT32 * pubEndorsementKeySize, /* out */
1391
BYTE ** pubEndorsementKey, /* out */
1392
TCPA_DIGEST * checksum) /* out */
1394
TSS_RESULT result = TSPERR(TSS_E_INTERNAL_ERROR);
1395
struct host_table_entry *entry = get_table_entry(hContext);
1398
return TSPERR(TSS_E_NO_CONNECTION);
1400
switch (entry->type) {
1401
case CONNECTION_TYPE_TCP_PERSISTANT:
1402
result = TCSP_ReadPubek_TP(entry, antiReplay,
1403
pubEndorsementKeySize, pubEndorsementKey,
1410
put_table_entry(entry);
1415
TSS_RESULT TCSP_DisablePubekRead(TSS_HCONTEXT hContext, /* in */
1416
TPM_AUTH * ownerAuth) /* in, out */
1418
TSS_RESULT result = TSPERR(TSS_E_INTERNAL_ERROR);
1419
struct host_table_entry *entry = get_table_entry(hContext);
1422
return TSPERR(TSS_E_NO_CONNECTION);
1424
switch (entry->type) {
1425
case CONNECTION_TYPE_TCP_PERSISTANT:
1426
result = TCSP_DisablePubekRead_TP(entry, ownerAuth);
1432
put_table_entry(entry);
1437
TSS_RESULT TCSP_OwnerReadPubek(TSS_HCONTEXT hContext, /* in */
1438
TPM_AUTH * ownerAuth, /* in, out */
1439
UINT32 * pubEndorsementKeySize, /* out */
1440
BYTE ** pubEndorsementKey) /* out */
1442
TSS_RESULT result = TSPERR(TSS_E_INTERNAL_ERROR);
1443
struct host_table_entry *entry = get_table_entry(hContext);
1446
return TSPERR(TSS_E_NO_CONNECTION);
1448
switch (entry->type) {
1449
case CONNECTION_TYPE_TCP_PERSISTANT:
1450
result = TCSP_OwnerReadPubek_TP(entry, ownerAuth,
1451
pubEndorsementKeySize, pubEndorsementKey);
1457
put_table_entry(entry);
1462
TSS_RESULT TCSP_SelfTestFull(TSS_HCONTEXT hContext) /* in */
1464
TSS_RESULT result = TSPERR(TSS_E_INTERNAL_ERROR);
1465
struct host_table_entry *entry = get_table_entry(hContext);
1468
return TSPERR(TSS_E_NO_CONNECTION);
1470
switch (entry->type) {
1471
case CONNECTION_TYPE_TCP_PERSISTANT:
1472
result = TCSP_SelfTestFull_TP(entry, hContext);
1478
put_table_entry(entry);
1483
TSS_RESULT TCSP_CertifySelfTest(TSS_HCONTEXT hContext, /* in */
1484
TCS_KEY_HANDLE keyHandle, /* in */
1485
TCPA_NONCE antiReplay, /* in */
1486
TPM_AUTH * privAuth, /* in, out */
1487
UINT32 * sigSize, /* out */
1488
BYTE ** sig) /* out */
1490
TSS_RESULT result = TSPERR(TSS_E_INTERNAL_ERROR);
1491
struct host_table_entry *entry = get_table_entry(hContext);
1494
return TSPERR(TSS_E_NO_CONNECTION);
1496
switch (entry->type) {
1497
case CONNECTION_TYPE_TCP_PERSISTANT:
1498
result = TCSP_CertifySelfTest_TP(entry, keyHandle, antiReplay,
1499
privAuth, sigSize, sig);
1505
put_table_entry(entry);
1510
TSS_RESULT TCSP_GetTestResult(TSS_HCONTEXT hContext, /* in */
1511
UINT32 * outDataSize, /* out */
1512
BYTE ** outData) /* out */
1514
TSS_RESULT result = TSPERR(TSS_E_INTERNAL_ERROR);
1515
struct host_table_entry *entry = get_table_entry(hContext);
1518
return TSPERR(TSS_E_NO_CONNECTION);
1520
switch (entry->type) {
1521
case CONNECTION_TYPE_TCP_PERSISTANT:
1522
result = TCSP_GetTestResult_TP(entry, outDataSize, outData);
1528
put_table_entry(entry);
1533
TSS_RESULT TCSP_OwnerSetDisable(TSS_HCONTEXT hContext, /* in */
1534
TSS_BOOL disableState, /* in */
1535
TPM_AUTH * ownerAuth) /* in, out */
1537
TSS_RESULT result = TSPERR(TSS_E_INTERNAL_ERROR);
1538
struct host_table_entry *entry = get_table_entry(hContext);
1541
return TSPERR(TSS_E_NO_CONNECTION);
1543
switch (entry->type) {
1544
case CONNECTION_TYPE_TCP_PERSISTANT:
1545
result = TCSP_OwnerSetDisable_TP(entry, disableState, ownerAuth);
1551
put_table_entry(entry);
1556
TSS_RESULT TCSP_OwnerClear(TSS_HCONTEXT hContext, /* in */
1557
TPM_AUTH * ownerAuth) /* in, out */
1559
TSS_RESULT result = TSPERR(TSS_E_INTERNAL_ERROR);
1560
struct host_table_entry *entry = get_table_entry(hContext);
1563
return TSPERR(TSS_E_NO_CONNECTION);
1565
switch (entry->type) {
1566
case CONNECTION_TYPE_TCP_PERSISTANT:
1567
result = TCSP_OwnerClear_TP(entry, ownerAuth);
1573
put_table_entry(entry);
1578
TSS_RESULT TCSP_DisableOwnerClear(TSS_HCONTEXT hContext, /* in */
1579
TPM_AUTH * ownerAuth) /* in, out */
1581
TSS_RESULT result = TSPERR(TSS_E_INTERNAL_ERROR);
1582
struct host_table_entry *entry = get_table_entry(hContext);
1585
return TSPERR(TSS_E_NO_CONNECTION);
1587
switch (entry->type) {
1588
case CONNECTION_TYPE_TCP_PERSISTANT:
1589
result = TCSP_DisableOwnerClear_TP(entry, ownerAuth);
1595
put_table_entry(entry);
1600
TSS_RESULT TCSP_ForceClear(TSS_HCONTEXT hContext) /* in */
1602
TSS_RESULT result = TSPERR(TSS_E_INTERNAL_ERROR);
1603
struct host_table_entry *entry = get_table_entry(hContext);
1606
return TSPERR(TSS_E_NO_CONNECTION);
1608
switch (entry->type) {
1609
case CONNECTION_TYPE_TCP_PERSISTANT:
1610
result = TCSP_ForceClear_TP(entry, hContext);
1616
put_table_entry(entry);
1621
TSS_RESULT TCSP_DisableForceClear(TSS_HCONTEXT hContext) /* in */
1623
TSS_RESULT result = TSPERR(TSS_E_INTERNAL_ERROR);
1624
struct host_table_entry *entry = get_table_entry(hContext);
1627
return TSPERR(TSS_E_NO_CONNECTION);
1629
switch (entry->type) {
1630
case CONNECTION_TYPE_TCP_PERSISTANT:
1631
result = TCSP_DisableForceClear_TP(entry, hContext);
1637
put_table_entry(entry);
1642
TSS_RESULT TCSP_PhysicalDisable(TSS_HCONTEXT hContext) /* in */
1644
TSS_RESULT result = TSPERR(TSS_E_INTERNAL_ERROR);
1645
struct host_table_entry *entry = get_table_entry(hContext);
1648
return TSPERR(TSS_E_NO_CONNECTION);
1650
switch (entry->type) {
1651
case CONNECTION_TYPE_TCP_PERSISTANT:
1652
result = TCSP_PhysicalDisable_TP(entry, hContext);
1658
put_table_entry(entry);
1663
TSS_RESULT TCSP_PhysicalEnable(TSS_HCONTEXT hContext) /* in */
1665
TSS_RESULT result = TSPERR(TSS_E_INTERNAL_ERROR);
1666
struct host_table_entry *entry = get_table_entry(hContext);
1669
return TSPERR(TSS_E_NO_CONNECTION);
1671
switch (entry->type) {
1672
case CONNECTION_TYPE_TCP_PERSISTANT:
1673
result = TCSP_PhysicalEnable_TP(entry, hContext);
1679
put_table_entry(entry);
1684
TSS_RESULT TCSP_PhysicalSetDeactivated(TSS_HCONTEXT hContext, /* in */
1685
TSS_BOOL state) /* in */
1687
TSS_RESULT result = TSPERR(TSS_E_INTERNAL_ERROR);
1688
struct host_table_entry *entry = get_table_entry(hContext);
1691
return TSPERR(TSS_E_NO_CONNECTION);
1693
switch (entry->type) {
1694
case CONNECTION_TYPE_TCP_PERSISTANT:
1695
result = TCSP_PhysicalSetDeactivated_TP(entry, state);
1701
put_table_entry(entry);
1706
TSS_RESULT TCSP_PhysicalPresence(TSS_HCONTEXT hContext, /* in */
1707
TCPA_PHYSICAL_PRESENCE fPhysicalPresence) /* in */
1709
TSS_RESULT result = TSPERR(TSS_E_INTERNAL_ERROR);
1710
struct host_table_entry *entry = get_table_entry(hContext);
1713
return TSPERR(TSS_E_NO_CONNECTION);
1715
switch (entry->type) {
1716
case CONNECTION_TYPE_TCP_PERSISTANT:
1717
result = TCSP_PhysicalPresence_TP(entry, fPhysicalPresence);
1723
put_table_entry(entry);
1728
TSS_RESULT TCSP_SetTempDeactivated(TSS_HCONTEXT hContext) /* in */
1730
TSS_RESULT result = TSPERR(TSS_E_INTERNAL_ERROR);
1731
struct host_table_entry *entry = get_table_entry(hContext);
1734
return TSPERR(TSS_E_NO_CONNECTION);
1736
switch (entry->type) {
1737
case CONNECTION_TYPE_TCP_PERSISTANT:
1738
result = TCSP_SetTempDeactivated_TP(entry, hContext);
1744
put_table_entry(entry);
1749
TSS_RESULT TCSP_FieldUpgrade(TSS_HCONTEXT hContext, /* in */
1750
UINT32 dataInSize, /* in */
1751
BYTE * dataIn, /* in */
1752
UINT32 * dataOutSize, /* out */
1753
BYTE ** dataOut, /* out */
1754
TPM_AUTH * ownerAuth) /* in, out */
1756
TSS_RESULT result = TSPERR(TSS_E_INTERNAL_ERROR);
1757
struct host_table_entry *entry = get_table_entry(hContext);
1760
return TSPERR(TSS_E_NO_CONNECTION);
1762
switch (entry->type) {
1763
case CONNECTION_TYPE_TCP_PERSISTANT:
1764
result = (UINT32) TSPERR(TSS_E_INTERNAL_ERROR);
1770
put_table_entry(entry);
1775
TSS_RESULT TCSP_SetRedirection(TSS_HCONTEXT hContext, /* in */
1776
TCS_KEY_HANDLE keyHandle, /* in */
1779
TPM_AUTH * privAuth) /* in, out */
1781
TSS_RESULT result = TSPERR(TSS_E_INTERNAL_ERROR);
1782
struct host_table_entry *entry = get_table_entry(hContext);
1785
return TSPERR(TSS_E_NO_CONNECTION);
1787
switch (entry->type) {
1788
case CONNECTION_TYPE_TCP_PERSISTANT:
1789
result = (UINT32) TSPERR(TSS_E_INTERNAL_ERROR);
1795
put_table_entry(entry);
1800
TSS_RESULT TCSP_CreateMaintenanceArchive(TSS_HCONTEXT hContext, /* in */
1801
TSS_BOOL generateRandom, /* in */
1802
TPM_AUTH * ownerAuth, /* in, out */
1803
UINT32 * randomSize, /* out */
1804
BYTE ** random, /* out */
1805
UINT32 * archiveSize, /* out */
1806
BYTE ** archive) /* out */
1808
TSS_RESULT result = TSPERR(TSS_E_INTERNAL_ERROR);
1809
struct host_table_entry *entry = get_table_entry(hContext);
1812
return TSPERR(TSS_E_NO_CONNECTION);
1814
switch (entry->type) {
1815
case CONNECTION_TYPE_TCP_PERSISTANT:
1816
result = TCSP_CreateMaintenanceArchive_TP(entry, generateRandom,
1817
ownerAuth, randomSize, random,
1818
archiveSize, archive);
1824
put_table_entry(entry);
1829
TSS_RESULT TCSP_LoadMaintenanceArchive(TSS_HCONTEXT hContext, /* in */
1830
UINT32 dataInSize, /* in */
1831
BYTE * dataIn, /* in */
1832
TPM_AUTH * ownerAuth, /* in, out */
1833
UINT32 * dataOutSize, /* out */
1834
BYTE ** dataOut) /* out */
1836
TSS_RESULT result = TSPERR(TSS_E_INTERNAL_ERROR);
1837
struct host_table_entry *entry = get_table_entry(hContext);
1840
return TSPERR(TSS_E_NO_CONNECTION);
1842
switch (entry->type) {
1843
case CONNECTION_TYPE_TCP_PERSISTANT:
1844
result = TCSP_LoadMaintenanceArchive_TP(entry, dataInSize, dataIn,
1845
ownerAuth, dataOutSize, dataOut);
1851
put_table_entry(entry);
1856
TSS_RESULT TCSP_KillMaintenanceFeature(TSS_HCONTEXT hContext, /* in */
1857
TPM_AUTH * ownerAuth) /* in, out */
1859
TSS_RESULT result = TSPERR(TSS_E_INTERNAL_ERROR);
1860
struct host_table_entry *entry = get_table_entry(hContext);
1863
return TSPERR(TSS_E_NO_CONNECTION);
1865
switch (entry->type) {
1866
case CONNECTION_TYPE_TCP_PERSISTANT:
1867
result = TCSP_KillMaintenanceFeature_TP(entry, ownerAuth);
1873
put_table_entry(entry);
1878
TSS_RESULT TCSP_LoadManuMaintPub(TSS_HCONTEXT hContext, /* in */
1879
TCPA_NONCE antiReplay, /* in */
1880
UINT32 PubKeySize, /* in */
1881
BYTE * PubKey, /* in */
1882
TCPA_DIGEST * checksum) /* out */
1884
TSS_RESULT result = TSPERR(TSS_E_INTERNAL_ERROR);
1885
struct host_table_entry *entry = get_table_entry(hContext);
1888
return TSPERR(TSS_E_NO_CONNECTION);
1890
switch (entry->type) {
1891
case CONNECTION_TYPE_TCP_PERSISTANT:
1892
result = TCSP_LoadManuMaintPub_TP(entry, antiReplay, PubKeySize,
1899
put_table_entry(entry);
1904
TSS_RESULT TCSP_ReadManuMaintPub(TSS_HCONTEXT hContext, /* in */
1905
TCPA_NONCE antiReplay, /* in */
1906
TCPA_DIGEST * checksum) /* out */
1908
TSS_RESULT result = TSPERR(TSS_E_INTERNAL_ERROR);
1909
struct host_table_entry *entry = get_table_entry(hContext);
1912
return TSPERR(TSS_E_NO_CONNECTION);
1914
switch (entry->type) {
1915
case CONNECTION_TYPE_TCP_PERSISTANT:
1916
result = TCSP_ReadManuMaintPub_TP(entry, antiReplay, checksum);
1922
put_table_entry(entry);