[PATCH v4 7/7] cryptodisk: Improve handling of partition name in cryptomount password prompt

2021-12-03 Thread Glenn Washburn
Call grub_partition_get_name unconditionally to initialize the part variable. Then part will only be NULL when grub_partition_get_name errors. Note that when source->partition is NULL, then grub_partition_get_name returns an allocated empty string. So no comma or partition will be printed, as

Re: [PATCH v3 2/4] cryptodisk: Refactor password input out of crypto dev modules into cryptodisk

2021-12-03 Thread Glenn Washburn
On Fri, 3 Dec 2021 22:35:11 +0100 Daniel Kiper wrote: > On Fri, Dec 03, 2021 at 03:04:36PM -0600, Glenn Washburn wrote: > > On Wed, 17 Nov 2021 20:10:21 +0100 > > Daniel Kiper wrote: > > > > > On Tue, Oct 12, 2021 at 06:26:27PM -0500, Glenn Washburn wrote: > > > > The crypto device modules

[PATCH v4 5/7] cryptodisk: Refactor password input out of crypto dev modules into cryptodisk

2021-12-03 Thread Glenn Washburn
The crypto device modules should only be setting up the crypto devices and not getting user input. This has the added benefit of simplifying the code such that three essentially duplicate pieces of code are merged into one. Add documentation of passphrase option for cryptomount as it is now

[PATCH v4 4/7] cryptodisk: Add infrastructure to pass data from cryptomount to cryptodisk modules

2021-12-03 Thread Glenn Washburn
Previously, the cryptomount arguments were passed by global variable and function call argument, neither of which are ideal. This change passes data via a grub_cryptomount_args struct, which can be added to over time as opposed to continually adding arguments to the cryptodisk scan and

[PATCH v4 3/7] cryptodisk: Improve error messaging in cryptomount invocations

2021-12-03 Thread Glenn Washburn
Update such that "cryptomount -u UUID" will not print two error messages when an invalid passphrase is given and the most relevant error message will be displayed. Improve error message which is displayed when a UUID is specified, but no cryptodisk backends find a disk with that UUID. Also, make

[PATCH v4 6/7] cryptodisk: Move global variables into grub_cryptomount_args struct

2021-12-03 Thread Glenn Washburn
Note that cargs.search_uuid does not need to be initialized in various parts of the cryptomount argument parsing, just once when cargs is declared with a struct initializer. The previous code used a global variable which would retain the value across cryptomount invocations. Signed-off-by: Glenn

[PATCH v4 2/7] cryptodisk: Refactor to discard have_it global

2021-12-03 Thread Glenn Washburn
The global "have_it" was never used by the crypto-backends, but was used to determine if a crypto-backend successfully mounted a cryptodisk with a given uuid. This is not needed however, because grub_device_iterate() will return 1 if and only if grub_cryptodisk_scan_device() returns 1. And

[PATCH v4 0/7] Refactor/improve cryptomount data passing to crypto modules

2021-12-03 Thread Glenn Washburn
Updates since v3: * Many updates based on feedback from Daniel and Patrick * Make removal of global "have_it" happen before rearchitecting cryptomount arg passing * Add changes that improve cryptomount error messaging --- This patch series refactors the way cryptomount passes data to the crypto

[PATCH v4 1/7] luks2: Add debug message to align with luks and geli modules

2021-12-03 Thread Glenn Washburn
Signed-off-by: Glenn Washburn --- grub-core/disk/luks2.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/grub-core/disk/luks2.c b/grub-core/disk/luks2.c index 371a53b83..fea196dd4 100644 --- a/grub-core/disk/luks2.c +++ b/grub-core/disk/luks2.c @@ -370,7 +370,10 @@

Re: [PATCH v3 2/4] cryptodisk: Refactor password input out of crypto dev modules into cryptodisk

2021-12-03 Thread Glenn Washburn
On Wed, 17 Nov 2021 20:10:21 +0100 Daniel Kiper wrote: > On Tue, Oct 12, 2021 at 06:26:27PM -0500, Glenn Washburn wrote: > > The crypto device modules should only be setting up the crypto devices and > > not getting user input. This has the added benefit of simplifying the code > > such that

Re: [PATCH v3 2/4] cryptodisk: Refactor password input out of crypto dev modules into cryptodisk

2021-12-03 Thread Daniel Kiper
On Fri, Dec 03, 2021 at 03:04:36PM -0600, Glenn Washburn wrote: > On Wed, 17 Nov 2021 20:10:21 +0100 > Daniel Kiper wrote: > > > On Tue, Oct 12, 2021 at 06:26:27PM -0500, Glenn Washburn wrote: > > > The crypto device modules should only be setting up the crypto devices and > > > not getting user

[PATCH] grub-mkconfig: restore umask for grub.cfg

2021-12-03 Thread Michael Chang via Grub-devel
Since commit: ab2e53c8a grub-mkconfig: Honor a symlink when generating configuration by grub-mkconfig has inadvertently discarded umask for creating grub.cfg in the process of grub-mkconfig. The resulting wrong permission (0644) would allow unprivileged users to read grub's configuration file

Re: [PATCH v3 4/4] cryptodisk: Remove unneeded found_uuid from cryptomount args

2021-12-03 Thread Daniel Kiper
On Thu, Dec 02, 2021 at 12:51:09AM -0600, Glenn Washburn wrote: > On Thu, 18 Nov 2021 15:25:44 +0100 > Daniel Kiper wrote: > > > On Tue, Oct 12, 2021 at 06:26:29PM -0500, Glenn Washburn wrote: > > > The member found_uuid was never used by the crypto-backends, but was used > > > to > > > > Ha!

Re: [PATCH v3 1/4] cryptodisk: Add infrastructure to pass data from cryptomount to cryptodisk modules

2021-12-03 Thread Daniel Kiper
On Wed, Dec 01, 2021 at 03:18:06PM -0600, Glenn Washburn wrote: > On Wed, 17 Nov 2021 18:29:36 +0100 > Daniel Kiper wrote: > > > On Tue, Oct 12, 2021 at 06:26:26PM -0500, Glenn Washburn wrote: > > > As an example, passing a password as a cryptomount argument is > > > implemented. > > > > I am

Re: [PATCH v3 2/4] cryptodisk: Refactor password input out of crypto dev modules into cryptodisk

2021-12-03 Thread Daniel Kiper
On Wed, Dec 01, 2021 at 03:48:40PM -0600, Glenn Washburn wrote: > On Wed, 17 Nov 2021 20:10:21 +0100 > Daniel Kiper wrote: > > > On Tue, Oct 12, 2021 at 06:26:27PM -0500, Glenn Washburn wrote: > > > The crypto device modules should only be setting up the crypto devices and > > > not getting user