3
* Licensed Materials - Property of IBM
5
* trousers - An open source TCG Software Stack
7
* (C) Copyright International Business Machines Corp. 2004-2007
11
#ifndef _RPC_TCSTP_TCS_H_
12
#define _RPC_TCSTP_TCS_H_
14
#include "rpc_tcstp.h"
16
#define DECLARE_TCSTP_FUNC(x) \
17
TSS_RESULT tcs_wrap_##x(struct tcsd_thread_data *)
18
/* Auth session, context and TPM caps support are always compiled in. TPM caps
19
* are necessary so that the TCSD can know what type of TPM its talking to */
20
DECLARE_TCSTP_FUNC(OpenContext);
21
DECLARE_TCSTP_FUNC(CloseContext);
22
DECLARE_TCSTP_FUNC(OIAP);
23
DECLARE_TCSTP_FUNC(OSAP);
24
DECLARE_TCSTP_FUNC(GetCapability);
25
DECLARE_TCSTP_FUNC(GetCapabilityOwner);
27
#ifdef TSS_BUILD_RANDOM
28
DECLARE_TCSTP_FUNC(GetRandom);
29
DECLARE_TCSTP_FUNC(StirRandom);
31
#define tcs_wrap_GetRandom tcs_wrap_Error
32
#define tcs_wrap_StirRandom tcs_wrap_Error
36
DECLARE_TCSTP_FUNC(CreateEndorsementKeyPair);
37
DECLARE_TCSTP_FUNC(ReadPubek);
38
DECLARE_TCSTP_FUNC(OwnerReadPubek);
39
DECLARE_TCSTP_FUNC(DisablePubekRead);
40
#ifdef TSS_BUILD_TSS12
41
DECLARE_TCSTP_FUNC(CreateRevocableEndorsementKeyPair);
42
DECLARE_TCSTP_FUNC(RevokeEndorsementKeyPair);
44
#define tcs_wrap_CreateRevocableEndorsementKeyPair tcs_wrap_Error
45
#define tcs_wrap_RevokeEndorsementKeyPair tcs_wrap_Error
48
#define tcs_wrap_CreateEndorsementKeyPair tcs_wrap_Error
49
#define tcs_wrap_ReadPubek tcs_wrap_Error
50
#define tcs_wrap_OwnerReadPubek tcs_wrap_Error
51
#define tcs_wrap_DisablePubekRead tcs_wrap_Error
52
#define tcs_wrap_CreateRevocableEndorsementKeyPair tcs_wrap_Error
53
#define tcs_wrap_RevokeEndorsementKeyPair tcs_wrap_Error
57
DECLARE_TCSTP_FUNC(EvictKey);
58
DECLARE_TCSTP_FUNC(GetPubkey);
59
DECLARE_TCSTP_FUNC(TerminateHandle);
60
DECLARE_TCSTP_FUNC(LoadKeyByBlob);
61
DECLARE_TCSTP_FUNC(CreateWrapKey);
62
DECLARE_TCSTP_FUNC(OwnerReadInternalPub);
63
#ifdef TSS_BUILD_TSS12
64
DECLARE_TCSTP_FUNC(KeyControlOwner);
66
#define tcs_wrap_KeyControlOwner tcs_wrap_Error
69
#define tcs_wrap_EvictKey tcs_wrap_Error
70
#define tcs_wrap_GetPubkey tcs_wrap_Error
71
#define tcs_wrap_TerminateHandle tcs_wrap_Error
72
#define tcs_wrap_LoadKeyByBlob tcs_wrap_Error
73
#define tcs_wrap_CreateWrapKey tcs_wrap_Error
74
#define tcs_wrap_OwnerReadInternalPub tcs_wrap_Error
75
#define tcs_wrap_KeyControlOwner tcs_wrap_Error
79
#ifdef TSS_BUILD_PCR_EXTEND
80
DECLARE_TCSTP_FUNC(Extend);
81
DECLARE_TCSTP_FUNC(PcrRead);
82
DECLARE_TCSTP_FUNC(PcrReset);
84
#define tcs_wrap_Extend tcs_wrap_Error
85
#define tcs_wrap_PcrRead tcs_wrap_Error
86
#define tcs_wrap_PcrReset tcs_wrap_Error
90
DECLARE_TCSTP_FUNC(TCSGetCapability);
92
#define tcs_wrap_TCSGetCapability tcs_wrap_Error
96
DECLARE_TCSTP_FUNC(TakeOwnership);
97
DECLARE_TCSTP_FUNC(OwnerClear);
99
#define tcs_wrap_TakeOwnership tcs_wrap_Error
100
#define tcs_wrap_OwnerClear tcs_wrap_Error
104
DECLARE_TCSTP_FUNC(RegisterKey);
105
DECLARE_TCSTP_FUNC(UnregisterKey);
106
DECLARE_TCSTP_FUNC(GetRegisteredKeyBlob);
107
DECLARE_TCSTP_FUNC(LoadKeyByUUID);
108
DECLARE_TCSTP_FUNC(GetRegisteredKeyByPublicInfo);
109
DECLARE_TCSTP_FUNC(EnumRegisteredKeys);
110
DECLARE_TCSTP_FUNC(EnumRegisteredKeys2);
112
#define tcs_wrap_RegisterKey tcs_wrap_Error
113
#define tcs_wrap_UnregisterKey tcs_wrap_Error
114
#define tcs_wrap_GetRegisteredKeyBlob tcs_wrap_Error
115
#define tcs_wrap_LoadKeyByUUID tcs_wrap_Error
116
#define tcs_wrap_GetRegisteredKeyByPublicInfo tcs_wrap_Error
117
#define tcs_wrap_EnumRegisteredKeys tcs_wrap_Error
118
#define tcs_wrap_EnumRegisteredKeys2 tcs_wrap_Error
121
#ifdef TSS_BUILD_SIGN
122
DECLARE_TCSTP_FUNC(Sign);
124
#define tcs_wrap_Sign tcs_wrap_Error
128
DECLARE_TCSTP_FUNC(DirWriteAuth);
129
DECLARE_TCSTP_FUNC(DirRead);
131
#define tcs_wrap_DirWriteAuth tcs_wrap_Error
132
#define tcs_wrap_DirRead tcs_wrap_Error
135
#ifdef TSS_BUILD_SEAL
136
DECLARE_TCSTP_FUNC(Seal);
137
DECLARE_TCSTP_FUNC(UnSeal);
139
#define tcs_wrap_Seal tcs_wrap_Error
140
#define tcs_wrap_UnSeal tcs_wrap_Error
143
#ifdef TSS_BUILD_SEALX
144
DECLARE_TCSTP_FUNC(Sealx);
146
#define tcs_wrap_Sealx tcs_wrap_Error
149
#ifdef TSS_BUILD_BIND
150
DECLARE_TCSTP_FUNC(UnBind);
152
#define tcs_wrap_UnBind tcs_wrap_Error
155
#ifdef TSS_BUILD_CHANGEAUTH
156
DECLARE_TCSTP_FUNC(ChangeAuth);
157
DECLARE_TCSTP_FUNC(ChangeAuthOwner);
159
#define tcs_wrap_ChangeAuth tcs_wrap_Error
160
#define tcs_wrap_ChangeAuthOwner tcs_wrap_Error
163
#ifdef TSS_BUILD_QUOTE
164
DECLARE_TCSTP_FUNC(Quote);
166
#define tcs_wrap_Quote tcs_wrap_Error
169
#ifdef TSS_BUILD_QUOTE2
170
DECLARE_TCSTP_FUNC(Quote2);
172
#define tcs_wrap_Quote2 tcs_wrap_Error
175
#ifdef TSS_BUILD_PCR_EVENTS
176
DECLARE_TCSTP_FUNC(LogPcrEvent);
177
DECLARE_TCSTP_FUNC(GetPcrEvent);
178
DECLARE_TCSTP_FUNC(GetPcrEventsByPcr);
179
DECLARE_TCSTP_FUNC(GetPcrEventLog);
181
#define tcs_wrap_LogPcrEvent tcs_wrap_Error
182
#define tcs_wrap_GetPcrEvent tcs_wrap_Error
183
#define tcs_wrap_GetPcrEventsByPcr tcs_wrap_Error
184
#define tcs_wrap_GetPcrEventLog tcs_wrap_Error
187
#ifdef TSS_BUILD_SELFTEST
188
DECLARE_TCSTP_FUNC(SelfTestFull);
189
DECLARE_TCSTP_FUNC(CertifySelfTest);
190
DECLARE_TCSTP_FUNC(GetTestResult);
192
#define tcs_wrap_SelfTestFull tcs_wrap_Error
193
#define tcs_wrap_CertifySelfTest tcs_wrap_Error
194
#define tcs_wrap_GetTestResult tcs_wrap_Error
197
#ifdef TSS_BUILD_ADMIN
198
DECLARE_TCSTP_FUNC(DisableOwnerClear);
199
DECLARE_TCSTP_FUNC(ForceClear);
200
DECLARE_TCSTP_FUNC(DisableForceClear);
201
DECLARE_TCSTP_FUNC(PhysicalEnable);
202
DECLARE_TCSTP_FUNC(PhysicalSetDeactivated);
203
DECLARE_TCSTP_FUNC(SetOwnerInstall);
204
DECLARE_TCSTP_FUNC(OwnerSetDisable);
205
DECLARE_TCSTP_FUNC(PhysicalDisable);
206
DECLARE_TCSTP_FUNC(PhysicalPresence);
207
DECLARE_TCSTP_FUNC(SetTempDeactivated);
208
#ifdef TSS_BUILD_TSS12
209
DECLARE_TCSTP_FUNC(SetTempDeactivated2);
211
#define tcs_wrap_SetTempDeactivated2 tcs_wrap_Error
213
DECLARE_TCSTP_FUNC(SetCapability);
214
DECLARE_TCSTP_FUNC(ResetLockValue);
216
#define tcs_wrap_DisableOwnerClear tcs_wrap_Error
217
#define tcs_wrap_ForceClear tcs_wrap_Error
218
#define tcs_wrap_DisableForceClear tcs_wrap_Error
219
#define tcs_wrap_PhysicalEnable tcs_wrap_Error
220
#define tcs_wrap_PhysicalSetDeactivated tcs_wrap_Error
221
#define tcs_wrap_SetOwnerInstall tcs_wrap_Error
222
#define tcs_wrap_OwnerSetDisable tcs_wrap_Error
223
#define tcs_wrap_PhysicalDisable tcs_wrap_Error
224
#define tcs_wrap_PhysicalPresence tcs_wrap_Error
225
#define tcs_wrap_SetTempDeactivated tcs_wrap_Error
226
#define tcs_wrap_SetTempDeactivated2 tcs_wrap_Error
227
#define tcs_wrap_SetCapability tcs_wrap_Error
228
#define tcs_wrap_ResetLockValue tcs_wrap_Error
231
#ifdef TSS_BUILD_CERTIFY
232
DECLARE_TCSTP_FUNC(CertifyKey);
234
#define tcs_wrap_CertifyKey tcs_wrap_Error
238
DECLARE_TCSTP_FUNC(MakeIdentity);
239
DECLARE_TCSTP_FUNC(MakeIdentity2);
240
DECLARE_TCSTP_FUNC(GetCredential);
241
DECLARE_TCSTP_FUNC(ActivateIdentity);
242
#ifdef TSS_BUILD_TSS12
243
DECLARE_TCSTP_FUNC(MakeIdentity2);
245
#define tcs_wrap_MakeIdentity2 tcs_wrap_Error
248
#define tcs_wrap_MakeIdentity tcs_wrap_Error
249
#define tcs_wrap_MakeIdentity2 tcs_wrap_Error
250
#define tcs_wrap_GetCredential tcs_wrap_Error
251
#define tcs_wrap_ActivateIdentity tcs_wrap_Error
254
#ifdef TSS_BUILD_MIGRATION
255
DECLARE_TCSTP_FUNC(CreateMigrationBlob);
256
DECLARE_TCSTP_FUNC(ConvertMigrationBlob);
257
DECLARE_TCSTP_FUNC(AuthorizeMigrationKey);
259
#define tcs_wrap_CreateMigrationBlob tcs_wrap_Error
260
#define tcs_wrap_ConvertMigrationBlob tcs_wrap_Error
261
#define tcs_wrap_AuthorizeMigrationKey tcs_wrap_Error
264
#ifdef TSS_BUILD_MAINT
265
DECLARE_TCSTP_FUNC(KillMaintenanceFeature);
266
DECLARE_TCSTP_FUNC(CreateMaintenanceArchive);
267
DECLARE_TCSTP_FUNC(LoadMaintenanceArchive);
268
DECLARE_TCSTP_FUNC(LoadManuMaintPub);
269
DECLARE_TCSTP_FUNC(ReadManuMaintPub);
271
#define tcs_wrap_KillMaintenanceFeature tcs_wrap_Error
272
#define tcs_wrap_CreateMaintenanceArchive tcs_wrap_Error
273
#define tcs_wrap_LoadMaintenanceArchive tcs_wrap_Error
274
#define tcs_wrap_LoadManuMaintPub tcs_wrap_Error
275
#define tcs_wrap_ReadManuMaintPub tcs_wrap_Error
279
DECLARE_TCSTP_FUNC(DaaJoin);
280
DECLARE_TCSTP_FUNC(DaaSign);
282
#define tcs_wrap_DaaJoin tcs_wrap_Error
283
#define tcs_wrap_DaaSign tcs_wrap_Error
287
DECLARE_TCSTP_FUNC(NV_DefineOrReleaseSpace);
288
DECLARE_TCSTP_FUNC(NV_WriteValue);
289
DECLARE_TCSTP_FUNC(NV_WriteValueAuth);
290
DECLARE_TCSTP_FUNC(NV_ReadValue);
291
DECLARE_TCSTP_FUNC(NV_ReadValueAuth);
293
#define tcs_wrap_NV_DefineOrReleaseSpace tcs_wrap_Error
294
#define tcs_wrap_NV_WriteValue tcs_wrap_Error
295
#define tcs_wrap_NV_WriteValueAuth tcs_wrap_Error
296
#define tcs_wrap_NV_ReadValue tcs_wrap_Error
297
#define tcs_wrap_NV_ReadValueAuth tcs_wrap_Error
300
#ifdef TSS_BUILD_COUNTER
301
DECLARE_TCSTP_FUNC(ReadCounter);
302
DECLARE_TCSTP_FUNC(CreateCounter);
303
DECLARE_TCSTP_FUNC(IncrementCounter);
304
DECLARE_TCSTP_FUNC(ReleaseCounter);
305
DECLARE_TCSTP_FUNC(ReleaseCounterOwner);
307
#define tcs_wrap_ReadCounter tcs_wrap_Error
308
#define tcs_wrap_CreateCounter tcs_wrap_Error
309
#define tcs_wrap_IncrementCounter tcs_wrap_Error
310
#define tcs_wrap_ReleaseCounter tcs_wrap_Error
311
#define tcs_wrap_ReleaseCounterOwner tcs_wrap_Error
314
#ifdef TSS_BUILD_TICK
315
DECLARE_TCSTP_FUNC(ReadCurrentTicks);
316
DECLARE_TCSTP_FUNC(TickStampBlob);
318
#define tcs_wrap_ReadCurrentTicks tcs_wrap_Error
319
#define tcs_wrap_TickStampBlob tcs_wrap_Error
322
#ifdef TSS_BUILD_TRANSPORT
323
DECLARE_TCSTP_FUNC(EstablishTransport);
324
DECLARE_TCSTP_FUNC(ExecuteTransport);
325
DECLARE_TCSTP_FUNC(ReleaseTransportSigned);
327
#define tcs_wrap_EstablishTransport tcs_wrap_Error
328
#define tcs_wrap_ExecuteTransport tcs_wrap_Error
329
#define tcs_wrap_ReleaseTransportSigned tcs_wrap_Error
332
#ifdef TSS_BUILD_AUDIT
333
DECLARE_TCSTP_FUNC(SetOrdinalAuditStatus);
334
DECLARE_TCSTP_FUNC(GetAuditDigest);
335
DECLARE_TCSTP_FUNC(GetAuditDigestSigned);
337
#define tcs_wrap_SetOrdinalAuditStatus tcs_wrap_Error
338
#define tcs_wrap_GetAuditDigest tcs_wrap_Error
339
#define tcs_wrap_GetAuditDigestSigned tcs_wrap_Error
342
#ifdef TSS_BUILD_TSS12
343
DECLARE_TCSTP_FUNC(SetOperatorAuth);
344
DECLARE_TCSTP_FUNC(FlushSpecific);
346
#define tcs_wrap_SetOperatorAuth tcs_wrap_Error
347
#define tcs_wrap_FlushSpecific tcs_wrap_Error
350
#ifdef TSS_BUILD_DELEGATION
351
DECLARE_TCSTP_FUNC(Delegate_Manage);
352
DECLARE_TCSTP_FUNC(Delegate_CreateKeyDelegation);
353
DECLARE_TCSTP_FUNC(Delegate_CreateOwnerDelegation);
354
DECLARE_TCSTP_FUNC(Delegate_LoadOwnerDelegation);
355
DECLARE_TCSTP_FUNC(Delegate_ReadTable);
356
DECLARE_TCSTP_FUNC(Delegate_UpdateVerificationCount);
357
DECLARE_TCSTP_FUNC(Delegate_VerifyDelegation);
358
DECLARE_TCSTP_FUNC(DSAP);
360
#define tcs_wrap_Delegate_Manage tcs_wrap_Error
361
#define tcs_wrap_Delegate_CreateKeyDelegation tcs_wrap_Error
362
#define tcs_wrap_Delegate_CreateOwnerDelegation tcs_wrap_Error
363
#define tcs_wrap_Delegate_LoadOwnerDelegation tcs_wrap_Error
364
#define tcs_wrap_Delegate_ReadTable tcs_wrap_Error
365
#define tcs_wrap_Delegate_UpdateVerificationCount tcs_wrap_Error
366
#define tcs_wrap_Delegate_VerifyDelegation tcs_wrap_Error
367
#define tcs_wrap_DSAP tcs_wrap_Error
371
DECLARE_TCSTP_FUNC(CMK_SetRestrictions);
372
DECLARE_TCSTP_FUNC(CMK_ApproveMA);
373
DECLARE_TCSTP_FUNC(CMK_CreateKey);
374
DECLARE_TCSTP_FUNC(CMK_CreateTicket);
375
DECLARE_TCSTP_FUNC(CMK_CreateBlob);
376
DECLARE_TCSTP_FUNC(CMK_ConvertMigration);
378
#define tcs_wrap_CMK_SetRestrictions tcs_wrap_Error
379
#define tcs_wrap_CMK_ApproveMA tcs_wrap_Error
380
#define tcs_wrap_CMK_CreateKey tcs_wrap_Error
381
#define tcs_wrap_CMK_CreateTicket tcs_wrap_Error
382
#define tcs_wrap_CMK_CreateBlob tcs_wrap_Error
383
#define tcs_wrap_CMK_ConvertMigration tcs_wrap_Error
386
DECLARE_TCSTP_FUNC(dispatchCommand);
388
void LoadBlob_Auth_Special(UINT64 *, BYTE *, TPM_AUTH *);
389
void UnloadBlob_Auth_Special(UINT64 *, BYTE *, TPM_AUTH *);
390
void LoadBlob_KM_KEYINFO(UINT64 *, BYTE *, TSS_KM_KEYINFO *);
391
void LoadBlob_KM_KEYINFO2(UINT64 *, BYTE *, TSS_KM_KEYINFO2 *);
392
void UnloadBlob_KM_KEYINFO(UINT64 *, BYTE *, TSS_KM_KEYINFO *);
393
void UnloadBlob_KM_KEYINFO2(UINT64 *, BYTE *, TSS_KM_KEYINFO2 *);
394
void LoadBlob_LOADKEY_INFO(UINT64 *, BYTE *, TCS_LOADKEY_INFO *);
395
void UnloadBlob_LOADKEY_INFO(UINT64 *, BYTE *, TCS_LOADKEY_INFO *);
396
void LoadBlob_PCR_EVENT(UINT64 *, BYTE *, TSS_PCR_EVENT *);
397
TSS_RESULT UnloadBlob_PCR_EVENT(UINT64 *, BYTE *, TSS_PCR_EVENT *);
398
int setData(TCSD_PACKET_TYPE, int, void *, int, struct tcsd_comm_data *);
399
UINT32 getData(TCSD_PACKET_TYPE, int, void *, int, struct tcsd_comm_data *);
400
void initData(struct tcsd_comm_data *, int);
401
int recv_from_socket(int, void *, int);
402
int send_to_socket(int, void *, int);
403
TSS_RESULT getTCSDPacket(struct tcsd_thread_data *);
405
MUTEX_DECLARE_EXTERN(tcsp_lock);