]> git.proxmox.com Git - grub2.git/commit
luks: Move configuration of ciphers into cryptodisk
authorPatrick Steinhardt <ps@pks.im>
Fri, 27 Dec 2019 15:18:38 +0000 (16:18 +0100)
committerDaniel Kiper <daniel.kiper@oracle.com>
Fri, 10 Jan 2020 13:29:37 +0000 (14:29 +0100)
commitdd3f49b106497416d4da557e8d583e1e9d6f2357
tree093726383f7a4542779d80587cabe0b217552ece
parent5324c335b1b1c1cdf40753d94360ec5debd8a46f
luks: Move configuration of ciphers into cryptodisk

The luks module contains quite a lot of logic to parse cipher and
cipher-mode strings like aes-xts-plain64 into constants to apply them
to the grub_cryptodisk_t structure. This code will be required by the
upcoming luks2 module, as well, which is why this commit moves it into
its own function grub_cryptodisk_setcipher in the cryptodisk module.
While the strings are probably rather specific to the LUKS modules, it
certainly does make sense that the cryptodisk module houses code to set
up its own internal ciphers instead of hosting that code in the luks
module.

Except for necessary adjustments around error handling, this commit does
an exact move of the cipher configuration logic from luks.c to
cryptodisk.c. Any behavior changes are unintentional.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
grub-core/disk/cryptodisk.c
grub-core/disk/luks.c
include/grub/cryptodisk.h