mirror of
https://github.com/AuxXxilium/eudev.git
synced 2024-12-22 23:36:40 +07:00
cryptsetup: hash=plain means don't use a hash
"plain" is a semantic value that cryptsetup(8) uses to describe a plain dm-crypt volume that does not use a hash. Catch this value earlier and ensure that a NULL params.hash is passed to crypt_format to avoid passing an invalid hash type to the libcryptsetup backend. FDO bug #56593.
This commit is contained in:
parent
aea54018a5
commit
65343c7494
@ -342,7 +342,12 @@ int main(int argc, char *argv[]) {
|
||||
|
||||
opt_tries = opt_tries > 0 ? opt_tries : 3;
|
||||
opt_key_size = (opt_key_size > 0 ? opt_key_size : 256);
|
||||
hash = opt_hash ? opt_hash : "ripemd160";
|
||||
if (opt_hash) {
|
||||
/* plain isn't a real hash type. it just means "use no hash" */
|
||||
if (!streq(opt_hash, "plain"))
|
||||
hash = opt_hash;
|
||||
} else
|
||||
hash = "ripemd160";
|
||||
|
||||
if (opt_cipher) {
|
||||
size_t l;
|
||||
@ -463,7 +468,7 @@ int main(int argc, char *argv[]) {
|
||||
opt_keyfile_size,
|
||||
¶ms);
|
||||
|
||||
pass_volume_key = streq(hash, "plain");
|
||||
pass_volume_key = !!hash;
|
||||
}
|
||||
|
||||
if (k < 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user