Re: [RFC][PATCH v3 0/9] KEYS: Introduce user asymmetric keys and signatures

From: Roberto Sassu
Date: Fri Jul 21 2023 - 03:05:09 EST


On Thu, 2023-07-20 at 20:38 +0300, Jarkko Sakkinen wrote:
> On Thu Jul 20, 2023 at 6:32 PM EEST, Roberto Sassu wrote:
> > From: Roberto Sassu <roberto.sassu@xxxxxxxxxx>
> >
> > Define a new TLV-based format for keys and signatures, aiming to store and
>
> "type-length-value (TLV) based"

Ok.

> > use in the kernel the crypto material from other unsupported formats
> > (e.g. PGP).
>
> Where's the motivation part and where is this defined?

Ah, thanks for the reminder. Will add it in the next version.

The motivations are:

- Avoid adding complex parsers in the kernel that might introduce
vulnerabilities
- Avoid adding support for key and signature formats that some consider
weak

That was basically the summary of the review of my attempt to add
support for PGP keys and signatures in the kernel.

This patch set adds support for only one format, which other formats
are converted from.

This is useful for the mere extraction of crypto material, and use it
with the kernel crypto API.

If there is a trust relationships between the original keys, converting
keys would lose the ability to verify that trust relationship.


Example

Suppose that there is a PGP key in the built-in keyring, and that
signed another PGP key.

If I want to add the second PGP key to the secondary keyring, I would
have to verify the signature of that key with the first key.

But the signature is on a PGP packet, so if the kernel verifies that
signature it would have also to ensure that the public key extracted
from the signed packet is the same as the converted key.

Originally I thought that we could do the conversion in a fully
isolated user space process (trustworthy User Mode Driver), so that
there is the guarantee that the key has not been modified during the
conversion. However, since it is difficult to achieve perfect
isolation, that approach has been put on hold.

So, at the moment, verifying trust with user asymmetric keys is not
possible, but this is not a problem with my use case, as a Linux
distributions can embed in the kernel all their (converted) public keys
directly usable for signature verification.

Thanks

Roberto