mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-15 21:00:05 +01:00
Fix init_by_name to allow unknown cipher format in dm-crypt as null context.
Deactivation code should deactivate dm-crypt device even if it is unknown for libcryptsetup. Previous fix for cipher specification was too strict. Let's allow initialization as null context, that allow status and deactivate to be usable again.
This commit is contained in:
@@ -1276,6 +1276,12 @@ static int _init_by_name_crypt(struct crypt_device *cd, const char *name)
|
||||
r = crypt_parse_name_and_mode(tgt->type == DM_LINEAR ? "null" : tgt->u.crypt.cipher, cipher,
|
||||
&key_nums, cipher_mode);
|
||||
if (r < 0) {
|
||||
/* Allow crypt null context with unknown cipher string */
|
||||
if (tgt->type == DM_CRYPT && !tgt->u.crypt.integrity) {
|
||||
crypt_set_null_type(cd);
|
||||
r = 0;
|
||||
goto out;
|
||||
}
|
||||
log_err(cd, _("No known cipher specification pattern detected for active device %s."), name);
|
||||
goto out;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user