mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-05 16:00:05 +01:00
Fix broken detection of null cipher in LUKS2.
This bug enabled to create LUKS2 keyslots encrypted by cipher_null when explicitely requested by user. LUKS2 was never meant to allow keyslot encryption with cipher_null. cipher_null is meant for debug purposes only as a segment cipher.
This commit is contained in:
@@ -155,7 +155,7 @@ int LUKS2_keyslot_cipher_incompatible(struct crypt_device *cd, const char *ciphe
|
||||
{
|
||||
char cipher[MAX_CIPHER_LEN], cipher_mode[MAX_CIPHER_LEN];
|
||||
|
||||
if (!cipher_spec || !strcmp(cipher_spec, "null") || !strcmp(cipher_spec, "cipher_null"))
|
||||
if (!cipher_spec || crypt_is_cipher_null(cipher_spec))
|
||||
return 1;
|
||||
|
||||
if (crypt_parse_name_and_mode(cipher_spec, cipher, NULL, cipher_mode) < 0)
|
||||
|
||||
Reference in New Issue
Block a user