From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1kQpDJ-0004I7-NY for mharc-grub-devel@gnu.org; Fri, 09 Oct 2020 06:01:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38766) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kQpDI-0004GY-CS for grub-devel@gnu.org; Fri, 09 Oct 2020 06:01:24 -0400 Received: from out2-smtp.messagingengine.com ([66.111.4.26]:49861) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kQpDF-0007pN-Az for grub-devel@gnu.org; Fri, 09 Oct 2020 06:01:24 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id C9F325C00D1; Fri, 9 Oct 2020 06:01:20 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Fri, 09 Oct 2020 06:01:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pks.im; h=date :from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm2; bh=z7XsYMeeSgQ43X7//bYmBTMQmqB 8p0ciSAivw/zT6eg=; b=CK78bvocyTsqc/GyL5DCNg5oSJQ5+Qn98plfdyp1t5z VxEre0TZDRa5v9+pZsfP4TI5vaLJYRZGdyBSSS6pQ/fabkcZs0rN43F/7XeGnCFo HMsFS1mTsnC9pK1zYwvwgMCdyjpY+FNxUWV1LD9FIQ+nKLvtQNxvvATfHr56HfUz NwA3tSK5G3DsfTzWNEMqHXXj6lH0SJiUbE2gEl6m1ofz0vCoTXx2WQXi/r8gkp/M oRcDhX4/qJJxyDGv8KrXyAUy1NQSolETb4cWhzHl2YISNH9Vv7adGBEIWCW/cCEk cXa+/DRFELc9lM+dQgHrhl/4apNdcOFdrhrCdNcoNow== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=z7XsYM eeSgQ43X7//bYmBTMQmqB8p0ciSAivw/zT6eg=; b=PxPUuiN97eTV62w8GOKi/g tVQJ60tYjQNkY6j5QZyr7v0T0kFgUmAGSX1LatoeOAWPAplSQDznCKdyufhNl/D0 mEzXXaxVpEu2LQQBnLKDkbQ+Q+Dp0iD5vjjpTEXS+eU2JNxYzwpkNFsY1Dx6/RTW qJU61ym4W3ohkhnpuX/mXTU3anQ8yoBWugXFW1yDs6P4ByzGOpVVD62QbBNOC3Nf eDWI++1rPRL2Y3oGQ5v/wlIVzAJ2fy3S8HMaqLq8zhwSDWYnTLymcfD+pkc7srMj gFLhZ76UfygIOLkHe5cSsJXJfJVas5VpxAXAGLcJoe+bZp+7llm5bdV7EurSKKpg == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrhedugddvgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvuffkfhggtggujgesghdtreertddtvdenucfhrhhomheprfgrthhrihgt khcuufhtvghinhhhrghrughtuceophhssehpkhhsrdhimheqnecuggftrfgrthhtvghrnh epheeghfdtfeeuffehkefgffduleffjedthfdvjeektdfhhedvlefgtefgvdettdfhnecu kfhppeejkedrheegrdefvddrudefgeenucevlhhushhtvghrufhiiigvpedtnecurfgrrh grmhepmhgrihhlfhhrohhmpehpshesphhkshdrihhm X-ME-Proxy: Received: from vm-mail.pks.im (dynamic-078-054-032-134.78.54.pool.telefonica.de [78.54.32.134]) by mail.messagingengine.com (Postfix) with ESMTPA id C4955328005D; Fri, 9 Oct 2020 06:01:19 -0400 (EDT) Received: from localhost (tanuki [10.192.0.23]) by vm-mail.pks.im (OpenSMTPD) with ESMTPSA id 412762c6 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Fri, 9 Oct 2020 10:01:18 +0000 (UTC) Date: Fri, 9 Oct 2020 12:01:22 +0200 From: Patrick Steinhardt To: Glenn Washburn Cc: grub-devel@gnu.org, Daniel Kiper Subject: Re: [PATCH v2 00/10] Cryptodisk fixes for v2.06 redux Message-ID: <20201009100122.GH2088@tanuki> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="Hlh2aiwFLCZwGcpw" Content-Disposition: inline In-Reply-To: Received-SPF: pass client-ip=66.111.4.26; envelope-from=ps@pks.im; helo=out2-smtp.messagingengine.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/09 05:22:33 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Oct 2020 10:01:24 -0000 --Hlh2aiwFLCZwGcpw Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Oct 03, 2020 at 05:55:24PM -0500, Glenn Washburn wrote: > This is a minor update to fix patch 3, where I missed updating the format= string > type code. This was causing i386 builds to fail. Rangediff is included. Cool, thanks a lot for taking care of this! I've left a few comments here and there, but overall things look good to me. Patrick > Glenn Washburn (10): > luks2: Fix use of incorrect index and some grub_error() messages. > luks2: Improve readability in luks2_get_keyslot. > luks2: Use more intuitive keyslot key instead of index when naming > keyslot. > luks2: grub_cryptodisk_t->total_length is the max number of device > native sectors > cryptodisk: Fix cipher IV mode 'plain64' always being set as 'plain'. > cryptodisk: Properly handle non-512 byte sized sectors. > cryptodisk: Replace some literals with constants in > grub_cryptodisk_endecrypt. > cryptodisk: Rename total_length field in grub_cryptodisk_t to > total_sectors. > cryptodisk: Rename offset in grub_cryptodisk_t to offset_sectors. > luks2: Rename source disk variabled named 'disk' to 'source' as in > luks.c. >=20 > grub-core/disk/cryptodisk.c | 78 ++++++++++++++++++-------------- > grub-core/disk/geli.c | 4 +- > grub-core/disk/luks.c | 9 ++-- > grub-core/disk/luks2.c | 88 ++++++++++++++++++++----------------- > include/grub/cryptodisk.h | 18 ++++++-- > include/grub/types.h | 3 ++ > 6 files changed, 118 insertions(+), 82 deletions(-) >=20 > Range-diff against v1: > 1: 00646c92f ! 1: e2433b8ab luks2: Use more intuitive keyslot key inste= ad of index when naming keyslot. > @@ grub-core/disk/luks2.c: luks2_recover_key (grub_disk_t disk, > if (keyslot.priority =3D=3D 0) > { > - grub_dprintf ("luks2", "Ignoring keyslot %"PRIuGRUB_SIZE" due to= priority\n", i); > -+ grub_dprintf ("luks2", "Ignoring keyslot %"PRIuGRUB_SIZE" due to= priority\n", keyslot_key); > ++ grub_dprintf ("luks2", "Ignoring keyslot %"PRIuGRUB_UINT64_T" du= e to priority\n", keyslot_key); > continue; > } > =20 > - grub_dprintf ("luks2", "Trying keyslot %"PRIuGRUB_SIZE"\n", i= ); > -+ grub_dprintf ("luks2", "Trying keyslot %"PRIuGRUB_SIZE"\n", k= eyslot_key); > ++ grub_dprintf ("luks2", "Trying keyslot %"PRIuGRUB_UINT64_T"\n= ", keyslot_key); > =20 > /* Set up disk according to keyslot's segment. */ > crypt->offset =3D grub_divmod64 (segment.offset, segment.sect= or_size, NULL); > @@ grub-core/disk/luks2.c: luks2_recover_key (grub_disk_t disk, > + (const grub_uint8_t *) passphrase, grub_strlen (passphras= e)); > if (ret) > { > - grub_dprintf ("luks2", "Decryption with keyslot %"PRIuGRUB_SIZE"= failed: %s\n", > +- grub_dprintf ("luks2", "Decryption with keyslot %"PRIuGRUB_SIZE"= failed: %s\n", > - i, grub_errmsg); > ++ grub_dprintf ("luks2", "Decryption with keyslot %"PRIuGRUB_UINT6= 4_T" failed: %s\n", > + keyslot_key, grub_errmsg); > continue; > } > =20 > -@@ grub-core/disk/luks2.c: luks2_recover_key (grub_disk_t disk, > + ret =3D luks2_verify_key (&digest, candidate_key, keyslot.key= _size); > if (ret) > { > - grub_dprintf ("luks2", "Could not open keyslot %"PRIuGRUB_SIZE":= %s\n", > +- grub_dprintf ("luks2", "Could not open keyslot %"PRIuGRUB_SIZE":= %s\n", > - i, grub_errmsg); > ++ grub_dprintf ("luks2", "Could not open keyslot %"PRIuGRUB_UINT64= _T": %s\n", > + keyslot_key, grub_errmsg); > continue; > } > @@ grub-core/disk/luks2.c: luks2_recover_key (grub_disk_t disk, > * where each element is either empty or holds a key. > */ > - grub_printf_ (N_("Slot %"PRIuGRUB_SIZE" opened\n"), i); > -+ grub_printf_ (N_("Slot %"PRIuGRUB_SIZE" opened\n"), keyslot_k= ey); > ++ grub_printf_ (N_("Slot %"PRIuGRUB_UINT64_T" opened\n"), keysl= ot_key); > =20 > candidate_key_len =3D keyslot.key_size; > break; > 2: 137909929 =3D 2: 3baffdd4f luks2: grub_cryptodisk_t->total_length is= the max number of device native sectors > 3: 9cfbb3373 =3D 3: 6da3d8598 cryptodisk: Fix cipher IV mode 'plain64' = always being set as 'plain'. > 4: 5f7bd00a6 =3D 4: fd7cb6b16 cryptodisk: Properly handle non-512 byte = sized sectors. > 5: 4251c828a =3D 5: b33733199 cryptodisk: Replace some literals with co= nstants in grub_cryptodisk_endecrypt. > 6: feb8298b8 =3D 6: de4f6b2e5 cryptodisk: Rename total_length field in = grub_cryptodisk_t to total_sectors. > 7: e26aed2ee ! 7: a165791de cryptodisk: Rename offset in grub_cryptodis= k_t to offset_sectors. > @@ grub-core/disk/luks.c: configure_ciphers (grub_disk_t disk, const = char *check_uu > =20 > ## grub-core/disk/luks2.c ## > @@ grub-core/disk/luks2.c: luks2_recover_key (grub_disk_t disk, > - grub_dprintf ("luks2", "Trying keyslot %"PRIuGRUB_SIZE"\n", k= eyslot_key); > + grub_dprintf ("luks2", "Trying keyslot %"PRIuGRUB_UINT64_T"\n= ", keyslot_key); > =20 > /* Set up disk according to keyslot's segment. */ > - crypt->offset =3D grub_divmod64 (segment.offset, segment.sect= or_size, NULL); > 8: e083b25e2 =3D 8: 86beb5be8 luks2: Rename source disk variabled named= 'disk' to 'source' as in luks.c. > --=20 > 2.27.0 >=20 --Hlh2aiwFLCZwGcpw Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEF9hrgiFbCdvenl/rVbJhu7ckPpQFAl+ANPEACgkQVbJhu7ck PpTWhg/9GgCQWSN2CIDurKc5Qc7SfpLGhBCYNDh1dvhS3xPJ/JdLxZcQzFubP8S8 vYzUQfvVryFX/JhTglqozTZK4mYsdiQUJNxDb84nLDL+B8SoBlAUevIqB7iusg9T 5pcn4jy825GxnPXGfYisuOu8akfNgyDb5wgbgvI0OkLinkZZ5WmOblfu87KNfkmY svetmFrS2cSx1FeG3Lj6UP4drBvolYsoeKztVFPhrBlTkuAVhr//hunqNyW3qHzr OXeT6QkOtQe+T2n4/ks62OSovpa2IFsL97YCF4OWVAaKp5rcJTKWR8a0bOYcdnhT SXJgal3diAo6chkVuuQ04Q1MWft84L8555RggyaVUElQ7UO6LUj0q7GuJ7cUANZQ 7I3uXRmXPFe2XtepOMzgLcZL3sdCczNPTSVCD/HJpvWZxGCGzkNqh3FuQYqIf3o/ F4Lx6FGKL+UoOIykogkWUR858pFBsLTe8STMYXfsHqNQEBcMiVituCih7nViFIKx rjooD6B4CsLVeJHB+Jit9yAoURPOAKz1DeAHgzefRbiD+oBCCiF0DB4SkdbzcDit PF7P9Eqf6msHgasOl/zzcAXQ98YR0VIdk40P2+gBTiNPzJnEx7myke3cy53T2TLU 10B2jMJCupk9BzZs2oTYAGLIHgjEK42pwfjO3oTKIv7dV7nn1As= =AhEa -----END PGP SIGNATURE----- --Hlh2aiwFLCZwGcpw--