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 30 matching lines...) Expand all Loading... |
41 TPM_AUTH ownerAuth; | 41 TPM_AUTH ownerAuth; |
42 TPM_AUTH entityAuth; | 42 TPM_AUTH entityAuth; |
43 | 43 |
44 UINT32 outDataSize; | 44 UINT32 outDataSize; |
45 BYTE *outData; | 45 BYTE *outData; |
46 TSS_RESULT result; | 46 TSS_RESULT result; |
47 | 47 |
48 if (getData(TCSD_PACKET_TYPE_UINT32, 0, &hContext, 0, &data->comm)) | 48 if (getData(TCSD_PACKET_TYPE_UINT32, 0, &hContext, 0, &data->comm)) |
49 return TCSERR(TSS_E_INTERNAL_ERROR); | 49 return TCSERR(TSS_E_INTERNAL_ERROR); |
50 | 50 |
51 » LogDebugFn("thread %zd context %x", THREAD_ID, hContext); | 51 » LogDebugFn("thread %ld context %x", THREAD_ID, hContext); |
52 | 52 |
53 if (getData(TCSD_PACKET_TYPE_UINT32, 1, &parentHandle, 0, &data->comm)) | 53 if (getData(TCSD_PACKET_TYPE_UINT32, 1, &parentHandle, 0, &data->comm)) |
54 return TCSERR(TSS_E_INTERNAL_ERROR); | 54 return TCSERR(TSS_E_INTERNAL_ERROR); |
55 if (getData(TCSD_PACKET_TYPE_UINT16, 2, &protocolID, 0, &data->comm)) | 55 if (getData(TCSD_PACKET_TYPE_UINT16, 2, &protocolID, 0, &data->comm)) |
56 return TCSERR(TSS_E_INTERNAL_ERROR); | 56 return TCSERR(TSS_E_INTERNAL_ERROR); |
57 if (getData(TCSD_PACKET_TYPE_ENCAUTH, 3, &newAuth, 0, &data->comm)) | 57 if (getData(TCSD_PACKET_TYPE_ENCAUTH, 3, &newAuth, 0, &data->comm)) |
58 return TCSERR(TSS_E_INTERNAL_ERROR); | 58 return TCSERR(TSS_E_INTERNAL_ERROR); |
59 if (getData(TCSD_PACKET_TYPE_UINT16, 4, &entityType, 0, &data->comm)) | 59 if (getData(TCSD_PACKET_TYPE_UINT16, 4, &entityType, 0, &data->comm)) |
60 return TCSERR(TSS_E_INTERNAL_ERROR); | 60 return TCSERR(TSS_E_INTERNAL_ERROR); |
61 if (getData(TCSD_PACKET_TYPE_UINT32, 5, &encDataSize, 0, &data->comm)) | 61 if (getData(TCSD_PACKET_TYPE_UINT32, 5, &encDataSize, 0, &data->comm)) |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 TCPA_PROTOCOL_ID protocolID; | 120 TCPA_PROTOCOL_ID protocolID; |
121 TCPA_ENCAUTH newAuth; | 121 TCPA_ENCAUTH newAuth; |
122 TCPA_ENTITY_TYPE entityType; | 122 TCPA_ENTITY_TYPE entityType; |
123 | 123 |
124 TPM_AUTH ownerAuth; | 124 TPM_AUTH ownerAuth; |
125 TSS_RESULT result; | 125 TSS_RESULT result; |
126 | 126 |
127 if (getData(TCSD_PACKET_TYPE_UINT32, 0, &hContext, 0, &data->comm)) | 127 if (getData(TCSD_PACKET_TYPE_UINT32, 0, &hContext, 0, &data->comm)) |
128 return TCSERR(TSS_E_INTERNAL_ERROR); | 128 return TCSERR(TSS_E_INTERNAL_ERROR); |
129 | 129 |
130 » LogDebugFn("thread %zd context %x", THREAD_ID, hContext); | 130 » LogDebugFn("thread %ld context %x", THREAD_ID, hContext); |
131 | 131 |
132 if (getData(TCSD_PACKET_TYPE_UINT16, 1, &protocolID, 0, &data->comm)) | 132 if (getData(TCSD_PACKET_TYPE_UINT16, 1, &protocolID, 0, &data->comm)) |
133 return TCSERR(TSS_E_INTERNAL_ERROR); | 133 return TCSERR(TSS_E_INTERNAL_ERROR); |
134 if (getData(TCSD_PACKET_TYPE_ENCAUTH, 2, &newAuth, 0, &data->comm)) | 134 if (getData(TCSD_PACKET_TYPE_ENCAUTH, 2, &newAuth, 0, &data->comm)) |
135 return TCSERR(TSS_E_INTERNAL_ERROR); | 135 return TCSERR(TSS_E_INTERNAL_ERROR); |
136 if (getData(TCSD_PACKET_TYPE_UINT16, 3, &entityType, 0, &data->comm)) | 136 if (getData(TCSD_PACKET_TYPE_UINT16, 3, &entityType, 0, &data->comm)) |
137 return TCSERR(TSS_E_INTERNAL_ERROR); | 137 return TCSERR(TSS_E_INTERNAL_ERROR); |
138 if (getData(TCSD_PACKET_TYPE_AUTH, 4, &ownerAuth, 0, &data->comm)) | 138 if (getData(TCSD_PACKET_TYPE_AUTH, 4, &ownerAuth, 0, &data->comm)) |
139 return TCSERR(TSS_E_INTERNAL_ERROR); | 139 return TCSERR(TSS_E_INTERNAL_ERROR); |
140 | 140 |
141 MUTEX_LOCK(tcsp_lock); | 141 MUTEX_LOCK(tcsp_lock); |
142 | 142 |
143 result = TCSP_ChangeAuthOwner_Internal(hContext, protocolID, newAuth, en
tityType, | 143 result = TCSP_ChangeAuthOwner_Internal(hContext, protocolID, newAuth, en
tityType, |
144 &ownerAuth); | 144 &ownerAuth); |
145 | 145 |
146 MUTEX_UNLOCK(tcsp_lock); | 146 MUTEX_UNLOCK(tcsp_lock); |
147 | 147 |
148 if (result == TSS_SUCCESS) { | 148 if (result == TSS_SUCCESS) { |
149 initData(&data->comm, 1); | 149 initData(&data->comm, 1); |
150 if (setData(TCSD_PACKET_TYPE_AUTH, 0, &ownerAuth, 0, &data->comm
)) { | 150 if (setData(TCSD_PACKET_TYPE_AUTH, 0, &ownerAuth, 0, &data->comm
)) { |
151 return TCSERR(TSS_E_INTERNAL_ERROR); | 151 return TCSERR(TSS_E_INTERNAL_ERROR); |
152 } | 152 } |
153 } else | 153 } else |
154 initData(&data->comm, 0); | 154 initData(&data->comm, 0); |
155 | 155 |
156 data->comm.hdr.u.result = result; | 156 data->comm.hdr.u.result = result; |
157 return TSS_SUCCESS; | 157 return TSS_SUCCESS; |
158 } | 158 } |
OLD | NEW |