[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 05/10] cryptodisk: Fix cipher IV mode 'plain64' always being s
From: |
Glenn Washburn |
Subject: |
[PATCH v3 05/10] cryptodisk: Fix cipher IV mode 'plain64' always being set as 'plain'. |
Date: |
Mon, 19 Oct 2020 18:09:53 -0500 |
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 <development@efficientek.com>
Reviewed-by: Patrick Steinhardt <ps@pks.im>
---
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 13af84dd1..a3d672f68 100644
--- a/grub-core/disk/cryptodisk.c
+++ b/grub-core/disk/cryptodisk.c
@@ -501,10 +501,10 @@ grub_cryptodisk_setcipher (grub_cryptodisk_t crypt, const
char *ciphername, cons
if (cipheriv == NULL)
;
- else if (grub_memcmp (cipheriv, "plain", sizeof ("plain") - 1) == 0)
- mode_iv = GRUB_CRYPTODISK_MODE_IV_PLAIN;
else if (grub_memcmp (cipheriv, "plain64", sizeof ("plain64") - 1) == 0)
mode_iv = GRUB_CRYPTODISK_MODE_IV_PLAIN64;
+ else if (grub_memcmp (cipheriv, "plain", sizeof ("plain") - 1) == 0)
+ mode_iv = GRUB_CRYPTODISK_MODE_IV_PLAIN;
else if (grub_memcmp (cipheriv, "benbi", sizeof ("benbi") - 1) == 0)
{
if (cipher->cipher->blocksize & (cipher->cipher->blocksize - 1)
--
2.27.0
- Re: [PATCH v3 01/10] luks2: Fix use of incorrect index and some grub_error() messages., (continued)
- Re: [PATCH v3 07/10] cryptodisk: Replace some literals with constants in grub_cryptodisk_endecrypt., Daniel Kiper, 2020/10/27
- [PATCH v3 10/10] luks2: Rename source disk variabled named 'disk' to 'source' as in luks.c., Glenn Washburn, 2020/10/19
- Re: [PATCH v3 10/10] luks2: Rename source disk variabled named 'disk' to 'source' as in luks.c., Patrick Steinhardt, 2020/10/23
- Re: [PATCH v3 10/10] luks2: Rename source disk variabled named 'disk' to 'source' as in luks.c., Daniel Kiper, 2020/10/27
- [PATCH v3 04/10] luks2: grub_cryptodisk_t->total_length is the max number of device native sectors, Glenn Washburn, 2020/10/19
- Re: [PATCH v3 04/10] luks2: grub_cryptodisk_t->total_length is the max number of device native sectors, Patrick Steinhardt, 2020/10/23
- [PATCH v3 05/10] cryptodisk: Fix cipher IV mode 'plain64' always being set as 'plain'.,
Glenn Washburn <=
- Re: [PATCH v3 05/10] cryptodisk: Fix cipher IV mode 'plain64' always being set as 'plain'., Daniel Kiper, 2020/10/23
- [PATCH v3 08/10] cryptodisk: Rename total_length field in grub_cryptodisk_t to total_sectors., Glenn Washburn, 2020/10/19
- Re: [PATCH v3 08/10] cryptodisk: Rename total_length field in grub_cryptodisk_t to total_sectors., Patrick Steinhardt, 2020/10/23
- Re: [PATCH v3 08/10] cryptodisk: Rename total_length field in grub_cryptodisk_t to total_sectors., Daniel Kiper, 2020/10/27
- [PATCH v3 09/10] cryptodisk: Rename offset in grub_cryptodisk_t to offset_sectors., Glenn Washburn, 2020/10/19
- Re: [PATCH v3 09/10] cryptodisk: Rename offset in grub_cryptodisk_t to offset_sectors., Patrick Steinhardt, 2020/10/23
- Re: [PATCH v3 09/10] cryptodisk: Rename offset in grub_cryptodisk_t to offset_sectors., Daniel Kiper, 2020/10/27
- [PATCH v3 06/10] cryptodisk: Properly handle non-512 byte sized sectors., Glenn Washburn, 2020/10/19
- Re: [PATCH v3 06/10] cryptodisk: Properly handle non-512 byte sized sectors., Patrick Steinhardt, 2020/10/23
- Re: [PATCH v3 06/10] cryptodisk: Properly handle non-512 byte sized sectors., Daniel Kiper, 2020/10/26