Re: [PATCH v2] tpm: return a TPM_RC_COMMAND_CODE response if a command isn't implemented

2017-11-30 Thread Javier Martinez Canillas
On 11/30/2017 05:38 PM, Jarkko Sakkinen wrote: > On Wed, Nov 29, 2017 at 07:24:48PM +0100, Javier Martinez Canillas wrote: >> Hello Jarkko, >> >> On 11/29/2017 06:57 PM, Jarkko Sakkinen wrote: >>> On Wed, Nov 29, 2017 at 12:08:46PM +0100, Javier Martinez Canillas >>> wrote: +#define

Re: [PATCH v2] tpm: return a TPM_RC_COMMAND_CODE response if a command isn't implemented

2017-11-30 Thread Javier Martinez Canillas
On 11/30/2017 05:38 PM, Jarkko Sakkinen wrote: > On Wed, Nov 29, 2017 at 07:24:48PM +0100, Javier Martinez Canillas wrote: >> Hello Jarkko, >> >> On 11/29/2017 06:57 PM, Jarkko Sakkinen wrote: >>> On Wed, Nov 29, 2017 at 12:08:46PM +0100, Javier Martinez Canillas >>> wrote: +#define

Re: [PATCH v2] tpm: return a TPM_RC_COMMAND_CODE response if a command isn't implemented

2017-11-30 Thread Jarkko Sakkinen
On Wed, Nov 29, 2017 at 06:13:51PM -0800, Philip Tricca wrote: > On 11/29/2017 10:24 AM, Javier Martinez Canillas wrote: > > Hello Jarkko, > > > > On 11/29/2017 06:57 PM, Jarkko Sakkinen wrote: > >> On Wed, Nov 29, 2017 at 12:08:46PM +0100, Javier Martinez Canillas > >> wrote: > >>> +#define

Re: [PATCH v2] tpm: return a TPM_RC_COMMAND_CODE response if a command isn't implemented

2017-11-30 Thread Jarkko Sakkinen
On Wed, Nov 29, 2017 at 06:13:51PM -0800, Philip Tricca wrote: > On 11/29/2017 10:24 AM, Javier Martinez Canillas wrote: > > Hello Jarkko, > > > > On 11/29/2017 06:57 PM, Jarkko Sakkinen wrote: > >> On Wed, Nov 29, 2017 at 12:08:46PM +0100, Javier Martinez Canillas > >> wrote: > >>> +#define

Re: [PATCH v2] tpm: return a TPM_RC_COMMAND_CODE response if a command isn't implemented

2017-11-30 Thread Jarkko Sakkinen
On Wed, Nov 29, 2017 at 07:24:48PM +0100, Javier Martinez Canillas wrote: > Hello Jarkko, > > On 11/29/2017 06:57 PM, Jarkko Sakkinen wrote: > > On Wed, Nov 29, 2017 at 12:08:46PM +0100, Javier Martinez Canillas > > wrote: > >> +#define TPM2_RC_LAYER_SHIFT 16 +#define

Re: [PATCH v2] tpm: return a TPM_RC_COMMAND_CODE response if a command isn't implemented

2017-11-30 Thread Jarkko Sakkinen
On Wed, Nov 29, 2017 at 07:24:48PM +0100, Javier Martinez Canillas wrote: > Hello Jarkko, > > On 11/29/2017 06:57 PM, Jarkko Sakkinen wrote: > > On Wed, Nov 29, 2017 at 12:08:46PM +0100, Javier Martinez Canillas > > wrote: > >> +#define TPM2_RC_LAYER_SHIFT 16 +#define

Re: [PATCH v2] tpm: return a TPM_RC_COMMAND_CODE response if a command isn't implemented

2017-11-29 Thread Philip Tricca
On 11/29/2017 10:24 AM, Javier Martinez Canillas wrote: > Hello Jarkko, > > On 11/29/2017 06:57 PM, Jarkko Sakkinen wrote: >> On Wed, Nov 29, 2017 at 12:08:46PM +0100, Javier Martinez Canillas >> wrote: >>> +#define TPM2_RC_LAYER_SHIFT16 +#define TPM2_RESMGRTPM_RC_LAYER >>> (11 <<

Re: [PATCH v2] tpm: return a TPM_RC_COMMAND_CODE response if a command isn't implemented

2017-11-29 Thread Philip Tricca
On 11/29/2017 10:24 AM, Javier Martinez Canillas wrote: > Hello Jarkko, > > On 11/29/2017 06:57 PM, Jarkko Sakkinen wrote: >> On Wed, Nov 29, 2017 at 12:08:46PM +0100, Javier Martinez Canillas >> wrote: >>> +#define TPM2_RC_LAYER_SHIFT16 +#define TPM2_RESMGRTPM_RC_LAYER >>> (11 <<

Re: [PATCH v2] tpm: return a TPM_RC_COMMAND_CODE response if a command isn't implemented

2017-11-29 Thread Philip Tricca
On 11/29/2017 09:57 AM, Jarkko Sakkinen wrote: > On Wed, Nov 29, 2017 at 12:08:46PM +0100, Javier Martinez Canillas wrote: >> +#define TPM2_RC_LAYER_SHIFT 16 >> +#define TPM2_RESMGRTPM_RC_LAYER (11 << TPM2_RC_LAYER_SHIFT) > > I got this spec from Philip [1]. As part of this I've been doing a

Re: [PATCH v2] tpm: return a TPM_RC_COMMAND_CODE response if a command isn't implemented

2017-11-29 Thread Philip Tricca
On 11/29/2017 09:57 AM, Jarkko Sakkinen wrote: > On Wed, Nov 29, 2017 at 12:08:46PM +0100, Javier Martinez Canillas wrote: >> +#define TPM2_RC_LAYER_SHIFT 16 >> +#define TPM2_RESMGRTPM_RC_LAYER (11 << TPM2_RC_LAYER_SHIFT) > > I got this spec from Philip [1]. As part of this I've been doing a

Re: [PATCH v2] tpm: return a TPM_RC_COMMAND_CODE response if a command isn't implemented

2017-11-29 Thread Javier Martinez Canillas
Hello Jarkko, On 11/29/2017 06:57 PM, Jarkko Sakkinen wrote: > On Wed, Nov 29, 2017 at 12:08:46PM +0100, Javier Martinez Canillas > wrote: >> +#define TPM2_RC_LAYER_SHIFT 16 +#define TPM2_RESMGRTPM_RC_LAYER >> (11 << TPM2_RC_LAYER_SHIFT) > > I got this spec from Philip [1]. > > Couple of

Re: [PATCH v2] tpm: return a TPM_RC_COMMAND_CODE response if a command isn't implemented

2017-11-29 Thread Javier Martinez Canillas
Hello Jarkko, On 11/29/2017 06:57 PM, Jarkko Sakkinen wrote: > On Wed, Nov 29, 2017 at 12:08:46PM +0100, Javier Martinez Canillas > wrote: >> +#define TPM2_RC_LAYER_SHIFT 16 +#define TPM2_RESMGRTPM_RC_LAYER >> (11 << TPM2_RC_LAYER_SHIFT) > > I got this spec from Philip [1]. > > Couple of

Re: [PATCH v2] tpm: return a TPM_RC_COMMAND_CODE response if a command isn't implemented

2017-11-29 Thread Jarkko Sakkinen
On Wed, Nov 29, 2017 at 12:08:46PM +0100, Javier Martinez Canillas wrote: > +#define TPM2_RC_LAYER_SHIFT 16 > +#define TPM2_RESMGRTPM_RC_LAYER (11 << TPM2_RC_LAYER_SHIFT) I got this spec from Philip [1]. Couple of remarks: * What is the difference between TSS2_RESMGR_RC_LAYER and

Re: [PATCH v2] tpm: return a TPM_RC_COMMAND_CODE response if a command isn't implemented

2017-11-29 Thread Jarkko Sakkinen
On Wed, Nov 29, 2017 at 12:08:46PM +0100, Javier Martinez Canillas wrote: > +#define TPM2_RC_LAYER_SHIFT 16 > +#define TPM2_RESMGRTPM_RC_LAYER (11 << TPM2_RC_LAYER_SHIFT) I got this spec from Philip [1]. Couple of remarks: * What is the difference between TSS2_RESMGR_RC_LAYER and

[PATCH v2] tpm: return a TPM_RC_COMMAND_CODE response if a command isn't implemented

2017-11-29 Thread Javier Martinez Canillas
According to the TPM Library Specification, a TPM device must do a command header validation before processing and return a TPM_RC_COMMAND_CODE code if the command is not implemented. So user-space will expect to handle that response as an error. But if the in-kernel resource manager is used

[PATCH v2] tpm: return a TPM_RC_COMMAND_CODE response if a command isn't implemented

2017-11-29 Thread Javier Martinez Canillas
According to the TPM Library Specification, a TPM device must do a command header validation before processing and return a TPM_RC_COMMAND_CODE code if the command is not implemented. So user-space will expect to handle that response as an error. But if the in-kernel resource manager is used