Re: [PATCH v7 2/7] tpm: tpm_tis: Add verify_data_integrity handle toy tpm_tis_phy_ops

From: Amir Mizinski
Date: Thu Apr 30 2020 - 06:19:42 EST



On 2020-04-29 05:34, Jarkko Sakkinen wrote:
> On Mon, Apr 27, 2020 at 03:49:26PM +0300, amirmizi6@xxxxxxxxx wrote:
>> +ÂÂÂ bool (*verify_data_integrity)(struct tpm_tis_data *data, const u8 *buf,
>> +ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ size_t len);
>
> Why can't the i2c driver verify this in the end of read_bytes()?
>

The TPM calculates the checksum of the entire command data at the end
of command transmission or the checksum of the entire response data at the
end of response transmission.
read_bytes is not necessarily called at the end of response transmission. Same for write_bytes.

> /Jarkko