| 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-2007 | 7 * (C) Copyright International Business Machines Corp. 2004-2007 |
| 8 * | 8 * |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 UINT32 eKPtrSize; | 35 UINT32 eKPtrSize; |
| 36 BYTE *eKPtr; | 36 BYTE *eKPtr; |
| 37 UINT32 eKSize; | 37 UINT32 eKSize; |
| 38 BYTE* eK; | 38 BYTE* eK; |
| 39 TCPA_DIGEST checksum; | 39 TCPA_DIGEST checksum; |
| 40 TSS_RESULT result; | 40 TSS_RESULT result; |
| 41 | 41 |
| 42 if (getData(TCSD_PACKET_TYPE_UINT32, 0, &hContext, 0, &data->comm)) | 42 if (getData(TCSD_PACKET_TYPE_UINT32, 0, &hContext, 0, &data->comm)) |
| 43 return TCSERR(TSS_E_INTERNAL_ERROR); | 43 return TCSERR(TSS_E_INTERNAL_ERROR); |
| 44 | 44 |
| 45 » LogDebugFn("thread %zd context %x", THREAD_ID, hContext); | 45 » LogDebugFn("thread %ld context %x", THREAD_ID, hContext); |
| 46 | 46 |
| 47 if (getData(TCSD_PACKET_TYPE_NONCE, 1, &antiReplay, 0, &data->comm)) | 47 if (getData(TCSD_PACKET_TYPE_NONCE, 1, &antiReplay, 0, &data->comm)) |
| 48 return TCSERR(TSS_E_INTERNAL_ERROR); | 48 return TCSERR(TSS_E_INTERNAL_ERROR); |
| 49 | 49 |
| 50 if (getData(TCSD_PACKET_TYPE_UINT32, 2, &eKPtrSize, 0, &data->comm)) | 50 if (getData(TCSD_PACKET_TYPE_UINT32, 2, &eKPtrSize, 0, &data->comm)) |
| 51 return TCSERR(TSS_E_INTERNAL_ERROR); | 51 return TCSERR(TSS_E_INTERNAL_ERROR); |
| 52 | 52 |
| 53 eKPtr = calloc(1, eKPtrSize); | 53 eKPtr = calloc(1, eKPtrSize); |
| 54 if (eKPtr == NULL) { | 54 if (eKPtr == NULL) { |
| 55 LogError("malloc of %u bytes failed.", eKPtrSize); | 55 LogError("malloc of %u bytes failed.", eKPtrSize); |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 TCS_CONTEXT_HANDLE hContext; | 96 TCS_CONTEXT_HANDLE hContext; |
| 97 TCPA_NONCE antiReplay; | 97 TCPA_NONCE antiReplay; |
| 98 UINT32 pubEKSize; | 98 UINT32 pubEKSize; |
| 99 BYTE *pubEK; | 99 BYTE *pubEK; |
| 100 TCPA_DIGEST checksum; | 100 TCPA_DIGEST checksum; |
| 101 TSS_RESULT result; | 101 TSS_RESULT result; |
| 102 | 102 |
| 103 if (getData(TCSD_PACKET_TYPE_UINT32, 0, &hContext, 0, &data->comm)) | 103 if (getData(TCSD_PACKET_TYPE_UINT32, 0, &hContext, 0, &data->comm)) |
| 104 return TCSERR(TSS_E_INTERNAL_ERROR); | 104 return TCSERR(TSS_E_INTERNAL_ERROR); |
| 105 | 105 |
| 106 » LogDebugFn("thread %zd context %x", THREAD_ID, hContext); | 106 » LogDebugFn("thread %ld context %x", THREAD_ID, hContext); |
| 107 | 107 |
| 108 if (getData(TCSD_PACKET_TYPE_NONCE, 1, &antiReplay, 0, &data->comm)) | 108 if (getData(TCSD_PACKET_TYPE_NONCE, 1, &antiReplay, 0, &data->comm)) |
| 109 return TCSERR(TSS_E_INTERNAL_ERROR); | 109 return TCSERR(TSS_E_INTERNAL_ERROR); |
| 110 | 110 |
| 111 MUTEX_LOCK(tcsp_lock); | 111 MUTEX_LOCK(tcsp_lock); |
| 112 | 112 |
| 113 result = TCSP_ReadPubek_Internal(hContext, antiReplay, &pubEKSize, &pubE
K, &checksum); | 113 result = TCSP_ReadPubek_Internal(hContext, antiReplay, &pubEKSize, &pubE
K, &checksum); |
| 114 | 114 |
| 115 MUTEX_UNLOCK(tcsp_lock); | 115 MUTEX_UNLOCK(tcsp_lock); |
| 116 | 116 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 140 { | 140 { |
| 141 TCS_CONTEXT_HANDLE hContext; | 141 TCS_CONTEXT_HANDLE hContext; |
| 142 UINT32 pubEKSize; | 142 UINT32 pubEKSize; |
| 143 BYTE *pubEK; | 143 BYTE *pubEK; |
| 144 TSS_RESULT result; | 144 TSS_RESULT result; |
| 145 TPM_AUTH auth; | 145 TPM_AUTH auth; |
| 146 | 146 |
| 147 if (getData(TCSD_PACKET_TYPE_UINT32, 0, &hContext, 0, &data->comm)) | 147 if (getData(TCSD_PACKET_TYPE_UINT32, 0, &hContext, 0, &data->comm)) |
| 148 return TCSERR(TSS_E_INTERNAL_ERROR); | 148 return TCSERR(TSS_E_INTERNAL_ERROR); |
| 149 | 149 |
| 150 » LogDebugFn("thread %zd context %x", THREAD_ID, hContext); | 150 » LogDebugFn("thread %ld context %x", THREAD_ID, hContext); |
| 151 | 151 |
| 152 if (getData(TCSD_PACKET_TYPE_AUTH, 1, &auth, 0, &data->comm)) | 152 if (getData(TCSD_PACKET_TYPE_AUTH, 1, &auth, 0, &data->comm)) |
| 153 return TCSERR(TSS_E_INTERNAL_ERROR); | 153 return TCSERR(TSS_E_INTERNAL_ERROR); |
| 154 | 154 |
| 155 MUTEX_LOCK(tcsp_lock); | 155 MUTEX_LOCK(tcsp_lock); |
| 156 | 156 |
| 157 result = TCSP_OwnerReadPubek_Internal(hContext, &auth, &pubEKSize, &pubE
K); | 157 result = TCSP_OwnerReadPubek_Internal(hContext, &auth, &pubEKSize, &pubE
K); |
| 158 | 158 |
| 159 MUTEX_UNLOCK(tcsp_lock); | 159 MUTEX_UNLOCK(tcsp_lock); |
| 160 | 160 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 183 TSS_RESULT | 183 TSS_RESULT |
| 184 tcs_wrap_DisablePubekRead(struct tcsd_thread_data *data) | 184 tcs_wrap_DisablePubekRead(struct tcsd_thread_data *data) |
| 185 { | 185 { |
| 186 TCS_CONTEXT_HANDLE hContext; | 186 TCS_CONTEXT_HANDLE hContext; |
| 187 TSS_RESULT result; | 187 TSS_RESULT result; |
| 188 TPM_AUTH auth; | 188 TPM_AUTH auth; |
| 189 | 189 |
| 190 if (getData(TCSD_PACKET_TYPE_UINT32, 0, &hContext, 0, &data->comm)) | 190 if (getData(TCSD_PACKET_TYPE_UINT32, 0, &hContext, 0, &data->comm)) |
| 191 return TCSERR(TSS_E_INTERNAL_ERROR); | 191 return TCSERR(TSS_E_INTERNAL_ERROR); |
| 192 | 192 |
| 193 » LogDebugFn("thread %zd context %x", THREAD_ID, hContext); | 193 » LogDebugFn("thread %ld context %x", THREAD_ID, hContext); |
| 194 | 194 |
| 195 if (getData(TCSD_PACKET_TYPE_AUTH, 1, &auth, 0, &data->comm)) | 195 if (getData(TCSD_PACKET_TYPE_AUTH, 1, &auth, 0, &data->comm)) |
| 196 return TCSERR(TSS_E_INTERNAL_ERROR); | 196 return TCSERR(TSS_E_INTERNAL_ERROR); |
| 197 | 197 |
| 198 MUTEX_LOCK(tcsp_lock); | 198 MUTEX_LOCK(tcsp_lock); |
| 199 | 199 |
| 200 result = TCSP_DisablePubekRead_Internal(hContext, &auth); | 200 result = TCSP_DisablePubekRead_Internal(hContext, &auth); |
| 201 | 201 |
| 202 MUTEX_UNLOCK(tcsp_lock); | 202 MUTEX_UNLOCK(tcsp_lock); |
| 203 | 203 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 224 TSS_BOOL genResetAuth; | 224 TSS_BOOL genResetAuth; |
| 225 TPM_DIGEST eKResetAuth; | 225 TPM_DIGEST eKResetAuth; |
| 226 UINT32 eKSize; | 226 UINT32 eKSize; |
| 227 BYTE* eK; | 227 BYTE* eK; |
| 228 TPM_DIGEST checksum; | 228 TPM_DIGEST checksum; |
| 229 TSS_RESULT result; | 229 TSS_RESULT result; |
| 230 | 230 |
| 231 if (getData(TCSD_PACKET_TYPE_UINT32, 0, &hContext, 0, &data->comm)) | 231 if (getData(TCSD_PACKET_TYPE_UINT32, 0, &hContext, 0, &data->comm)) |
| 232 return TCSERR(TSS_E_INTERNAL_ERROR); | 232 return TCSERR(TSS_E_INTERNAL_ERROR); |
| 233 | 233 |
| 234 » LogDebugFn("thread %zd context %x", THREAD_ID, hContext); | 234 » LogDebugFn("thread %ld context %x", THREAD_ID, hContext); |
| 235 | 235 |
| 236 if (getData(TCSD_PACKET_TYPE_NONCE, 1, &antiReplay, 0, &data->comm)) | 236 if (getData(TCSD_PACKET_TYPE_NONCE, 1, &antiReplay, 0, &data->comm)) |
| 237 return TCSERR(TSS_E_INTERNAL_ERROR); | 237 return TCSERR(TSS_E_INTERNAL_ERROR); |
| 238 | 238 |
| 239 if (getData(TCSD_PACKET_TYPE_UINT32, 2, &eKPtrSize, 0, &data->comm)) | 239 if (getData(TCSD_PACKET_TYPE_UINT32, 2, &eKPtrSize, 0, &data->comm)) |
| 240 return TCSERR(TSS_E_INTERNAL_ERROR); | 240 return TCSERR(TSS_E_INTERNAL_ERROR); |
| 241 | 241 |
| 242 eKPtr = calloc(1, eKPtrSize); | 242 eKPtr = calloc(1, eKPtrSize); |
| 243 if (eKPtr == NULL) { | 243 if (eKPtr == NULL) { |
| 244 LogError("malloc of %d bytes failed.", eKPtrSize); | 244 LogError("malloc of %d bytes failed.", eKPtrSize); |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 297 TSS_RESULT | 297 TSS_RESULT |
| 298 tcs_wrap_RevokeEndorsementKeyPair(struct tcsd_thread_data *data) | 298 tcs_wrap_RevokeEndorsementKeyPair(struct tcsd_thread_data *data) |
| 299 { | 299 { |
| 300 TCS_CONTEXT_HANDLE hContext; | 300 TCS_CONTEXT_HANDLE hContext; |
| 301 TPM_DIGEST eKResetAuth; | 301 TPM_DIGEST eKResetAuth; |
| 302 TSS_RESULT result; | 302 TSS_RESULT result; |
| 303 | 303 |
| 304 if (getData(TCSD_PACKET_TYPE_UINT32, 0, &hContext, 0, &data->comm)) | 304 if (getData(TCSD_PACKET_TYPE_UINT32, 0, &hContext, 0, &data->comm)) |
| 305 return TCSERR(TSS_E_INTERNAL_ERROR); | 305 return TCSERR(TSS_E_INTERNAL_ERROR); |
| 306 | 306 |
| 307 » LogDebugFn("thread %zd context %x", THREAD_ID, hContext); | 307 » LogDebugFn("thread %ld context %x", THREAD_ID, hContext); |
| 308 | 308 |
| 309 if (getData(TCSD_PACKET_TYPE_DIGEST, 1, &eKResetAuth, 0, &data->comm)) | 309 if (getData(TCSD_PACKET_TYPE_DIGEST, 1, &eKResetAuth, 0, &data->comm)) |
| 310 return TCSERR(TSS_E_INTERNAL_ERROR); | 310 return TCSERR(TSS_E_INTERNAL_ERROR); |
| 311 | 311 |
| 312 MUTEX_LOCK(tcsp_lock); | 312 MUTEX_LOCK(tcsp_lock); |
| 313 | 313 |
| 314 result = TCSP_RevokeEndorsementKeyPair_Internal(hContext, eKResetAuth); | 314 result = TCSP_RevokeEndorsementKeyPair_Internal(hContext, eKResetAuth); |
| 315 | 315 |
| 316 MUTEX_UNLOCK(tcsp_lock); | 316 MUTEX_UNLOCK(tcsp_lock); |
| 317 | 317 |
| 318 initData(&data->comm, 0); | 318 initData(&data->comm, 0); |
| 319 | 319 |
| 320 data->comm.hdr.u.result = result; | 320 data->comm.hdr.u.result = result; |
| 321 | 321 |
| 322 return TSS_SUCCESS; | 322 return TSS_SUCCESS; |
| 323 } | 323 } |
| 324 #endif | 324 #endif |
| OLD | NEW |