| 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 TCS_CONTEXT_HANDLE hContext; | 33 TCS_CONTEXT_HANDLE hContext; |
| 34 TSS_PCR_EVENT *pEvent = NULL; | 34 TSS_PCR_EVENT *pEvent = NULL; |
| 35 TSS_RESULT result; | 35 TSS_RESULT result; |
| 36 UINT32 pcrIndex, number, totalSize; | 36 UINT32 pcrIndex, number, totalSize; |
| 37 BYTE lengthOnly; | 37 BYTE lengthOnly; |
| 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, &pcrIndex, 0, &data->comm)) | 44 if (getData(TCSD_PACKET_TYPE_UINT32, 1, &pcrIndex, 0, &data->comm)) |
| 45 return TCSERR(TSS_E_INTERNAL_ERROR); | 45 return TCSERR(TSS_E_INTERNAL_ERROR); |
| 46 | 46 |
| 47 if (getData(TCSD_PACKET_TYPE_UINT32, 2, &number, 0, &data->comm)) | 47 if (getData(TCSD_PACKET_TYPE_UINT32, 2, &number, 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_BYTE, 3, &lengthOnly, 0, &data->comm)) | 50 if (getData(TCSD_PACKET_TYPE_BYTE, 3, &lengthOnly, 0, &data->comm)) |
| 51 return TCSERR(TSS_E_INTERNAL_ERROR); | 51 return TCSERR(TSS_E_INTERNAL_ERROR); |
| 52 | 52 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 tcs_wrap_GetPcrEventsByPcr(struct tcsd_thread_data *data) | 91 tcs_wrap_GetPcrEventsByPcr(struct tcsd_thread_data *data) |
| 92 { | 92 { |
| 93 TCS_CONTEXT_HANDLE hContext; | 93 TCS_CONTEXT_HANDLE hContext; |
| 94 TSS_PCR_EVENT *ppEvents = NULL; | 94 TSS_PCR_EVENT *ppEvents = NULL; |
| 95 TSS_RESULT result; | 95 TSS_RESULT result; |
| 96 UINT32 firstEvent, eventCount, totalSize, pcrIndex, i, j; | 96 UINT32 firstEvent, eventCount, totalSize, pcrIndex, i, j; |
| 97 | 97 |
| 98 if (getData(TCSD_PACKET_TYPE_UINT32, 0, &hContext, 0, &data->comm)) | 98 if (getData(TCSD_PACKET_TYPE_UINT32, 0, &hContext, 0, &data->comm)) |
| 99 return TCSERR(TSS_E_INTERNAL_ERROR); | 99 return TCSERR(TSS_E_INTERNAL_ERROR); |
| 100 | 100 |
| 101 » LogDebugFn("thread %zd context %x", THREAD_ID, hContext); | 101 » LogDebugFn("thread %ld context %x", THREAD_ID, hContext); |
| 102 | 102 |
| 103 if (getData(TCSD_PACKET_TYPE_UINT32, 1, &pcrIndex, 0, &data->comm)) | 103 if (getData(TCSD_PACKET_TYPE_UINT32, 1, &pcrIndex, 0, &data->comm)) |
| 104 return TCSERR(TSS_E_INTERNAL_ERROR); | 104 return TCSERR(TSS_E_INTERNAL_ERROR); |
| 105 | 105 |
| 106 if (getData(TCSD_PACKET_TYPE_UINT32, 2, &firstEvent, 0, &data->comm)) | 106 if (getData(TCSD_PACKET_TYPE_UINT32, 2, &firstEvent, 0, &data->comm)) |
| 107 return TCSERR(TSS_E_INTERNAL_ERROR); | 107 return TCSERR(TSS_E_INTERNAL_ERROR); |
| 108 | 108 |
| 109 if (getData(TCSD_PACKET_TYPE_UINT32, 3, &eventCount, 0, &data->comm)) | 109 if (getData(TCSD_PACKET_TYPE_UINT32, 3, &eventCount, 0, &data->comm)) |
| 110 return TCSERR(TSS_E_INTERNAL_ERROR); | 110 return TCSERR(TSS_E_INTERNAL_ERROR); |
| 111 | 111 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 tcs_wrap_GetPcrEventLog(struct tcsd_thread_data *data) | 146 tcs_wrap_GetPcrEventLog(struct tcsd_thread_data *data) |
| 147 { | 147 { |
| 148 TCS_CONTEXT_HANDLE hContext; | 148 TCS_CONTEXT_HANDLE hContext; |
| 149 TSS_PCR_EVENT *ppEvents; | 149 TSS_PCR_EVENT *ppEvents; |
| 150 TSS_RESULT result; | 150 TSS_RESULT result; |
| 151 UINT32 eventCount, totalSize, i, j; | 151 UINT32 eventCount, totalSize, i, j; |
| 152 | 152 |
| 153 if (getData(TCSD_PACKET_TYPE_UINT32, 0, &hContext, 0, &data->comm)) | 153 if (getData(TCSD_PACKET_TYPE_UINT32, 0, &hContext, 0, &data->comm)) |
| 154 return TCSERR(TSS_E_INTERNAL_ERROR); | 154 return TCSERR(TSS_E_INTERNAL_ERROR); |
| 155 | 155 |
| 156 » LogDebugFn("thread %zd context %x", THREAD_ID, hContext); | 156 » LogDebugFn("thread %ld context %x", THREAD_ID, hContext); |
| 157 | 157 |
| 158 result = TCS_GetPcrEventLog_Internal(hContext, &eventCount, &ppEvents); | 158 result = TCS_GetPcrEventLog_Internal(hContext, &eventCount, &ppEvents); |
| 159 | 159 |
| 160 if (result == TSS_SUCCESS) { | 160 if (result == TSS_SUCCESS) { |
| 161 for (i = 0, totalSize = 0; i < eventCount; i++) | 161 for (i = 0, totalSize = 0; i < eventCount; i++) |
| 162 totalSize += get_pcr_event_size(&(ppEvents[i])); | 162 totalSize += get_pcr_event_size(&(ppEvents[i])); |
| 163 | 163 |
| 164 initData(&data->comm, eventCount + 1); | 164 initData(&data->comm, eventCount + 1); |
| 165 if (setData(TCSD_PACKET_TYPE_UINT32, 0, &eventCount, 0, &data->c
omm)) { | 165 if (setData(TCSD_PACKET_TYPE_UINT32, 0, &eventCount, 0, &data->c
omm)) { |
| 166 free_external_events(eventCount, ppEvents); | 166 free_external_events(eventCount, ppEvents); |
| (...skipping 25 matching lines...) Expand all Loading... |
| 192 { | 192 { |
| 193 TCS_CONTEXT_HANDLE hContext; | 193 TCS_CONTEXT_HANDLE hContext; |
| 194 TSS_PCR_EVENT event; | 194 TSS_PCR_EVENT event; |
| 195 TSS_RESULT result; | 195 TSS_RESULT result; |
| 196 UINT32 number; | 196 UINT32 number; |
| 197 | 197 |
| 198 /* Receive */ | 198 /* Receive */ |
| 199 if (getData(TCSD_PACKET_TYPE_UINT32, 0, &hContext, 0, &data->comm)) | 199 if (getData(TCSD_PACKET_TYPE_UINT32, 0, &hContext, 0, &data->comm)) |
| 200 return TCSERR(TSS_E_INTERNAL_ERROR); | 200 return TCSERR(TSS_E_INTERNAL_ERROR); |
| 201 | 201 |
| 202 » LogDebugFn("thread %zd context %x", THREAD_ID, hContext); | 202 » LogDebugFn("thread %ld context %x", THREAD_ID, hContext); |
| 203 | 203 |
| 204 if (getData(TCSD_PACKET_TYPE_PCR_EVENT , 1, &event, 0, &data->comm)) | 204 if (getData(TCSD_PACKET_TYPE_PCR_EVENT , 1, &event, 0, &data->comm)) |
| 205 return TCSERR(TSS_E_INTERNAL_ERROR); | 205 return TCSERR(TSS_E_INTERNAL_ERROR); |
| 206 | 206 |
| 207 result = TCS_LogPcrEvent_Internal(hContext, event, &number); | 207 result = TCS_LogPcrEvent_Internal(hContext, event, &number); |
| 208 | 208 |
| 209 if (result == TSS_SUCCESS) { | 209 if (result == TSS_SUCCESS) { |
| 210 initData(&data->comm, 1); | 210 initData(&data->comm, 1); |
| 211 if (setData(TCSD_PACKET_TYPE_UINT32, 0, &number, 0, &data->comm)
) { | 211 if (setData(TCSD_PACKET_TYPE_UINT32, 0, &number, 0, &data->comm)
) { |
| 212 return TCSERR(TSS_E_INTERNAL_ERROR); | 212 return TCSERR(TSS_E_INTERNAL_ERROR); |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 return TCSERR(TSS_E_OUTOFMEMORY); | 281 return TCSERR(TSS_E_OUTOFMEMORY); |
| 282 } | 282 } |
| 283 | 283 |
| 284 UnloadBlob(offset, event->ulEventLength, blob, event->rgbEvent); | 284 UnloadBlob(offset, event->ulEventLength, blob, event->rgbEvent); |
| 285 } else { | 285 } else { |
| 286 event->rgbEvent = NULL; | 286 event->rgbEvent = NULL; |
| 287 } | 287 } |
| 288 | 288 |
| 289 return TSS_SUCCESS; | 289 return TSS_SUCCESS; |
| 290 } | 290 } |
| OLD | NEW |