From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1kbG8i-0008UM-Ka for mharc-grub-devel@gnu.org; Fri, 06 Nov 2020 23:47:48 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45386) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kbG8f-0008Mg-KS for grub-devel@gnu.org; Fri, 06 Nov 2020 23:47:45 -0500 Received: from mail-oi1-x241.google.com ([2607:f8b0:4864:20::241]:44230) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kbG8X-0002oN-KB for grub-devel@gnu.org; Fri, 06 Nov 2020 23:47:44 -0500 Received: by mail-oi1-x241.google.com with SMTP id t16so3759834oie.11 for ; Fri, 06 Nov 2020 20:47:36 -0800 (PST) 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=1R/C8+Usms2L5oPea4EvCY+mUsqBUYYdAp4SZ8pgZDs=; b=eJVLQeAVqkCaUdDnDJuahyCReyINRRaaPXzv1eAVnvXAZE8YbBL15OcdZ8uPZdBMlu yKXbHwGtsvz+pVkoSDpz6thoc+OPOSykL+3xiWtmniTGZFek4AAG3nvdYv1BziYI/nnP 2u8iLpqtv8VhsDTiPCdJiFi+yTzQzzwdlGvHWrMZ1RAgYoMSzk24NbtdMN20JD+tnloD cu9SKW7Y37ZEDSJ3Heszf+yCf2M5hXgrr9st07IfzWcqIZgHqUFYvOC13CEuyPiFyehJ H42Q20o4UOj/znSsMaAkVANhbR6CkhsSJtgPJJJg/wJ3jY11JrF0sjVYNzT1lYOpySno ne3w== 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=1R/C8+Usms2L5oPea4EvCY+mUsqBUYYdAp4SZ8pgZDs=; b=p5MeL4P3n3kOnYb8g45+OVJ682qgMVtN4yMRNranK3X0Zz6f79vKDJk89Dx92zrhRJ wimTkhu8DX9+7B3djGkJIfXHTICCgeY54wRG/Y/cp5ChPplziQGYbELV7ibo4GS1t9l4 Z0nP9iyzPCDBNRRoThCqBH7RKjSezHStHiHX1th+apbxIj2EzsvwdHvAV/1fku03clxP ZDc/1ljSD6oQwbaw/Auiuq+ypBj/yK+3pZoCrWoetOwZiwISoeLdGXnuvanWAPbfATZC pzvX4iMM2p6d7eQvNNHHuPwvUauvnUwF3zefoKWKCr8WD06B0bZca2BQ+RtJl7AAnbS0 M+0Q== X-Gm-Message-State: AOAM532sFidmN9RATyY//FgUBDQmQExSxaBQ7GvrRntlU/RWERKWCggV j7IwcXoacuq7DnMXKYxWwINPDWLGkMdpldfL X-Google-Smtp-Source: ABdhPJxA4ZPbiohpZTvxNZw09GrfZwbF7gRe/kvRS9PC8zow8XI5sME7vSo/k14FhBsEunOKHUcZLQ== X-Received: by 2002:aca:bc03:: with SMTP id m3mr3183016oif.35.1604724455820; Fri, 06 Nov 2020 20:47:35 -0800 (PST) Received: from localhost.localdomain ([136.49.44.103]) by smtp.gmail.com with ESMTPSA id x25sm836888oie.17.2020.11.06.20.47.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Nov 2020 20:47:35 -0800 (PST) From: Glenn Washburn To: grub-devel@gnu.org Cc: Patrick Steinhardt , Daniel Kiper , Glenn Washburn Subject: [PATCH v4 03/15] luks2: Rename source disk variabled named 'disk' to 'source' as in luks.c. Date: Fri, 6 Nov 2020 22:44:23 -0600 Message-Id: X-Mailer: git-send-email 2.27.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2607:f8b0:4864:20::241; envelope-from=development@efficientek.com; helo=mail-oi1-x241.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: Sat, 07 Nov 2020 04:47:45 -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 26fb14a12..d963255d4 100644 --- a/grub-core/disk/luks2.c +++ b/grub-core/disk/luks2.c @@ -415,7 +415,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) { @@ -491,7 +491,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); @@ -530,7 +530,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]; @@ -545,7 +545,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; @@ -554,7 +554,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; @@ -571,10 +571,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)) { @@ -609,11 +609,11 @@ 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->offset_sectors; + crypt->total_sectors = grub_disk_get_size (source) - crypt->offset_sectors; else crypt->total_sectors = grub_strtoull (segment.size, NULL, 10); - 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