Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1k1TkH-0006mt-KA for mharc-grub-devel@gnu.org; Fri, 31 Jul 2020 08:02:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45222) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k1TkG-0006jt-4d for grub-devel@gnu.org; Fri, 31 Jul 2020 08:02:40 -0400 Received: from mail-pj1-x1042.google.com ([2607:f8b0:4864:20::1042]:38036) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k1TkE-0005VX-9N for grub-devel@gnu.org; Fri, 31 Jul 2020 08:02:39 -0400 Received: by mail-pj1-x1042.google.com with SMTP id e22so7614082pjt.3 for ; Fri, 31 Jul 2020 05:02:37 -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=E0VlJFTZ6PBtle1h6lADusfzdHK0CrDjLUbTuhABYNk=; b=awxu6FrI8Z1Mm01XtpxR+Hilz4eD66LdtlorJmx8tBjMX9oLw/D9NTi9Ykfhj7J+6x tvQ+9FrnKZRHfqrV7Lgg/uoqY+G1YzLJbvPrVbTCNHP/vPEBOtKv4xZdQDDix3XOcOyB hOlcxHRdAVX9omdrE7M6R1OPtgrDY8onADiKHYLRAKtK24ZV0Zkr5+Kmsx1uCXPUiES4 3Q3kLYnvK7vFDv1iljQraCQettCYtzmAZjYmlaS8t5M+z8U5Vl3HpB7exwOAYu2Wpdzs ut7hJ0HXqb6uQ1gGUVkCNqfMZLNoqT7PlknRnCBcqajK41nx205oMVencjssB/C0eApK Cu6Q== 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=E0VlJFTZ6PBtle1h6lADusfzdHK0CrDjLUbTuhABYNk=; b=omSkRIa6QNibTl+kW5B7SPsmTPImhPV2srjoFyALCsqXIh0PZv2xIR6adqu3E5xokm R5x0+GOzWoYMbH7qDJXh9LBLx64B+59D7tiItG3vNMW61m9pIN8p4CrcLRq5zbNo7tXz vqGG5tfSo6hN2k86hDoof63m9yS5ANkC90TLln8Cgr1q6ej9ZVGJl4yXRtKkgiCsCzwt nseyKB0EpP8lBYaJq8YZ+uLkI2pEi0gCspP7ZrfFf4fdAz6EkPczLK8Adqi/xh6om09A eG1DChGXw35+Ke1lou6VqENtL6+wQPs8Qi7zggHRtoFargiMIWjjvkIqKz7vpUoSnVaK Ai8A== X-Gm-Message-State: AOAM533fumnxZR4yPqbKs2GGoJSWd+X+dpCF6tVZOMWeQ+lrp8UaLSVV sPb+c7pGV9FZZDBv3OQO7UBtbi3G8Pw= X-Google-Smtp-Source: ABdhPJwZ1HL82gprqGJVAD3xCTi7Ciy5fiHcKwcfZD2ZXM2A+fnxpIV5nPYB+kbo6d+LrMu60NB2/Q== X-Received: by 2002:a17:90b:380b:: with SMTP id mq11mr2298259pjb.140.1596196956546; Fri, 31 Jul 2020 05:02:36 -0700 (PDT) Received: from localhost.localdomain ([189.216.105.24]) by smtp.gmail.com with ESMTPSA id o4sm9781590pfd.25.2020.07.31.05.02.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 Jul 2020 05:02:36 -0700 (PDT) From: Glenn Washburn To: grub-devel@gnu.org Cc: Glenn Washburn , Daniel Kiper , Patrick Steinhardt Subject: [CRYPTO-LUKS v1 06/19] luks2: Rename source disk variabled named 'disk' to 'source' as in luks.c. Date: Fri, 31 Jul 2020 07:01:47 -0500 Message-Id: <0e757e59283de5ebf1e0da173a0d3155f97520ea.1596196383.git.development@efficientek.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2607:f8b0:4864:20::1042; envelope-from=development@efficientek.com; helo=mail-pj1-x1042.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: Fri, 31 Jul 2020 12:02:40 -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 e3ff7c83d..9f58780a2 100644 --- a/grub-core/disk/luks2.c +++ b/grub-core/disk/luks2.c @@ -408,7 +408,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) { @@ -484,7 +484,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); @@ -523,7 +523,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]; @@ -538,7 +538,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; @@ -547,7 +547,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; @@ -564,10 +564,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)) { @@ -602,11 +602,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_length = grub_disk_get_size (disk) - crypt->offset; + crypt->total_length = grub_disk_get_size (source) - crypt->offset; else crypt->total_length = 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.25.1