Esempio n. 1
0
uint32_t TPM_ReadStoredData(struct tpm_buffer *buffer, uint32_t offset, TPM_STORED_DATA *sd)
{
	uint32_t ret;
	ret = TSS_parsebuff(FORMAT_TPM_STORED_DATA, buffer, offset,
	                      PARAMS_TPM_STORED_DATA_R(sd));
	return ret;
}
Esempio n. 2
0
uint32_t TPM_ReadCurrentTicks(struct tpm_buffer *buffer,
                              uint32_t offset,
			      TPM_CURRENT_TICKS *tct)
{
	return TSS_parsebuff(FORMAT_TPM_CURRENT_TICKS, buffer, offset,
	                     PARAMS_TPM_CURRENT_TICKS_R(tct));
}
Esempio n. 3
0
uint32_t TPM_ReadPCRInfoShort(const struct tpm_buffer *buffer, uint32_t offset, TPM_PCR_INFO_SHORT *info)
{
	uint32_t ret;
	ret = TSS_parsebuff(FORMAT_TPM_PCR_INFO_SHORT, buffer, offset,
	                      PARAMS_TPM_PCR_INFO_SHORT_R(info));
	return ret;	
}
Esempio n. 4
0
uint32_t TPM_ReadDAInfo(struct tpm_buffer *buffer,
                        uint32_t offset,
                        TPM_DA_INFO *tdi)
{
	return TSS_parsebuff(FORMAT_TPM_DA_INFO, buffer, offset,
	                     PARAMS_TPM_DA_INFO_R(tdi));
} 
Esempio n. 5
0
uint32_t TPM_ReadDAInfoLimited(struct tpm_buffer *buffer,
                               uint32_t offset,
                               TPM_DA_INFO_LIMITED *tdil)
{
	return TSS_parsebuff(FORMAT_TPM_DA_INFO_LIMITED, buffer, offset,
	                     PARAMS_TPM_DA_INFO_LIMITED_R(tdil));
} 
Esempio n. 6
0
uint32_t TPM_ReadDelegatePublic(struct tpm_buffer *buffer,
                                uint32_t offset,
                                TPM_DELEGATE_PUBLIC *dp)
{
	return TSS_parsebuff(FORMAT_TPM_DELEGATE_PUBLIC, buffer, offset,
	                     PARAMS_TPM_DELEGATE_PUBLIC_R(dp));
}
Esempio n. 7
0
uint32_t TPM_GetCurrentTicks(const struct tpm_buffer *tb,
                             uint32_t offset, 
                             TPM_CURRENT_TICKS * ticks) 
{
	return TSS_parsebuff(FORMAT_TPM_CURRENT_TICKS, tb, offset,
	                     PARAMS_TPM_CURRENT_TICKS_R(ticks));
}
Esempio n. 8
0
uint32_t TPM_ReadPCRComposite(const struct tpm_buffer *buffer, uint32_t offset, TPM_PCR_COMPOSITE *tpc)
{
	uint32_t ret;
	ret = TSS_parsebuff(FORMAT_TPM_PCR_COMPOSITE, buffer, offset,
	                      PARAMS_TPM_PCR_COMPOSITE_R(tpc));
	return ret;
}
Esempio n. 9
0
uint32_t TPM_ReadCapVersionInfo(const struct tpm_buffer *tb, uint32_t offset, TPM_CAP_VERSION_INFO * cvi)
{
	uint32_t ret;
	ret = TSS_parsebuff(FORMAT_TPM_CAP_VERSION_INFO, tb, offset,
	                    PARAMS_TPM_CAP_VERSION_INFO_R(cvi));
	return ret;
}
Esempio n. 10
0
uint32_t TPM_ReadFamilyTableEntry(struct tpm_buffer * buffer,
				  uint32_t offset,
				  TPM_FAMILY_TABLE_ENTRY * fte)
{
    return TSS_parsebuff(FORMAT_TPM_FAMILY_TABLE_ENTRY, buffer, offset,
			 PARAMS_TPM_FAMILY_TABLE_ENTRY_R(fte));
}
Esempio n. 11
0
uint32_t TPM_ReadPCRInfo(struct tpm_buffer *buffer, uint32_t offset, TPM_PCR_INFO *info)
{
	uint32_t ret;
	ret = TSS_parsebuff(FORMAT_TPM_PCR_INFO, buffer, offset,
	                      PARAMS_TPM_PCR_INFO_R(info));
	return ret;
}
Esempio n. 12
0
uint32_t TPM_ReadPCRSelection(struct tpm_buffer * buffer, uint32_t offset,
			      TPM_PCR_SELECTION * sel)
{
    uint32_t ret;
    ret = TSS_parsebuff(FORMAT_TPM_PCR_SELECTION, buffer, offset,
			PARAMS_TPM_PCR_SELECTION_R(sel));
    return ret;
}
Esempio n. 13
0
uint32_t TSS_PubKeyExtract(const struct tpm_buffer * tb, uint32_t offset,
			   pubkeydata * k)
{
    uint32_t ret;
    ret = TSS_parsebuff(FORMAT_TPM_PUBKEY_EMB_RSA, tb, offset,
			PARAMS_TPM_PUBKEY_EMB_RSA_R(k));
    return ret;
}
Esempio n. 14
0
uint32_t TPM_ReadNVDataPublic(const struct tpm_buffer * tb,
			      uint32_t offset, TPM_NV_DATA_PUBLIC * ndp)
{
    uint32_t ret;
    ret = TSS_parsebuff(FORMAT_TPM_NV_DATA_PUBLIC, tb, offset,
			PARAMS_TPM_NV_DATA_PUBLIC_R(ndp));
    return ret;
}
Esempio n. 15
0
/* the most recent permanent flags */
uint32_t TPM_ReadPermanentFlags(const struct tpm_buffer * tb,
                                uint32_t offset, 
                                TPM_PERMANENT_FLAGS * pf,
				uint32_t used)
{
	uint32_t ret;
	/* rev 62 */
	if (used == 17) {
	    ret = TSS_parsebuff(FORMAT_TPM_PERMANENT_FLAGS17, tb, offset,
				PARAMS_TPM_PERMANENT_FLAGS17_R(pf));
	}
	/* rev 85 Atmel */
	else if (used == 20) {
		ret = TSS_parsebuff(FORMAT_TPM_PERMANENT_FLAGS20, tb, offset,
				    PARAMS_TPM_PERMANENT_FLAGS20_R(pf));
	}
	/* rev 85, 94 */
	else if (used == 21) {
	    ret = TSS_parsebuff(FORMAT_TPM_PERMANENT_FLAGS21, tb, offset,
				PARAMS_TPM_PERMANENT_FLAGS21_R(pf));
	}
	/* rev 103 */
	else if (used == 22) {
	    ret = TSS_parsebuff(FORMAT_TPM_PERMANENT_FLAGS22, tb, offset,
				PARAMS_TPM_PERMANENT_FLAGS22_R(pf));
	}
	else {
	    ret = ERR_STRUCTURE;
	}
	if ((ret & ERR_MASK))
	    return ret;
	/* compliant TPM */
	if (used != 20) {
	    if (pf->tag != TPM_TAG_PERMANENT_FLAGS) {
		return ERR_STRUCTURE;
	    }
	}
	/* Atmel rev 85 TPM */
	if (used == 20) {
	    if (pf->tag != TPM_TAG_PERSISTENT_FLAGS) {
		return ERR_STRUCTURE;
	    }
	}
	return ret;
}
Esempio n. 16
0
uint32_t TPM_ReadCertifyInfo(const struct tpm_buffer *tb, uint32_t offset, TPM_CERTIFY_INFO * cinfo)
{
	uint32_t ret;
	ret = TSS_parsebuff(FORMAT_TPM_CERTIFY_INFO, tb, offset, 
	                     PARAMS_TPM_CERTIFY_INFO_R(cinfo));


	return ret;
}
Esempio n. 17
0
uint32_t TPM_ReadKey(const struct tpm_buffer * tb, uint32_t offset,
		     keydata * k)
{
    uint32_t ret;
    uint16_t filler = 0;
    /* 
     * must first try to parse as a 1.2 key, then later as an 
     * old-style key.
     */
    ret = TSS_parsebuff(FORMAT_TPM_KEY12_EMB_RSA, tb, offset,
			PARAMS_TPM_KEY12_EMB_RSA_R(k));
    if (ret > 0) {
	if (k->v.tag != TPM_TAG_KEY12)
	    ret = TSS_parsebuff(FORMAT_TPM_KEY_EMB_RSA, tb, offset,
				PARAMS_TPM_KEY_EMB_RSA_R(k));
    }
    return ret;
}
Esempio n. 18
0
uint32_t TPM_ReadCertifyInfo2(const struct tpm_buffer *tb, uint32_t offset, TPM_CERTIFY_INFO2 * cinfo)
{
	uint32_t ret;
	ret = TSS_parsebuff(FORMAT_TPM_CERTIFY_INFO2, tb, offset, 
	                     PARAMS_TPM_CERTIFY_INFO2_R(cinfo));
	if ((ret & ERR_MASK))
		return ret;
	if (cinfo->tag != TPM_TAG_CERTIFY_INFO2)
		return ERR_STRUCTURE;
	return ret;
}
Esempio n. 19
0
uint32_t TPM_ReadSTClearFlags(const struct tpm_buffer * tb,
			      uint32_t offset, TPM_STCLEAR_FLAGS * sf)
{
    uint32_t ret;
    ret = TSS_parsebuff(FORMAT_TPM_STCLEAR_FLAGS, tb, offset,
			PARAMS_TPM_STCLEAR_FLAGS_R(sf));

    if (ret & ERR_MASK)
	return ret;
    if (sf->tag != TPM_TAG_STCLEAR_FLAGS)
	return ERR_STRUCTURE;
    return ret;
}
Esempio n. 20
0
uint32_t TPM_ReadContextBlob(const struct tpm_buffer * buffer,
			     uint32_t offset, TPM_CONTEXT_BLOB * context)
{
    uint32_t ret;

    ret = TSS_parsebuff(FORMAT_TPM_CONTEXT_BLOB, buffer, offset,
			PARAMS_TPM_CONTEXT_BLOB_R(context));
    if (ret & ERR_MASK)
	return ret;
    if (context->tag != TPM_TAG_CONTEXTBLOB)
	return ERR_STRUCTURE;
    return ret;
}
Esempio n. 21
0
uint32_t TPM_ReadTPMDelegations(const struct tpm_buffer * buffer,
				uint32_t offset, TPM_DELEGATIONS * td)
{
    return TSS_parsebuff(FORMAT_TPM_DELEGATIONS, buffer, offset,
			 PARAMS_TPM_DELEGATIONS_R(td));
}
Esempio n. 22
0
uint32_t TPM_ReadSymmetricKey(struct tpm_buffer * tb, uint32_t offset,
			      TPM_SYMMETRIC_KEY * key)
{
    return TSS_parsebuff(FORMAT_TPM_SYMMETRIC_KEY, tb, offset,
			 PARAMS_TPM_SYMMETRIC_KEY_R(key));
}
Esempio n. 23
0
uint32_t TPM_ReadKeyParms(const struct tpm_buffer * tb, uint32_t offset,
			  TPM_KEY_PARMS * keyparms)
{
    return TSS_parsebuff(FORMAT_TPM_KEY_PARMS, tb, offset,
			 PARAMS_TPM_KEY_PARMS_R(keyparms));
}
Esempio n. 24
0
uint32_t TPM_ReadPCRInfoLong(struct tpm_buffer * buffer, uint32_t offset,
			     TPM_PCR_INFO_LONG * info)
{
    return TSS_parsebuff(FORMAT_TPM_PCR_INFO_LONG, buffer, offset,
			 PARAMS_TPM_PCR_INFO_LONG_R(info));
}