From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1kW1L2-0006vC-OK for mharc-grub-devel@gnu.org; Fri, 23 Oct 2020 13:58:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40982) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kW1L0-0006uu-Mo for grub-devel@gnu.org; Fri, 23 Oct 2020 13:58:50 -0400 Received: from wout4-smtp.messagingengine.com ([64.147.123.20]:60809) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kW1Ky-0004Yk-UP for grub-devel@gnu.org; Fri, 23 Oct 2020 13:58:50 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 826D4A0E; Fri, 23 Oct 2020 13:58:47 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Fri, 23 Oct 2020 13:58:47 -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=52bFGo8FUspcM+Ye/Mjap/7/FGx w9O6eOCdSaSyR2j4=; b=vzItA8+HzVcIGdNvBaKpD4FsEKOJH9i2MD2tOrTf7Ob 2ieUZex5e2SqTD0fUsCSOdYbAU9THwHQtsne/5MP219NCkBhKIW7I+HN7ovC11gg Kb/rZOxPCx/XlXaCAd7p9wNYltI8Ce+yyKgIKmvRX2IZ/BP0Vg4za5Em6duR7YzF GMBChIPOe8vsL4ww5C0kqswyI0bf/YgCMUXKbOcJgtWeafUKLhlPgyzRBl5dQ3vM G1MymFx6CJKZ06BX+gUD6eLdqYHtidlYs4S1vAuoT6BsznOeKPRWrag4Kw3eJzWC js0C+POYmMSFupONk8CNk8G8IUiQukrgiPksJG+UmUQ== 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=52bFGo 8FUspcM+Ye/Mjap/7/FGxw9O6eOCdSaSyR2j4=; b=ovAo5wYcXVGd5FNJjqQuwu OXihmM+O4gtZydcxxP54spbEjx3rTAyMA5d7t2Nne56miOq+H/3JZj206dmg+/Wi h1eIZdawaU7RsdIxOhrNV80AUGFSGnliR7MPApHYIyRYG0Mp21gECzevYaZLAOYg izDFFOgvl6kh1gSQMrZEm1JcaZyFC8Amya0u4Bp3fRYf5WMMD6CeaBk+9JJMhQfv /c5OpsSW+mpnsWkYGV1zHQiW0gnjNPh1BebojRo2RovOxcair4L9idTsjxhU9zIs 0BvTXCO8xCfa7i1PJd3H4ZfU9GCodtqKo1FyogM2+BCQ8sAVNVlsGtsbjUFmxqPA == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrkedtgdduvddtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfhfgggtuggjsehgtderredttddvnecuhfhrohhmpefrrghtrhhi tghkucfuthgvihhnhhgrrhguthcuoehpshesphhkshdrihhmqeenucggtffrrghtthgvrh hnpeehgefhtdefueffheekgfffudelffejtdfhvdejkedthfehvdelgfetgfdvtedthfen ucfkphepkeelrddugedrgeeirddvtddtnecuvehluhhsthgvrhfuihiivgepvdenucfrrg hrrghmpehmrghilhhfrhhomhepphhssehpkhhsrdhimh X-ME-Proxy: Received: from vm-mail.pks.im (dynamic-089-014-046-200.89.14.pool.telefonica.de [89.14.46.200]) by mail.messagingengine.com (Postfix) with ESMTPA id CC8EB3064682; Fri, 23 Oct 2020 13:58:45 -0400 (EDT) Received: from localhost (tanuki [10.192.0.23]) by vm-mail.pks.im (OpenSMTPD) with ESMTPSA id e8b7e42a (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Fri, 23 Oct 2020 17:58:44 +0000 (UTC) Date: Fri, 23 Oct 2020 19:58:50 +0200 From: Patrick Steinhardt To: Glenn Washburn Cc: grub-devel@gnu.org, Daniel Kiper Subject: Re: [PATCH v3 08/10] cryptodisk: Rename total_length field in grub_cryptodisk_t to total_sectors. Message-ID: <20201023175850.GE810@tanuki> References: <20201009100122.GH2088@tanuki> <28e0cac661495f962db3898bd97e8975492cab0a.1603148099.git.development@efficientek.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="3O1VwFp74L81IIeR" Content-Disposition: inline In-Reply-To: <28e0cac661495f962db3898bd97e8975492cab0a.1603148099.git.development@efficientek.com> Received-SPF: pass client-ip=64.147.123.20; envelope-from=ps@pks.im; helo=wout4-smtp.messagingengine.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/23 13:46:38 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, 23 Oct 2020 17:58:50 -0000 --3O1VwFp74L81IIeR Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Oct 19, 2020 at 06:09:56PM -0500, 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 Patrick > --- > 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 b9e0e98e1..bae54936c 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 --3O1VwFp74L81IIeR Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEF9hrgiFbCdvenl/rVbJhu7ckPpQFAl+TGdkACgkQVbJhu7ck PpSkOxAAnyo3BnvpN8zkKglC9yVZEhNyOouYghaCPCPeMRnbXPSoNVTgNNr1WfmG mgLAFBkS4Qk8Fb0h17cyzVHzuEY7wvRUexflBBdIcJZXvyJ5ZsMBqYW0NnvYCIZa h/byCwiJFoM3wqYdZxvD02nBuDiXeHFCARoo0EnvkqaVXFNPTCCliotjf5F7esRe 6vSPtgmIPpi57NONwZntA9ko6FFn8DUt0+Xx3fsd1qDY77C4+FWN/DywvDfoGFww grlQvF+6qUt/1Jd+sJF1wo+FbN7EGZKJjxNtiIoaR5iHLoveYzN+s1UbkwGHbw0S G+HGGBJzaHEDzAxOYGPDsxjoF8YJEolFf3gYt1xuIJp1mSFuO8TEkzaIY7IiBiyx QkVz67f/S5dPHC/Ed9YLBxUyMC5m/8ZiKV1V+7LvrjpgX0GIe5IBS4cFkREEVKlf uo5VI/y9gXgXhrAb7hi2MoGF+2LOAU/wrJcf8gaLCPDjYdVeUejngoMrlD2BqGqM h6vVBQ5UrDgXVHGkKVhpM7rZNpVYRN2glJWpb6z+r5vaEW6jEVE4wLZjMifIzaE/ s7djcEgMz5FdcCCGBmtCuDCJCWVJx65yRW5CajsTs5k4U6ZlA6SDiYDPezCXblqe ub5eoYY/mKc0kVjZL2y+xERljXq8YgqxQGbJGaueNK/BIT16ufo= =KzkN -----END PGP SIGNATURE----- --3O1VwFp74L81IIeR--