From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1keEVS-0007cx-FZ for mharc-grub-devel@gnu.org; Sun, 15 Nov 2020 04:39:34 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:38238) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1keEVR-0007bw-64 for grub-devel@gnu.org; Sun, 15 Nov 2020 04:39:33 -0500 Received: from out3-smtp.messagingengine.com ([66.111.4.27]:34425) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1keEVP-0000Sm-Ch for grub-devel@gnu.org; Sun, 15 Nov 2020 04:39:32 -0500 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 944DB5C0108; Sun, 15 Nov 2020 04:39:24 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Sun, 15 Nov 2020 04:39:24 -0500 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=l9WGnkoLRoqNolN41WCVRC6LK1A 572t6bn4am8RRDdw=; b=ve+Xdabx3Tq1vfzAJpF6538ko4K4ygzDQozxRaT3aH/ FuieOGqfac9yTkj+mIdZlFwqwEII+e4aAOapbWnHLYXjHydgiqLxqx7EJEfkdQZt G/CCD9raZd2bAJNFYY5SmtO4hd1U3dz5JI5EJ6A/uB8ub+xisj0DYM/zEAMi79mJ BL6qV5uCQwK3Uo2hhSbyD8uVo+5vgkmv8PWFsqnlvicevusjITf5Olh5qSAsxBFD aeANXwtmMeiaP7zSVOb3QS6FNotIlKJOSm3S1osMff+yOMi5y2dVnsikSjv74diD ehZj910qyEuU/JTnRpVPkZJXJuGSE3369JPRPJyaJ0w== 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=l9WGnk oLRoqNolN41WCVRC6LK1A572t6bn4am8RRDdw=; b=RIpt/VmGC1pvzEaU9MzrIH jJeVHUKNKMY+fxLj/OWMGTVLn+FijdMLtBVUGSh5CScl+ZFbBoWeKuW7UNCyO669 eF66eEAKCWb0UzzVI6zWqhQbv+yrneVsMCCyxljVF1teELU+ft7Oy30Q8BJDm8+W vMxjs4a1I60aKpXScHr/NGr5V/ylmT+WzRrzKCQhfrbnH9/iFhsgN0g3FwzVOpOl 72rkGCaG5MwRJNkbl5Dd/492y3jkUptEo+iLepEeb7xi+RgZmOuoHY6OaqfsG6hQ SHpma3MWVXCHXBw7/ZUnT8c5g51WUML4eLV3OLdhuX11HaONs7bug5W+9f/EUBaA == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedruddvledgtdejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfhfgggtuggjsehgtderredttddvnecuhfhrohhmpefrrghtrhhi tghkucfuthgvihhnhhgrrhguthcuoehpshesphhkshdrihhmqeenucggtffrrghtthgvrh hnpeehgefhtdefueffheekgfffudelffejtdfhvdejkedthfehvdelgfetgfdvtedthfen ucfkphepjeekrdehgedrvddurddvtdeinecuvehluhhsthgvrhfuihiivgepvdenucfrrg hrrghmpehmrghilhhfrhhomhepphhssehpkhhsrdhimh X-ME-Proxy: Received: from vm-mail.pks.im (dynamic-078-054-021-206.78.54.pool.telefonica.de [78.54.21.206]) by mail.messagingengine.com (Postfix) with ESMTPA id CDFC0328005E; Sun, 15 Nov 2020 04:39:23 -0500 (EST) Received: from localhost (ncase [10.192.0.11]) by vm-mail.pks.im (OpenSMTPD) with ESMTPSA id 92fb4d6e (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Sun, 15 Nov 2020 09:39:23 +0000 (UTC) Date: Sun, 15 Nov 2020 10:39:21 +0100 From: Patrick Steinhardt To: Glenn Washburn Cc: grub-devel@gnu.org, Daniel Kiper Subject: Re: [PATCH v4 03/15] luks2: Rename source disk variabled named 'disk' to 'source' as in luks.c. Message-ID: References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="fxSjMcAuQyvq9ED1" Content-Disposition: inline In-Reply-To: Received-SPF: pass client-ip=66.111.4.27; envelope-from=ps@pks.im; helo=out3-smtp.messagingengine.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/11/15 04:37:28 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: Sun, 15 Nov 2020 09:39:33 -0000 --fxSjMcAuQyvq9ED1 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Nov 06, 2020 at 10:44:23PM -0600, Glenn Washburn wrote: > This makes it more obvious to the reader that the disk referred to is the > source disk, as opposed to say the disk holding the cryptodisk. >=20 > Signed-off-by: Glenn Washburn Reviewed-by: Patrick Steinhardt > --- > grub-core/disk/luks2.c | 22 +++++++++++----------- > 1 file changed, 11 insertions(+), 11 deletions(-) >=20 > diff --git a/grub-core/disk/luks2.c b/grub-core/disk/luks2.c > index 26fb14a12..d963255d4 100644 > --- a/grub-core/disk/luks2.c > +++ b/grub-core/disk/luks2.c > @@ -415,7 +415,7 @@ luks2_verify_key (grub_luks2_digest_t *d, grub_uint8_= t *candidate_key, > =20 > static grub_err_t > luks2_decrypt_key (grub_uint8_t *out_key, > - grub_disk_t disk, grub_cryptodisk_t crypt, > + grub_disk_t source, grub_cryptodisk_t crypt, > grub_luks2_keyslot_t *k, > const grub_uint8_t *passphrase, grub_size_t passphraselen) > { > @@ -491,7 +491,7 @@ luks2_decrypt_key (grub_uint8_t *out_key, > } > =20 > grub_errno =3D GRUB_ERR_NONE; > - ret =3D grub_disk_read (disk, 0, k->area.offset, k->area.size, split_k= ey); > + ret =3D grub_disk_read (source, 0, k->area.offset, k->area.size, split= _key); > if (ret) > { > grub_error (GRUB_ERR_IO, "Read error: %s\n", grub_errmsg); > @@ -530,7 +530,7 @@ luks2_decrypt_key (grub_uint8_t *out_key, > } > =20 > static grub_err_t > -luks2_recover_key (grub_disk_t disk, > +luks2_recover_key (grub_disk_t source, > grub_cryptodisk_t crypt) > { > grub_uint8_t candidate_key[GRUB_CRYPTODISK_MAX_KEYLEN]; > @@ -545,7 +545,7 @@ luks2_recover_key (grub_disk_t disk, > grub_json_t *json =3D NULL, keyslots; > grub_err_t ret; > =20 > - ret =3D luks2_read_header (disk, &header); > + ret =3D luks2_read_header (source, &header); > if (ret) > return ret; > =20 > @@ -554,7 +554,7 @@ luks2_recover_key (grub_disk_t disk, > return GRUB_ERR_OUT_OF_MEMORY; > =20 > /* Read the JSON area. */ > - ret =3D grub_disk_read (disk, 0, grub_be_to_cpu64 (header.hdr_offset) = + sizeof (header), > + ret =3D grub_disk_read (source, 0, grub_be_to_cpu64 (header.hdr_offset= ) + sizeof (header), > grub_be_to_cpu64 (header.hdr_size) - sizeof (header), json_header); > if (ret) > goto err; > @@ -571,10 +571,10 @@ luks2_recover_key (grub_disk_t disk, > } > =20 > /* Get the passphrase from the user. */ > - if (disk->partition) > - part =3D grub_partition_get_name (disk->partition); > - grub_printf_ (N_("Enter passphrase for %s%s%s (%s): "), disk->name, > - disk->partition ? "," : "", part ? : "", > + if (source->partition) > + part =3D grub_partition_get_name (source->partition); > + grub_printf_ (N_("Enter passphrase for %s%s%s (%s): "), source->name, > + source->partition ? "," : "", part ? : "", > crypt->uuid); > if (!grub_password_get (passphrase, MAX_PASSPHRASE)) > { > @@ -609,11 +609,11 @@ luks2_recover_key (grub_disk_t disk, > crypt->log_sector_size =3D sizeof (unsigned int) * 8 > - __builtin_clz ((unsigned int) segment.sector_size) - 1; > if (grub_strcmp (segment.size, "dynamic") =3D=3D 0) > - crypt->total_sectors =3D grub_disk_get_size (disk) - crypt->offset_sect= ors; > + crypt->total_sectors =3D grub_disk_get_size (source) - crypt->offset_se= ctors; > else > crypt->total_sectors =3D grub_strtoull (segment.size, NULL, 10); > =20 > - ret =3D luks2_decrypt_key (candidate_key, disk, crypt, &keyslot, > + ret =3D luks2_decrypt_key (candidate_key, source, crypt, &keyslot, > (const grub_uint8_t *) passphrase, grub_strlen (passphrase)); > if (ret) > { > --=20 > 2.27.0 >=20 --fxSjMcAuQyvq9ED1 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEF9hrgiFbCdvenl/rVbJhu7ckPpQFAl+w90gACgkQVbJhu7ck PpTJ0g//XfE+fjeRNA64mO3CyczFQowT7Pk1oKBH0OVMDIz9SDCxEU3lJ/sv9kaw hUh13tz4fS6Kxu9KEVcWo/nFi0PV8MHoyXjtd3boUPwUPn/kXMhdwYAmpETYGaWc eOvIOAsce7FAZkPEM/MeoQQ9GGI0+/Ous7i5AwAWKMdgQmp37wXlFwt8+yaddv+y 3Psubm39kkzIcE0n1Csn5S6VdPB1QSOM/lFvW1ax50ygZV//3SJS5RWVhFh2OhdZ CuKXSBBIKVQzvUlisg0RhKPfOQhJ8LCtZvH2Q7O1w/qhj783ONqrtX75hwEB5sHC dhMvqBNs9QRxohwtAchhSQrdD14G9lrdG+w/fJX09xWABr3dCF6M9MIVXraLdkgH Iprxydtg7wE3NWmG6V9KDEbVSY7hD95v1OlBZkgDZKjg9neLuzOZ+i4aN+ef7Cds hCMJYH1dvXTfrJ743VqhDTdboffNYpzt83ETwYjQ74LmJsY3hw4Nzpg+LFprFGc5 OL6EJt5jwZkJG9X1ezWuGO65Y4pzUlxnBFxYIZGkrO3eYGyHmnNUJf642DSOYKia GfsPsya47+8QKuzBQYXS2OGXBB6QEpKhrKw6TCt7KwzNfvi5kLk1aBsqzgYhqXqu 3kHlQi+FCJA67p7pAa4uBrVnqCO7OxgUUJ4xI1B2W71EpAYw5x0= =Zc47 -----END PGP SIGNATURE----- --fxSjMcAuQyvq9ED1--