Re: [PATCH v3] tpm: add support for partial reads

2018-11-15 Thread Jarkko Sakkinen
On Thu, Nov 15, 2018 at 04:26:33PM -0800, Tadeusz Struk wrote: > On 11/15/18 3:31 PM, Jarkko Sakkinen wrote: > > You could drop these memset() calls and also one from > > tpm_timeout_work(). The call could be done once in the beginning of > > tpm_common_write() instead of having three different cal

Re: [PATCH v3] tpm: add support for partial reads

2018-11-15 Thread Tadeusz Struk
On 11/15/18 3:31 PM, Jarkko Sakkinen wrote: > You could drop these memset() calls and also one from > tpm_timeout_work(). The call could be done once in the beginning of > tpm_common_write() instead of having three different call sites. > Don't we want to clean the buffer as the response is read?

Re: [PATCH v3] tpm: add support for partial reads

2018-11-15 Thread Jarkko Sakkinen
On Fri, Nov 16, 2018 at 01:31:58AM +0200, Jarkko Sakkinen wrote: > On Thu, Nov 15, 2018 at 12:42:22PM -0800, Tadeusz Struk wrote: > > Currently to read a response from the TPM device an application needs > > provide big enough buffer for the whole response and read it in one go. > > The application

Re: [PATCH v3] tpm: add support for partial reads

2018-11-15 Thread Jarkko Sakkinen
On Thu, Nov 15, 2018 at 12:42:22PM -0800, Tadeusz Struk wrote: > Currently to read a response from the TPM device an application needs > provide big enough buffer for the whole response and read it in one go. > The application doesn't know how big the response it beforehand so it > always needs to

[PATCH v3] tpm: add support for partial reads

2018-11-15 Thread Tadeusz Struk
Currently to read a response from the TPM device an application needs provide big enough buffer for the whole response and read it in one go. The application doesn't know how big the response it beforehand so it always needs to maintain a 4K buffer and read the max (4K). In case if the user of the