mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-14 12:20:00 +01:00
Fix reencryption to fail properly for unknown cipher.
crypt_get_cipher and crypt_get_cipher mode can return NULL, check it in advance.
This commit is contained in:
@@ -419,6 +419,12 @@ static bool luks2_reencrypt_eligible(struct crypt_device *cd)
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Check that cipher is in compatible format */
|
||||
if (!crypt_get_cipher(cd)) {
|
||||
log_err(_("No known cipher specification pattern detected in LUKS2 header."));
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user