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 29 matching lines...) Expand all Loading... |
40 BYTE *srkInfo; | 40 BYTE *srkInfo; |
41 TPM_AUTH ownerAuth; | 41 TPM_AUTH ownerAuth; |
42 | 42 |
43 UINT32 srkKeySize; | 43 UINT32 srkKeySize; |
44 BYTE *srkKey; | 44 BYTE *srkKey; |
45 TSS_RESULT result; | 45 TSS_RESULT result; |
46 | 46 |
47 if (getData(TCSD_PACKET_TYPE_UINT32, 0, &hContext, 0, &data->comm)) | 47 if (getData(TCSD_PACKET_TYPE_UINT32, 0, &hContext, 0, &data->comm)) |
48 return TCSERR(TSS_E_INTERNAL_ERROR); | 48 return TCSERR(TSS_E_INTERNAL_ERROR); |
49 | 49 |
50 » LogDebugFn("thread %zd context %x", THREAD_ID, hContext); | 50 » LogDebugFn("thread %ld context %x", THREAD_ID, hContext); |
51 | 51 |
52 if (getData(TCSD_PACKET_TYPE_UINT16, 1, &protocolID, 0, &data->comm)) | 52 if (getData(TCSD_PACKET_TYPE_UINT16, 1, &protocolID, 0, &data->comm)) |
53 return TCSERR(TSS_E_INTERNAL_ERROR); | 53 return TCSERR(TSS_E_INTERNAL_ERROR); |
54 if (getData(TCSD_PACKET_TYPE_UINT32, 2, &encOwnerAuthSize, 0, &data->com
m)) | 54 if (getData(TCSD_PACKET_TYPE_UINT32, 2, &encOwnerAuthSize, 0, &data->com
m)) |
55 return TCSERR(TSS_E_INTERNAL_ERROR); | 55 return TCSERR(TSS_E_INTERNAL_ERROR); |
56 encOwnerAuth = calloc(1, encOwnerAuthSize); | 56 encOwnerAuth = calloc(1, encOwnerAuthSize); |
57 if (encOwnerAuth == NULL) { | 57 if (encOwnerAuth == NULL) { |
58 LogError("malloc of %d bytes failed.", encOwnerAuthSize); | 58 LogError("malloc of %d bytes failed.", encOwnerAuthSize); |
59 return TCSERR(TSS_E_OUTOFMEMORY); | 59 return TCSERR(TSS_E_OUTOFMEMORY); |
60 } | 60 } |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 TSS_RESULT | 139 TSS_RESULT |
140 tcs_wrap_OwnerClear(struct tcsd_thread_data *data) | 140 tcs_wrap_OwnerClear(struct tcsd_thread_data *data) |
141 { | 141 { |
142 TCS_CONTEXT_HANDLE hContext; | 142 TCS_CONTEXT_HANDLE hContext; |
143 TSS_RESULT result; | 143 TSS_RESULT result; |
144 TPM_AUTH auth; | 144 TPM_AUTH auth; |
145 | 145 |
146 if (getData(TCSD_PACKET_TYPE_UINT32, 0, &hContext, 0, &data->comm)) | 146 if (getData(TCSD_PACKET_TYPE_UINT32, 0, &hContext, 0, &data->comm)) |
147 return TCSERR(TSS_E_INTERNAL_ERROR); | 147 return TCSERR(TSS_E_INTERNAL_ERROR); |
148 | 148 |
149 » LogDebugFn("thread %zd context %x", THREAD_ID, hContext); | 149 » LogDebugFn("thread %ld context %x", THREAD_ID, hContext); |
150 | 150 |
151 if (getData(TCSD_PACKET_TYPE_AUTH, 1, &auth, 0, &data->comm)) | 151 if (getData(TCSD_PACKET_TYPE_AUTH, 1, &auth, 0, &data->comm)) |
152 return TCSERR(TSS_E_INTERNAL_ERROR); | 152 return TCSERR(TSS_E_INTERNAL_ERROR); |
153 | 153 |
154 MUTEX_LOCK(tcsp_lock); | 154 MUTEX_LOCK(tcsp_lock); |
155 | 155 |
156 result = TCSP_OwnerClear_Internal(hContext, &auth); | 156 result = TCSP_OwnerClear_Internal(hContext, &auth); |
157 | 157 |
158 MUTEX_UNLOCK(tcsp_lock); | 158 MUTEX_UNLOCK(tcsp_lock); |
159 | 159 |
160 if (result == TSS_SUCCESS) { | 160 if (result == TSS_SUCCESS) { |
161 initData(&data->comm, 1); | 161 initData(&data->comm, 1); |
162 if (setData(TCSD_PACKET_TYPE_AUTH, 0, &auth, 0, &data->comm)) { | 162 if (setData(TCSD_PACKET_TYPE_AUTH, 0, &auth, 0, &data->comm)) { |
163 return TCSERR(TSS_E_INTERNAL_ERROR); | 163 return TCSERR(TSS_E_INTERNAL_ERROR); |
164 } | 164 } |
165 } else | 165 } else |
166 initData(&data->comm, 0); | 166 initData(&data->comm, 0); |
167 | 167 |
168 data->comm.hdr.u.result = result; | 168 data->comm.hdr.u.result = result; |
169 return TSS_SUCCESS; | 169 return TSS_SUCCESS; |
170 } | 170 } |
OLD | NEW |