From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:700:3204::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id oBnsCcXhn2VMnQAAkFu2QA (envelope-from ) for ; Thu, 11 Jan 2024 13:40:37 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id ECb9A8Xhn2X4CwAAe85BDQ (envelope-from ) for ; Thu, 11 Jan 2024 13:40:37 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=wolfsden.cz header.s=mail header.b=vZ7WxEMI; dkim=fail ("headers rsa verify failed") header.d=wolfsden.cz header.s=mail header.b=vZ7WxEMI; dmarc=fail reason="SPF not aligned (relaxed)" header.from=wolfsden.cz (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1704976836; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post: dkim-signature; bh=P5mIbGUCjYmzNqJORDnoSmNg6aAeRSOz/lJQPqz5FhE=; b=o86HS0b0q3LTagerDFVCuaSuH32ZXwzAyZRwItoqOVfRnLDZBNpvBnGRt6OOnmsimeUOQI 7PzjrCSg5T+UhdYuOrr8ss75RwFwrDPGP2nhJ50vHGWaWfMOBJIKVVQYWIO5F4mTy+ihJ/ iAvgGu6VO62K0PltFXevporaotn+7VN8d8zKWFRbIdylE+hCQjNZYNU35lMq0VTlc48dbb UdtTbyQm19PVuo5xLGCZF+/RKzedOsxabwbYkPcMbkD28GAHF+J/1f6KaZewFMVqXpBeSj YtnEkSqyBMaglydKzyC7Y/2zHbd0BBioaTG/EhfdSaMwz+2shUkHbqi0DVd7lw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=wolfsden.cz header.s=mail header.b=vZ7WxEMI; dkim=fail ("headers rsa verify failed") header.d=wolfsden.cz header.s=mail header.b=vZ7WxEMI; dmarc=fail reason="SPF not aligned (relaxed)" header.from=wolfsden.cz (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1704976836; a=rsa-sha256; cv=none; b=dz6l8ThAZSdgV4O0ShglB/Elrg9YPYfuL/hZWMPr9sLh2LBi5WgXIhBLP1rLklE6SPexWy mMd6aIZhGD/q53XHyZlKHyhMK91/361CGvwmp89+UiFPqTF+QCoGf6L7bOAoSZ94PjuWCE +q0Hb0J2FIeOgxt75cTWHJzoYuVwE7PvMUB3ayfii+0GtvLDgoh3oVMhfXGwm9+4OnDyTu EDQYKeV2V0ZHiiWx9j4sR3vSwzcHXkiT6iRVeFBe31UM37l+IKeYVx39jjPacJKWQ+ldGJ 3N+q1PSVP94UHe8vejvMKSmf5BnWwkwEsFUAUkuExKAPQNMSN8s06pvFvDGObQ== Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id D279336249 for ; Thu, 11 Jan 2024 13:40:36 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rNuME-0003Ia-Fc; Thu, 11 Jan 2024 07:40:27 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rNuLx-00037Z-HG for guix-patches@gnu.org; Thu, 11 Jan 2024 07:40:10 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rNuLs-0000ht-Vq for guix-patches@gnu.org; Thu, 11 Jan 2024 07:40:06 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rNuLq-0004I5-2F for guix-patches@gnu.org; Thu, 11 Jan 2024 07:40:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#65002] [PATCH v2 1/2] mapped-devices: Allow unlocking by a key file Resent-From: Tomas Volf <~@wolfsden.cz> Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 11 Jan 2024 12:40:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65002 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 65002@debbugs.gnu.org Received: via spool by 65002-submit@debbugs.gnu.org id=B65002.170497678016445 (code B ref 65002); Thu, 11 Jan 2024 12:40:02 +0000 Received: (at 65002) by debbugs.gnu.org; 11 Jan 2024 12:39:40 +0000 Received: from localhost ([127.0.0.1]:58962 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rNuLU-0004HA-Ej for submit@debbugs.gnu.org; Thu, 11 Jan 2024 07:39:40 -0500 Received: from wolfsden.cz ([37.205.8.62]:45498) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <~@wolfsden.cz>) id 1rNuLP-0004Gv-IL for 65002@debbugs.gnu.org; Thu, 11 Jan 2024 07:39:38 -0500 Received: by wolfsden.cz (Postfix, from userid 104) id 7EC6924F750; Thu, 11 Jan 2024 12:39:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=wolfsden.cz; s=mail; t=1704976776; bh=YL91AgAAjlqUoMix51QjrzZkXIT4RNm2EfGsqhykWUc=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=vZ7WxEMIKhVEVspGvgbRQwUsdKdp0KluZgBBpHolq/JTlg/2ICehCf4TiQIQNG2vQ betZ483SIjcqv9FS4cVEde8BLCu181UJqJc8ylx0Lntno3MijrwCgpyFst+DMnrAps kmb+1TmOkLs15lGfSSj4gsdlvDgCFQpngSOOZleJr9lYNwr23/EY/WHsEz648qiiiR OCo5d2aHQbUi6sgWzWcse3wOojz68x0MpNhnN6JhKnsJa0R6141zCz/d/rSIrncFc4 AZTBRzb74Hax8QcUa72PA/U9cB5yPS2Pyeb2Zn1SBgaOWfdtf3ln6TPqqMS5VC6Fwt OOE00/7NqRiLf/UamZ1yALIGIxZqYcn/RIeTtq2jOyeVyiQYkXzO01DRet9j79TY8S bvmicmIwaeOCGWzOgkPSc7CwPMaNAsYKGu3XeIRejLcc7g7HRXVuDNrKy6P2Skvt41 5CwlPQyN3+vy+m1wMqxoow3EVEKmOyGrlxqZq4M9/qwnYFBxQF+XqMJw01HlSh97uk lEksePiKZWIEL7ySuuehOwLSimb88+FEHwcrE39+RJOGIC39zMV1chBzvjR1jKLjiB saMtw7yBDW+NC8BBbLzfPmdmIyn6ChxO47QyfWs33sym22lWqECkfLiGho74sRwqPG jaXdQnPaTUW2FAdqW5W3XwAo= Received: from localhost (unknown [193.32.127.158]) by wolfsden.cz (Postfix) with ESMTPSA id F379924F0D5; Thu, 11 Jan 2024 12:39:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=wolfsden.cz; s=mail; t=1704976776; bh=YL91AgAAjlqUoMix51QjrzZkXIT4RNm2EfGsqhykWUc=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=vZ7WxEMIKhVEVspGvgbRQwUsdKdp0KluZgBBpHolq/JTlg/2ICehCf4TiQIQNG2vQ betZ483SIjcqv9FS4cVEde8BLCu181UJqJc8ylx0Lntno3MijrwCgpyFst+DMnrAps kmb+1TmOkLs15lGfSSj4gsdlvDgCFQpngSOOZleJr9lYNwr23/EY/WHsEz648qiiiR OCo5d2aHQbUi6sgWzWcse3wOojz68x0MpNhnN6JhKnsJa0R6141zCz/d/rSIrncFc4 AZTBRzb74Hax8QcUa72PA/U9cB5yPS2Pyeb2Zn1SBgaOWfdtf3ln6TPqqMS5VC6Fwt OOE00/7NqRiLf/UamZ1yALIGIxZqYcn/RIeTtq2jOyeVyiQYkXzO01DRet9j79TY8S bvmicmIwaeOCGWzOgkPSc7CwPMaNAsYKGu3XeIRejLcc7g7HRXVuDNrKy6P2Skvt41 5CwlPQyN3+vy+m1wMqxoow3EVEKmOyGrlxqZq4M9/qwnYFBxQF+XqMJw01HlSh97uk lEksePiKZWIEL7ySuuehOwLSimb88+FEHwcrE39+RJOGIC39zMV1chBzvjR1jKLjiB saMtw7yBDW+NC8BBbLzfPmdmIyn6ChxO47QyfWs33sym22lWqECkfLiGho74sRwqPG jaXdQnPaTUW2FAdqW5W3XwAo= Date: Thu, 11 Jan 2024 13:39:35 +0100 From: Tomas Volf <~@wolfsden.cz> Message-ID: References: <058b41c5060e1811048fe44c20278c64fdfc3ece.1690981365.git.wolf@wolfsden.cz> <87il42w0sw.fsf@gnu.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="zbUG0RNWjm2gZ9bf" Content-Disposition: inline In-Reply-To: <87il42w0sw.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Scanner: mx12.migadu.com X-Migadu-Queue-Id: D279336249 X-Migadu-Spam-Score: -6.54 X-Spam-Score: -6.54 X-TUID: Ca+NpTKfKaFP --zbUG0RNWjm2gZ9bf Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2024-01-10 00:21:19 +0100, Ludovic Court=C3=A8s wrote: > Hello! >=20 > I know, I know, it=E2=80=99s taken way too long=E2=80=A6 My apologies! No worries, thank you for getting to it. :) >=20 > > * gnu/system/mapped-devices.scm (luks-device-mapping): New keyword argu= ment > > * gnu/system/mapped-devices.scm (luks-device-mapping-with-options): New > > procedure >=20 > No need to repeat the file name here. Please also mention the > doc/guix.texi changes. Adjusted. I also fixed the name of the first procedure (should have been open-luks-device). >=20 > > +@deffn {Procedure} luks-device-mapping-with-options [#:key-file] > > +Return a @code{luks-device-mapping} object, which defines LUKS block > > +device encryption using the @command{cryptsetup} command from the > > +package with the same name. It relies on the @code{dm-crypt} Linux > > +kernel module. > > + > > +If @code{key-file} is provided, unlocking is first attempted using that > > +key file. If it fails, password unlock is attempted as well. Key file > > +is not stored in the store and needs to be available at the specified > > +path at the time of the unlock attempt. >=20 > s/specified path/given location/ >=20 > Perhaps add a sentence or two saying that the advantage is that it > allows you to avoid typing the passphrase, for instance by passing the > key file on a USB key (would that work?), but that this may not be > suitable for all use cases. Added a sentence. As for the USB key, that would not currently work. The f= ile needs to be accessible to the init script, so the USB would need to be moun= ted first. I believe extending the code to support it would not be hard (adding e.g. #:device to luks-device-mapping-with-options), but I have not use for = it, so I did not intend to do it in this series. Maybe later. >=20 > I=E2=80=99d also add a short commented config example. Done. >=20 > I wonder if we could have a system test; it doesn=E2=80=99t sound very ea= sy so > maybe we=E2=80=99ll skip, but you can check that the =E2=80=9Cencrypted-r= oot-os=E2=80=9D test, > which exercises =E2=80=98luks-device-mapping=E2=80=99, still passes (it t= akes time and > disk space). It does not pass, but it fails even on master =C2=AF\_ (=E3=83=84)_/=C2=AF: guix system: warning: at least 1526.8 MB needed but only 1408.3 MB avai= lable in /mnt It seems somewhat hard to do it based on encrypted-root-os, but should be m= uch easier basing it on encrypted-home-os. I might give it a try. >=20 > The rest LGTM! >=20 > Ludo=E2=80=99. --=20 There are only two hard things in Computer Science: cache invalidation, naming things and off-by-one errors. --zbUG0RNWjm2gZ9bf Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEt4NJs4wUfTYpiGikL7/ufbZ/wakFAmWf4YcACgkQL7/ufbZ/ wam8UA/8C51fp/Acc3esHi1UWRS6G8oLFdiRTWbiFYKYng3QgCzOeTuHXyuSOOE2 RDDL0NIdbgR/Y7T+O78BPucrW8+KfCIP0Wh8lBcnvT8FTSKgoAEw4teQhaz3GzBG LvASrTrl2eo1demGkdTdepTOL3/1eqAfhRKfBWRvG0teAPc8tSXpWTaiMv8V0IOk OuT7n1U7OWAFxkMy4/pAAwshws9FhTpfBXqyoNqJlVVJIPykAsN3sgtKLhSmB5l/ H13H03fubWoEWOJpwD4KJ4u88hYv1Ya/FYv1sDeD7SF0cfCjPTVHQo9FY37W5Jke MffylYFMbVYLbD/7USApx9eAYVAKxWMXjMlPf2ITXaXgUjlYFxzXi1m5SVDG3495 rbkLyQIJYf8gj8ugnPIqilNSpD0r8+sca6WyqhDQTgALdf8i5uz92OE6I7SJVTWa 4x1w2nx0O+Zf1AVDoJvzNox7vRWvxzS7HOnfjF/JVP3LOMwKUvmF9SDwsqfFwIni CWWXliJm6hFYICcLhmUZLcKh3hRfPZm//DIAAdCTpJZtk0FF47MFXAbRXJTL4Prd s7Vlkc685XBmSx7x6zv6EtXXPfDZDpl3NwyhCQkFlBGDmuh30UHfgfED92qHzRf7 hSHextVHsg/Pf3+xjaO/cHXDePdA7z4Hn3Sv+13D9weoqs8/ylM= =V8ID -----END PGP SIGNATURE----- --zbUG0RNWjm2gZ9bf--