[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1289566691.4341.21.camel@localhost.localdomain>
Date: Fri, 12 Nov 2010 07:58:11 -0500
From: David Safford <safford@...son.ibm.com>
To: David Howells <dhowells@...hat.com>
Cc: Mimi Zohar <zohar@...ux.vnet.ibm.com>,
linux-kernel@...r.kernel.org,
linux-security-module@...r.kernel.org, keyrings@...ux-nfs.org,
linux-crypto@...r.kernel.org,
Jason Gunthorpe <jgunthorpe@...idianresearch.com>,
James Morris <jmorris@...ei.org>,
Rajiv Andrade <srajiv@...ux.vnet.ibm.com>,
Mimi Zohar <zohar@...ibm.com>
Subject: Re: [PATCH v1.3 3/4] keys: add new trusted key-type
On Thu, 2010-11-11 at 21:57 +0000, David Howells wrote:
> Mimi Zohar <zohar@...ux.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists