From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1kQp7L-0002MU-Je for mharc-grub-devel@gnu.org; Fri, 09 Oct 2020 05:55:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37572) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kQp7J-0002JI-I3 for grub-devel@gnu.org; Fri, 09 Oct 2020 05:55:13 -0400 Received: from out2-smtp.messagingengine.com ([66.111.4.26]:47403) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kQp7H-00073Z-G7 for grub-devel@gnu.org; Fri, 09 Oct 2020 05:55:13 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id B32FD5C00C9; Fri, 9 Oct 2020 05:55:10 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Fri, 09 Oct 2020 05:55:10 -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=LM9vfUw304VRSbc6gu9nRkDhYBR 70G3FNyZ6/zTZK8k=; b=ANC7D6or8Cf2XWoKwO0+uXUiCYj+tWaLyGLdk9Sdy0V hDf2NCDCVeL//JlEmHDb7hPgi75AQ4vco/pmUwl145Ks9rCzKNBSVrXeJj7h0oC2 R5p5xVYgQxHw6HeL/H6cGCd3z4d5HL5BiH+4ede0AIdBdG+6jVG+uwmGPAPgKXhA nHGW4XAhE8EUNtS62Fy+ZmvLMldrYJOadMxDXG3fDSyoiSTGHHSkzP1v8Xy8iPzu AZIk02tSjJjyalQ1J6T6xDRnxtYAtLtUnWh6ws1kjkqJ+2EDILj3iBgnlLVrHYFP lxrjLCEVxKYoQ7Hgtm7rJQAq+VfE1tPqbK+Sgv6VB1w== 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=LM9vfU w304VRSbc6gu9nRkDhYBR70G3FNyZ6/zTZK8k=; b=LhzbT6uXUe/VfwQ4GR9f4H T9J6g72FO4aWhdo+SCDSncDtPoy2kGwRzvxxGjqwcwhybomAH788CtLl8scZFJcN 091AuThJE1gPLBw/CB8KTDQtOWbUVidIg2tnFGKcNjPHvVQfVmYwQoKbSs2NqRr+ UYS0QHvxK9QxcxyV8kUxpNTuedXyguwprzByWLseALE+lP4f9skx44xxkQ2xmOHM 1Okxy1TJTJXQXKK/F6SuB79V7jyAB5EK2bpf3PIYBaNkI75cz9m30H5pQvBrwCB7 RT8AXheET12CjQry1e5d3rVPxIktx6IDqd6GZBPTooc68SyCWiSOJLbetUuGU2pA == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrhedugddvvdcutefuodetggdotefrodftvf 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 9CC543280064; Fri, 9 Oct 2020 05:55:09 -0400 (EDT) Received: from localhost (tanuki [10.192.0.23]) by vm-mail.pks.im (OpenSMTPD) with ESMTPSA id bd26f325 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Fri, 9 Oct 2020 09:55:08 +0000 (UTC) Date: Fri, 9 Oct 2020 11:55:12 +0200 From: Patrick Steinhardt To: Glenn Washburn Cc: grub-devel@gnu.org, Daniel Kiper Subject: Re: [PATCH v2 08/10] cryptodisk: Rename total_length field in grub_cryptodisk_t to total_sectors. Message-ID: <20201009095512.GE2088@tanuki> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="CGDBiGfvSTbxKZlW" 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 09:55:13 -0000 --CGDBiGfvSTbxKZlW Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Oct 03, 2020 at 05:55:32PM -0500, Glenn Washburn wrote: > This makes the creates an alignment with grub_disk_t naming of the same > field and is more intuitive as to how it should be used. > Signed-off-by: Glenn Washburn > --- There's something off with the commit message here. Other than that: 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 1a91c2d55..f5d098f65 100644 > --- a/grub-core/disk/cryptodisk.c > +++ b/grub-core/disk/cryptodisk.c > @@ -711,7 +711,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 20cc20b9b..545734342 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 LUKS1_LOG_SECTOR_SIZE; > - 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 b7d3b425a..2e295cac8 100644 > --- a/grub-core/disk/luks2.c > +++ b/grub-core/disk/luks2.c > @@ -616,10 +616,10 @@ 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->log_secto= r_size - disk->log_sector_size)) > + crypt->total_sectors =3D (grub_disk_get_size (disk) >> (crypt->log_sect= or_size - disk->log_sector_size)) > - crypt->offset; > else > - crypt->total_length =3D grub_strtoull (segment.size, NULL, 10) >> crypt= ->log_sector_size; > + crypt->total_sectors =3D grub_strtoull (segment.size, NULL, 10) >> cryp= t->log_sector_size; > =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 006f3ec49..9e10ae927 100644 > --- a/include/grub/cryptodisk.h > +++ b/include/grub/cryptodisk.h > @@ -73,7 +73,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 --CGDBiGfvSTbxKZlW Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEF9hrgiFbCdvenl/rVbJhu7ckPpQFAl+AM38ACgkQVbJhu7ck PpRKwQ//Wvu3aiu+b7GISpbVNFGJ843qZArX++q6x6wfjSm7ZUYmpPmCrIQdCy7E ayAYxWLOfkAotd3ld82amFqTVlblcYdmkrkkPWKhW/xoC5PNQ/dpie2UPPMCBtqm qnSbHoCDmsJuF3Wiy2T3qaSVz+lEypZwwiG5iOcI5mak+JtulFGrKbfwivIpraZ4 lvoEHgwK3BNLAKCn0rvNlA7nY4RRPCAYPx8vii1VH6UUIjQUdhh/Fm9mv3HAe3Z4 NLZHAlWSG+9ZwMHV2K0J+sUEOerk6kt5H13Th12yiF59/5eqM54S2DOpLC3TYtFC Oed3gwjdIUSum2jJYa2HePyB1l9LPjU8VBYVSLOkJwge0jR3qtPf8IR3c+Pafe05 6DaTY/f0zTa/thecnMcbvRgTEYY6Y51HfUfNB+J9eKxy9KSHel66zMsQpOgD8n4i gA7Qe4pViQs6RRva/cHWfXfpbzYn0TThN9kMgAdl9tFGiK7llr03xrVNbsJsid9h 9RKUIeBDXprl1r44ghO7otRBsDt7Vc3bF4uSa7L6r4747Ml9xnXnfclgDg+dDfeN nD9TKZrjdeHBLkag4jhNE2dByWSq5ozg6N5yDl0fKXIxi/M07/jKL6/rUPEkIMq6 cdrdiPpSmZoijFZCk3Le/VQYMC7LSKz7w+MPlKqs0pg0T2jkMCg= =oDfJ -----END PGP SIGNATURE----- --CGDBiGfvSTbxKZlW--