From: Glenn Washburn <development@efficientek.com>
To: grub-devel@gnu.org
Subject: Re: Keyfile Support for GRUBs LUKS
Date: Tue, 19 Nov 2013 19:31:35 -0600 [thread overview]
Message-ID: <20131119193135.7b3b5d2f@crass-Ideapad-Z570> (raw)
In-Reply-To: <528BF7A9.8010702@ramses-pyramidenbau.de>
On Wed, 20 Nov 2013 00:43:37 +0100
Ralf Ramsauer <ralf+grub@ramses-pyramidenbau.de> wrote:
> Hi,
>
> yesterday I realised, that GRUB is already supporting LUKS and even
> simple DSA signature checking.
>
> I was thinking about the following setup:
> - fully encrypted harddisk (LUKS) (incl. rootfs).
> - no bootloader on harddisk
> - kernel + initrd inside encrypted partition
> - optionally: signatures of the kernel + initrd
I've had this setup ever since grub had LUKS support, except for the
signature checking. I don't really see the point of checking
signatures if the kernel and initrd are encrypted.
> For "trusted" booting, I thought about an USB stick, that just
> includes GRUB, a public key for verification and a keyfile for LUKS.
> Using that setup, no password input would be required during boot. The
> USB stick can be considered as "trusted environment".
Can you give more details on what you'd use the public key to verify?
The initrd + kernel? I'm not sure it'll buy you much unless you're
using it in combo with hardware/firmware.
> Unfortunately, GRUB doesn't support keyfile for Luks up to now. As I'm
> quite familiar with dm-crypt and LUKS I tried to implement the keyfile
> feature to GRUB.
> After spending several hours trying to get a deeper insight into the
> GRUB internas I finally resigned, as I was missing documentation on
> several things...
>
> I was very confused about the way how GRUB2 is handling its modules
> and about the strategies how functions are exactly called.
> The aim is to implement three additional options to cryptodisk.c resp.
> luks.c:
> -k keyfile [e.g. (hd2,msdos3)/mysecretkey]
> -o keyfile offset [optional, default: 0]
> -s keyfile size [optional, default: keyfilesize]
>
> Using LUKS, a keyfile can simply be treated like a passphrase, which
> basically is already implemented.
To open and read from a file, use grub_file_open and grub_file_read.
Look at the implementation of ./grub-core/commands/cat.c for
inspiration. Read in the key data into global memory in
grub_cmd_cryptomount from ./grub-core/disk/cryptodisk.c. Then in
luks_recover_key from grub-core/disk/luks.c use the keydata instead of
asking for the password if keydata exists.
This seems like one way to do it, but I'm not a grub developer, so it
might not be a method they would except patches for. While you're at
it, it would be nice to have support for detachable luks headers. :)
Glenn
> I would appreciate, if perhaps someone of you could help me with this
> issue.
>
> Thanks in advance!
> Ralf
>
next prev parent reply other threads:[~2013-11-20 1:31 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-19 23:43 Keyfile Support for GRUBs LUKS Ralf Ramsauer
2013-11-20 1:31 ` Glenn Washburn [this message]
2013-11-20 1:55 ` Elliott Mitchell
2013-11-20 5:43 ` Glenn Washburn
2013-11-20 5:48 ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-11-20 7:02 ` Glenn Washburn
2013-11-20 7:36 ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-11-21 5:57 ` Glenn Washburn
2013-11-25 10:38 ` Darren J Moffat
2013-11-20 6:42 ` Elliott Mitchell
2013-11-20 6:52 ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-11-20 21:08 ` Glenn Washburn
2013-11-21 15:31 ` Vladimir 'phcoder' Serbinenko
2013-11-21 19:34 ` Ralf Ramsauer
2013-11-22 3:01 ` Vladimir 'φ-coder/phcoder' Serbinenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20131119193135.7b3b5d2f@crass-Ideapad-Z570 \
--to=development@efficientek.com \
--cc=grub-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).