From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1kOqRj-0007Xr-Lv for mharc-grub-devel@gnu.org; Sat, 03 Oct 2020 18:56:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54692) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kOqRi-0007Wv-Bl for grub-devel@gnu.org; Sat, 03 Oct 2020 18:56:06 -0400 Received: from mail-oo1-xc2a.google.com ([2607:f8b0:4864:20::c2a]:38958) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kOqRe-0000Ez-7g for grub-devel@gnu.org; Sat, 03 Oct 2020 18:56:06 -0400 Received: by mail-oo1-xc2a.google.com with SMTP id c4so1333267oou.6 for ; Sat, 03 Oct 2020 15:56:01 -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=EuOPq9/MiwlkJ6oRyYwAArAG9JvN4d3r9l/IYHjpJgo=; b=pp/KQeyCfXeC3h413D+tLGL5j95y212uESFfMsGJBu1LnmXSm7WLayOGwRkFJ2XiQP /UYDnSfttZCZg14D/Lp+T4WffI1T0vjKNZQlDVwdbECewe0W42MLoczlf8Mr7t6jhTht lSgJxj/B5kUoZAktUAhoLFlcP4BWwdff2u906DczOT+tmtxYTM6Gci+hD/U+T+zwIAoZ A+Lx+HQmbEJHTcCi1WWg5sZpuf+mXxEnepzmVvQKhWq3nFSP79rsiNs/moGUIs98G5fx 6a7/nwCPD1goS+miKCEuBjhzW73PmazIm4X76GodTTIJQPdorvF+3K4n60PsTDndsi5b THXw== 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=EuOPq9/MiwlkJ6oRyYwAArAG9JvN4d3r9l/IYHjpJgo=; b=NJreakAydxlOZ4sG/yPcU9RGX8iB9zREDHurKUB8D/gMtJ8eZUJoyXfrJyT9FMKdAR dGaK5VJOZWRmbsUlRT84hW5B6GUGdT2XzgkZm6vMi7URD97q+furzhxg7I5axooUfv/2 7ukdUXrlEs6BrAggXQ4JGvf2W7mYcIgghPye4j3lTygPOgYXSXfpyEu/kW+iM0RWfvMk xdgPDld7xFAml/P2Un67xxJZeklL+rosE0eVlrEUNTKC/8iDtGo0dqvhuOARPguaRzHW HEJUEpcB3NQB5XkLL9Ify9c2bS8RYqASWq+5VpZ3Z7p0AaBt64TfuADaqSa/Gz8dyjEZ lKrA== X-Gm-Message-State: AOAM531AbDtr8hWFeuwj3WACb4yjiB2sabD2T0ldtGpkf2svNpyPHpyy LoE94m3T+g+BEm/KDlZRpMFFa5BC05myGA== X-Google-Smtp-Source: ABdhPJwhY6VKHpCXDYTdFgyEtRrbBjQDzPI7fK8NTxJ+dULieKDGSjTzcLYlPwDDTPj/m1iDvjWiJQ== X-Received: by 2002:a4a:978a:: with SMTP id w10mr7070452ooi.69.1601765760397; Sat, 03 Oct 2020 15:56:00 -0700 (PDT) Received: from crass-HP-ZBook-15-G2.lan ([136.49.44.103]) by smtp.gmail.com with ESMTPSA id d17sm1524580oth.73.2020.10.03.15.55.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 03 Oct 2020 15:55:59 -0700 (PDT) From: Glenn Washburn To: grub-devel@gnu.org Cc: Daniel Kiper , Patrick Steinhardt , Glenn Washburn Subject: [PATCH v2 00/10] Cryptodisk fixes for v2.06 redux Date: Sat, 3 Oct 2020 17:55:24 -0500 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::c2a; envelope-from=development@efficientek.com; helo=mail-oo1-xc2a.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, 03 Oct 2020 22:56:06 -0000 This is a minor update to fix patch 3, where I missed updating the format string type code. This was causing i386 builds to fail. Rangediff is included. Glenn Washburn (10): luks2: Fix use of incorrect index and some grub_error() messages. luks2: Improve readability in luks2_get_keyslot. luks2: Use more intuitive keyslot key instead of index when naming keyslot. luks2: grub_cryptodisk_t->total_length is the max number of device native sectors cryptodisk: Fix cipher IV mode 'plain64' always being set as 'plain'. cryptodisk: Properly handle non-512 byte sized sectors. cryptodisk: Replace some literals with constants in grub_cryptodisk_endecrypt. cryptodisk: Rename total_length field in grub_cryptodisk_t to total_sectors. cryptodisk: Rename offset in grub_cryptodisk_t to offset_sectors. luks2: Rename source disk variabled named 'disk' to 'source' as in luks.c. grub-core/disk/cryptodisk.c | 78 ++++++++++++++++++-------------- grub-core/disk/geli.c | 4 +- grub-core/disk/luks.c | 9 ++-- grub-core/disk/luks2.c | 88 ++++++++++++++++++++----------------- include/grub/cryptodisk.h | 18 ++++++-- include/grub/types.h | 3 ++ 6 files changed, 118 insertions(+), 82 deletions(-) Range-diff against v1: 1: 00646c92f ! 1: e2433b8ab luks2: Use more intuitive keyslot key instead of index when naming keyslot. @@ grub-core/disk/luks2.c: luks2_recover_key (grub_disk_t disk, if (keyslot.priority == 0) { - grub_dprintf ("luks2", "Ignoring keyslot %"PRIuGRUB_SIZE" due to priority\n", i); -+ grub_dprintf ("luks2", "Ignoring keyslot %"PRIuGRUB_SIZE" due to priority\n", keyslot_key); ++ grub_dprintf ("luks2", "Ignoring keyslot %"PRIuGRUB_UINT64_T" due to priority\n", keyslot_key); continue; } - grub_dprintf ("luks2", "Trying keyslot %"PRIuGRUB_SIZE"\n", i); -+ grub_dprintf ("luks2", "Trying keyslot %"PRIuGRUB_SIZE"\n", keyslot_key); ++ grub_dprintf ("luks2", "Trying keyslot %"PRIuGRUB_UINT64_T"\n", keyslot_key); /* Set up disk according to keyslot's segment. */ crypt->offset = grub_divmod64 (segment.offset, segment.sector_size, NULL); @@ grub-core/disk/luks2.c: luks2_recover_key (grub_disk_t disk, + (const grub_uint8_t *) passphrase, grub_strlen (passphrase)); if (ret) { - grub_dprintf ("luks2", "Decryption with keyslot %"PRIuGRUB_SIZE" failed: %s\n", +- grub_dprintf ("luks2", "Decryption with keyslot %"PRIuGRUB_SIZE" failed: %s\n", - i, grub_errmsg); ++ grub_dprintf ("luks2", "Decryption with keyslot %"PRIuGRUB_UINT64_T" failed: %s\n", + keyslot_key, grub_errmsg); continue; } -@@ grub-core/disk/luks2.c: luks2_recover_key (grub_disk_t disk, + ret = luks2_verify_key (&digest, candidate_key, keyslot.key_size); if (ret) { - grub_dprintf ("luks2", "Could not open keyslot %"PRIuGRUB_SIZE": %s\n", +- grub_dprintf ("luks2", "Could not open keyslot %"PRIuGRUB_SIZE": %s\n", - i, grub_errmsg); ++ grub_dprintf ("luks2", "Could not open keyslot %"PRIuGRUB_UINT64_T": %s\n", + keyslot_key, grub_errmsg); continue; } @@ grub-core/disk/luks2.c: luks2_recover_key (grub_disk_t disk, * where each element is either empty or holds a key. */ - grub_printf_ (N_("Slot %"PRIuGRUB_SIZE" opened\n"), i); -+ grub_printf_ (N_("Slot %"PRIuGRUB_SIZE" opened\n"), keyslot_key); ++ grub_printf_ (N_("Slot %"PRIuGRUB_UINT64_T" opened\n"), keyslot_key); candidate_key_len = keyslot.key_size; break; 2: 137909929 = 2: 3baffdd4f luks2: grub_cryptodisk_t->total_length is the max number of device native sectors 3: 9cfbb3373 = 3: 6da3d8598 cryptodisk: Fix cipher IV mode 'plain64' always being set as 'plain'. 4: 5f7bd00a6 = 4: fd7cb6b16 cryptodisk: Properly handle non-512 byte sized sectors. 5: 4251c828a = 5: b33733199 cryptodisk: Replace some literals with constants in grub_cryptodisk_endecrypt. 6: feb8298b8 = 6: de4f6b2e5 cryptodisk: Rename total_length field in grub_cryptodisk_t to total_sectors. 7: e26aed2ee ! 7: a165791de cryptodisk: Rename offset in grub_cryptodisk_t to offset_sectors. @@ grub-core/disk/luks.c: configure_ciphers (grub_disk_t disk, const char *check_uu ## grub-core/disk/luks2.c ## @@ grub-core/disk/luks2.c: luks2_recover_key (grub_disk_t disk, - grub_dprintf ("luks2", "Trying keyslot %"PRIuGRUB_SIZE"\n", keyslot_key); + grub_dprintf ("luks2", "Trying keyslot %"PRIuGRUB_UINT64_T"\n", keyslot_key); /* Set up disk according to keyslot's segment. */ - crypt->offset = grub_divmod64 (segment.offset, segment.sector_size, NULL); 8: e083b25e2 = 8: 86beb5be8 luks2: Rename source disk variabled named 'disk' to 'source' as in luks.c. -- 2.27.0