From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1kW19M-0000G1-EC for mharc-grub-devel@gnu.org; Fri, 23 Oct 2020 13:46:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38400) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kW19K-0000EU-2M for grub-devel@gnu.org; Fri, 23 Oct 2020 13:46:46 -0400 Received: from wout4-smtp.messagingengine.com ([64.147.123.20]:57427) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kW19G-00034B-Ox for grub-devel@gnu.org; Fri, 23 Oct 2020 13:46:45 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 2C8059BB; Fri, 23 Oct 2020 13:46:38 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Fri, 23 Oct 2020 13:46:38 -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=meIagTXveHjvVj74SE1KtHbwGFy Lz0IHatVi2Btwa8o=; b=IinS5mwiq+acTp1L1nTdlh9EG02dekJrnbkUek+Vdxd 4WLkvu4fa1k0keMw8zazAMK8pYjyagWVmLHYpLNBfKYOpcMO5tPzmLrCHDJqcnKx R+wUhoVpCDebHZpTGly0uzyf6gpGHBBVvfhVCEtfZFi8zuq/at7BbpIaoA7/IMxd lKLdDh2Dtl779zpBoG5il2eyYX0CgBnhBCU0ezDZb+svhpFL9v9fL3fofn8otyku +jjmL0DjYblU5H/RIJIExXc0AVNA80Sckc2n+tLp/0z7mznNubqdKeiAq76EzVmi KH09M6RWnVaIimYYneZjSeJgZUsyKaSpNo4q2AyJBpg== 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=meIagT XveHjvVj74SE1KtHbwGFyLz0IHatVi2Btwa8o=; b=iAvA9NynyOxpESh+2ZNPAr aSXXqBSrfswyJWgwn7EZs6pB/an9ls+RgzV0ekiCDNaoLQzmlnQMbe8z9oLIPMUf 0lh5/qcizOXpsGKMiequ4qY4QKYsSnoW4ecm2wYnwVbJJUHwr19aB7+z4zmhcjSv JSMqcuqjQTASxY3d08Jckq/zdI7cyp2XT+tt/3+spl/PSZCRJx8KU0V/P4iQIqdO LuBcsoqqc6QQQJgnekN2j5uRGkC3Ta6fub5XS1/SB2nPWnmBaH+GzKIV6eXerHGd hGOP8eyrnQhC53cijEmUOKjsoIV654VEUMYHlwWzOfCQEbKz7Hqdd4sHCjgiZilw == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrkedtgdduudekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfhfgggtuggjsehgtderredttddvnecuhfhrohhmpefrrghtrhhi tghkucfuthgvihhnhhgrrhguthcuoehpshesphhkshdrihhmqeenucggtffrrghtthgvrh hnpeehgefhtdefueffheekgfffudelffejtdfhvdejkedthfehvdelgfetgfdvtedthfen ucfkphepkeelrddugedrgeeirddvtddtnecuvehluhhsthgvrhfuihiivgeptdenucfrrg 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 7118C3280066; Fri, 23 Oct 2020 13:46:36 -0400 (EDT) Received: from localhost (tanuki [10.192.0.23]) by vm-mail.pks.im (OpenSMTPD) with ESMTPSA id 34b4d2b1 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Fri, 23 Oct 2020 17:46:32 +0000 (UTC) Date: Fri, 23 Oct 2020 19:46:38 +0200 From: Patrick Steinhardt To: Glenn Washburn Cc: grub-devel@gnu.org, Daniel Kiper Subject: Re: [PATCH v2 10/10] luks2: Rename source disk variabled named 'disk' to 'source' as in luks.c. Message-ID: <20201023174638.GA810@tanuki> References: <86beb5be81a77d201f1b4151f2c0ec26b2c63fd5.1601765266.git.development@efficientek.com> <20201009100047.GG2088@tanuki> <20201019112712.480076e5@crass-HP-ZBook-15-G2> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="bg08WKrSYDhXBjb5" Content-Disposition: inline In-Reply-To: <20201019112712.480076e5@crass-HP-ZBook-15-G2> 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:46:46 -0000 --bg08WKrSYDhXBjb5 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Oct 19, 2020 at 11:27:12AM -0500, Glenn Washburn wrote: > On Fri, 9 Oct 2020 12:00:47 +0200 > Patrick Steinhardt wrote: >=20 > > On Sat, Oct 03, 2020 at 05:55:34PM -0500, 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 > > Hum. I'm not sure this actually helps readability, mostly because I > > think that the distinction here is not that helpful in the context of > > encryption or decryption of the device. In the end we are trying to > > encrypt or decrypt the disk in order to create the new cryptodisk. > >=20 > > Anyway, I don't particularly care, so take this just as my two cents. > > The patch itself looks good to me. > >=20 > > Patrick >=20 > If I'm following you, you're saying that because encryption is > reversible, `source` is not helpful because either plaintext or > encrypted data can be the source depending on if you're encrypting or > decrypting. > In our case here, I think its intuitive to call the disk `source` > because it is where the data is coming from and to distinguish it from > the cryptodisk grub_disk_t. So its not called source because of the > (encrypted) contents of the disk, as I think you're suggesting. I think > this patch makes more sense in the context of some cryptodisk.c and > luks.c code. >=20 > Note that in grub_cryptodisk_scan_device_real in cryptodisk.c > which calls luks2_recover_key the grub_disk_t passed is named `source`. > And in in grub_cryptodisk_open, the parameter `disk` refers to a > grub_disk_t that can be read to decrypt an associated encrypted > grub_disk_t (ie. the cryptodisk grub_disk_t). The grub_cryptodisk_t > associated in disk->data has a member named "source_disk" which points > to the associated grub_disk_t and member "source" which is the name of > the associated disk. In both luks2_decrypt_key and luks2_recover_key the > grub_disk_t argument refers to the encrypted grub_disk_t which can be > accessed as (unencrypted disk)->data->source_disk on the opened crypto > disk. So I think its consistent with cryptodisk.c naming conventions to > call the grub_disk_t argument "source". Also as the subject line says, > this creates consistency with luks.c in its luks2_decrypt_key, which I > suspect is named "source" for the reasons I outlined above.=20 >=20 > I'm a little confused by "In the end we are trying to encrypt or > decrypt the disk in order to create the new cryptodisk." Where does > "encrypt" fit in to creating the new cryptodisk? Let's just keep your patch if others think it helps readability. As I said, I don't particularly care as to me the old naming was already quite clear. Patrick --bg08WKrSYDhXBjb5 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEF9hrgiFbCdvenl/rVbJhu7ckPpQFAl+TFv0ACgkQVbJhu7ck PpRlGg/9HQgpGZERV/18IiacrzuS6Cg9wX60YEbqEUoU0qLYSQX/ExAuGwvfqjSd 6dcGtwpvo6IrsQOMCJj5+V0gIp90zYEJSKdChTzcHx2r+55Yd6mHRsVkXHTxzc6V iZVgS+NHJOHNzaVWwuDE2rEq2fM2PIXFk98bbQ2NCHlz4GQ/g1KHGzwoDym1cJ/Z uJzKqi+jfOFFSNTdKqKhgi5ypXvrGMopFkV311tpUOVSDZrqn65lIQKE4R/C9+3k TK9c1kcIwD2eLDYoAivFzU+8hCQJ1my+eDQLaY3TxYGcabMjpsOzCPLppw+p4U+X rOZKTMtDTvPVln51eiCihZ2NiLdbsMNPXUGfh0N0oFwTf59QtdwUycBWomi707aM Y/u8XjuMmjKEwpqSzYikkM/SOAod1DNQu6nfhk0OecktjvO99X7tbFbIpoKsbudc kAMGAFD7eyN4QAEUA/DEyCGx+ghiiDBJW5iW5sylUOPx7uMh1xa2unH8hGvFtJak qMtmSKKRD5x73LWNJe3AhCzyhH88h5Omb7CRVuUtKOknepY+BBL7zCx7W5pTUAQ0 aqZx9If9hDDkUXI+4UdpvCF3u6vpK3OcnC9id1+Z8bV/Jqa07mxynogF86hG6Ed8 5gzPS8UVm+4DQAbJbuer+zTybGyM7imrg0ysrKC9NQ+/Kc4MahA= =NQm1 -----END PGP SIGNATURE----- --bg08WKrSYDhXBjb5--