Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1008)

Side by Side Diff: src/tcs/rpc/tcstp/rpc_own.c

Issue 3581012: Upgrade from trousers 0.3.3 to 0.3.6 and from testsuite 0.2 to 0.3. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/trousers.git
Patch Set: git cl push Created 10 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/tcs/rpc/tcstp/rpc_oper.c ('k') | src/tcs/rpc/tcstp/rpc_pcr_extend.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 29 matching lines...) Expand all
40 BYTE *srkInfo; 40 BYTE *srkInfo;
41 TPM_AUTH ownerAuth; 41 TPM_AUTH ownerAuth;
42 42
43 UINT32 srkKeySize; 43 UINT32 srkKeySize;
44 BYTE *srkKey; 44 BYTE *srkKey;
45 TSS_RESULT result; 45 TSS_RESULT result;
46 46
47 if (getData(TCSD_PACKET_TYPE_UINT32, 0, &hContext, 0, &data->comm)) 47 if (getData(TCSD_PACKET_TYPE_UINT32, 0, &hContext, 0, &data->comm))
48 return TCSERR(TSS_E_INTERNAL_ERROR); 48 return TCSERR(TSS_E_INTERNAL_ERROR);
49 49
50 » LogDebugFn("thread %zd context %x", THREAD_ID, hContext); 50 » LogDebugFn("thread %ld context %x", THREAD_ID, hContext);
51 51
52 if (getData(TCSD_PACKET_TYPE_UINT16, 1, &protocolID, 0, &data->comm)) 52 if (getData(TCSD_PACKET_TYPE_UINT16, 1, &protocolID, 0, &data->comm))
53 return TCSERR(TSS_E_INTERNAL_ERROR); 53 return TCSERR(TSS_E_INTERNAL_ERROR);
54 if (getData(TCSD_PACKET_TYPE_UINT32, 2, &encOwnerAuthSize, 0, &data->com m)) 54 if (getData(TCSD_PACKET_TYPE_UINT32, 2, &encOwnerAuthSize, 0, &data->com m))
55 return TCSERR(TSS_E_INTERNAL_ERROR); 55 return TCSERR(TSS_E_INTERNAL_ERROR);
56 encOwnerAuth = calloc(1, encOwnerAuthSize); 56 encOwnerAuth = calloc(1, encOwnerAuthSize);
57 if (encOwnerAuth == NULL) { 57 if (encOwnerAuth == NULL) {
58 LogError("malloc of %d bytes failed.", encOwnerAuthSize); 58 LogError("malloc of %d bytes failed.", encOwnerAuthSize);
59 return TCSERR(TSS_E_OUTOFMEMORY); 59 return TCSERR(TSS_E_OUTOFMEMORY);
60 } 60 }
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 TSS_RESULT 139 TSS_RESULT
140 tcs_wrap_OwnerClear(struct tcsd_thread_data *data) 140 tcs_wrap_OwnerClear(struct tcsd_thread_data *data)
141 { 141 {
142 TCS_CONTEXT_HANDLE hContext; 142 TCS_CONTEXT_HANDLE hContext;
143 TSS_RESULT result; 143 TSS_RESULT result;
144 TPM_AUTH auth; 144 TPM_AUTH auth;
145 145
146 if (getData(TCSD_PACKET_TYPE_UINT32, 0, &hContext, 0, &data->comm)) 146 if (getData(TCSD_PACKET_TYPE_UINT32, 0, &hContext, 0, &data->comm))
147 return TCSERR(TSS_E_INTERNAL_ERROR); 147 return TCSERR(TSS_E_INTERNAL_ERROR);
148 148
149 » LogDebugFn("thread %zd context %x", THREAD_ID, hContext); 149 » LogDebugFn("thread %ld context %x", THREAD_ID, hContext);
150 150
151 if (getData(TCSD_PACKET_TYPE_AUTH, 1, &auth, 0, &data->comm)) 151 if (getData(TCSD_PACKET_TYPE_AUTH, 1, &auth, 0, &data->comm))
152 return TCSERR(TSS_E_INTERNAL_ERROR); 152 return TCSERR(TSS_E_INTERNAL_ERROR);
153 153
154 MUTEX_LOCK(tcsp_lock); 154 MUTEX_LOCK(tcsp_lock);
155 155
156 result = TCSP_OwnerClear_Internal(hContext, &auth); 156 result = TCSP_OwnerClear_Internal(hContext, &auth);
157 157
158 MUTEX_UNLOCK(tcsp_lock); 158 MUTEX_UNLOCK(tcsp_lock);
159 159
160 if (result == TSS_SUCCESS) { 160 if (result == TSS_SUCCESS) {
161 initData(&data->comm, 1); 161 initData(&data->comm, 1);
162 if (setData(TCSD_PACKET_TYPE_AUTH, 0, &auth, 0, &data->comm)) { 162 if (setData(TCSD_PACKET_TYPE_AUTH, 0, &auth, 0, &data->comm)) {
163 return TCSERR(TSS_E_INTERNAL_ERROR); 163 return TCSERR(TSS_E_INTERNAL_ERROR);
164 } 164 }
165 } else 165 } else
166 initData(&data->comm, 0); 166 initData(&data->comm, 0);
167 167
168 data->comm.hdr.u.result = result; 168 data->comm.hdr.u.result = result;
169 return TSS_SUCCESS; 169 return TSS_SUCCESS;
170 } 170 }
OLDNEW
« no previous file with comments | « src/tcs/rpc/tcstp/rpc_oper.c ('k') | src/tcs/rpc/tcstp/rpc_pcr_extend.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698