Re: [PATCH 00/23] Crypto keys and module signing

From: Rusty Russell
Date: Wed May 23 2012 - 08:54:31 EST


On Wed, 23 May 2012 00:02:19 +0100, David Howells <dhowells@xxxxxxxxxx> wrote:
> The extended module file format is as follows:
>
> The module signature is appended to the end of the module file, followed by
> "@mod_size@\n@sig_size@\nThis Is A Crypto Signed Module".
>
> The EOF must follow the magic string directly, so nothing further must be
> appended to the file.
>
> mod_size and sig_size are left-aligned decimal numbers, space-padded to 8
> characters. mod_size is the size of the module payload part of the file and
> sig_size is the size of the signature blob.

Hi David,

That's pretty weird. Why not put the "@This Is A Crypto Signed
Module\n" before the signature? Then module-size is implied: everything
before that signature. The signature size is implied: everything after
that signature.

In fact, I'd modify this slightly, to allow multiple signatures.
This would work nicely with a deterministic strip. Find the signatures
backward, and truncate as they fail.

If you want to be super-paranoid, scan for that signature before
signing the module.

Cheers,
Rusty.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/