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] [thread-next>] [day] [month] [year] [list]
Date: Thu, 23 May 2024 16:57:53 +0300
From: "Jarkko Sakkinen" <jarkko@...nel.org>
To: "Ben Boeckel" <me@...boeckel.net>
Cc: <linux-integrity@...r.kernel.org>, <keyrings@...r.kernel.org>, "David
 Woodhouse" <dwmw2@...radead.org>, "Eric Biggers" <ebiggers@...nel.org>,
 "James Bottomley" <James.Bottomley@...senpartnership.com>, "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 v2] KEYS: trusted: Use ASN.1 encoded OID

On Thu May 23, 2024 at 4:41 PM EEST, Ben Boeckel wrote:
> On Thu, May 23, 2024 at 16:23:37 +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
>
> Is it the same size? It looks considerably smaller to me (6*4 bytes
> versus 8 bytes).

Not in that sense but in practice the old array stored byte values.
Forgot for that reason that it was actually u32 array.

I can change it to "same number of elements".

>
> > Include OBJECT IDENTIFIER (0x06) tag and length as the epilogue so that
> > the OID can be simply copied to the blob.
>
> An "epilogue" occurs at the end, but it seems to be at the beginning
> here (that would be a "prologue").

Yup, typo.

> > -static u32 tpm2key_oid[] = { 2, 23, 133, 10, 1, 5 };
> > +/* Encoded OID_TPMSealedData. */
> > +static u8 OID_TPMSealedData_ASN1[] = {0x06, 0x06, 0x67, 0x81, 0x05, 0x0a, 0x01, 0x05};
>
> I'd say that a comment of what it encodes would be good to have for
> context, but the source tree has `OID_TPMSealedData` in a header with
> the value in a comment there, so that seems good enough to me.

OK. I named it this way to promote generation these from CSV file 
(see my other response to James).


>
> > as it never changes.
>
> Should it, perhaps be `const` too?

Yup.

>
> --Ben

Thanks for the remarks!

BR, Jarkko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ