lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <D1F4XQT63H3G.2LXFQ4FCHU06G@kernel.org>
Date: Tue, 21 May 2024 10:13:56 +0300
From: "Jarkko Sakkinen" <jarkko@...nel.org>
To: "Bharat Bhushan" <bbhushan2@...vell.com>, "Herbert Xu"
 <herbert@...dor.apana.org.au>
Cc: "linux-integrity@...r.kernel.org" <linux-integrity@...r.kernel.org>,
 "keyrings@...r.kernel.org" <keyrings@...r.kernel.org>,
 "Andreas.Fuchs@...ineon.com" <Andreas.Fuchs@...ineon.com>, "James
 Prestwood" <prestwoj@...il.com>, "David Woodhouse" <dwmw2@...radead.org>,
 "Eric Biggers" <ebiggers@...nel.org>, "James Bottomley"
 <James.Bottomley@...senpartnership.com>, "David S. Miller"
 <davem@...emloft.net>, "open list:CRYPTO API"
 <linux-crypto@...r.kernel.org>, "open list" <linux-kernel@...r.kernel.org>,
 "Peter Huewe" <peterhuewe@....de>, "Jason Gunthorpe" <jgg@...pe.ca>, "James
 Bottomley" <James.Bottomley@...senPartnership.com>, "Mimi Zohar"
 <zohar@...ux.ibm.com>, "David Howells" <dhowells@...hat.com>, "Paul Moore"
 <paul@...l-moore.com>, "James Morris" <jmorris@...ei.org>, "Serge E.
 Hallyn" <serge@...lyn.com>, "open list:SECURITY SUBSYSTEM"
 <linux-security-module@...r.kernel.org>
Subject: Re: [EXTERNAL] [PATCH v2 5/6] tpm: tpm2_key: Extend parser to
 TPM_LoadableKey

On Tue May 21, 2024 at 8:47 AM EEST, Bharat Bhushan wrote:
>
>
> > -----Original Message-----
> > From: Jarkko Sakkinen <jarkko@...nel.org>
> > Sent: Tuesday, May 21, 2024 8:47 AM
> > To: Herbert Xu <herbert@...dor.apana.org.au>
> > Cc: linux-integrity@...r.kernel.org; keyrings@...r.kernel.org;
> > Andreas.Fuchs@...ineon.com; James Prestwood <prestwoj@...il.com>;
> > David Woodhouse <dwmw2@...radead.org>; Eric Biggers
> > <ebiggers@...nel.org>; James Bottomley
> > <James.Bottomley@...senpartnership.com>; Jarkko Sakkinen
> > <jarkko@...nel.org>; David S. Miller <davem@...emloft.net>; open
> > list:CRYPTO API <linux-crypto@...r.kernel.org>; open list <linux-
> > kernel@...r.kernel.org>; Peter Huewe <peterhuewe@....de>; Jason
> > Gunthorpe <jgg@...pe.ca>; James Bottomley
> > <James.Bottomley@...senPartnership.com>; Mimi Zohar
> > <zohar@...ux.ibm.com>; David Howells <dhowells@...hat.com>; Paul Moore
> > <paul@...l-moore.com>; James Morris <jmorris@...ei.org>; Serge E. Hallyn
> > <serge@...lyn.com>; open list:SECURITY SUBSYSTEM <linux-security-
> > module@...r.kernel.org>
> > Subject: [EXTERNAL] [PATCH v2 5/6] tpm: tpm2_key: Extend parser to
> > TPM_LoadableKey
> > 
> > ----------------------------------------------------------------------
> > Extend parser to TPM_LoadableKey. Add field for oid to struct tpm2_key
> > so that callers can differentiate different key types.
> > 
> > Signed-off-by: Jarkko Sakkinen <jarkko@...nel.org>
> > ---
> >  drivers/char/tpm/tpm2_key.c               | 14 +++++++++++---
> >  include/crypto/tpm2_key.h                 |  2 ++
> >  security/keys/trusted-keys/trusted_tpm2.c |  4 ++++
> >  3 files changed, 17 insertions(+), 3 deletions(-)
> > 
> > diff --git a/drivers/char/tpm/tpm2_key.c b/drivers/char/tpm/tpm2_key.c
> > index 0112362e432e..59797dc232f1 100644
> > --- a/drivers/char/tpm/tpm2_key.c
> > +++ b/drivers/char/tpm/tpm2_key.c
> > @@ -32,16 +32,24 @@ int tpm2_key_type(void *context, size_t hdrlen,
> >  		  const void *value, size_t vlen)
> >  {
> >  	enum OID oid = look_up_OID(value, vlen);
> > -
> > -	if (oid != OID_TPMSealedData) {
> > +	struct tpm2_key *key = context;
> > +
> > +	switch (oid) {
> > +	case OID_TPMSealedData:
> > +		pr_info("TPMSealedData\n");
> > +		break;
> > +	case OID_TPMLoadableKey:
> > +		pr_info("TPMLodableKey\n");

These should be pr_debug() (forgot to change).

> > +		break;
> > +	default:
> >  		char buffer[50];
> > -
> >  		sprint_oid(value, vlen, buffer, sizeof(buffer));
> >  		pr_debug("OID is \"%s\" which is not TPMSealedData\n",
> >  			 buffer);
>
> Maybe extend this print to say "neither TPMSealedData nor TPMLodableKey"

Right, I tried to apply minimal delta to patches where existing code
needs to be carved to a new form :-)

I think it could be just "OID \"%s\" is unknown"?

BR, Jarkko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ