| 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 24 matching lines...) Expand all Loading... |
| 35 UINT32 ulTransControlFlags, ulTransSessionInfoSize, ulSecretSize, ulCurr
entTicks, i; | 35 UINT32 ulTransControlFlags, ulTransSessionInfoSize, ulSecretSize, ulCurr
entTicks, i; |
| 36 BYTE *rgbTransSessionInfo, *rgbSecret, *prgbCurrentTicks; | 36 BYTE *rgbTransSessionInfo, *rgbSecret, *prgbCurrentTicks; |
| 37 TPM_MODIFIER_INDICATOR pbLocality; | 37 TPM_MODIFIER_INDICATOR pbLocality; |
| 38 TPM_AUTH pEncKeyAuth, *pAuth; | 38 TPM_AUTH pEncKeyAuth, *pAuth; |
| 39 TPM_NONCE pTransNonce; | 39 TPM_NONCE pTransNonce; |
| 40 TSS_RESULT result; | 40 TSS_RESULT result; |
| 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, &ulTransControlFlags, 0, &data->
comm)) | 47 if (getData(TCSD_PACKET_TYPE_UINT32, 1, &ulTransControlFlags, 0, &data->
comm)) |
| 48 return TCSERR(TSS_E_INTERNAL_ERROR); | 48 return TCSERR(TSS_E_INTERNAL_ERROR); |
| 49 if (getData(TCSD_PACKET_TYPE_UINT32, 2, &hEncKey, 0, &data->comm)) | 49 if (getData(TCSD_PACKET_TYPE_UINT32, 2, &hEncKey, 0, &data->comm)) |
| 50 return TCSERR(TSS_E_INTERNAL_ERROR); | 50 return TCSERR(TSS_E_INTERNAL_ERROR); |
| 51 if (getData(TCSD_PACKET_TYPE_UINT32, 3, &ulTransSessionInfoSize, 0, &dat
a->comm)) | 51 if (getData(TCSD_PACKET_TYPE_UINT32, 3, &ulTransSessionInfoSize, 0, &dat
a->comm)) |
| 52 return TCSERR(TSS_E_INTERNAL_ERROR); | 52 return TCSERR(TSS_E_INTERNAL_ERROR); |
| 53 | 53 |
| 54 rgbTransSessionInfo = malloc(ulTransSessionInfoSize); | 54 rgbTransSessionInfo = malloc(ulTransSessionInfoSize); |
| 55 if (rgbTransSessionInfo == NULL) { | 55 if (rgbTransSessionInfo == NULL) { |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 UINT32 ulWrappedCmdDataInSize, pulHandleListSize, ulWrappedCmdDataOutSiz
e, i = 0; | 141 UINT32 ulWrappedCmdDataInSize, pulHandleListSize, ulWrappedCmdDataOutSiz
e, i = 0; |
| 142 BYTE *rgbWrappedCmdDataIn, *rgbWrappedCmdDataOut; | 142 BYTE *rgbWrappedCmdDataIn, *rgbWrappedCmdDataOut; |
| 143 TPM_MODIFIER_INDICATOR pbLocality; | 143 TPM_MODIFIER_INDICATOR pbLocality; |
| 144 TPM_AUTH pWrappedCmdAuth1, pWrappedCmdAuth2, pTransAuth, *pAuth1, *pAuth
2, null_auth; | 144 TPM_AUTH pWrappedCmdAuth1, pWrappedCmdAuth2, pTransAuth, *pAuth1, *pAuth
2, null_auth; |
| 145 UINT64 punCurrentTicks; | 145 UINT64 punCurrentTicks; |
| 146 TSS_RESULT result, pulWrappedCmdReturnCode; | 146 TSS_RESULT result, pulWrappedCmdReturnCode; |
| 147 | 147 |
| 148 if (getData(TCSD_PACKET_TYPE_UINT32, i++, &hContext, 0, &data->comm)) | 148 if (getData(TCSD_PACKET_TYPE_UINT32, i++, &hContext, 0, &data->comm)) |
| 149 return TCSERR(TSS_E_INTERNAL_ERROR); | 149 return TCSERR(TSS_E_INTERNAL_ERROR); |
| 150 | 150 |
| 151 » LogDebugFn("thread %zd context %x", THREAD_ID, hContext); | 151 » LogDebugFn("thread %ld context %x", THREAD_ID, hContext); |
| 152 | 152 |
| 153 if (getData(TCSD_PACKET_TYPE_UINT32, i++, &unWrappedCommandOrdinal, 0, &
data->comm)) | 153 if (getData(TCSD_PACKET_TYPE_UINT32, i++, &unWrappedCommandOrdinal, 0, &
data->comm)) |
| 154 return TCSERR(TSS_E_INTERNAL_ERROR); | 154 return TCSERR(TSS_E_INTERNAL_ERROR); |
| 155 if (getData(TCSD_PACKET_TYPE_UINT32, i++, &ulWrappedCmdDataInSize, 0, &d
ata->comm)) | 155 if (getData(TCSD_PACKET_TYPE_UINT32, i++, &ulWrappedCmdDataInSize, 0, &d
ata->comm)) |
| 156 return TCSERR(TSS_E_INTERNAL_ERROR); | 156 return TCSERR(TSS_E_INTERNAL_ERROR); |
| 157 | 157 |
| 158 rgbWrappedCmdDataIn = malloc(ulWrappedCmdDataInSize); | 158 rgbWrappedCmdDataIn = malloc(ulWrappedCmdDataInSize); |
| 159 if (rgbWrappedCmdDataIn == NULL) { | 159 if (rgbWrappedCmdDataIn == NULL) { |
| 160 LogError("malloc of %u bytes failed", ulWrappedCmdDataInSize); | 160 LogError("malloc of %u bytes failed", ulWrappedCmdDataInSize); |
| 161 return TCSERR(TSS_E_INTERNAL_ERROR); | 161 return TCSERR(TSS_E_INTERNAL_ERROR); |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 308 TPM_MODIFIER_INDICATOR pbLocality; | 308 TPM_MODIFIER_INDICATOR pbLocality; |
| 309 TPM_AUTH pKeyAuth, pTransAuth, *pAuth, null_auth; | 309 TPM_AUTH pKeyAuth, pTransAuth, *pAuth, null_auth; |
| 310 TSS_RESULT result; | 310 TSS_RESULT result; |
| 311 | 311 |
| 312 memset(&null_auth, 0, sizeof(TPM_AUTH)); | 312 memset(&null_auth, 0, sizeof(TPM_AUTH)); |
| 313 memset(&pKeyAuth, 0, sizeof(TPM_AUTH)); | 313 memset(&pKeyAuth, 0, sizeof(TPM_AUTH)); |
| 314 | 314 |
| 315 if (getData(TCSD_PACKET_TYPE_UINT32, 0, &hContext, 0, &data->comm)) | 315 if (getData(TCSD_PACKET_TYPE_UINT32, 0, &hContext, 0, &data->comm)) |
| 316 return TCSERR(TSS_E_INTERNAL_ERROR); | 316 return TCSERR(TSS_E_INTERNAL_ERROR); |
| 317 | 317 |
| 318 » LogDebugFn("thread %zd context %x", THREAD_ID, hContext); | 318 » LogDebugFn("thread %ld context %x", THREAD_ID, hContext); |
| 319 | 319 |
| 320 if (getData(TCSD_PACKET_TYPE_UINT32, 1, &hSignatureKey, 0, &data->comm)) | 320 if (getData(TCSD_PACKET_TYPE_UINT32, 1, &hSignatureKey, 0, &data->comm)) |
| 321 return TCSERR(TSS_E_INTERNAL_ERROR); | 321 return TCSERR(TSS_E_INTERNAL_ERROR); |
| 322 if (getData(TCSD_PACKET_TYPE_NONCE, 2, &AntiReplayNonce, 0, &data->comm)
) | 322 if (getData(TCSD_PACKET_TYPE_NONCE, 2, &AntiReplayNonce, 0, &data->comm)
) |
| 323 return TCSERR(TSS_E_INTERNAL_ERROR); | 323 return TCSERR(TSS_E_INTERNAL_ERROR); |
| 324 if (getData(TCSD_PACKET_TYPE_AUTH, 3, &pKeyAuth, 0, &data->comm)) | 324 if (getData(TCSD_PACKET_TYPE_AUTH, 3, &pKeyAuth, 0, &data->comm)) |
| 325 return TCSERR(TSS_E_INTERNAL_ERROR); | 325 return TCSERR(TSS_E_INTERNAL_ERROR); |
| 326 | 326 |
| 327 if (!memcmp(&null_auth, &pKeyAuth, sizeof(TPM_AUTH))) | 327 if (!memcmp(&null_auth, &pKeyAuth, sizeof(TPM_AUTH))) |
| 328 pAuth = NULL; | 328 pAuth = NULL; |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 388 free(prgbSignature); | 388 free(prgbSignature); |
| 389 return TCSERR(TSS_E_INTERNAL_ERROR); | 389 return TCSERR(TSS_E_INTERNAL_ERROR); |
| 390 } | 390 } |
| 391 free(prgbSignature); | 391 free(prgbSignature); |
| 392 } else | 392 } else |
| 393 initData(&data->comm, 0); | 393 initData(&data->comm, 0); |
| 394 | 394 |
| 395 data->comm.hdr.u.result = result; | 395 data->comm.hdr.u.result = result; |
| 396 return TSS_SUCCESS; | 396 return TSS_SUCCESS; |
| 397 } | 397 } |
| OLD | NEW |