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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 | 48 |
49 UINT32 sigSize; | 49 UINT32 sigSize; |
50 BYTE *sig; | 50 BYTE *sig; |
51 TSS_RESULT result; | 51 TSS_RESULT result; |
52 | 52 |
53 int i; | 53 int i; |
54 | 54 |
55 if (getData(TCSD_PACKET_TYPE_UINT32, 0, &hContext, 0, &data->comm)) | 55 if (getData(TCSD_PACKET_TYPE_UINT32, 0, &hContext, 0, &data->comm)) |
56 return TCSERR(TSS_E_INTERNAL_ERROR); | 56 return TCSERR(TSS_E_INTERNAL_ERROR); |
57 | 57 |
58 » LogDebugFn("thread %zd context %x", THREAD_ID, hContext); | 58 » LogDebugFn("thread %ld context %x", THREAD_ID, hContext); |
59 | 59 |
60 if (getData(TCSD_PACKET_TYPE_UINT32, 1, &hKey, 0, &data->comm)) | 60 if (getData(TCSD_PACKET_TYPE_UINT32, 1, &hKey, 0, &data->comm)) |
61 return TCSERR(TSS_E_INTERNAL_ERROR); | 61 return TCSERR(TSS_E_INTERNAL_ERROR); |
62 if (getData(TCSD_PACKET_TYPE_NONCE, 2, &antiReplay, 0, &data->comm)) | 62 if (getData(TCSD_PACKET_TYPE_NONCE, 2, &antiReplay, 0, &data->comm)) |
63 return TCSERR(TSS_E_INTERNAL_ERROR); | 63 return TCSERR(TSS_E_INTERNAL_ERROR); |
64 if (getData(TCSD_PACKET_TYPE_UINT32, 3, &pcrDataSizeIn, 0, &data->comm)) | 64 if (getData(TCSD_PACKET_TYPE_UINT32, 3, &pcrDataSizeIn, 0, &data->comm)) |
65 return TCSERR(TSS_E_INTERNAL_ERROR); | 65 return TCSERR(TSS_E_INTERNAL_ERROR); |
66 pcrDataIn = (BYTE *)calloc(1, pcrDataSizeIn); | 66 pcrDataIn = (BYTE *)calloc(1, pcrDataSizeIn); |
67 if (pcrDataIn == NULL) { | 67 if (pcrDataIn == NULL) { |
68 LogError("malloc of %u bytes failed.", pcrDataSizeIn); | 68 LogError("malloc of %u bytes failed.", pcrDataSizeIn); |
69 return TCSERR(TSS_E_OUTOFMEMORY); | 69 return TCSERR(TSS_E_OUTOFMEMORY); |
70 } | 70 } |
71 if (getData(TCSD_PACKET_TYPE_PBYTE, 4, pcrDataIn, pcrDataSizeIn, &data->
comm)) { | 71 if (getData(TCSD_PACKET_TYPE_PBYTE, 4, pcrDataIn, pcrDataSizeIn, &data->
comm)) { |
72 free(pcrDataIn); | 72 free(pcrDataIn); |
73 return TCSERR(TSS_E_INTERNAL_ERROR); | 73 return TCSERR(TSS_E_INTERNAL_ERROR); |
74 } | 74 } |
75 » if (getData(TCSD_PACKET_TYPE_BOOL,5,&addVersion, 0, &data->comm)) | 75 » if (getData(TCSD_PACKET_TYPE_BOOL,5,&addVersion, 0, &data->comm)) { |
| 76 » » free(pcrDataIn); |
76 return TCSERR(TSS_E_INTERNAL_ERROR); | 77 return TCSERR(TSS_E_INTERNAL_ERROR); |
77 » | 78 » } |
78 result = getData(TCSD_PACKET_TYPE_AUTH, 6, &privAuth, 0, &data->comm); | 79 result = getData(TCSD_PACKET_TYPE_AUTH, 6, &privAuth, 0, &data->comm); |
79 if (result == TSS_TCP_RPC_BAD_PACKET_TYPE) | 80 if (result == TSS_TCP_RPC_BAD_PACKET_TYPE) |
80 pPrivAuth = NULL; | 81 pPrivAuth = NULL; |
81 else if (result) { | 82 else if (result) { |
82 free(pcrDataIn); | 83 free(pcrDataIn); |
83 return result; | 84 return result; |
84 } else | 85 } else |
85 pPrivAuth = &privAuth; | 86 pPrivAuth = &privAuth; |
86 | 87 |
87 MUTEX_LOCK(tcsp_lock); | 88 MUTEX_LOCK(tcsp_lock); |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 free(pcrDataOut); | 154 free(pcrDataOut); |
154 if (versionInfoSize >0) | 155 if (versionInfoSize >0) |
155 free(versionInfo); | 156 free(versionInfo); |
156 free(sig); | 157 free(sig); |
157 } else | 158 } else |
158 initData(&data->comm, 0); | 159 initData(&data->comm, 0); |
159 | 160 |
160 data->comm.hdr.u.result = result; | 161 data->comm.hdr.u.result = result; |
161 return TSS_SUCCESS; | 162 return TSS_SUCCESS; |
162 } | 163 } |
OLD | NEW |