lkml.org 
[lkml]   [2010]   [Nov]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v1.3 3/4] keys: add new trusted key-type
From
Date
On Thu, 2010-11-11 at 21:57 +0000, David Howells wrote:
> Mimi Zohar <zohar@linux.vnet.ibm.com> wrote:
Thanks for the helpful comments - much appreciated.
Willdo on all of them - just one question on the last comment:

> > +/*
> > + * Have the TPM seal(encrypt) the trusted key, possibly based on
> > + * Platform Configuration Registers (PCRs). AUTH1 for sealing key.
> > + */
> > +static int tpm_seal(struct tpm_buf *tb, uint16_t keytype,
> > + uint32_t keyhandle, unsigned char *keyauth,
> > + unsigned char *data, uint32_t datalen,
> > + unsigned char *blob, uint32_t * bloblen,
> > + unsigned char *blobauth,
> > + unsigned char *pcrinfo, uint32_t pcrinfosize)
> > +{
> > + struct osapsess sess;
> > + unsigned char encauth[TPM_HASH_SIZE];
> > + unsigned char pubauth[TPM_HASH_SIZE];
> > + unsigned char xorwork[TPM_HASH_SIZE * 2];
> > + unsigned char xorhash[TPM_HASH_SIZE];
> > + unsigned char nonceodd[TPM_NONCE_SIZE];
>
> That's quite a lot of stack space, and you're calling other functions that
> also allocate chunks of stack space.

checkstack showed that the max stack usage was for tpm_seal, at 530
bytes. (The rest were 300 or less.) I can certainly throw the hashes
and nonce (120 bytes) into a dynamically allocated struct, if you
think it is worth the extra code...

thanks
dave


\
 
 \ /
  Last update: 2010-11-12 14:03    [from the cache]
©2003-2011 Jasper Spaans