Received: from list by lists.gnu.org with archive (Exim 4.71) id 1Viwe5-0002Ce-IV for mharc-grub-devel@gnu.org; Tue, 19 Nov 2013 20:31:57 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43749) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Viwdx-00026J-7z for grub-devel@gnu.org; Tue, 19 Nov 2013 20:31:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Viwdr-0004vy-4c for grub-devel@gnu.org; Tue, 19 Nov 2013 20:31:49 -0500 Received: from mail-bk0-f45.google.com ([209.85.214.45]:50847) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Viwdq-0004uE-Uw for grub-devel@gnu.org; Tue, 19 Nov 2013 20:31:43 -0500 Received: by mail-bk0-f45.google.com with SMTP id mx13so1071932bkb.18 for ; Tue, 19 Nov 2013 17:31:41 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:subject:message-id:in-reply-to :references:mime-version:content-type:content-transfer-encoding; bh=6+G6lVpv8BKw8vO2E2fg435PLOmIluob/n5DyjUZtMk=; b=PLxxfyTB1Y9Z7HUA5Z3lTnY8LlNQYeA4s4LL9qLW20TfSeBNXFHsOMQl1NwrAuIdIk 4zc9B51NE7HPFcUqK9tc/H4Yth1Fy20xqK1hwLcvt/EQ8pgyx3WIWHMBGDwCZn+qfV8u u06VPMLacS/Yfg+TlCSnUdzsBBpGGbeaF0oZipT9tDZpKlwmi/X0GPB8ihLT8uuFPkLo x8g8f2xvm6Q3lZ4Sn2vVG1kl8VmMQdS7Nib3nYE7N9z3TZeEG+yh1T1ReUmUlH61WM5x YPRlRk7B5fVGukRi2W1YDMI29JXQa4lanOraR9kvpGKj7OhQXwfy5Nq/bSVtrAXY1WLB gtsg== X-Gm-Message-State: ALoCoQlvin7WSd7et2wAcjyQ2mNGNAKezigu+fasBrzN0hkFNR8Dwg1/MaPVRTNGTPRitNSCEjf1 X-Received: by 10.205.65.132 with SMTP id xm4mr18334585bkb.1.1384911101207; Tue, 19 Nov 2013 17:31:41 -0800 (PST) Received: from crass-Ideapad-Z570 (cpe-70-113-30-216.austin.res.rr.com. [70.113.30.216]) by mx.google.com with ESMTPSA id z6sm22473560bkn.8.2013.11.19.17.31.40 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 19 Nov 2013 17:31:41 -0800 (PST) Date: Tue, 19 Nov 2013 19:31:35 -0600 From: Glenn Washburn To: grub-devel@gnu.org Subject: Re: Keyfile Support for GRUBs LUKS Message-ID: <20131119193135.7b3b5d2f@crass-Ideapad-Z570> In-Reply-To: <528BF7A9.8010702@ramses-pyramidenbau.de> References: <528BF7A9.8010702@ramses-pyramidenbau.de> X-Mailer: Claws Mail 3.9.1 (GTK+ 2.24.20; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.214.45 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Nov 2013 01:31:55 -0000 On Wed, 20 Nov 2013 00:43:37 +0100 Ralf Ramsauer 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 >