From: Wyllys I. <wyl...@su...> - 2008-12-13 19:44:14
|
I ran into a problem in the owner_evict_init function that is exactly like what is being described in a thread from last May-July. http://sourceforge.net/mailarchive/message.php?msg_id=da7b3ce30807290928ib4c092cre7950aaca563dc25%40mail.gmail.com The 4th key in the list of keys is TPM_E_INVALID_KEYHANDLE (errcode 12) and tcsd silently fails. Why the 4th key is bad, I have no idea. As far as I know this TPM has never been used for anything and is fresh from a reset + reboot. I didn't see the patch submitted to trousers-tech, so I am including it here in case it got left behind, I do think it should be included in the next release, though. I found this bug testing on an ATML TPM. Have not seen the same problem on Infineon or even on some other ATML TPMs. *** src/tcs/tcs_key_mem_cache.c.old Fri Oct 19 18:38:54 2007 --- src/tcs/tcs_key_mem_cache.c Sat Dec 13 14:37:02 2008 *************** *** 1080,1088 **** LoadBlob_UINT32(&offset, keyList.handle[i], (BYTE *)&keyHandle); /* get the ownerEvict flag for this key handle */ ! if ((result = TCSP_GetCapability_Internal(InternalContext, TPM_CAP_KEY_STATUS, sizeof(UINT32), (BYTE *)&keyHandle, ! &respDataSize, &respData))) { free(keyList.handle); return result; } --- 1080,1092 ---- LoadBlob_UINT32(&offset, keyList.handle[i], (BYTE *)&keyHandle); /* get the ownerEvict flag for this key handle */ ! result = TCSP_GetCapability_Internal(InternalContext, TPM_CAP_KEY_STATUS, sizeof(UINT32), (BYTE *)&keyHandle, ! &respDataSize, &respData); ! /* special case, invalid keys are automatically evicted later */ ! if (result == TPM_E_INVALID_KEYHANDLE) ! continue; ! if (result != TSS_SUCCESS) { free(keyList.handle); return result; } |