| 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 20 matching lines...) Expand all Loading... |
| 31 tcs_wrap_ReadCurrentTicks(struct tcsd_thread_data *data) | 31 tcs_wrap_ReadCurrentTicks(struct tcsd_thread_data *data) |
| 32 { | 32 { |
| 33 TCS_CONTEXT_HANDLE hContext; | 33 TCS_CONTEXT_HANDLE hContext; |
| 34 UINT32 pulCurrentTime; | 34 UINT32 pulCurrentTime; |
| 35 BYTE *prgbCurrentTime; | 35 BYTE *prgbCurrentTime; |
| 36 TSS_RESULT result; | 36 TSS_RESULT result; |
| 37 | 37 |
| 38 if (getData(TCSD_PACKET_TYPE_UINT32, 0, &hContext, 0, &data->comm)) | 38 if (getData(TCSD_PACKET_TYPE_UINT32, 0, &hContext, 0, &data->comm)) |
| 39 return TCSERR(TSS_E_INTERNAL_ERROR); | 39 return TCSERR(TSS_E_INTERNAL_ERROR); |
| 40 | 40 |
| 41 » LogDebugFn("thread %zd context %x", THREAD_ID, hContext); | 41 » LogDebugFn("thread %ld context %x", THREAD_ID, hContext); |
| 42 | 42 |
| 43 MUTEX_LOCK(tcsp_lock); | 43 MUTEX_LOCK(tcsp_lock); |
| 44 | 44 |
| 45 result = TCSP_ReadCurrentTicks_Internal(hContext, &pulCurrentTime, &prgb
CurrentTime); | 45 result = TCSP_ReadCurrentTicks_Internal(hContext, &pulCurrentTime, &prgb
CurrentTime); |
| 46 | 46 |
| 47 MUTEX_UNLOCK(tcsp_lock); | 47 MUTEX_UNLOCK(tcsp_lock); |
| 48 | 48 |
| 49 if (result == TSS_SUCCESS) { | 49 if (result == TSS_SUCCESS) { |
| 50 initData(&data->comm, 2); | 50 initData(&data->comm, 2); |
| 51 if (setData(TCSD_PACKET_TYPE_UINT32, 0, &pulCurrentTime, 0, &dat
a->comm)) { | 51 if (setData(TCSD_PACKET_TYPE_UINT32, 0, &pulCurrentTime, 0, &dat
a->comm)) { |
| (...skipping 21 matching lines...) Expand all Loading... |
| 73 TPM_AUTH auth, *pAuth; | 73 TPM_AUTH auth, *pAuth; |
| 74 TPM_NONCE nonce; | 74 TPM_NONCE nonce; |
| 75 TPM_DIGEST digest; | 75 TPM_DIGEST digest; |
| 76 UINT32 sigSize, tcSize, i; | 76 UINT32 sigSize, tcSize, i; |
| 77 BYTE *sig, *tc; | 77 BYTE *sig, *tc; |
| 78 TSS_RESULT result; | 78 TSS_RESULT result; |
| 79 | 79 |
| 80 if (getData(TCSD_PACKET_TYPE_UINT32, 0, &hContext, 0, &data->comm)) | 80 if (getData(TCSD_PACKET_TYPE_UINT32, 0, &hContext, 0, &data->comm)) |
| 81 return TCSERR(TSS_E_INTERNAL_ERROR); | 81 return TCSERR(TSS_E_INTERNAL_ERROR); |
| 82 | 82 |
| 83 » LogDebugFn("thread %zd context %x", THREAD_ID, hContext); | 83 » LogDebugFn("thread %ld context %x", THREAD_ID, hContext); |
| 84 | 84 |
| 85 if (getData(TCSD_PACKET_TYPE_UINT32, 1, &hKey, 0, &data->comm)) | 85 if (getData(TCSD_PACKET_TYPE_UINT32, 1, &hKey, 0, &data->comm)) |
| 86 return TCSERR(TSS_E_INTERNAL_ERROR); | 86 return TCSERR(TSS_E_INTERNAL_ERROR); |
| 87 if (getData(TCSD_PACKET_TYPE_NONCE, 2, &nonce, 0, &data->comm)) | 87 if (getData(TCSD_PACKET_TYPE_NONCE, 2, &nonce, 0, &data->comm)) |
| 88 return TCSERR(TSS_E_INTERNAL_ERROR); | 88 return TCSERR(TSS_E_INTERNAL_ERROR); |
| 89 if (getData(TCSD_PACKET_TYPE_DIGEST, 3, &digest, 0, &data->comm)) | 89 if (getData(TCSD_PACKET_TYPE_DIGEST, 3, &digest, 0, &data->comm)) |
| 90 return TCSERR(TSS_E_INTERNAL_ERROR); | 90 return TCSERR(TSS_E_INTERNAL_ERROR); |
| 91 if (getData(TCSD_PACKET_TYPE_AUTH, 4, &auth, 0, &data->comm)) | 91 if (getData(TCSD_PACKET_TYPE_AUTH, 4, &auth, 0, &data->comm)) |
| 92 pAuth = NULL; | 92 pAuth = NULL; |
| 93 else | 93 else |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 free(sig); | 129 free(sig); |
| 130 free(tc); | 130 free(tc); |
| 131 return TCSERR(TSS_E_INTERNAL_ERROR); | 131 return TCSERR(TSS_E_INTERNAL_ERROR); |
| 132 } | 132 } |
| 133 } else | 133 } else |
| 134 initData(&data->comm, 0); | 134 initData(&data->comm, 0); |
| 135 | 135 |
| 136 data->comm.hdr.u.result = result; | 136 data->comm.hdr.u.result = result; |
| 137 return TSS_SUCCESS; | 137 return TSS_SUCCESS; |
| 138 } | 138 } |
| OLD | NEW |