linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mimi Zohar <zohar@linux.vnet.ibm.com>
To: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Cc: Peter Huewe <peterhuewe@gmx.de>,
	Marcel Selhorst <tpmdd@selhorst.net>,
	David Howells <dhowells@redhat.com>,
	tpmdd-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org,
	linux-security-module@vger.kernel.org, keyrings@vger.kernel.org,
	chris.j.arges@canonical.com, seth.forshee@canonical.com,
	colin.king@canonical.com, josh@joshtriplett.org,
	Jason Gunthorpe <jgunthorpe@obsidianresearch.com>,
	David Safford <safford@us.ibm.com>,
	James Morris <james.l.morris@oracle.com>,
	"Serge E. Hallyn" <serge@hallyn.com>
Subject: Re: [PATCH] keys, trusted: select TPM2 hash algorithm
Date: Tue, 27 Oct 2015 09:54:07 -0400	[thread overview]
Message-ID: <1445954047.5237.28.camel@linux.vnet.ibm.com> (raw)
In-Reply-To: <20151027104255.GA9798@intel.com>

On Tue, 2015-10-27 at 12:42 +0200, Jarkko Sakkinen wrote:
> n Mon, Oct 26, 2015 at 07:44:39AM +0200, Jarkko Sakkinen wrote:
> > On Sun, Oct 25, 2015 at 03:21:31PM -0400, Mimi Zohar wrote:
> > > On Sat, 2015-10-24 at 15:42 +0300, Jarkko Sakkinen wrote:
> > > > Added 'hashalg=' option for selecting the hash algorithm.
> > > > 
> > > > Currently available options are:
> > > > 
> > > > * sha1
> > > > * sha256
> > > > * sha384
> > > > * sha512
> > > > * sm3_256
> > > 
> > > Please consider using crypto/hash_info.c: hash_algo_name[], which
> > > already define the algorithm string names.  Use
> > > include/crypto/hash_info.c to include a reference to this array.
> > 
> > It wold work for me. I did ad-hoc because first example that I looked
> > at was EcryptFS.

After EVM, EcryptFS was the first subsystem to use trusted keys.
Support for larger digests was later added to IMA.    

> > I need to add sm3_256 to that array.

Unless there is kernel crypto support for this algorithm, I would
conditionally include the algorithm, probably based on a Kconfig option.

> > I've found three different ways to write it:
> > 
> > * sm3256 (various google hits)
> > * sm3-256 (various google hits)
> > * sm3_256 (TPM 2.0 Structures specification)
> > 
> > Maybe the second option would be the most appropriate?

Right, If there aren't any standards,  use the second option for the
string and an underscore for the variable name. 

> > > Boot command line options should be prefixed with the subsystem name.
> > > So instead of hashalg, please use tpm_hashalg.  The boot command line
> > > option needs to be documented in Documentation/kernel-parameters.txt.
> > 
> > I see. My commit message is clearly inadequate. It's an option for the
> > keyring syscalls.

Sorry for the misunderstanding.

> BTW, in IMA I see you have the hash algorithm as a boot parameter. I
> guess it makes sense there because it works implicitly in the
> background?

The default hash algorithm is defined using the Kconfig IMA_DEFAULT_HASH
option, but can be specified on the boot command line using "ima_hash=".

> Sealing a trusted key is an explicit operation. That's why I thought
> it'd be better to have it as an option for the syscall. Does this logic
> make sense to your or not?

It does.

> 
> PS. Hey one more thing: this was supposed to be RFC, forgot to add
> --subject-prefix="PATCH RFC". Sorry about that.

:)

Mimi


      reply	other threads:[~2015-10-27 13:55 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-24 12:42 [PATCH] keys, trusted: select TPM2 hash algorithm Jarkko Sakkinen
2015-10-25 17:38 ` Jarkko Sakkinen
2015-10-25 19:21 ` Mimi Zohar
2015-10-26  5:44   ` Jarkko Sakkinen
2015-10-27 10:42     ` Jarkko Sakkinen
2015-10-27 13:54       ` Mimi Zohar [this message]

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=1445954047.5237.28.camel@linux.vnet.ibm.com \
    --to=zohar@linux.vnet.ibm.com \
    --cc=chris.j.arges@canonical.com \
    --cc=colin.king@canonical.com \
    --cc=dhowells@redhat.com \
    --cc=james.l.morris@oracle.com \
    --cc=jarkko.sakkinen@linux.intel.com \
    --cc=jgunthorpe@obsidianresearch.com \
    --cc=josh@joshtriplett.org \
    --cc=keyrings@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=peterhuewe@gmx.de \
    --cc=safford@us.ibm.com \
    --cc=serge@hallyn.com \
    --cc=seth.forshee@canonical.com \
    --cc=tpmdd-devel@lists.sourceforge.net \
    --cc=tpmdd@selhorst.net \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).