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>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <D1H75ZOA69LC.3OO4RAW8JBNHY@kernel.org>
Date: Thu, 23 May 2024 20:24:04 +0300
From: "Jarkko Sakkinen" <jarkko@...nel.org>
To: "James Bottomley" <James.Bottomley@...senPartnership.com>,
 <linux-integrity@...r.kernel.org>
Cc: <keyrings@...r.kernel.org>, "David Woodhouse" <dwmw2@...radead.org>,
 "Eric Biggers" <ebiggers@...nel.org>, "Herbert Xu"
 <herbert@...dor.apana.org.au>, "David S. Miller" <davem@...emloft.net>,
 "Andrew Morton" <akpm@...ux-foundation.org>, "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:CRYPTO API"
 <linux-crypto@...r.kernel.org>, "open list" <linux-kernel@...r.kernel.org>,
 "open list:SECURITY SUBSYSTEM" <linux-security-module@...r.kernel.org>
Subject: Re: [PATCH RESEND] KEYS: trusted: Use ASN.1 encoded OID

On Thu May 23, 2024 at 8:08 PM EEST, James Bottomley wrote:
> On Thu, 2024-05-23 at 11:30 -0400, James Bottomley wrote:
> > On Thu, 2024-05-23 at 16:54 +0300, Jarkko Sakkinen wrote:
> > > On Thu May 23, 2024 at 4:38 PM EEST, James Bottomley wrote:
> > > > On Thu, 2024-05-23 at 16:19 +0300, Jarkko Sakkinen wrote:
> > > > > There's no reason to encode OID_TPMSealedData at run-time, as
> > > > > it
> > > > > never changes.
> > > > > 
> > > > > Replace it with the encoded version, which has exactly the same
> > > > > size:
> > > > > 
> > > > >         67 81 05 0A 01 05
> > > > > 
> > > > > Include OBJECT IDENTIFIER (0x06) tag and length as the epilogue
> > > > > so
> > > > > that the OID can be simply copied to the blob.
> > > > 
> > > > This is true, but if we're going to do this, we should expand the
> > > > OID
> > > > registry functions (in lib/oid_registry.c) to do something like
> > > > encode_OID.  The registry already contains the hex above minus
> > > > the
> > > > two
> > > > prefixes (which are easy to add).
> > > 
> > > Yes, I do agree with this idea, and I named variable the I named
> > > it to make it obvious that generation is possible.
> > > 
> > > It would be best to have a single source, which could be just
> > > a CSV file with entries like:
> > > 
> > > <Name>,<OID number>
> > > 
> > > And then in scripts/ there should be a script that takes this
> > > source and generates oid_registry.gen.{h,c}. The existing
> > > oid_registry.h should really just include oid_registry.gen.h
> > > then to make this transparent change.
> > > 
> > > And then in the series where OID's are encoded per-subsystem
> > > patch that takes pre-encoded OID into use.
> > > 
> > > Happy to review such patch set if it is pushed forward.
> > 
> > Heh, OK, since I'm the one who thinks it's quite easy, I'll give it a
> > go.
>
> Turns out it's actually really simple.  This would go as three patches:
> adding the feature to lib/oid_registry.c using it in trusted keys and
> removing the now unused OID encode from lib/asn1_encode.c but I'm
> attaching here (minus the removal) to give an idea.

This looks pretty good to me at least in this level. I could repeal
and replace the patch I did today with this if it plays out well.

BR, Jarkko


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ