*** mtmemu-0.1-orig/tpm/tpm_integrity.c 2007-12-11 18:28:38.000000000 +0200 --- mtmemu-0.1/tpm/tpm_integrity.c 2009-01-15 23:39:06.000000000 +0200 *************** *** 167,175 **** return TPM_SUCCESS; } ! TPM_RESULT tpm_compute_pcr_digest(TPM_PCR_SELECTION *pcrSelection, TPM_COMPOSITE_HASH *digest, ! TPM_PCR_COMPOSITE *composite) { int i,j; TPM_PCR_COMPOSITE comp; --- 167,177 ---- return TPM_SUCCESS; } ! ! TPM_RESULT tpm_compute_digest(TPM_PCR_SELECTION *pcrSelection, TPM_COMPOSITE_HASH *digest, ! TPM_PCR_COMPOSITE *composite, ! TPM_PCRVALUE *pcr_value) { int i,j; TPM_PCR_COMPOSITE comp; *************** *** 183,189 **** for (i = 0, j = 0; i < pcrSelection->sizeOfSelect * 8; i++) { /* is PCR number i selected ? */ if (pcrSelection->pcrSelect[i >> 3] & (1 << (i & 7))) { ! memcpy(&comp.pcrValue[j++], &PCR_VALUE[i], sizeof(TPM_PCRVALUE)); } } memcpy(&comp.select, pcrSelection, sizeof(TPM_PCR_SELECTION)); --- 185,191 ---- for (i = 0, j = 0; i < pcrSelection->sizeOfSelect * 8; i++) { /* is PCR number i selected ? */ if (pcrSelection->pcrSelect[i >> 3] & (1 << (i & 7))) { ! memcpy(&comp.pcrValue[j++], &pcr_value[i], sizeof(TPM_PCRVALUE)); } } memcpy(&comp.select, pcrSelection, sizeof(TPM_PCR_SELECTION)); *************** *** 206,211 **** --- 208,223 ---- return TPM_SUCCESS; } + + TPM_RESULT tpm_compute_pcr_digest(TPM_PCR_SELECTION *pcrSelection, + TPM_COMPOSITE_HASH *digest, + TPM_PCR_COMPOSITE *composite) + { + return (tpm_compute_digest(pcrSelection, digest, composite, (TPM_PCRVALUE*)&PCR_VALUE)); + } + + + TPM_RESULT tpm_verify_pcr(TPM_KEY_DATA *key, BOOL atrelease, BOOL atcreation) { TPM_RESULT res;