From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1keETY-0006py-Tp for mharc-grub-devel@gnu.org; Sun, 15 Nov 2020 04:37:36 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:37846) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1keETW-0006pM-Ob for grub-devel@gnu.org; Sun, 15 Nov 2020 04:37:34 -0500 Received: from out3-smtp.messagingengine.com ([66.111.4.27]:55517) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1keETT-0008Je-PR for grub-devel@gnu.org; Sun, 15 Nov 2020 04:37:34 -0500 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 4B40C5C00DA; Sun, 15 Nov 2020 04:37:28 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Sun, 15 Nov 2020 04:37:28 -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=qaerLHkoFJYi3ZIMowZ6uu1xv4o 1irEKprfTkumjHBs=; b=fmUYQWMfcQFptUNG64Sq6CGK+gn0bbYz9zp6uDqjAbZ xScc9H6KZWl/WPks4xwJvZ8M3bkqBJ0Xo4MVXsbM/5SFBgOhSIgcPVRdbx3vsNUY al/+n3NrAz3BfnSe2G6kkOmjeW7nUOjYvXxKB+gCJ+C8lAMHzKE8nnYsiR/i799m FWz9bEfRxSLxGgGzAiXDJSLzf5Z+ab71NNoy0LqKC8skVvySLeVRH2TQr2ByBYCO Bv+7HAfSkzQuBpTgdSv4NFDAmwB9BK0SXF6F6D0Oy+sTaYVHCNALX5QEwrxh6O+k RAj+WMuNAMxiNGKOm8sgYgbhru95aWoU5ATiU9LOruw== 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=qaerLH koFJYi3ZIMowZ6uu1xv4o1irEKprfTkumjHBs=; b=XN8eN8pBjakZYYk/LpuXUo fzSreJuKJ3L72JqnJrVJJITH5R1028LXCWCzuKm7SGm8sUeLRBxSwk9FWCVWFH33 xh/uwVYqEU3YYuJe4kCfp95++AYZf31aGaKKn9xfnygD9QSvKCecEvjSgNDLCqIo JVcRpjCeLpCMiR8JgyUgqUg+uDhVjMePG2lmOEVb1cp8zkt0tYsihC9sbj8GRplx O02HvYYXuYEYc5xgoYJXM+vV5cLvP8eAlpVDxhnvrwjVfHHVbpCAepTOEr9eSoqj 1uqizQ3bs/KETxNzNRXbPdN3UrPve3jccG1fVauEg0Tk8+Za6jL+D0JKD75U3WfA == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedruddvledgtdejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfhfgggtuggjsehgtderredttddvnecuhfhrohhmpefrrghtrhhi tghkucfuthgvihhnhhgrrhguthcuoehpshesphhkshdrihhmqeenucggtffrrghtthgvrh hnpeehgefhtdefueffheekgfffudelffejtdfhvdejkedthfehvdelgfetgfdvtedthfen ucfkphepjeekrdehgedrvddurddvtdeinecuvehluhhsthgvrhfuihiivgeptdenucfrrg 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 ED8673280059; Sun, 15 Nov 2020 04:37:26 -0500 (EST) Received: from localhost (ncase [10.192.0.11]) by vm-mail.pks.im (OpenSMTPD) with ESMTPSA id 969399aa (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Sun, 15 Nov 2020 09:37:25 +0000 (UTC) Date: Sun, 15 Nov 2020 10:37:23 +0100 From: Patrick Steinhardt To: Glenn Washburn Cc: grub-devel@gnu.org, Daniel Kiper Subject: Re: [PATCH v4 01/15] cryptodisk: Rename total_length field in grub_cryptodisk_t to total_sectors. Message-ID: References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="Eha5u7ENLr5Nfwoo" 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:37:35 -0000 --Eha5u7ENLr5Nfwoo Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Nov 06, 2020 at 10:44:21PM -0600, Glenn Washburn wrote: > This creates an alignment with grub_disk_t naming of the same field and is > more intuitive as to how it should be used. >=20 > Signed-off-by: Glenn Washburn Reviewed-by: Patrick Steinhardt > --- > grub-core/disk/cryptodisk.c | 2 +- > grub-core/disk/geli.c | 2 +- > grub-core/disk/luks.c | 2 +- > grub-core/disk/luks2.c | 4 ++-- > include/grub/cryptodisk.h | 3 ++- > 5 files changed, 7 insertions(+), 6 deletions(-) >=20 > diff --git a/grub-core/disk/cryptodisk.c b/grub-core/disk/cryptodisk.c > index a3d672f68..3703da221 100644 > --- a/grub-core/disk/cryptodisk.c > +++ b/grub-core/disk/cryptodisk.c > @@ -699,7 +699,7 @@ grub_cryptodisk_open (const char *name, grub_disk_t d= isk) > } > =20 > disk->data =3D dev; > - disk->total_sectors =3D dev->total_length; > + disk->total_sectors =3D dev->total_sectors; > disk->max_agglomerate =3D GRUB_DISK_MAX_MAX_AGGLOMERATE; > disk->id =3D dev->id; > dev->ref++; > diff --git a/grub-core/disk/geli.c b/grub-core/disk/geli.c > index e9d23299a..4ec875821 100644 > --- a/grub-core/disk/geli.c > +++ b/grub-core/disk/geli.c > @@ -391,7 +391,7 @@ configure_ciphers (grub_disk_t disk, const char *chec= k_uuid, > =20 > newdev->modname =3D "geli"; > =20 > - newdev->total_length =3D grub_disk_get_size (disk) - 1; > + newdev->total_sectors =3D grub_disk_get_size (disk) - 1; > grub_memcpy (newdev->uuid, uuid, sizeof (newdev->uuid)); > COMPILE_TIME_ASSERT (sizeof (newdev->uuid) >=3D 32 * 2 + 1); > return newdev; > diff --git a/grub-core/disk/luks.c b/grub-core/disk/luks.c > index 59702067a..429db4ad8 100644 > --- a/grub-core/disk/luks.c > +++ b/grub-core/disk/luks.c > @@ -125,7 +125,7 @@ configure_ciphers (grub_disk_t disk, const char *chec= k_uuid, > newdev->offset =3D grub_be_to_cpu32 (header.payloadOffset); > newdev->source_disk =3D NULL; > newdev->log_sector_size =3D 9; > - newdev->total_length =3D grub_disk_get_size (disk) - newdev->offset; > + newdev->total_sectors =3D grub_disk_get_size (disk) - newdev->offset; > grub_memcpy (newdev->uuid, uuid, sizeof (uuid)); > newdev->modname =3D "luks"; > =20 > diff --git a/grub-core/disk/luks2.c b/grub-core/disk/luks2.c > index 31d7166fc..3173a098d 100644 > --- a/grub-core/disk/luks2.c > +++ b/grub-core/disk/luks2.c > @@ -609,9 +609,9 @@ 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_length =3D grub_disk_get_size (disk) - crypt->offset; > + crypt->total_sectors =3D grub_disk_get_size (disk) - crypt->offset; > else > - crypt->total_length =3D grub_strtoull (segment.size, NULL, 10); > + crypt->total_sectors =3D grub_strtoull (segment.size, NULL, 10); > =20 > ret =3D luks2_decrypt_key (candidate_key, disk, crypt, &keyslot, > (const grub_uint8_t *) passphrase, grub_strlen (passphrase)); > diff --git a/include/grub/cryptodisk.h b/include/grub/cryptodisk.h > index e1b21e785..21dc69501 100644 > --- a/include/grub/cryptodisk.h > +++ b/include/grub/cryptodisk.h > @@ -67,7 +67,8 @@ struct grub_cryptodisk > =20 > char *source; > grub_disk_addr_t offset; > - grub_disk_addr_t total_length; > + /* Total number of encrypted sectors of size (1< + grub_disk_addr_t total_sectors; > grub_disk_t source_disk; > int ref; > grub_crypto_cipher_handle_t cipher; > --=20 > 2.27.0 >=20 --Eha5u7ENLr5Nfwoo Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEF9hrgiFbCdvenl/rVbJhu7ckPpQFAl+w9tIACgkQVbJhu7ck PpRUDxAAqE49d1qf8ioT02TB3zWL9kuKVj41axHLHVBj4T4xsJQUxrVIeDyxAluL k1YuCsn+x6Gwk5pQfB9N3BoQv4/M4kUcBW5uv/Dhb9gCoOEtAMcL9euirR0ltAHf T0/LkDS84GW91FXapbXvdYwuHcURAgmy2pAaMOlcvWhwjSAqWtjuaD3Zqwd58YjH WAUrhYq9YgJ37Cmd+vI5A3mWzXGSkWrnQxh7ddWbtmyZsIHtFSv8Je4s03HqAbJL 67azJBmVsvnFgbazPmcoUYoGmdJoSX8gtkytQbW33cNd/eeT/FPko9WbRczGlUpQ YjwLRd6TY5QJiGPmHzy3OnuUGudoXr7X28i7p1elWIFfRG5jtvhStZRR4aGpx1XD X3/IzDkVZCSFE5JlACWncWjFzuyus9eNsKaLxkCS6NETGztWJ6cmaozRrlB0N4lS v24Q/L+yA8KLtgAwJ5GQHrY5PcCi7R6JbeTdaAlrTZKzs6L3OWM5KHCZEO8eoXIQ UdzYxvMwscb0Ph+0gd2n0kcEtZsIm71NUOEctqHQZmXKe+GSBftDPKeiHN61VOeB QSHY9NUuU94Pmg+UGt6JXFxE1PqzSdBl03nVGOej4MNt4Nk5Ytg3/3xe6DbH0Adp yeof3OjRvDnnYwyz/mQqnPkDq6ntogi6Gb5gEPWRAW9gaZCMtpE= =Rz7V -----END PGP SIGNATURE----- --Eha5u7ENLr5Nfwoo--