From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1kUeKf-0000bs-By for mharc-grub-devel@gnu.org; Mon, 19 Oct 2020 19:12:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40756) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kUeKd-0000Yd-Rq for grub-devel@gnu.org; Mon, 19 Oct 2020 19:12:47 -0400 Received: from mail-ot1-x344.google.com ([2607:f8b0:4864:20::344]:37989) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kUeKa-0007Vp-Mn for grub-devel@gnu.org; Mon, 19 Oct 2020 19:12:47 -0400 Received: by mail-ot1-x344.google.com with SMTP id i12so1508530ota.5 for ; Mon, 19 Oct 2020 16:12:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=efficientek-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Sn4rN394KNc5gf0aSdvjd57Oucm20Znw+E74ycBUysQ=; b=QXqKMrsoAply3PFW4/AUvHQhoZ1t5K5Y9qiNukCldbvBq96rHEjLze/ErcXzjjWoLC 3tLmQOwVEgRu5R7nspJ2fIZ3fEGlOGVUYhlbUQGwDe4whKpikVKubk+OeBRYdy6uSApG y4kMYLaHixXRXnA2Fxbkyy43JavxBsg+0u2fRoIiuTotOQWMFuCNNYIQmqupi6KYqoNY Q54oAxUQn68Ealaw1NEdVe/REdKAcQUgW/Pufw/2dR0KG07pBhBg6patbc/h9XHL/ANr Ub3fH8ZYnvTR8KK9Bynzue+0rxYmlsfBE2NR+tQkiYxBCmM69+nuG8Xw3WQYDZw7uk4w sAQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Sn4rN394KNc5gf0aSdvjd57Oucm20Znw+E74ycBUysQ=; b=dptIew/MB6WTu6jDtvZlBng+WmWqNwiRx5vRy4LQZXKodN5yOK6GK6mqjo1qS6SQc9 s9AUemEL7X2L5I/Ima0M4yBKkDaRUPtjZbvIY+/510sInaPra8THnEKsJlcGEIFBPDsR WhQD7WfyilySF2JdC5OhvnfPLMxdbw1nY28q4Ead1iOBUG6u1t7E22OE0ZvZnQlquv9N zNqj/uxWinEGVmbqbib4QlgI+5YtgtzIQv361rZPCghWJ6id3mKEhzGdcLDcYzvT7qRP NZy2iDgnZBtJft8TcQ5WMMgtbFpSmEbuTCuu0PB4rg5gL9OphM1yJBCI948FcNwVeD82 1cFA== X-Gm-Message-State: AOAM533Y0NIfBVtQfRjpnxKErjRot64MLGeAN36yyaDNhRk4B6vzUsZf iG8BMOd62cKKyop204YErXB6hSlOw5obAg== X-Google-Smtp-Source: ABdhPJxjFGLtt9hp9l7oBT4kjBDAno3lZlgE5/3+JQla8yPRYl5BcOcIPAZzEneR2Y57/yD+r8fgyg== X-Received: by 2002:a9d:7993:: with SMTP id h19mr1613795otm.129.1603149162648; Mon, 19 Oct 2020 16:12:42 -0700 (PDT) Received: from localhost.localdomain (47-218-232-180.bcstcmtk03.res.dyn.suddenlink.net. [47.218.232.180]) by smtp.gmail.com with ESMTPSA id d27sm310848otc.6.2020.10.19.16.12.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Oct 2020 16:12:41 -0700 (PDT) From: Glenn Washburn To: grub-devel@gnu.org Cc: Patrick Steinhardt , Daniel Kiper , Glenn Washburn Subject: [PATCH v3 10/10] luks2: Rename source disk variabled named 'disk' to 'source' as in luks.c. Date: Mon, 19 Oct 2020 18:09:58 -0500 Message-Id: <738fe0139bde2a2bd36d0c97526309ab8b5a8224.1603148099.git.development@efficientek.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: References: <20201009100122.GH2088@tanuki> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2607:f8b0:4864:20::344; envelope-from=development@efficientek.com; helo=mail-ot1-x344.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=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: Mon, 19 Oct 2020 23:12:48 -0000 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. Signed-off-by: Glenn Washburn --- grub-core/disk/luks2.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/grub-core/disk/luks2.c b/grub-core/disk/luks2.c index cd573208a..ccb94e80d 100644 --- a/grub-core/disk/luks2.c +++ b/grub-core/disk/luks2.c @@ -417,7 +417,7 @@ luks2_verify_key (grub_luks2_digest_t *d, grub_uint8_t *candidate_key, 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) { @@ -493,7 +493,7 @@ luks2_decrypt_key (grub_uint8_t *out_key, } grub_errno = GRUB_ERR_NONE; - ret = grub_disk_read (disk, 0, k->area.offset, k->area.size, split_key); + ret = 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); @@ -537,7 +537,7 @@ luks2_decrypt_key (grub_uint8_t *out_key, } 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]; @@ -552,7 +552,7 @@ luks2_recover_key (grub_disk_t disk, grub_json_t *json = NULL, keyslots; grub_err_t ret; - ret = luks2_read_header (disk, &header); + ret = luks2_read_header (source, &header); if (ret) return ret; @@ -561,7 +561,7 @@ luks2_recover_key (grub_disk_t disk, return GRUB_ERR_OUT_OF_MEMORY; /* Read the JSON area. */ - ret = grub_disk_read (disk, 0, grub_be_to_cpu64 (header.hdr_offset) + sizeof (header), + ret = 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; @@ -578,10 +578,10 @@ luks2_recover_key (grub_disk_t disk, } /* Get the passphrase from the user. */ - if (disk->partition) - part = 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 = 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)) { @@ -616,12 +616,12 @@ luks2_recover_key (grub_disk_t disk, crypt->log_sector_size = sizeof (unsigned int) * 8 - __builtin_clz ((unsigned int) segment.sector_size) - 1; if (grub_strcmp (segment.size, "dynamic") == 0) - crypt->total_sectors = (grub_disk_get_size (disk) >> (crypt->log_sector_size - disk->log_sector_size)) + crypt->total_sectors = (grub_disk_get_size (source) >> (crypt->log_sector_size - source->log_sector_size)) - crypt->offset_sectors; else crypt->total_sectors = grub_strtoull (segment.size, NULL, 10) >> crypt->log_sector_size; - ret = luks2_decrypt_key (candidate_key, disk, crypt, &keyslot, + ret = luks2_decrypt_key (candidate_key, source, crypt, &keyslot, (const grub_uint8_t *) passphrase, grub_strlen (passphrase)); if (ret) { -- 2.27.0