mirror of
https://git.proxmox.com/git/grub2
synced 2025-07-24 17:01:34 +00:00
cryptodisk: Fix cipher IV mode "plain64" always being set as "plain"
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> Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
This commit is contained in:
parent
2df2912266
commit
6355ba91e5
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user