OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Licensed Materials - Property of IBM | 3 * Licensed Materials - Property of IBM |
4 * | 4 * |
5 * trousers - An open source TCG Software Stack | 5 * trousers - An open source TCG Software Stack |
6 * | 6 * |
7 * (C) Copyright International Business Machines Corp. 2004-2006 | 7 * (C) Copyright International Business Machines Corp. 2004-2006 |
8 * | 8 * |
9 */ | 9 */ |
10 | 10 |
(...skipping 21 matching lines...) Expand all Loading... |
32 { | 32 { |
33 TSS_RESULT result; | 33 TSS_RESULT result; |
34 TSS_HCONTEXT hContext; | 34 TSS_HCONTEXT hContext; |
35 TCPA_DIRINDEX dirIndex; | 35 TCPA_DIRINDEX dirIndex; |
36 TCPA_DIGEST dirDigest; | 36 TCPA_DIGEST dirDigest; |
37 TPM_AUTH auth; | 37 TPM_AUTH auth; |
38 | 38 |
39 if (getData(TCSD_PACKET_TYPE_UINT32, 0, &hContext, 0, &data->comm)) | 39 if (getData(TCSD_PACKET_TYPE_UINT32, 0, &hContext, 0, &data->comm)) |
40 return TCSERR(TSS_E_INTERNAL_ERROR); | 40 return TCSERR(TSS_E_INTERNAL_ERROR); |
41 | 41 |
42 » LogDebugFn("thread %zd context %x", THREAD_ID, hContext); | 42 » LogDebugFn("thread %ld context %x", THREAD_ID, hContext); |
43 | 43 |
44 if (getData(TCSD_PACKET_TYPE_UINT32, 1, &dirIndex, 0, &data->comm)) | 44 if (getData(TCSD_PACKET_TYPE_UINT32, 1, &dirIndex, 0, &data->comm)) |
45 return TCSERR(TSS_E_INTERNAL_ERROR); | 45 return TCSERR(TSS_E_INTERNAL_ERROR); |
46 if (getData(TCSD_PACKET_TYPE_DIGEST, 2, &dirDigest, 0, &data->comm)) | 46 if (getData(TCSD_PACKET_TYPE_DIGEST, 2, &dirDigest, 0, &data->comm)) |
47 return TCSERR(TSS_E_INTERNAL_ERROR); | 47 return TCSERR(TSS_E_INTERNAL_ERROR); |
48 if (getData(TCSD_PACKET_TYPE_AUTH, 3, &auth, 0, &data->comm)) | 48 if (getData(TCSD_PACKET_TYPE_AUTH, 3, &auth, 0, &data->comm)) |
49 return TCSERR(TSS_E_INTERNAL_ERROR); | 49 return TCSERR(TSS_E_INTERNAL_ERROR); |
50 | 50 |
51 MUTEX_LOCK(tcsp_lock); | 51 MUTEX_LOCK(tcsp_lock); |
52 | 52 |
(...skipping 18 matching lines...) Expand all Loading... |
71 tcs_wrap_DirRead(struct tcsd_thread_data *data) | 71 tcs_wrap_DirRead(struct tcsd_thread_data *data) |
72 { | 72 { |
73 TSS_RESULT result; | 73 TSS_RESULT result; |
74 TSS_HCONTEXT hContext; | 74 TSS_HCONTEXT hContext; |
75 TCPA_DIRINDEX dirIndex; | 75 TCPA_DIRINDEX dirIndex; |
76 TCPA_DIRVALUE dirValue; | 76 TCPA_DIRVALUE dirValue; |
77 | 77 |
78 if (getData(TCSD_PACKET_TYPE_UINT32, 0, &hContext, 0, &data->comm)) | 78 if (getData(TCSD_PACKET_TYPE_UINT32, 0, &hContext, 0, &data->comm)) |
79 return TCSERR(TSS_E_INTERNAL_ERROR); | 79 return TCSERR(TSS_E_INTERNAL_ERROR); |
80 | 80 |
81 » LogDebugFn("thread %zd context %x", THREAD_ID, hContext); | 81 » LogDebugFn("thread %ld context %x", THREAD_ID, hContext); |
82 | 82 |
83 if (getData(TCSD_PACKET_TYPE_UINT32, 1, &dirIndex, 0, &data->comm)) | 83 if (getData(TCSD_PACKET_TYPE_UINT32, 1, &dirIndex, 0, &data->comm)) |
84 return TCSERR(TSS_E_INTERNAL_ERROR); | 84 return TCSERR(TSS_E_INTERNAL_ERROR); |
85 | 85 |
86 MUTEX_LOCK(tcsp_lock); | 86 MUTEX_LOCK(tcsp_lock); |
87 | 87 |
88 result = TCSP_DirRead_Internal(hContext, dirIndex, &dirValue); | 88 result = TCSP_DirRead_Internal(hContext, dirIndex, &dirValue); |
89 | 89 |
90 MUTEX_UNLOCK(tcsp_lock); | 90 MUTEX_UNLOCK(tcsp_lock); |
91 | 91 |
92 if (result == TSS_SUCCESS) { | 92 if (result == TSS_SUCCESS) { |
93 initData(&data->comm, 1); | 93 initData(&data->comm, 1); |
94 if (setData(TCSD_PACKET_TYPE_DIGEST, 0, &dirValue, 0, &data->com
m)) { | 94 if (setData(TCSD_PACKET_TYPE_DIGEST, 0, &dirValue, 0, &data->com
m)) { |
95 return TCSERR(TSS_E_INTERNAL_ERROR); | 95 return TCSERR(TSS_E_INTERNAL_ERROR); |
96 } | 96 } |
97 } else | 97 } else |
98 initData(&data->comm, 0); | 98 initData(&data->comm, 0); |
99 | 99 |
100 data->comm.hdr.u.result = result; | 100 data->comm.hdr.u.result = result; |
101 | 101 |
102 return TSS_SUCCESS; | 102 return TSS_SUCCESS; |
103 } | 103 } |
OLD | NEW |