Re: [tpmdd-devel] [PATCH v2 1/2] tpm2: add session handle context saving and restoring to the space code

Jarkko Sakkinen
2017-01-31T13:16:13Z

On Mon, Jan 30, 2017 at 02:14:37PM -0800, James Bottomley wrote:
> On Mon, 2017-01-30 at 23:45 +0200, Jarkko Sakkinen wrote:
> > On Sun, Jan 29, 2017 at 02:36:58PM -0800, James Bottomley wrote:
> [...]
> > > > 2. Can it really return both TPM_RC_HANDLE and
> > > > TPM_RC_REFERENCE_H0?
> > >
> > > Yes, it seems that a session that doesn't exist (because it's been
> > > flushed) then it returns TPM_RC_REFERNCE_H0, but if the context has
> > > a sequence mismatch (because it's been flushed and reloaded) then
> > > we get TPM_RC_HANDLE.
> > >
> > > James
> >
> > If it is flushed, wouldn't you just get TPM_RC_REFERENCE_H0 when you
> > try to TPM2_ContextLoad? The "and reloaded" does not make sense to
> > me. Once a session is flushed it cannot be reloaded.
> >
> > Maybe you meant to say "beause it's been saved and reloaded"? That
> > would make more sense and fits better what I see in the Commands
> > specification.
>
> I mean if you load a prior context instead of the current one for an
> existing handle, effectively a replay, you get TPM_RC_HANDLE.
>
> James

Thanks for clarifying this.

/Jarkko