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
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
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.
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 ++--
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
Introduce new variables keyslot_key, digest_key, and segment_key which
represent the integer key of the item in the respective associative array
when looping over the array items. This replaces using a generically
named variable named "idx" used for all three values. The parameter "i"
is renamed
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
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 the end user. For
example, say you have a LUKS2 device with a key in slot 1 and slot 4. When
using the password for slot 4 to unlock the device, the messages using
When looping over the digests and segments, the loop variable is j, but the
variable i is used to index in the the digests and segments json array. The
variable i is the keyslot index. Similarly, there are several grub_error()
statements using the wrong index in constructing the error string.
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".
Signed-off-by: Glenn Washburn
Reviewed-by: Patrick
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
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?
>
> Daniel
I have
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 ++--
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
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
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
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".
Signed-off-by: Glenn Washburn
Reviewed-by: Patrick
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 the end user. For
example, say you have a LUKS2 device with a key in slot 1 and slot 4. When
using the password for slot 4 to unlock the device, the messages using
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
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
Introduce new variables keyslot_key, digest_key, and segment_key which
represent the integer key of the item in the respective associative array
when looping over the array items. This replaces using a generically
named variable named "idx" used for all three values. The parameter "i"
is renamed
When looping over the digests and segments, the loop variable is j, but the
variable i is used to index in the the digests and segments json array. The
variable i is the keyslot index. Similarly, there are several grub_error()
statements using the wrong index in constructing the error string.
This series is meant to address concerns Daniel had for patches 3, 4, 8, and 9
of Daniel's series with subject "[PATCH 0/9] Cryptodisk fixes for v2.06". These
were patches authored by me and which Daniel handed back for me to take the lead
in getting accepted. This series warrants a new thread
23 matches
Mail list logo