All of lore.kernel.org
 help / color / mirror / Atom feed
From: Desai, Imran <imran.desai at intel.com>
To: tpm2@lists.01.org
Subject: Re: [tpm2] [RFC] Session Handling/Policy Support in Tools
Date: Wed, 20 Dec 2017 08:18:04 +0000	[thread overview]
Message-ID: <9CB84C32-2275-4402-B3C4-25398184F61F@intel.com> (raw)
In-Reply-To: 476DC76E7D1DF2438D32BFADF679FC563FE6D774@ORSMSX101.amr.corp.intel.com

[-- Attachment #1: Type: text/plain, Size: 2600 bytes --]

Hello Bill,

This (attached diagram) is what my thought process was, when designing the createpolicy tool.
I concur the startauthsession and flushcontext can be separate tools that are currently clubbed in the createpolicy tool.

[cid:CC18E3F2-C642-4662-9CEC-C1091AA18831(a)amr.corp.intel.com]

Thanks and Regards,

Imran Desai  | imran.desai(a)intel.com<mailto:imran.desai(a)intel.com>




On Dec 19, 2017, at 11:01 AM, Roberts, William C <william.c.roberts(a)intel.com<mailto:william.c.roberts(a)intel.com>> wrote:

There are two main parts to the direction I see the tools policy/session support heading:

1. The first is cleaning up all the code around session support and policy building.  I think now that I understand the topic better, I can organize this code a little better. This is rather trivial and beside the main point.

2. Since abrmd 1.3 we have support for sessions across RM IPC connections and direct tpm communications (/dev/tmp0) also has the same support. We have tools like tpm2_createpolicy that are made up of multiple
commands to work around session flushing on IPC RM disconnections. tpm2_createpolicy is really comprised of 3 commands: tpm2_startauthsession, tpm2_policypcr and tpm2_flushcontext.

I'm proposing we leave tpm2_createpolicy, for in-kernel-rm users, but add tpm2_startauthsession and tpm2_policypcr for the abrmd and direct tpm usages. Abrmd works by using Tss2_Sys_ContextSave as the
marker of NOT flushing a session handle. Granted you also need the sessionAttributes set to continue so the TPM doesn't kill it.

I think the flow for using the new tools would be something like this:

1. tpm2_createpolicy - create a pcr policy and spit out the policy digest
2. tpm2_create - create an object and set its policy digest as obtained in step 1
3. tpm2_startauthsession - create a pcr policy and spit out the session handle
4. tpm2_policypcr - satisfy policy via policy digest and pcr list obtained/used in step 1 as well as taking the session handle from step 3
5. tpm2_<tool> - use some tool passing the session handle from step 3
6. tpm2_flushcontext - flushes the handle from step 3

With that said, since tpm2_createpolicy is really a combination of the tpm2_startauthsession, tpm2_pcrlist, tpm2_policypcr and tpm2_flushcontext, all that could be moved into lib, so each new tool and
create policy are really just calling into the same code.

Thoughts, am I missing something here?

This is a lot of work, so I would like to start it now, as it would be the major feature set going towards 4.0 release.

Bill


[-- Attachment #2: attachment.html --]
[-- Type: text/html, Size: 4756 bytes --]

[-- Attachment #3: PastedGraphic-1.png --]
[-- Type: image/png, Size: 343937 bytes --]

             reply	other threads:[~2017-12-20  8:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-20  8:18 Desai, Imran [this message]
  -- strict thread matches above, loose matches on Subject: below --
2017-12-27 16:49 [tpm2] [RFC] Session Handling/Policy Support in Tools Roberts, William C
2017-12-26 17:40 Roberts, William C
2017-12-22 15:47 Javier Martinez Canillas
2017-12-22 15:14 Javier Martinez Canillas
2017-12-20 14:35 Ian Oliver
2017-12-19 18:01 Roberts, William C

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9CB84C32-2275-4402-B3C4-25398184F61F@intel.com \
    --to=tpm2@lists.01.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.