Re: [PATCH v4 01/15] cryptodisk: Rename total_length field in grub_cryptodisk_t to total_sectors.

2020-11-15 Thread Patrick Steinhardt
On Fri, Nov 06, 2020 at 10:44:21PM -0600, Glenn Washburn wrote: > 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 Reviewed-by: Patrick Steinhardt > --- > grub-core/disk/cryptodisk.c | 2

Re: [PATCH v4 02/15] cryptodisk: Rename offset in grub_cryptodisk_t to offset_sectors.

2020-11-15 Thread Patrick Steinhardt
On Fri, Nov 06, 2020 at 10:44:22PM -0600, Glenn Washburn wrote: > This makes it clear that the offset represents sectors, not bytes, in order > to improve readability. > > Signed-off-by: Glenn Washburn Reviewed-by: Patrick Steinhardt > --- > grub-core/disk/cryptodisk.c | 10 +- > grub

Re: [PATCH v4 03/15] luks2: Rename source disk variabled named 'disk' to 'source' as in luks.c.

2020-11-15 Thread Patrick Steinhardt
On Fri, Nov 06, 2020 at 10:44:23PM -0600, 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 cryptodisk. > > Signed-off-by: Glenn Washburn Reviewed-by: Patrick Steinhardt > --- > grub-core/dis

Re: [PATCH v4 04/15] types: Define GRUB_CHAR_BIT based on compiler macro instead of using literal.

2020-11-15 Thread Patrick Steinhardt
On Fri, Nov 06, 2020 at 10:44:24PM -0600, Glenn Washburn wrote: > Signed-off-by: Glenn Washburn > --- > include/grub/types.h | 10 -- > 1 file changed, 8 insertions(+), 2 deletions(-) > > diff --git a/include/grub/types.h b/include/grub/types.h > index 035a4b528..495c86bb1 100644 > --- a

Re: [PATCH v4 06/15] luks2: Rename variable i to keyslot_idx in luks2_get_keyslot.

2020-11-15 Thread Patrick Steinhardt
On Fri, Nov 06, 2020 at 10:44:26PM -0600, Glenn Washburn wrote: > Variables named i are usually looping variables, so rename to keyslot_idx to > allow for easier reading of luks2_get_keyslot. > > Signed-off-by: Glenn Washburn Reviewed-by: Patrick Steinhardt > --- > grub-core/disk/luks2.c | 8

Re: [PATCH v4 05/15] luks2: Use correct index variable when looping in luks2_get_keyslot.

2020-11-15 Thread Patrick Steinhardt
On Fri, Nov 06, 2020 at 10:44:25PM -0600, Glenn Washburn wrote: > The loop variable j should be used to index the digests and segments json > array, instead of the variable i, which is the keyslot index. > > Signed-off-by: Glenn Washburn Reviewed-by: Patrick Steinhardt > --- > grub-core/disk/

Re: [PATCH v4 07/15] luks2: Rename index variable j to i.

2020-11-15 Thread Patrick Steinhardt
On Fri, Nov 06, 2020 at 10:44:27PM -0600, Glenn Washburn wrote: > Looping variable j was named such because the variable name i was taken. > Since i has been renamed in the previous patch, we can rename j to i. > > Signed-off-by: Glenn Washburn Reviewed-by: Patrick Steinhardt > --- > grub-cor

Re: [PATCH v4 08/15] luks2: Split idx into three variables: keyslot_key, digest_key, segment_key.

2020-11-15 Thread Patrick Steinhardt
On Fri, Nov 06, 2020 at 10:44:28PM -0600, Glenn Washburn wrote: > 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 variabl

Re: [PATCH v4 09/15] luks2: Improve error messages in luks2_get_keyslot.

2020-11-15 Thread Patrick Steinhardt
On Fri, Nov 06, 2020 at 10:44:29PM -0600, Glenn Washburn wrote: > 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 Reviewed-by: Patrick Steinhardt > --- > grub-

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

2020-11-15 Thread Patrick Steinhardt
On Fri, Nov 06, 2020 at 10:44:30PM -0600, 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 the end user. For > example, say you have a LUKS2 device with a key in slot 1 and slot 4. When >

Re: [PATCH v4 11/15] cryptodisk: Replace some literals with constants in grub_cryptodisk_endecrypt.

2020-11-15 Thread Patrick Steinhardt
On Fri, Nov 06, 2020 at 10:44:31PM -0600, Glenn Washburn wrote: > This should improve readability of code by providing clues as to what the > value represents. The new macro GRUB_TYPE_BITS(type) returns the number of > bits allocated for type. Also add GRUB_TYPE_U_MAX/MIN(type) macros to get > the

Re: [PATCH v4 12/15] luks2: grub_cryptodisk_t->total_length is the max number of device native sectors

2020-11-15 Thread Patrick Steinhardt
On Fri, Nov 06, 2020 at 10:44:32PM -0600, Glenn Washburn wrote: > 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 > numbe

Re: [PATCH v4 13/15] cryptodisk: Properly handle non-512 byte sized sectors.

2020-11-15 Thread Patrick Steinhardt
On Fri, Nov 06, 2020 at 10:44:33PM -0600, 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 this means is > that when using a larger sector size, the IV is incremented every sector. > However,

Re: [PATCH v4 14/15] luks2: Better error handling when setting up the cryptodisk.

2020-11-15 Thread Patrick Steinhardt
On Fri, Nov 06, 2020 at 10:44:34PM -0600, Glenn Washburn wrote: > Signed-off-by: Glenn Washburn A commit message would help to set the stage for your changes here, especially so as they're non-trivial. > --- > grub-core/disk/luks2.c | 70 +++--- > include/gru

Re: [PATCH v4 15/15] luks2: Error check segment.sector_size.

2020-11-15 Thread Patrick Steinhardt
On Fri, Nov 06, 2020 at 10:44:35PM -0600, Glenn Washburn wrote: > Signed-off-by: Glenn Washburn Reviewed-by: Patrick Steinhardt > --- > grub-core/disk/luks2.c | 11 +++ > 1 file changed, 11 insertions(+) > > diff --git a/grub-core/disk/luks2.c b/grub-core/disk/luks2.c > index 751b48d6

Re: [PATCH v2 1/3] cryptodisk: make the password getter and additional argument to recover_key

2020-11-15 Thread Patrick Steinhardt
On Fri, Nov 13, 2020 at 02:25:08PM -0800, James Bottomley wrote: > For AMD SEV environments, the grub boot password has to be retrieved > from a given memory location rather than prompted for. This means > that the standard password getter needs to be replaced with one that > gets the passphrase f

Re: [PATCH v2 0/3] Add ability to use SEV provisioned secrets for disk decryption

2020-11-15 Thread Patrick Steinhardt
On Fri, Nov 13, 2020 at 07:50:38PM -0600, Glenn Washburn wrote: > On Fri, 13 Nov 2020 14:25:07 -0800 > James Bottomley wrote: > > > v2: update geli.c to use conditional prompt and add callback for > > variable message printing and secret destruction > > > > To achieve encrypted disk images i

Re: [SPECIFICATION RFC] The firmware and bootloader log specification

2020-11-15 Thread James Courtier-Dutton
On Sat, 14 Nov 2020 at 12:37, Nico Huber wrote: > > (I think > > newer spec versions should not change anything in first 5 bf_log > members; > > this way older log parsers will be able to traverse/copy all logs > regardless > > of version used in one log or another), > > Good point, w

Antw: [EXT] [systemd-devel] [SPECIFICATION RFC] The firmware and bootloader log specification

2020-11-15 Thread Ulrich Windl
>>> Daniel Kiper schrieb am 14.11.2020 um 00:52 in Nachricht <20201113235242.k6fzlwmwm2xqh...@tomti.i.net-space.pl>: ... > The members of struct bf_log_msg: > ‑ size: total size of bf_log_msg struct, > ‑ ts_nsec: timestamp expressed in nanoseconds starting from 0, Who or what defines t == 0?