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. 2006 | 7 * (C) Copyright International Business Machines Corp. 2006 |
8 * | 8 * |
9 */ | 9 */ |
10 | 10 |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 | 205 |
206 while (1) { | 206 while (1) { |
207 /* read event header from the file */ | 207 /* read event header from the file */ |
208 if ((fread(page, 32, 1, handle)) == 0) { | 208 if ((fread(page, 32, 1, handle)) == 0) { |
209 goto done; | 209 goto done; |
210 } | 210 } |
211 | 211 |
212 event = (TCG_PCClientPCREventStruc *)page; | 212 event = (TCG_PCClientPCREventStruc *)page; |
213 | 213 |
214 if (pcr_index == event->pcrIndex) { | 214 if (pcr_index == event->pcrIndex) { |
215 » » » if (!ppEvent && seen_indices == *num) { | 215 » » » if (ppEvent && !*ppEvent && seen_indices == *num) { |
216 *ppEvent = calloc(1, sizeof(TSS_PCR_EVENT)); | 216 *ppEvent = calloc(1, sizeof(TSS_PCR_EVENT)); |
217 if (*ppEvent == NULL) { | 217 if (*ppEvent == NULL) { |
218 LogError("malloc of %zd bytes failed.", | 218 LogError("malloc of %zd bytes failed.", |
219 sizeof(TSS_PCR_EVENT)); | 219 sizeof(TSS_PCR_EVENT)); |
220 return TSS_E_INTERNAL_ERROR; | 220 return TSS_E_INTERNAL_ERROR; |
221 } | 221 } |
222 | 222 |
223 e = *ppEvent; | 223 e = *ppEvent; |
224 | 224 |
225 e->rgbPcrValue = malloc(20); | 225 e->rgbPcrValue = malloc(20); |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 | 289 |
290 int | 290 int |
291 bios_close(FILE *handle) | 291 bios_close(FILE *handle) |
292 { | 292 { |
293 fclose(handle); | 293 fclose(handle); |
294 | 294 |
295 return 0; | 295 return 0; |
296 } | 296 } |
297 | 297 |
298 #endif | 298 #endif |
OLD | NEW |