[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 @@

[CRYPTO-LUKS v1 00/19] Fixes and improvements for cryptodisks+luks2 and a few other things.

2020-07-31 Thread Glenn Washburn
I've changed the name of the patch series to make it more self-explanatory, but still incremented the version number. All of Patrick's suggestions have been added in. I've added 2 new patches, one suggested by Patrick for rename cryptodisk's offset member to offset_sectors. And another to rename

[CRYPTO-LUKS v1 01/19] configure: Add Ubuntu dejavu font path.

2020-07-31 Thread Glenn Washburn
Signed-off-by: Glenn Washburn --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 7c10a4db7..c6b0ef499 100644 --- a/configure.ac +++ b/configure.ac @@ -1678,7 +1678,7 @@ fi if test x"$starfield_excuse" = x; then for ext in

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

2020-07-31 Thread Glenn Washburn
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 transformed into native grub sector size, but then added to dev->offset which is not transformed. It would be nice if the type system would help us with this. Signe

[CRYPTO-LUKS v1 09/19] cryptodisk: Unregister cryptomount command when removing module.

2020-07-31 Thread Glenn Washburn
Signed-off-by: Glenn Washburn --- grub-core/disk/cryptodisk.c | 1 + 1 file changed, 1 insertion(+) diff --git a/grub-core/disk/cryptodisk.c b/grub-core/disk/cryptodisk.c index e7a4b8082..263ca2e1a 100644 --- a/grub-core/disk/cryptodisk.c +++ b/grub-core/disk/cryptodisk.c @@ -1319,5 +1319,6 @@ G

[CRYPTO-LUKS v1 05/19] luks2: Add support for LUKS2 in (proc)/luks_script

2020-07-31 Thread Glenn Washburn
The sector size in bytes is added to each line and it is allowed to be 4 decimal digits long, which covers the most common cases of 512 and 4096 byte sectors. The size allocation is updated to reflect this additional field, allow up to 4 characters and 1 space added. Signed-off-by: Glenn Washburn

[CRYPTO-LUKS v1 04/19] cryptodisk: Add more verbosity when reading/writing cryptodisks.

2020-07-31 Thread Glenn Washburn
Signed-off-by: Glenn Washburn --- grub-core/disk/cryptodisk.c | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/grub-core/disk/cryptodisk.c b/grub-core/disk/cryptodisk.c index 2791a4870..c21be7d52 100644 --- a/grub-core/disk/cryptodisk.c +++ b/grub-core/disk/cryptod

[CRYPTO-LUKS v1 07/19] luks2: grub_cryptodisk_t->total_length is the max number of device native sectors.

2020-07-31 Thread Glenn Washburn
The total_length field is named confusingly because length usually refers to bytes, whereas in this case its really the total number of sectors on the device. Also counter-intuitively, grub_disk_get_size returns the total number of device native sectors sectors. We need to convert the sectors from

[CRYPTO-LUKS v1 11/19] cryptodisk: Properly handle non-512 byte sized sectors.

2020-07-31 Thread 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 that when using a larger sector size, the IV is incremented every sector. However, the amount the IV is incremented is the number of 512 byte blocks in a

[CRYPTO-LUKS v1 14/19] loopback: Add procfs entry 'loopbacks' to output configured loopback devices.

2020-07-31 Thread Glenn Washburn
Signed-off-by: Glenn Washburn --- grub-core/disk/loopback.c | 56 +++ 1 file changed, 56 insertions(+) diff --git a/grub-core/disk/loopback.c b/grub-core/disk/loopback.c index cdf9123fa..6a2be257b 100644 --- a/grub-core/disk/loopback.c +++ b/grub-core/disk/loo

[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 i

[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 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
This is primarily useful to do something like "loopback newdev (dev)8+" to create a device that skips the first 4K, which may contain a non-standard RAID1 header that grub does not recognize. This would allow that initial data to be accessed and potentially mounted by grub up to the rest of the dis

[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-cor

[CRYPTO-LUKS v1 15/19] cryptodisk, luks2: Add header line to procfs entry and crypto and source device names.

2020-07-31 Thread Glenn Washburn
A header line is added to luks_script for easier comprehension of fields by user. And the crypto disk name and source device names are added. Signed-off-by: Glenn Washburn --- grub-core/disk/cryptodisk.c | 28 ++-- 1 file changed, 22 insertions(+), 6 deletions(-) diff --

[CRYPTO-LUKS v1 17/19] luks2: Ensure that bit fields of grub_luks2_digest_t in luks2_parse_digest are initialized before returning.

2020-07-31 Thread Glenn Washburn
Signed-off-by: Glenn Washburn --- grub-core/disk/luks2.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/grub-core/disk/luks2.c b/grub-core/disk/luks2.c index 28d9fe0e0..58bb4b9ef 100644 --- a/grub-core/disk/luks2.c +++ b/grub-core/disk/luks2.c @@ -230,6 +230,7 @@ luks2_parse_digest (grub_l

[CRYPTO-LUKS v1 08/19] cryptodisk, luks: Allow special processing for comparing UUIDs.

2020-07-31 Thread Glenn Washburn
Create grub_uuidcasecmp to compare UUIDs in a case-insensitive manner and that ignores '-' characters. This is backwards compatible with the old LUKS1 code that stored and compared against UUIDs without dashes. However, the new LUKS2 code stores and compares UUIDs that contain dashes. Really, the U

[CRYPTO-LUKS v1 16/19] cryptodisk: Add a couple comments noting the usage of a couple fields in grub_cryptodisk_t as is done for grub_disk_t.

2020-07-31 Thread Glenn Washburn
Signed-off-by: Glenn Washburn --- include/grub/cryptodisk.h | 6 ++ 1 file changed, 6 insertions(+) diff --git a/include/grub/cryptodisk.h b/include/grub/cryptodisk.h index f9e42796e..8d3284aad 100644 --- a/include/grub/cryptodisk.h +++ b/include/grub/cryptodisk.h @@ -66,9 +66,15 @@ struct g

[CRYPTO-LUKS v1 18/19] luks2: Fix use of incorrect index and some error messages.

2020-07-31 Thread Glenn Washburn
Signed-off-by: Glenn Washburn --- grub-core/disk/luks2.c | 35 ++- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/grub-core/disk/luks2.c b/grub-core/disk/luks2.c index 58bb4b9ef..09584c84c 100644 --- a/grub-core/disk/luks2.c +++ b/grub-core/disk/lu

[CRYPTO-LUKS v1 19/19] cryptodisk: Rename offset in grub_cryptodisk_t to offset_sectors to improve readability.

2020-07-31 Thread Glenn Washburn
Signed-off-by: Glenn Washburn --- grub-core/disk/cryptodisk.c | 12 ++-- grub-core/disk/geli.c | 2 +- grub-core/disk/luks.c | 4 ++-- grub-core/disk/luks2.c | 4 ++-- include/grub/cryptodisk.h | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a

[PATCH] cryptodisk: Use cipher name instead of object in error message.

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 9d2f0d635..4a35c0478 100644 --- a/grub-core/disk/cryptodisk.c +++ b/grub-core/disk/cryptodisk.c @@

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

2020-07-31 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| 8 grub-core/disk/dmraid_nvidia.c | 2 +- g

[PATCH] lexer: char const * should be const char *.

2020-07-31 Thread Glenn Washburn
Signed-off-by: Glenn Washburn --- grub-core/script/lexer.c | 2 +- include/grub/script_sh.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/grub-core/script/lexer.c b/grub-core/script/lexer.c index 27daad791..52004d059 100644 --- a/grub-core/script/lexer.c +++ b/grub-core/s

[PATCH] script: Do not allow a delimiter between function name and block start.

2020-07-31 Thread Glenn Washburn
Currently the following is valid syntax, but should be a syntax error: grub> function f; { echo HERE; } grub> f HERE This fix is not backward compatible, but current syntax is not documented either and has no functional value. So any scripts with this unintended syntax are technically syntactical

[PATCH] docs/grub: Support for loading and concatenating multiple initrds.

2020-07-31 Thread Glenn Washburn
This has been available since January of 2012, but has not been documented. Signed-off-by: Glenn Washburn --- docs/grub.texi | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/docs/grub.texi b/docs/grub.texi index 1ce9993a5..935aa1bf3 100644 --- a/docs/gru

[PATCH] crypto: Remove GPG_ERROR_CFLAGS from gpg_err_code_t enum.

2020-07-31 Thread Glenn Washburn
This was probably added by accident when originally creating the file. Signed-off-by: Glenn Washburn --- include/grub/crypto.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/grub/crypto.h b/include/grub/crypto.h index a24e89dd9..21cd1f75a 100644 --- a/include/grub/crypto.h +++ b/incl

Re: [CRYPTO-LUKS v1 08/19] cryptodisk, luks: Allow special processing for comparing UUIDs.

2020-07-31 Thread Patrick Steinhardt
On Fri, Jul 31, 2020 at 07:01:49AM -0500, Glenn Washburn wrote: > Create grub_uuidcasecmp to compare UUIDs in a case-insensitive manner and > that ignores '-' characters. This is backwards compatible with the old LUKS1 > code that stored and compared against UUIDs without dashes. However, the new >

Re: [CRYPTO-LUKS v1 15/19] cryptodisk,luks2: Add header line to procfs entry and crypto and source device names.

2020-07-31 Thread Patrick Steinhardt
On Fri, Jul 31, 2020 at 07:01:56AM -0500, Glenn Washburn wrote: > A header line is added to luks_script for easier comprehension of fields by > user. And the crypto disk name and source device names are added. > > Signed-off-by: Glenn Washburn > --- > grub-core/disk/cryptodisk.c | 28 +++

Re: [CRYPTO-LUKS v1 00/19] Fixes and improvements for cryptodisks+luks2 and a few other things.

2020-07-31 Thread Patrick Steinhardt
On Fri, Jul 31, 2020 at 07:01:41AM -0500, Glenn Washburn wrote: > I've changed the name of the patch series to make it more self-explanatory, > but > still incremented the version number. All of Patrick's suggestions have been > added in. I've added 2 new patches, one suggested by Patrick for re

Re: [CRYPTO-LUKS v1 15/19] cryptodisk,luks2: Add header line to procfs entry and crypto and source device names.

2020-07-31 Thread Glenn Washburn
On Fri, 31 Jul 2020 17:37:46 +0200 Patrick Steinhardt wrote: > On Fri, Jul 31, 2020 at 07:01:56AM -0500, Glenn Washburn wrote: > > A header line is added to luks_script for easier comprehension of > > fields by user. And the crypto disk name and source device names > > are added. > > > > Signed-