Re: [PATCH v1.3 3/4] keys: add new trusted key-type

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: David Howells
Date: Friday, November 12, 2010 - 9:52 am

Mimi Zohar <zohar@linux.vnet.ibm.com> wrote:


The compiler can generate slightly more efficient code if you don't skip 0 in
your enum.


const.


Superfluous brackets round the individual comparisons.


Unnecessary cast.


Unnecessary cast.


NAK!  You cannot do this.  It won't work on 64-bit machines, especially
big-endian ones.  Casting the pointer does not change the size of the
destination variable.  You must use a temporary var.


Superfluous parenthesization.


Aha!  I see how this works now.  Using add/update key seems the right way to
do things.


Do you really want to go through pcrlock() if you're going to return -EINVAL?


kfree() can handle NULL pointers.


Again, kfree() can handle a NULL pointer.


I suspect some of these should be in somewhere like linux/tpm.h rather than
here.  They're specific to TPM access not TPM key management.


key type enum?


The TPM_DEBUG stuff should probably be in the directory with the sources, not
in a directory for others to include.


Also these look like internal functions which shouldn't be in the global
headers.

David
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH v1.3 0/4] keys: trusted and encrypted keys, Mimi Zohar, (Wed Nov 10, 8:51 am)
[PATCH v1.3 2/4] key: add tpm_send command, Mimi Zohar, (Wed Nov 10, 8:51 am)
[PATCH v1.3 3/4] keys: add new trusted key-type, Mimi Zohar, (Wed Nov 10, 8:51 am)
[PATCH v1.3 4/4] keys: add new key-type encrypted, Mimi Zohar, (Wed Nov 10, 8:51 am)
Re: [PATCH v1.3 2/4] key: add tpm_send command, David Howells, (Thu Nov 11, 12:48 pm)
Re: [PATCH v1.3 3/4] keys: add new trusted key-type, David Howells, (Thu Nov 11, 2:57 pm)
Re: [PATCH v1.3 2/4] key: add tpm_send command, Mimi Zohar, (Thu Nov 11, 3:25 pm)
Re: [PATCH v1.3 3/4] keys: add new trusted key-type, David Safford, (Fri Nov 12, 5:58 am)
Re: [PATCH v1.3 2/4] key: add tpm_send command, David Howells, (Fri Nov 12, 7:11 am)
Re: [PATCH v1.3 2/4] key: add tpm_send command, David Safford, (Fri Nov 12, 7:48 am)
Re: [PATCH v1.3 3/4] keys: add new trusted key-type, David Howells, (Fri Nov 12, 9:52 am)
Re: [PATCH v1.3 3/4] keys: add new trusted key-type, David Safford, (Fri Nov 12, 10:39 am)
Re: [PATCH v1.3 3/4] keys: add new trusted key-type, David Howells, (Fri Nov 12, 11:36 am)
Re: [PATCH v1.3 4/4] keys: add new key-type encrypted, David Howells, (Fri Nov 12, 12:45 pm)
Re: [PATCH v1.3 4/4] keys: add new key-type encrypted, David Howells, (Fri Nov 12, 2:23 pm)
Re: [PATCH v1.3 2/4] key: add tpm_send command, Rajiv Andrade, (Fri Nov 12, 2:24 pm)
Re: [PATCH v1.3 2/4] key: add tpm_send command, David Safford, (Fri Nov 12, 3:06 pm)
Re: [PATCH v1.3 2/4] key: add tpm_send command, David Howells, (Fri Nov 12, 3:11 pm)
Re: [PATCH v1.3 4/4] keys: add new key-type encrypted, David Howells, (Mon Nov 15, 9:18 am)
Re: [PATCH v1.3 4/4] keys: add new key-type encrypted, Mimi Zohar, (Mon Nov 15, 12:35 pm)
Re: [PATCH v1.3 4/4] keys: add new key-type encrypted, David Howells, (Tue Nov 16, 7:08 am)
Re: [PATCH v1.3 4/4] keys: add new key-type encrypted, David Howells, (Tue Nov 16, 10:50 am)
Re: [PATCH v1.3 4/4] keys: add new key-type encrypted, Mimi Zohar, (Tue Nov 16, 11:54 am)
Re: [PATCH v1.3 4/4] keys: add new key-type encrypted, David Howells, (Tue Nov 16, 11:58 am)
Re: [PATCH v1.3 2/4] key: add tpm_send command, Rajiv Andrade, (Wed Nov 17, 6:12 am)