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. 2007 | 7 * (C) Copyright International Business Machines Corp. 2007 |
8 * | 8 * |
9 */ | 9 */ |
10 | 10 |
(...skipping 20 matching lines...) Expand all Loading... |
31 tcs_wrap_CMK_SetRestrictions(struct tcsd_thread_data *data) | 31 tcs_wrap_CMK_SetRestrictions(struct tcsd_thread_data *data) |
32 { | 32 { |
33 TCS_CONTEXT_HANDLE hContext; | 33 TCS_CONTEXT_HANDLE hContext; |
34 TSS_CMK_DELEGATE restriction; | 34 TSS_CMK_DELEGATE restriction; |
35 TPM_AUTH ownerAuth; | 35 TPM_AUTH ownerAuth; |
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 if (getData(TCSD_PACKET_TYPE_UINT32, 1, &restriction, 0, &data->comm)) | 43 if (getData(TCSD_PACKET_TYPE_UINT32, 1, &restriction, 0, &data->comm)) |
44 return TCSERR(TSS_E_INTERNAL_ERROR); | 44 return TCSERR(TSS_E_INTERNAL_ERROR); |
45 | 45 |
46 if (getData(TCSD_PACKET_TYPE_AUTH, 2, &ownerAuth, 0, &data->comm)) | 46 if (getData(TCSD_PACKET_TYPE_AUTH, 2, &ownerAuth, 0, &data->comm)) |
47 return TCSERR(TSS_E_INTERNAL_ERROR); | 47 return TCSERR(TSS_E_INTERNAL_ERROR); |
48 | 48 |
49 MUTEX_LOCK(tcsp_lock); | 49 MUTEX_LOCK(tcsp_lock); |
50 | 50 |
51 result = TCSP_CMK_SetRestrictions_Internal(hContext, restriction, &owner
Auth); | 51 result = TCSP_CMK_SetRestrictions_Internal(hContext, restriction, &owner
Auth); |
(...skipping 17 matching lines...) Expand all Loading... |
69 { | 69 { |
70 TCS_CONTEXT_HANDLE hContext; | 70 TCS_CONTEXT_HANDLE hContext; |
71 TPM_DIGEST migAuthorityDigest; | 71 TPM_DIGEST migAuthorityDigest; |
72 TPM_AUTH ownerAuth; | 72 TPM_AUTH ownerAuth; |
73 TPM_HMAC migAuthorityApproval; | 73 TPM_HMAC migAuthorityApproval; |
74 TSS_RESULT result; | 74 TSS_RESULT result; |
75 | 75 |
76 if (getData(TCSD_PACKET_TYPE_UINT32, 0, &hContext, 0, &data->comm)) | 76 if (getData(TCSD_PACKET_TYPE_UINT32, 0, &hContext, 0, &data->comm)) |
77 return TCSERR(TSS_E_INTERNAL_ERROR); | 77 return TCSERR(TSS_E_INTERNAL_ERROR); |
78 | 78 |
79 » LogDebugFn("thread %zd context %x", THREAD_ID, hContext); | 79 » LogDebugFn("thread %ld context %x", THREAD_ID, hContext); |
80 | 80 |
81 if (getData(TCSD_PACKET_TYPE_DIGEST, 1, &migAuthorityDigest, 0, &data->c
omm)) | 81 if (getData(TCSD_PACKET_TYPE_DIGEST, 1, &migAuthorityDigest, 0, &data->c
omm)) |
82 return TCSERR(TSS_E_INTERNAL_ERROR); | 82 return TCSERR(TSS_E_INTERNAL_ERROR); |
83 | 83 |
84 if (getData(TCSD_PACKET_TYPE_AUTH, 2, &ownerAuth, 0, &data->comm)) | 84 if (getData(TCSD_PACKET_TYPE_AUTH, 2, &ownerAuth, 0, &data->comm)) |
85 return TCSERR(TSS_E_INTERNAL_ERROR); | 85 return TCSERR(TSS_E_INTERNAL_ERROR); |
86 | 86 |
87 MUTEX_LOCK(tcsp_lock); | 87 MUTEX_LOCK(tcsp_lock); |
88 | 88 |
89 result = TCSP_CMK_ApproveMA_Internal(hContext, migAuthorityDigest, &owne
rAuth, | 89 result = TCSP_CMK_ApproveMA_Internal(hContext, migAuthorityDigest, &owne
rAuth, |
(...skipping 28 matching lines...) Expand all Loading... |
118 BYTE *keyData; | 118 BYTE *keyData; |
119 TPM_AUTH parentAuth, nullAuth, *pAuth; | 119 TPM_AUTH parentAuth, nullAuth, *pAuth; |
120 TSS_RESULT result; | 120 TSS_RESULT result; |
121 | 121 |
122 memset(&parentAuth, 0, sizeof(TPM_AUTH)); | 122 memset(&parentAuth, 0, sizeof(TPM_AUTH)); |
123 memset(&nullAuth, 0, sizeof(TPM_AUTH)); | 123 memset(&nullAuth, 0, sizeof(TPM_AUTH)); |
124 | 124 |
125 if (getData(TCSD_PACKET_TYPE_UINT32, 0, &hContext, 0, &data->comm)) | 125 if (getData(TCSD_PACKET_TYPE_UINT32, 0, &hContext, 0, &data->comm)) |
126 return TCSERR(TSS_E_INTERNAL_ERROR); | 126 return TCSERR(TSS_E_INTERNAL_ERROR); |
127 | 127 |
128 » LogDebugFn("thread %zd context %x", THREAD_ID, hContext); | 128 » LogDebugFn("thread %ld context %x", THREAD_ID, hContext); |
129 | 129 |
130 if (getData(TCSD_PACKET_TYPE_UINT32, 1, &hKey, 0, &data->comm)) | 130 if (getData(TCSD_PACKET_TYPE_UINT32, 1, &hKey, 0, &data->comm)) |
131 return TCSERR(TSS_E_INTERNAL_ERROR); | 131 return TCSERR(TSS_E_INTERNAL_ERROR); |
132 | 132 |
133 if (getData(TCSD_PACKET_TYPE_ENCAUTH, 2, &keyUsageAuth, 0, &data->comm)) | 133 if (getData(TCSD_PACKET_TYPE_ENCAUTH, 2, &keyUsageAuth, 0, &data->comm)) |
134 return TCSERR(TSS_E_INTERNAL_ERROR); | 134 return TCSERR(TSS_E_INTERNAL_ERROR); |
135 | 135 |
136 if (getData(TCSD_PACKET_TYPE_DIGEST, 3, &migAuthorityApproval, 0, &data-
>comm)) | 136 if (getData(TCSD_PACKET_TYPE_DIGEST, 3, &migAuthorityApproval, 0, &data-
>comm)) |
137 return TCSERR(TSS_E_INTERNAL_ERROR); | 137 return TCSERR(TSS_E_INTERNAL_ERROR); |
138 | 138 |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 TPM_DIGEST signedData; | 203 TPM_DIGEST signedData; |
204 UINT32 sigValueSize; | 204 UINT32 sigValueSize; |
205 BYTE *sigValue; | 205 BYTE *sigValue; |
206 TPM_AUTH ownerAuth; | 206 TPM_AUTH ownerAuth; |
207 TPM_HMAC sigTicket; | 207 TPM_HMAC sigTicket; |
208 TSS_RESULT result; | 208 TSS_RESULT result; |
209 | 209 |
210 if (getData(TCSD_PACKET_TYPE_UINT32, 0, &hContext, 0, &data->comm)) | 210 if (getData(TCSD_PACKET_TYPE_UINT32, 0, &hContext, 0, &data->comm)) |
211 return TCSERR(TSS_E_INTERNAL_ERROR); | 211 return TCSERR(TSS_E_INTERNAL_ERROR); |
212 | 212 |
213 » LogDebugFn("thread %zd context %x", THREAD_ID, hContext); | 213 » LogDebugFn("thread %ld context %x", THREAD_ID, hContext); |
214 | 214 |
215 if (getData(TCSD_PACKET_TYPE_UINT32, 1, &publicVerifyKeySize, 0, &data->
comm)) | 215 if (getData(TCSD_PACKET_TYPE_UINT32, 1, &publicVerifyKeySize, 0, &data->
comm)) |
216 return TCSERR(TSS_E_INTERNAL_ERROR); | 216 return TCSERR(TSS_E_INTERNAL_ERROR); |
217 | 217 |
218 publicVerifyKey = malloc(publicVerifyKeySize); | 218 publicVerifyKey = malloc(publicVerifyKeySize); |
219 if (publicVerifyKey == NULL) { | 219 if (publicVerifyKey == NULL) { |
220 LogError("malloc of %u bytes failed.", publicVerifyKeySize); | 220 LogError("malloc of %u bytes failed.", publicVerifyKeySize); |
221 return TCSERR(TSS_E_OUTOFMEMORY); | 221 return TCSERR(TSS_E_OUTOFMEMORY); |
222 } | 222 } |
223 if (getData(TCSD_PACKET_TYPE_PBYTE, 2, publicVerifyKey, publicVerifyKeyS
ize, &data->comm)) { | 223 if (getData(TCSD_PACKET_TYPE_PBYTE, 2, publicVerifyKey, publicVerifyKeyS
ize, &data->comm)) { |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 BYTE *random, *outData; | 293 BYTE *random, *outData; |
294 TSS_RESULT result; | 294 TSS_RESULT result; |
295 int i; | 295 int i; |
296 | 296 |
297 memset(&parentAuth, 0, sizeof(TPM_AUTH)); | 297 memset(&parentAuth, 0, sizeof(TPM_AUTH)); |
298 memset(&nullAuth, 0, sizeof(TPM_AUTH)); | 298 memset(&nullAuth, 0, sizeof(TPM_AUTH)); |
299 | 299 |
300 if (getData(TCSD_PACKET_TYPE_UINT32, 0, &hContext, 0, &data->comm)) | 300 if (getData(TCSD_PACKET_TYPE_UINT32, 0, &hContext, 0, &data->comm)) |
301 return TCSERR(TSS_E_INTERNAL_ERROR); | 301 return TCSERR(TSS_E_INTERNAL_ERROR); |
302 | 302 |
303 » LogDebugFn("thread %zd context %x", THREAD_ID, hContext); | 303 » LogDebugFn("thread %ld context %x", THREAD_ID, hContext); |
304 | 304 |
305 if (getData(TCSD_PACKET_TYPE_UINT32, 1, &hKey, 0, &data->comm)) | 305 if (getData(TCSD_PACKET_TYPE_UINT32, 1, &hKey, 0, &data->comm)) |
306 return TCSERR(TSS_E_INTERNAL_ERROR); | 306 return TCSERR(TSS_E_INTERNAL_ERROR); |
307 | 307 |
308 if (getData(TCSD_PACKET_TYPE_UINT16, 2, &migrationType, 0, &data->comm)) | 308 if (getData(TCSD_PACKET_TYPE_UINT16, 2, &migrationType, 0, &data->comm)) |
309 return TCSERR(TSS_E_INTERNAL_ERROR); | 309 return TCSERR(TSS_E_INTERNAL_ERROR); |
310 | 310 |
311 if (getData(TCSD_PACKET_TYPE_UINT32, 3, &migKeyAuthSize, 0, &data->comm)
) | 311 if (getData(TCSD_PACKET_TYPE_UINT32, 3, &migKeyAuthSize, 0, &data->comm)
) |
312 return TCSERR(TSS_E_INTERNAL_ERROR); | 312 return TCSERR(TSS_E_INTERNAL_ERROR); |
313 | 313 |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
496 BYTE *outData; | 496 BYTE *outData; |
497 TSS_RESULT result; | 497 TSS_RESULT result; |
498 int i; | 498 int i; |
499 | 499 |
500 memset(&parentAuth, 0, sizeof(TPM_AUTH)); | 500 memset(&parentAuth, 0, sizeof(TPM_AUTH)); |
501 memset(&nullAuth, 0, sizeof(TPM_AUTH)); | 501 memset(&nullAuth, 0, sizeof(TPM_AUTH)); |
502 | 502 |
503 if (getData(TCSD_PACKET_TYPE_UINT32, 0, &hContext, 0, &data->comm)) | 503 if (getData(TCSD_PACKET_TYPE_UINT32, 0, &hContext, 0, &data->comm)) |
504 return TCSERR(TSS_E_INTERNAL_ERROR); | 504 return TCSERR(TSS_E_INTERNAL_ERROR); |
505 | 505 |
506 » LogDebugFn("thread %zd context %x", THREAD_ID, hContext); | 506 » LogDebugFn("thread %ld context %x", THREAD_ID, hContext); |
507 | 507 |
508 if (getData(TCSD_PACKET_TYPE_UINT32, 1, &hKey, 0, &data->comm)) | 508 if (getData(TCSD_PACKET_TYPE_UINT32, 1, &hKey, 0, &data->comm)) |
509 return TCSERR(TSS_E_INTERNAL_ERROR); | 509 return TCSERR(TSS_E_INTERNAL_ERROR); |
510 | 510 |
511 if (getData(TCSD_PACKET_TYPE_PBYTE, 2, &restrictTicket, sizeof(restrictT
icket), &data->comm)) | 511 if (getData(TCSD_PACKET_TYPE_PBYTE, 2, &restrictTicket, sizeof(restrictT
icket), &data->comm)) |
512 return TCSERR(TSS_E_INTERNAL_ERROR); | 512 return TCSERR(TSS_E_INTERNAL_ERROR); |
513 | 513 |
514 if (getData(TCSD_PACKET_TYPE_DIGEST, 3, &sigTicket, 0, &data->comm)) | 514 if (getData(TCSD_PACKET_TYPE_DIGEST, 3, &sigTicket, 0, &data->comm)) |
515 return TCSERR(TSS_E_INTERNAL_ERROR); | 515 return TCSERR(TSS_E_INTERNAL_ERROR); |
516 | 516 |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
608 } | 608 } |
609 free(outData); | 609 free(outData); |
610 } else | 610 } else |
611 initData(&data->comm, 0); | 611 initData(&data->comm, 0); |
612 | 612 |
613 data->comm.hdr.u.result = result; | 613 data->comm.hdr.u.result = result; |
614 | 614 |
615 return TSS_SUCCESS; | 615 return TSS_SUCCESS; |
616 } | 616 } |
617 | 617 |
OLD | NEW |