[PATCH] Add comments to rescue parser

2011-11-06 Thread Glenn Washburn
Hi all, Attached is an extremely simple patch to support full line comments (lines prefixed by a '#'). This was useful to me to have comments in an embedded config file without the rescue parser complaining. It might be nice to have comments at the tail of commands, and I haven't tested to see

[PATCH] Memdisk and embedded config options for grub-install

2011-11-06 Thread Glenn Washburn
Hi all, I've attached a patch to grub-install which adds an extra option for specifying a memdisk to install and an option to specify an embedded config which will be appended to the already generated embedded config (written to $prefix as load.cfg). I don't really need the options to be user

Tar fs module appears to be broken

2011-11-18 Thread Glenn Washburn
Hi all, I'm in the middle of debugging an issue with the tar fs module, but thought sharing it with the list might make it go faster. With the attached tar file, and any tar file it seems, I am only able to see files which are children of root. So in this case, I can see /boot, but not

Re: LUKS Encryption and Fingerprint readers?

2013-08-29 Thread Glenn Washburn
On Thu, 15 Aug 2013 17:51:03 +0100 TJ grub-de...@iam.tj wrote: So I'd like to know what support for key-files and/or fingerprint reading is/could be as input for LUKS unlocking? My other thought, to keep things simple, is to encrypt the entire hard drive and install GRUB and the /boot/

Re: LUKS Encryption and Fingerprint readers?

2013-08-30 Thread Glenn Washburn
On Thu, 29 Aug 2013 21:20:14 +0100 TJ grub-de...@iam.tj wrote: that'd be silly so I'm now moving to whole-disc encryption with the boot-loader, kernel, and initrd on a key-fob USB. I'd still like GRUB to be able to read a key-file rather than a typed pass-phrase, and have the key-file

Re: Beware using modules from different grub versions (was error: cannot allocate real mode pages)

2013-09-09 Thread Glenn Washburn
On Tue, 10 Sep 2013 06:59:18 +0400 Andrey Borzenkov arvidj...@gmail.com wrote: Regardless, there's another issue, the difficulty in ensuring where modules are being loaded from. Currently, modules are searched for in the $prefix directory. But $prefix is used for many other things as

Re: __stack_chk_fail in regexp is not defined

2013-11-08 Thread Glenn Washburn
On Fri, 08 Nov 2013 19:54:43 +0100 Vladimir 'φ-coder/phcoder' Serbinenko phco...@gmail.com wrote: On 08.11.2013 19:42, Glenn Washburn wrote: Now, I'm getting this error while building. Bug in the awk script? cat syminfo.lst | sort | gawk -f ./grub.git/grub-core/genmoddep.awk

Re: __stack_chk_fail in regexp is not defined

2013-11-09 Thread Glenn Washburn
On Sat, 09 Nov 2013 12:37:08 +0100 Vladimir 'φ-coder/phcoder' Serbinenko phco...@gmail.com wrote: On 09.11.2013 05:11, Andrey Borzenkov wrote: В Fri, 8 Nov 2013 14:42:43 -0600 Glenn Washburn developm...@efficientek.com пишет: On Fri, 08 Nov 2013 19:54:43 +0100 Vladimir 'φ-coder

grub_machine_fini definition inconsistencies

2013-11-09 Thread Glenn Washburn
I'm now getting compilation errors for platform efi. /home/crass/development/bootloader/grub2-src/grub.git/grub-core/lib/efi/halt.c: In function ‘grub_halt’: /home/crass/development/bootloader/grub2-src/grub.git/grub-core/lib/efi/halt.c:30:3: error: too few arguments to function

Re: __stack_chk_fail in regexp is not defined

2013-11-10 Thread Glenn Washburn
On Sun, 10 Nov 2013 09:40:58 +0400 Andrey Borzenkov arvidj...@gmail.com wrote: В Sat, 9 Nov 2013 23:33:54 -0600 Glenn Washburn developm...@efficientek.com пишет: On Sat, 09 Nov 2013 12:37:08 +0100 Vladimir 'φ-coder/phcoder' Serbinenko phco...@gmail.com wrote: On 09.11.2013 05:11

Re: grub_machine_fini definition inconsistencies

2013-11-10 Thread Glenn Washburn
On Sun, 10 Nov 2013 13:33:48 +0100 Vladimir 'φ-coder/phcoder' Serbinenko phco...@gmail.com wrote: On 10.11.2013 07:56, Glenn Washburn wrote: I'm now getting compilation errors for platform efi. /home/crass/development/bootloader/grub2-src/grub.git/grub-core/lib/efi/halt.c: In function

Re: Keyfile Support for GRUBs LUKS

2013-11-19 Thread Glenn Washburn
On Wed, 20 Nov 2013 00:43:37 +0100 Ralf Ramsauer ralf+g...@ramses-pyramidenbau.de wrote: Hi, yesterday I realised, that GRUB is already supporting LUKS and even simple DSA signature checking. I was thinking about the following setup: - fully encrypted harddisk (LUKS) (incl. rootfs).

Re: Keyfile Support for GRUBs LUKS

2013-11-19 Thread Glenn Washburn
On Tue, 19 Nov 2013 17:55:40 -0800 Elliott Mitchell ehem+g...@m5p.com wrote: On Tue, Nov 19, 2013 at 07:31:35PM -0600, Glenn Washburn wrote: I've had this setup ever since grub had LUKS support, except for the signature checking. I don't really see the point of checking signatures

Re: Keyfile Support for GRUBs LUKS

2013-11-20 Thread Glenn Washburn
On Tue, 19 Nov 2013 22:42:27 -0800 Elliott Mitchell ehem+g...@m5p.com wrote: On Tue, Nov 19, 2013 at 11:43:12PM -0600, Glenn Washburn wrote: On Tue, 19 Nov 2013 17:55:40 -0800 Elliott Mitchell ehem+g...@m5p.com wrote: On Tue, Nov 19, 2013 at 07:31:35PM -0600, Glenn Washburn wrote

Re: Keyfile Support for GRUBs LUKS

2013-11-20 Thread Glenn Washburn
On Wed, 20 Nov 2013 08:36:40 +0100 Vladimir 'φ-coder/phcoder' Serbinenko phco...@gmail.com wrote: On 20.11.2013 08:02, Glenn Washburn wrote: On Wed, 20 Nov 2013 06:48:40 +0100 Vladimir 'φ-coder/phcoder' Serbinenko phco...@gmail.com wrote: On 20.11.2013 06:43, Glenn Washburn wrote

Add TARGET_CFLAGS to efiemu link format test

2014-01-26 Thread Glenn Washburn
Its been a while since I've compiled grub using the latest git. When I just did, the build now fails in configure when evaluating the efiemu link format test (which was being automatically chosen by efiemu option being guessed to yes). The proximate issue was that the test program failed to

Improper handling of --disk-module argument in grub-install

2014-05-18 Thread Glenn Washburn
Currently when using --disk-module=xxx, grub-install will fail with a message about disk-module not being a valid option. To fix this, OPTION_MODULE should be removed from the option enum and the remaining references to OPTION_MODULE (only one) should be renamed to OPTION_DISK_MODULE. Glenn

[PATCH] Allow user-defined functions to override builtins.

2014-05-19 Thread Glenn Washburn
Currently, builtin commands take precedence over user-defined functions. This patch reverses that precedence, so that users can override builtin commands. Builtin commands may be accessed by issuing the command prefixed by an '@' character. My motivation for this change is to hook insmod in

[PATCH 1/2] Add hidden memdisk option to grub-install.

2014-05-19 Thread Glenn Washburn
I have a set of scripts that I've been using with the old shell script grub-install that creates its own memdisk and embedded config. Those options are not available at present (I suspect partly intentionally). With this in mind, I've added these options to grub-install, but left them as

[PATCH 2/2] Add emdedded-config hidden option to grub-install.

2014-05-19 Thread Glenn Washburn
One thing to note with this patch is that the supplied embedded config file is appended to the normally generated one. I did this to allow the default root and prefix to be generated and subsequently overridden if desired. --- util/grub-install.c | 20 +++- 1 file changed, 19

[PATCH 1/2] Allow user-defined functions to override builtins. [take 2]

2014-05-22 Thread Glenn Washburn
Thanks for suggestions from Michel and Ben, I've added a pseudo-command called builtin which will allow access to builtins that have been overridden by functions. Any help in getting this functionality committed would be much appreciated. --- grub-core/script/execute.c | 17 + 1

[PATCH 2/2] Allow user-defined functions to override builtins. [take 2]

2014-05-22 Thread Glenn Washburn
This is implements the builtin pseudo-command. --- grub-core/script/execute.c | 25 + 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/grub-core/script/execute.c b/grub-core/script/execute.c index 857f8c6..2dbc17f 100644 --- a/grub-core/script/execute.c +++

Re: [PATCH] Allow user-defined functions to override builtins.

2014-05-24 Thread Glenn Washburn
On Thu, 22 May 2014 09:31:24 +0200 Vladimir 'φ-coder/phcoder' Serbinenko phco...@gmail.com wrote: On 19.05.2014 08:37, Glenn Washburn wrote: Currently, builtin commands take precedence over user-defined functions. This patch reverses that precedence, so that users can override builtin

Re: [PATCH] Allow user-defined functions to override builtins.

2014-05-27 Thread Glenn Washburn
On Sun, 25 May 2014 05:03:31 +0200 Vladimir 'φ-coder/phcoder' Serbinenko phco...@gmail.com wrote: On 24.05.2014 09:47, Glenn Washburn wrote: But the prefix variable is used for other things in the loaded config file. So if I change the prefix to be that of the running grub to load

Re: [PATCH 2/2] Add emdedded-config hidden option to grub-install.

2014-05-27 Thread Glenn Washburn
On Thu, 22 May 2014 09:33:05 +0200 Vladimir 'φ-coder/phcoder' Serbinenko phco...@gmail.com wrote: On 19.05.2014 09:03, Glenn Washburn wrote: One thing to note with this patch is that the supplied embedded config file is appended to the normally generated one. I did this to allow

Re: [PATCH 2/2] Allow user-defined functions to override builtins. [take 2]

2014-05-27 Thread Glenn Washburn
defined commands so that it can be called from builtin, and a change in the documentation to advertise about builtin command. Cheers Le 22 mai 2014 08:46, Glenn Washburn developm...@efficientek.com a écrit : This is implements the builtin pseudo-command. --- grub-core/script/execute.c

Re: [PATCH] cryptodisk: Properly handle non-512 byte sized sectors.

2020-09-01 Thread Glenn Washburn
The main difference with this patch is that sector_size is renamed to log_sector_size, grub has enough inaccurate or misleading names. Additionally, rename LOG_SECTOR_SIZE to LUKS_LOG_SECTOR_SIZE and CRYPT_LOG_SECTOR_SIZE to GRUB_CRYPTODISK_IV_LOG_SIZE and moved to cryptodisk.h. Also a comment

[PATCH] cryptodisk: Properly handle non-512 byte sized sectors.

2020-09-01 Thread Glenn Washburn
even if your data is encrypted with 4K sector sizes, the split key encrypted area must be decrypted with a block size of 512 (ie the IV increments every 512 bytes). This made these changes less aestetically pleasing than desired. Signed-off-by: Glenn Washburn --- grub-core/disk/cryptodisk.c | 44

Re: [PATCH v2 9/9] cryptodisk: Properly handle non-512 byte sized sectors

2020-08-31 Thread Glenn Washburn
instead of my inline comments below. On Wed, 26 Aug 2020 10:14:02 +0200 Patrick Steinhardt wrote: > From: Glenn Washburn > > By default, dm-crypt internally uses an IV that corresponds to > 512-byte sectors, even when a larger sector size is specified. What > this means is

Re: [PATCH] error: Do compile-time format string checking on grub_error.

2020-10-05 Thread Glenn Washburn
On Sat, 3 Oct 2020 17:34:29 -0500 Glenn Washburn wrote: > On Thu, 17 Sep 2020 16:29:23 +0200 > Daniel Kiper wrote: > > > On Fri, Jul 31, 2020 at 09:33:18AM -0500, Glenn Washburn wrote: > > > Fix the many issues this uncovered mostly related to incorrect > > > l

[PATCH] error: Do compile-time format string checking on grub_error.

2020-10-05 Thread Glenn Washburn
Fix the many issues this uncovered mostly related to incorrect length modifiers. Signed-off-by: Glenn Washburn --- grub-core/commands/pgp.c | 2 +- grub-core/disk/ata.c | 4 ++-- grub-core/disk/cryptodisk.c| 14 -- grub-core/disk/dmraid_nvidia.c

Re: [PATCH v6 5/6] cryptodisk: enable the backends to implement key files

2020-10-04 Thread Glenn Washburn
There are a couple issues with format string conversions that do not currently cause building to fail. However, they will when/if my strict format string checking for grub_error is accepted. Its best to fix them anyway. On Wed, 19 Aug 2020 17:09:13 +0200 Denis 'GNUtoo' Carikli wrote: > From:

Re: [PATCH v2 03/10] luks2: Use more intuitive keyslot key instead of index when naming keyslot.

2020-10-18 Thread Glenn Washburn
On Fri, 9 Oct 2020 11:44:15 +0200 Patrick Steinhardt wrote: > On Sat, Oct 03, 2020 at 05:55:27PM -0500, Glenn Washburn wrote: > > Use the keyslot key value in the keyslot json array rather than the > > index of the keyslot in the json array. This is less confusing for &

Re: [PATCH v2 06/10] cryptodisk: Properly handle non-512 byte sized sectors.

2020-10-18 Thread Glenn Washburn
On Fri, 9 Oct 2020 11:50:29 +0200 Patrick Steinhardt wrote: > On Sat, Oct 03, 2020 at 05:55:30PM -0500, Glenn Washburn wrote: > > By default, dm-crypt internally uses an IV that corresponds to > > 512-byte sectors, even when a larger sector size is specified. What > > th

Re: [PATCH v2 10/10] luks2: Rename source disk variabled named 'disk' to 'source' as in luks.c.

2020-10-19 Thread Glenn Washburn
On Fri, 9 Oct 2020 12:00:47 +0200 Patrick Steinhardt wrote: > 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 > > cryp

[PATCH v3 00/10] Cryptodisk fixes for v2.06 redux

2020-10-19 Thread Glenn Washburn
Heres an updated patch series which addresses comment from Patrick. The only code change is adding a slot_key member to grub_luks2_keyslot and using that instead of an extra out parameter to luks2_get_keyslot. Glenn Washburn (10): luks2: Fix use of incorrect index and some grub_error() messages

[PATCH v3 04/10] luks2: grub_cryptodisk_t->total_length is the max number of device native sectors

2020-10-19 Thread Glenn Washburn
the size of the underlying device to the cryptodisk sector size. And segment.size is in bytes which need to be converted to cryptodisk sectors. Also, removed an empty statement. Signed-off-by: Glenn Washburn --- grub-core/disk/luks2.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff

[PATCH v3 01/10] luks2: Fix use of incorrect index and some grub_error() messages.

2020-10-19 Thread Glenn Washburn
. Signed-off-by: Glenn Washburn --- grub-core/disk/luks2.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/grub-core/disk/luks2.c b/grub-core/disk/luks2.c index 31d7166fc..2241e0312 100644 --- a/grub-core/disk/luks2.c +++ b/grub-core/disk/luks2.c @@ -275,34 +275,34

[PATCH v3 03/10] luks2: Use more intuitive keyslot key instead of index when naming keyslot.

2020-10-19 Thread Glenn Washburn
the index of the keyslot will mention keyslot 1 (its a zero-based index). Furthermore,with this change the keyslot number will align with the number used to reference the keyslot when using the --key-slot argument to cryptsetup. Signed-off-by: Glenn Washburn --- grub-core/disk/luks2.c | 23

[PATCH v3 08/10] cryptodisk: Rename total_length field in grub_cryptodisk_t to total_sectors.

2020-10-19 Thread Glenn Washburn
This creates an alignment with grub_disk_t naming of the same field and is more intuitive as to how it should be used. Signed-off-by: Glenn Washburn --- grub-core/disk/cryptodisk.c | 2 +- grub-core/disk/geli.c | 2 +- grub-core/disk/luks.c | 2 +- grub-core/disk/luks2.c | 4

[PATCH v3 09/10] cryptodisk: Rename offset in grub_cryptodisk_t to offset_sectors.

2020-10-19 Thread Glenn Washburn
This makes it clear that the offset represents sectors, not bytes, in order to improve readability. Signed-off-by: Glenn Washburn --- grub-core/disk/cryptodisk.c | 10 +- grub-core/disk/geli.c | 2 +- grub-core/disk/luks.c | 4 ++-- grub-core/disk/luks2.c | 4

[PATCH v3 05/10] cryptodisk: Fix cipher IV mode 'plain64' always being set as 'plain'.

2020-10-19 Thread Glenn Washburn
When setting cipher IV mode, detection is done by prefix matching the cipher IV mode part of the cipher mode string. Since "plain" matches "plain64", we must check for "plain64" first. Otherwise, "plain64" will be detected as "plain". S

[PATCH v3 02/10] luks2: Improve readability in luks2_get_keyslot.

2020-10-19 Thread Glenn Washburn
t;i" is renamed to "keyslot_idx" and the loop variable "j" is renamed to "i". Error messages now distinguish between indexes and keys. The former include "index" in the error string, and the later are surrounded in quotes. Signed-off-by: Glenn Washburn

[PATCH v3 06/10] cryptodisk: Properly handle non-512 byte sized sectors.

2020-10-19 Thread Glenn Washburn
is encrypted with 4K sector sizes, the split key encrypted area must be decrypted with a block size of 512 (ie the IV increments every 512 bytes). This made these changes less aestetically pleasing than desired. Signed-off-by: Glenn Washburn --- grub-core/disk/cryptodisk.c | 52

[PATCH v3 07/10] cryptodisk: Replace some literals with constants in grub_cryptodisk_endecrypt.

2020-10-19 Thread Glenn Washburn
This should improve readability of code by providing clues as to what the value represents. Signed-off-by: Glenn Washburn --- grub-core/disk/cryptodisk.c | 12 +++- include/grub/types.h| 3 +++ 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/grub-core/disk

[PATCH v3 10/10] luks2: Rename source disk variabled named 'disk' to 'source' as in luks.c.

2020-10-19 Thread Glenn Washburn
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

Re: Can grub-git be used to decrypt a LUKS2 encrypted partition? Testing Results

2020-08-28 Thread Glenn Washburn
On Fri, 28 Aug 2020 15:28:41 + HardenedArray via Grub-devel wrote: > I run Arch Linux as an encrypted /, /boot and swap system. That > encrypted /boot is nothing more than a folder under /, however two > Keyslots are required to boot. > > If I understand the boot process correctly, LUKS

[PATCH] tests: F2FS test should use MOUNTDEVICE like other tests.

2020-08-28 Thread Glenn Washburn
LODEVICES is not an array variable and should not be accessed as such. This allows the f2fs test to pass as it was failing because a device name had a space prepended to the path. Signed-off-by: Glenn Washburn --- tests/util/grub-fs-tester.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion

Re: [PATCH] v6 for detached headers and key files

2020-08-19 Thread Glenn Washburn
On Wed, 19 Aug 2020 17:09:08 +0200 Denis 'GNUtoo' Carikli wrote: > Hi, > > Here's a new version of this patchset. > > The only change with the v5 is that I fixed the issue that Glenn > Washburn found (in the 4/6 patch, one of the grub_file_seek return > code wasn't prop

Re: GRUB build failure

2020-08-19 Thread Glenn Washburn
On Wed, 19 Aug 2020 10:30:34 + Naveen Chaudhary wrote: > Hi, > > I figured out that I should add "--disable-werror" to the configure. > > After this I was able to build successfully. Hmm, interesting. I also compile on ubuntu (upgrade to 20.04) with no added CFLAGS and do not have this

Re: [PATCH] cryptodisk: Incorrect calculation of sector in grub_cryptodisk_read/write.

2020-08-26 Thread Glenn Washburn
On Wed, 26 Aug 2020 18:44:35 -0500 Glenn Washburn wrote: > Here dev is a grub_cryptodisk_t and dev->offset is offset in sectors > of size native to the cryptodisk device. The function grub_disk_read > expects that the given start sector is in the native grub sector > size, so d

[PATCH] cryptodisk: Incorrect calculation of sector in grub_cryptodisk_read/write.

2020-08-26 Thread Glenn Washburn
sector to convert disk sectors to grub sectors. Signed-off-by: Glenn Washburn --- grub-core/disk/cryptodisk.c | 11 --- include/grub/disk.h | 7 +++ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/grub-core/disk/cryptodisk.c b/grub-core/disk/cryptodisk.c

Re: [PATCH v2 0/9] Cryptodisk fixes for v2.06

2020-08-26 Thread Glenn Washburn
On Wed, 26 Aug 2020 10:13:18 +0200 Patrick Steinhardt wrote: > I didn't yet get your test series to work, Glenn. I'll try again on > another day as I'm not on top of things today. Meanwhile, could you > please give it a go with this updated patch series? I've tested with this patch series and

Re: [PATCH] v6 for detached headers and key files

2020-08-23 Thread Glenn Washburn
On Sat, 22 Aug 2020 00:25:18 +0200 Denis 'GNUtoo' Carikli wrote: > On Wed, 19 Aug 2020 13:59:57 -0500 > Glenn Washburn wrote: > > > I'm curious, are you using a virtual machine to test grub? If I > > understand correctly the above, you're using physical machines to >

Re: [PATCH 0/9] Cryptodisk fixes for v2.06

2020-08-24 Thread Glenn Washburn
On Sun, 23 Aug 2020 12:59:47 +0200 Patrick Steinhardt wrote: > Hi, > > I've sifted through the mailing list contents of the last few months > to cherry-pick cryptodisk bugfixes which I think should be included > in the v2.06 release. I've found the following 9 patches from Glenn > and me which

Re: [CRYPTO-LUKS v1 03/19] cryptodisk: Incorrect calculation of start sector for grub_disk_read in grub_cryptodisk_read.

2020-08-23 Thread Glenn Washburn
On Sun, 23 Aug 2020 12:39:03 +0200 Patrick Steinhardt wrote: > On Fri, Jul 31, 2020 at 07:01:44AM -0500, Glenn Washburn wrote: > > Here dev is a grub_cryptodisk_t and dev->offset is offset in > > sectors of size native to the cryptodisk device. The sector is > > correctly

Re: [PATCH 3/9] luks2: Fix use of incorrect index and some error messages

2020-08-24 Thread Glenn Washburn
3:07 +0200 Patrick Steinhardt wrote: > From: Glenn Washburn > > Signed-off-by: Glenn Washburn > Reviewed-by: Patrick Steinhardt > --- > grub-core/disk/luks2.c | 14 +++--- > 1 file changed, 7 insertions(+), 7 deletions(-) > > diff --git a/grub-core/disk/luk

[CRYPTO-LUKS v2 03/19] cryptodisk: Incorrect calculation of sector in grub_cryptodisk_read/write.

2020-08-24 Thread Glenn Washburn
e disk sector to grub sector size conversion. Signed-off-by: Glenn Washburn --- grub-core/disk/cryptodisk.c | 12 +--- include/grub/disk.h | 7 +++ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/grub-core/disk/cryptodisk.c b/grub-core/disk/cryptodisk.c

[CRYPTO-LUKS v3 03/19] cryptodisk: Incorrect calculation of start sector for grub_disk_read in grub_cryptodisk_read.

2020-08-24 Thread Glenn Washburn
elp us with this. Signed-off-by: Glenn Washburn --- grub-core/disk/cryptodisk.c | 11 --- include/grub/disk.h | 7 +++ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/grub-core/disk/cryptodisk.c b/grub-core/disk/cryptodisk.c index b87925ad3..38bd49835 100644 --- a/grub-cor

Re: [CRYPTO-LUKS v1 03/19] cryptodisk: Incorrect calculation of start sector for grub_disk_read in grub_cryptodisk_read.

2020-08-24 Thread Glenn Washburn
On Mon, 24 Aug 2020 07:10:51 +0200 Patrick Steinhardt wrote: > On Sun, Aug 23, 2020 at 11:31:46PM -0500, Glenn Washburn wrote: > > On Sun, 23 Aug 2020 12:39:03 +0200 > > Patrick Steinhardt wrote: > > ... > > > So the fix does seem correct to me, but I think it's

Re: [CRYPTO-LUKS v2 03/19] cryptodisk: Incorrect calculation of sector in grub_cryptodisk_read/write.

2020-08-24 Thread Glenn Washburn
Ignore this patch, I neglected to run my test until after I had sent the patch. My tests immediately found an error. Please see version v3. On Mon, 24 Aug 2020 18:42:30 -0500 Glenn Washburn wrote: > Here dev is a grub_cryptodisk_t and dev->offset is offset in sectors > of si

[CRYPTOMOUNT-TEST v2 6/7] tests: Add grub-shell-luks-tester to facilitate functional LUKS1/2 testing.

2020-08-17 Thread Glenn Washburn
Signed-off-by: Glenn Washburn --- Makefile.util.def| 6 + tests/util/grub-shell-luks-tester.in | 321 +++ 2 files changed, 327 insertions(+) create mode 100644 tests/util/grub-shell-luks-tester.in diff --git a/Makefile.util.def b/Makefile.util.def

[CRYPTOMOUNT-TEST v2 7/7] test: Add cryptomount test.

2020-08-17 Thread Glenn Washburn
Signed-off-by: Glenn Washburn --- Makefile.util.def | 6 ++ tests/grub_cmd_cryptomount.in | 154 ++ 2 files changed, 160 insertions(+) create mode 100644 tests/grub_cmd_cryptomount.in diff --git a/Makefile.util.def b/Makefile.util.def index

Re: [CRYPTOMOUNT-TEST 0/7] Add LUKS1/2 tests for cryptomount

2020-08-17 Thread Glenn Washburn
to mirror the LUKS1 tests). In the future, is it better to send out the full patchset again, even if most of the patches are unchanged? What's the best practice here? On Sun, 16 Aug 2020 19:05:11 -0500 Glenn Washburn wrote: > Grub maintainers, > > Here is a patch set that adds f

Re: [PATCH v3 4/9] luks2: grub_cryptodisk_t->total_length is the max number of device native sectors

2020-10-02 Thread Glenn Washburn
On Mon, 21 Sep 2020 13:23:04 +0200 Daniel Kiper wrote: > On Mon, Sep 21, 2020 at 06:28:28AM +0000, Glenn Washburn wrote: > > Sep 8, 2020 7:21:31 AM Daniel Kiper : > > > On Mon, Sep 07, 2020 at 05:27:46PM +0200, Patrick Steinhardt > > > wrote:

[PATCH 09/10] cryptodisk: Rename offset in grub_cryptodisk_t to offset_sectors.

2020-10-03 Thread Glenn Washburn
This makes it clear that the offset represents sectors, not bytes, in order to improve readability. Signed-off-by: Glenn Washburn --- grub-core/disk/cryptodisk.c | 10 +- grub-core/disk/geli.c | 2 +- grub-core/disk/luks.c | 4 ++-- grub-core/disk/luks2.c | 4

[PATCH 07/10] cryptodisk: Replace some literals with constants in grub_cryptodisk_endecrypt.

2020-10-03 Thread Glenn Washburn
This should improve readability of code by providing clues as to what the value represents. Signed-off-by: Glenn Washburn --- grub-core/disk/cryptodisk.c | 12 +++- include/grub/types.h| 3 +++ 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/grub-core/disk

[PATCH 10/10] luks2: Rename source disk variabled named 'disk' to 'source' as in luks.c.

2020-10-03 Thread Glenn Washburn
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

[PATCH 08/10] cryptodisk: Rename total_length field in grub_cryptodisk_t to total_sectors.

2020-10-03 Thread Glenn Washburn
This makes the creates an alignment with grub_disk_t naming of the same field and is more intuitive as to how it should be used. Signed-off-by: Glenn Washburn --- grub-core/disk/cryptodisk.c | 2 +- grub-core/disk/geli.c | 2 +- grub-core/disk/luks.c | 2 +- grub-core/disk/luks2.c

[PATCH 05/10] cryptodisk: Fix cipher IV mode 'plain64' always being set as 'plain'.

2020-10-03 Thread Glenn Washburn
When setting cipher IV mode, detection is done by prefix matching the cipher IV mode part of the cipher mode string. Since "plain" matches "plain64", we must check for "plain64" first. Otherwise, "plain64" will be detected as "plain". S

[PATCH 01/10] luks2: Fix use of incorrect index and some grub_error() messages.

2020-10-03 Thread Glenn Washburn
. Signed-off-by: Glenn Washburn --- grub-core/disk/luks2.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/grub-core/disk/luks2.c b/grub-core/disk/luks2.c index 31d7166fc..2241e0312 100644 --- a/grub-core/disk/luks2.c +++ b/grub-core/disk/luks2.c @@ -275,34 +275,34

[PATCH 00/10] Cryptodisk fixes for v2.06 redux

2020-10-03 Thread Glenn Washburn
t they aid in the understanding of the code by more accurately describing what the identifiers represent. 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 w

[PATCH 03/10] luks2: Use more intuitive keyslot key instead of index when naming keyslot.

2020-10-03 Thread Glenn Washburn
the index of the keyslot will mention keyslot 1 (its a zero-based index). Furthermore,with this change the keyslot number will align with the number used to reference the keyslot when using the --key-slot argument to cryptsetup. Signed-off-by: Glenn Washburn --- grub-core/disk/luks2.c | 23

[PATCH 06/10] cryptodisk: Properly handle non-512 byte sized sectors.

2020-10-03 Thread Glenn Washburn
is encrypted with 4K sector sizes, the split key encrypted area must be decrypted with a block size of 512 (ie the IV increments every 512 bytes). This made these changes less aestetically pleasing than desired. Signed-off-by: Glenn Washburn --- grub-core/disk/cryptodisk.c | 52

[PATCH 04/10] luks2: grub_cryptodisk_t->total_length is the max number of device native sectors

2020-10-03 Thread Glenn Washburn
the size of the underlying device to the cryptodisk sector size. And segment.size is in bytes which need to be converted to cryptodisk sectors. Also, removed an empty statement. Signed-off-by: Glenn Washburn --- grub-core/disk/luks2.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions

[PATCH 02/10] luks2: Improve readability in luks2_get_keyslot.

2020-10-03 Thread Glenn Washburn
t;i" is renamed to "keyslot_idx" and the loop variable "j" is renamed to "i". Error messages now distinguish between indexes and keys. The former include "index" in the error string, and the later are surrounded in quotes. Signed-off-by: Glenn Washburn

Re: [PATCH] error: Do compile-time format string checking on grub_error.

2020-10-03 Thread Glenn Washburn
On Thu, 17 Sep 2020 16:29:23 +0200 Daniel Kiper wrote: > On Fri, Jul 31, 2020 at 09:33:18AM -0500, Glenn Washburn wrote: > > Fix the many issues this uncovered mostly related to incorrect > > length modifiers. > > Did you test the 32-bit and 64-bit builds with this patch

[PATCH v2 06/10] cryptodisk: Properly handle non-512 byte sized sectors.

2020-10-03 Thread Glenn Washburn
is encrypted with 4K sector sizes, the split key encrypted area must be decrypted with a block size of 512 (ie the IV increments every 512 bytes). This made these changes less aestetically pleasing than desired. Signed-off-by: Glenn Washburn --- grub-core/disk/cryptodisk.c | 52

[PATCH v2 02/10] luks2: Improve readability in luks2_get_keyslot.

2020-10-03 Thread Glenn Washburn
t;i" is renamed to "keyslot_idx" and the loop variable "j" is renamed to "i". Error messages now distinguish between indexes and keys. The former include "index" in the error string, and the later are surrounded in quotes. Signed-off-by: Glenn Washburn

[PATCH v2 08/10] cryptodisk: Rename total_length field in grub_cryptodisk_t to total_sectors.

2020-10-03 Thread Glenn Washburn
This makes the creates an alignment with grub_disk_t naming of the same field and is more intuitive as to how it should be used. Signed-off-by: Glenn Washburn --- grub-core/disk/cryptodisk.c | 2 +- grub-core/disk/geli.c | 2 +- grub-core/disk/luks.c | 2 +- grub-core/disk/luks2.c

[PATCH v2 03/10] luks2: Use more intuitive keyslot key instead of index when naming keyslot.

2020-10-03 Thread Glenn Washburn
the index of the keyslot will mention keyslot 1 (its a zero-based index). Furthermore,with this change the keyslot number will align with the number used to reference the keyslot when using the --key-slot argument to cryptsetup. Signed-off-by: Glenn Washburn --- grub-core/disk/luks2.c | 27

[PATCH v2 01/10] luks2: Fix use of incorrect index and some grub_error() messages.

2020-10-03 Thread Glenn Washburn
. Signed-off-by: Glenn Washburn --- grub-core/disk/luks2.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/grub-core/disk/luks2.c b/grub-core/disk/luks2.c index 31d7166fc..2241e0312 100644 --- a/grub-core/disk/luks2.c +++ b/grub-core/disk/luks2.c @@ -275,34 +275,34

[PATCH v2 05/10] cryptodisk: Fix cipher IV mode 'plain64' always being set as 'plain'.

2020-10-03 Thread Glenn Washburn
When setting cipher IV mode, detection is done by prefix matching the cipher IV mode part of the cipher mode string. Since "plain" matches "plain64", we must check for "plain64" first. Otherwise, "plain64" will be detected as "plain". S

[PATCH v2 04/10] luks2: grub_cryptodisk_t->total_length is the max number of device native sectors

2020-10-03 Thread Glenn Washburn
the size of the underlying device to the cryptodisk sector size. And segment.size is in bytes which need to be converted to cryptodisk sectors. Also, removed an empty statement. Signed-off-by: Glenn Washburn --- grub-core/disk/luks2.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions

[PATCH v2 09/10] cryptodisk: Rename offset in grub_cryptodisk_t to offset_sectors.

2020-10-03 Thread Glenn Washburn
This makes it clear that the offset represents sectors, not bytes, in order to improve readability. Signed-off-by: Glenn Washburn --- grub-core/disk/cryptodisk.c | 10 +- grub-core/disk/geli.c | 2 +- grub-core/disk/luks.c | 4 ++-- grub-core/disk/luks2.c | 4

[PATCH v2 00/10] Cryptodisk fixes for v2.06 redux

2020-10-03 Thread Glenn Washburn
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

[PATCH v2 10/10] luks2: Rename source disk variabled named 'disk' to 'source' as in luks.c.

2020-10-03 Thread Glenn Washburn
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

[PATCH v2 07/10] cryptodisk: Replace some literals with constants in grub_cryptodisk_endecrypt.

2020-10-03 Thread Glenn Washburn
This should improve readability of code by providing clues as to what the value represents. Signed-off-by: Glenn Washburn --- grub-core/disk/cryptodisk.c | 12 +++- include/grub/types.h| 3 +++ 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/grub-core/disk

Re: [PATCH v3 9/9] cryptodisk: Properly handle non-512 byte sized sectors

2020-09-20 Thread Glenn Washburn
Sep 9, 2020 5:22:11 AM Daniel Kiper : > On Mon, Sep 07, 2020 at 05:28:08PM +0200, Patrick Steinhardt wrote: >> From: Glenn Washburn >> >> By default, dm-crypt internally uses an IV that corresponds to 512-byte >> sectors, even when a larger sector size is

Re: [PATCH v3 0/9] Cryptodisk fixes for v2.06

2020-09-20 Thread Glenn Washburn
;> Additionally, rename LOG_SECTOR_SIZE to LUKS_LOG_SECTOR_SIZE and >>> CRYPT_LOG_SECTOR_SIZE to GRUB_CRYPTODISK_IV_LOG_SIZE and moved to >>> cryptodisk.h.  Also a comment was reworded for clarity. > > A subset of these patches has been applied by Daniel, leaving us at > (rearranged for better re

Re: [PATCH v3 6/9] cryptodisk: Unregister cryptomount command when removing module

2020-09-21 Thread Glenn Washburn
Sep 8, 2020 7:28:13 AM Daniel Kiper : > On Mon, Sep 07, 2020 at 05:27:55PM +0200, Patrick Steinhardt wrote: >> From: Glenn Washburn >> >> Signed-off-by: Glenn Washburn >> Reviewed-by: Patrick Steinhardt >> --- >> grub-core/disk/cryptodisk.c | 1 + >&

Re: [PATCH v3 3/9] luks2: Fix use of incorrect index and some error messages

2020-09-21 Thread Glenn Washburn
Sep 8, 2020 6:58:48 AM Daniel Kiper : > On Mon, Sep 07, 2020 at 05:27:41PM +0200, Patrick Steinhardt wrote: >> From: Glenn Washburn > > It seems to me this patch should be split into two and and begs for > commit message improvement. In general it would be nice to know why >

Re: [PATCH v3 4/9] luks2: grub_cryptodisk_t->total_length is the max number of device native sectors

2020-09-21 Thread Glenn Washburn
Sep 8, 2020 7:21:31 AM Daniel Kiper : > On Mon, Sep 07, 2020 at 05:27:46PM +0200, Patrick Steinhardt wrote: >> From: Glenn Washburn >> >> The total_length field is named confusingly because length usually refers to >> bytes, whereas in this case its really

Re: [PATCH v3 07/10] cryptodisk: Replace some literals with constants in grub_cryptodisk_endecrypt.

2020-10-26 Thread Glenn Washburn
Oct 23, 2020 1:00:59 PM Patrick Steinhardt : > On Mon, Oct 19, 2020 at 06:09:55PM -0500, Glenn Washburn wrote: >> This should improve readability of code by providing clues as to what the >> value represents. >> >> Signed-off-by: Glenn Washburn >> --- &g

Re: [v5][ 4/6] cryptodisk: add support for LUKS1 detached headers

2020-08-04 Thread Glenn Washburn
Thanks Denis for taking the lead in trying to get these patches included. One issue I've found that make LUKS1 detached header support unusable is below. On Thu, 11 Jun 2020 18:18:05 +0200 Denis 'GNUtoo' Carikli wrote: > From: John Lane > > cryptsetup supports having a detached header

[CRYPTO-LUKS v1 13/19] fs: Allow number of blocks in block list to be optional, where length will be defaulted to the length of the device.

2020-07-31 Thread Glenn Washburn
o the rest of the disk. There is currently not a good way with in grub to programmatically get the number of sectors on a disk to select the appropriate number of sectors. Signed-off-by: Glenn Washburn --- grub-core/kern/fs.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/grub

[CRYPTO-LUKS v1 06/19] luks2: Rename source disk variabled named 'disk' to 'source' as in luks.c.

2020-07-31 Thread Glenn Washburn
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

[CRYPTO-LUKS v1 12/19] cryptodisk: Rename total_length field in grub_cryptodisk_t to total_sectors.

2020-07-31 Thread Glenn Washburn
This makes the creates an alignment with grub_disk_t naming of the same field and is more intuitive as to how it should be used. Signed-off-by: Glenn Washburn --- grub-core/disk/cryptodisk.c | 2 +- grub-core/disk/geli.c | 2 +- grub-core/disk/luks.c | 2 +- grub-core/disk/luks2.c

[CRYPTO-LUKS v1 10/19] fs: Fix block lists not being able to address to end of disk sometimes.

2020-07-31 Thread Glenn Washburn
When checking if a block list goes past the end of the disk, make sure the total size of the disk is in grub native sector sizes, otherwise there will be blocks at the end of the disk unaccessible by block lists. Signed-off-by: Glenn Washburn --- grub-core/kern/fs.c | 4 +++- 1 file changed, 3

[CRYPTO-LUKS v1 02/19] cryptodisk: Fix cipher IV mode 'plain64' always being set as 'plain'.

2020-07-31 Thread Glenn Washburn
Signed-off-by: Glenn Washburn --- grub-core/disk/cryptodisk.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/grub-core/disk/cryptodisk.c b/grub-core/disk/cryptodisk.c index 1897acc4b..d8f66e9ef 100644 --- a/grub-core/disk/cryptodisk.c +++ b/grub-core/disk/cryptodisk.c

  1   2   3   4   5   6   7   8   9   10   >