[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v5 2/9] cryptodisk: Refactor to discard have_it global
From: |
Daniel Kiper |
Subject: |
Re: [PATCH v5 2/9] cryptodisk: Refactor to discard have_it global |
Date: |
Thu, 16 Dec 2021 20:11:39 +0100 |
User-agent: |
NeoMutt/20170113 (1.7.2) |
On Thu, Dec 09, 2021 at 11:14:51AM -0600, Glenn Washburn wrote:
> 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
> grub_cryptodisk_scan_device() will now only return 1 if a search_uuid has
> been specified and a cryptodisk was successfully setup by a crypto-backend or
> a cryptodisk of the requested uuid is already open.
>
> To implement this grub_cryptodisk_scan_device_real is modified to return a
> cryptodisk or NULL on failure and having the appropriate grub_errno set to
> indicated failure. Note that grub_cryptodisk_scan_device_real will fail now
> with a new errno GRUB_ERR_BAD_MODULE when none of the cryptodisk backend
> modules succeed in identifying the source disk.
>
> With this change grub_device_iterate() will return 1 when a crypto device is
> successfully decrypted or when the source device has already been
> successfully opened. Prior to this change, trying to mount an already
> successfully opened device would trigger an error with the message "no such
> cryptodisk found", which is at best misleading. The mount should silently
> succeed in this case, which is what happens with this patch.
>
> Signed-off-by: Glenn Washburn <development@efficientek.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
Daniel
- [PATCH v5 0/9] Refactor/improve cryptomount data passing to crypto modules, Glenn Washburn, 2021/12/09
- [PATCH v5 1/9] luks2: Add debug message to align with luks and geli modules, Glenn Washburn, 2021/12/09
- [PATCH v5 2/9] cryptodisk: Refactor to discard have_it global, Glenn Washburn, 2021/12/09
- Re: [PATCH v5 2/9] cryptodisk: Refactor to discard have_it global,
Daniel Kiper <=
- [PATCH v5 4/9] cryptodisk: Improve error messaging in cryptomount invocations, Glenn Washburn, 2021/12/09
- [PATCH v5 3/9] cryptodisk: Return failure in cryptomount when no cryptodisk modules are loaded, Glenn Washburn, 2021/12/09
- [PATCH v5 5/9] cryptodisk: Improve cryptomount -u error message, Glenn Washburn, 2021/12/09
- [PATCH v5 7/9] cryptodisk: Refactor password input out of crypto dev modules into cryptodisk, Glenn Washburn, 2021/12/09
- [PATCH v5 6/9] cryptodisk: Add infrastructure to pass data from cryptomount to cryptodisk modules, Glenn Washburn, 2021/12/09