| 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 24 matching lines...) Expand all Loading... |
| 35 TCS_KEY_HANDLE parentHandle; | 35 TCS_KEY_HANDLE parentHandle; |
| 36 TSS_MIGRATE_SCHEME migrationType; | 36 TSS_MIGRATE_SCHEME migrationType; |
| 37 UINT32 MigrationKeyAuthSize, encDataSize, randomSize, outDataSize; | 37 UINT32 MigrationKeyAuthSize, encDataSize, randomSize, outDataSize; |
| 38 BYTE *MigrationKeyAuth, *encData, *random, *outData; | 38 BYTE *MigrationKeyAuth, *encData, *random, *outData; |
| 39 TPM_AUTH auth1, auth2, *pParentAuth, *pEntityAuth; | 39 TPM_AUTH auth1, auth2, *pParentAuth, *pEntityAuth; |
| 40 UINT32 i; | 40 UINT32 i; |
| 41 | 41 |
| 42 if (getData(TCSD_PACKET_TYPE_UINT32, 0, &hContext, 0, &data->comm)) | 42 if (getData(TCSD_PACKET_TYPE_UINT32, 0, &hContext, 0, &data->comm)) |
| 43 return TCSERR(TSS_E_INTERNAL_ERROR); | 43 return TCSERR(TSS_E_INTERNAL_ERROR); |
| 44 | 44 |
| 45 » LogDebugFn("thread %zd context %x", THREAD_ID, hContext); | 45 » LogDebugFn("thread %ld context %x", THREAD_ID, hContext); |
| 46 | 46 |
| 47 if (getData(TCSD_PACKET_TYPE_UINT32, 1, &parentHandle, 0, &data->comm)) | 47 if (getData(TCSD_PACKET_TYPE_UINT32, 1, &parentHandle, 0, &data->comm)) |
| 48 return TCSERR(TSS_E_INTERNAL_ERROR); | 48 return TCSERR(TSS_E_INTERNAL_ERROR); |
| 49 if (getData(TCSD_PACKET_TYPE_UINT16, 2, &migrationType, 0, &data->comm)) | 49 if (getData(TCSD_PACKET_TYPE_UINT16, 2, &migrationType, 0, &data->comm)) |
| 50 return TCSERR(TSS_E_INTERNAL_ERROR); | 50 return TCSERR(TSS_E_INTERNAL_ERROR); |
| 51 | 51 |
| 52 if (getData(TCSD_PACKET_TYPE_UINT32, 3, &MigrationKeyAuthSize, 0, &data-
>comm)) | 52 if (getData(TCSD_PACKET_TYPE_UINT32, 3, &MigrationKeyAuthSize, 0, &data-
>comm)) |
| 53 return TCSERR(TSS_E_INTERNAL_ERROR); | 53 return TCSERR(TSS_E_INTERNAL_ERROR); |
| 54 | 54 |
| 55 MigrationKeyAuth = (BYTE *)malloc(MigrationKeyAuthSize); | 55 MigrationKeyAuth = (BYTE *)malloc(MigrationKeyAuthSize); |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 TSS_RESULT result; | 164 TSS_RESULT result; |
| 165 TCS_KEY_HANDLE parentHandle; | 165 TCS_KEY_HANDLE parentHandle; |
| 166 UINT32 outDataSize, randomSize, inDataSize; | 166 UINT32 outDataSize, randomSize, inDataSize; |
| 167 BYTE *outData, *random, *inData; | 167 BYTE *outData, *random, *inData; |
| 168 TPM_AUTH parentAuth, *pParentAuth; | 168 TPM_AUTH parentAuth, *pParentAuth; |
| 169 UINT32 i; | 169 UINT32 i; |
| 170 | 170 |
| 171 if (getData(TCSD_PACKET_TYPE_UINT32, 0, &hContext, 0, &data->comm)) | 171 if (getData(TCSD_PACKET_TYPE_UINT32, 0, &hContext, 0, &data->comm)) |
| 172 return TCSERR(TSS_E_INTERNAL_ERROR); | 172 return TCSERR(TSS_E_INTERNAL_ERROR); |
| 173 | 173 |
| 174 » LogDebugFn("thread %zd context %x", THREAD_ID, hContext); | 174 » LogDebugFn("thread %ld context %x", THREAD_ID, hContext); |
| 175 | 175 |
| 176 if (getData(TCSD_PACKET_TYPE_UINT32, 1, &parentHandle, 0, &data->comm)) | 176 if (getData(TCSD_PACKET_TYPE_UINT32, 1, &parentHandle, 0, &data->comm)) |
| 177 return TCSERR(TSS_E_INTERNAL_ERROR); | 177 return TCSERR(TSS_E_INTERNAL_ERROR); |
| 178 | 178 |
| 179 if (getData(TCSD_PACKET_TYPE_UINT32, 2, &inDataSize, 0, &data->comm)) | 179 if (getData(TCSD_PACKET_TYPE_UINT32, 2, &inDataSize, 0, &data->comm)) |
| 180 return TCSERR(TSS_E_INTERNAL_ERROR); | 180 return TCSERR(TSS_E_INTERNAL_ERROR); |
| 181 | 181 |
| 182 inData = (BYTE *)malloc(inDataSize); | 182 inData = (BYTE *)malloc(inDataSize); |
| 183 if (inData == NULL) { | 183 if (inData == NULL) { |
| 184 LogError("malloc of %d bytes failed.", inDataSize); | 184 LogError("malloc of %d bytes failed.", inDataSize); |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 TCS_CONTEXT_HANDLE hContext; | 256 TCS_CONTEXT_HANDLE hContext; |
| 257 TSS_RESULT result; | 257 TSS_RESULT result; |
| 258 TSS_MIGRATE_SCHEME migrateScheme; | 258 TSS_MIGRATE_SCHEME migrateScheme; |
| 259 UINT32 MigrationKeySize, MigrationKeyAuthSize; | 259 UINT32 MigrationKeySize, MigrationKeyAuthSize; |
| 260 BYTE *MigrationKey, *MigrationKeyAuth; | 260 BYTE *MigrationKey, *MigrationKeyAuth; |
| 261 TPM_AUTH ownerAuth; | 261 TPM_AUTH ownerAuth; |
| 262 | 262 |
| 263 if (getData(TCSD_PACKET_TYPE_UINT32, 0, &hContext, 0, &data->comm)) | 263 if (getData(TCSD_PACKET_TYPE_UINT32, 0, &hContext, 0, &data->comm)) |
| 264 return TCSERR(TSS_E_INTERNAL_ERROR); | 264 return TCSERR(TSS_E_INTERNAL_ERROR); |
| 265 | 265 |
| 266 » LogDebugFn("thread %zd context %x", THREAD_ID, hContext); | 266 » LogDebugFn("thread %ld context %x", THREAD_ID, hContext); |
| 267 | 267 |
| 268 if (getData(TCSD_PACKET_TYPE_UINT16, 1, &migrateScheme, 0, &data->comm)) | 268 if (getData(TCSD_PACKET_TYPE_UINT16, 1, &migrateScheme, 0, &data->comm)) |
| 269 return TCSERR(TSS_E_INTERNAL_ERROR); | 269 return TCSERR(TSS_E_INTERNAL_ERROR); |
| 270 | 270 |
| 271 if (getData(TCSD_PACKET_TYPE_UINT32, 2, &MigrationKeySize, 0, &data->com
m)) | 271 if (getData(TCSD_PACKET_TYPE_UINT32, 2, &MigrationKeySize, 0, &data->com
m)) |
| 272 return TCSERR(TSS_E_INTERNAL_ERROR); | 272 return TCSERR(TSS_E_INTERNAL_ERROR); |
| 273 | 273 |
| 274 MigrationKey = (BYTE *)malloc(MigrationKeySize); | 274 MigrationKey = (BYTE *)malloc(MigrationKeySize); |
| 275 if (MigrationKey == NULL) { | 275 if (MigrationKey == NULL) { |
| 276 LogError("malloc of %d bytes failed.", MigrationKeySize); | 276 LogError("malloc of %d bytes failed.", MigrationKeySize); |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 312 } | 312 } |
| 313 | 313 |
| 314 free(MigrationKeyAuth); | 314 free(MigrationKeyAuth); |
| 315 } else | 315 } else |
| 316 initData(&data->comm, 0); | 316 initData(&data->comm, 0); |
| 317 | 317 |
| 318 data->comm.hdr.u.result = result; | 318 data->comm.hdr.u.result = result; |
| 319 | 319 |
| 320 return TSS_SUCCESS; | 320 return TSS_SUCCESS; |
| 321 } | 321 } |
| OLD | NEW |