lkml.org 
[lkml]   [2012]   [Jul]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/2] tpm: Move tpm_get_random api into the TPM device driver
On 06/07/2012 11:47 AM, Kent Yoder wrote:
> Move the tpm_get_random api from the trusted keys code into the TPM
> device driver itself so that other callers can make use of it. Also,
> change the api slightly so that the number of bytes read is returned in
> the call, since the TPM command can potentially return fewer bytes than
> requested.
>
> Signed-off-by: Kent Yoder <key@linux.vnet.ibm.com>

I see a second problem with this patch: you don't seem to handle the
case where you get a short return anywhere in your code. Presumably
this should either be considered an error condition, or you need to
create a private wrapper which can loop and make additional requests.

As it is if you get a short return you simply proceed as if you had
gotten what you requested, since this was not an error mode supported by
the old code.

-hpa

--
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel. I don't speak on their behalf.



\
 
 \ /
  Last update: 2012-07-27 02:41    [W:0.113 / U:3.532 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site