diff --git a/lib/libdevmapper.c b/lib/libdevmapper.c index 11578df0..d3cb2442 100644 --- a/lib/libdevmapper.c +++ b/lib/libdevmapper.c @@ -651,7 +651,7 @@ static char *get_dm_crypt_params(const struct dm_target *tgt, uint32_t flags) } else *features = '\0'; - if (!strncmp(cipher_dm, "cipher_null-", 12)) + if (crypt_is_cipher_null(cipher_dm)) null_cipher = 1; if (flags & CRYPT_ACTIVATE_KEYRING_KEY) { diff --git a/lib/luks1/keymanage.c b/lib/luks1/keymanage.c index b6575841..695d466a 100644 --- a/lib/luks1/keymanage.c +++ b/lib/luks1/keymanage.c @@ -1015,7 +1015,7 @@ static int LUKS_open_key(unsigned int keyIndex, r = LUKS_verify_volume_key(hdr, vk); /* Allow only empty passphrase with null cipher */ - if (!r && !strcmp(hdr->cipherName, "cipher_null") && passwordLen) + if (!r && crypt_is_cipher_null(hdr->cipherName) && passwordLen) r = -EPERM; out: crypt_safe_free(AfKey); diff --git a/lib/utils_storage_wrappers.c b/lib/utils_storage_wrappers.c index 37f009d6..80d275b2 100644 --- a/lib/utils_storage_wrappers.c +++ b/lib/utils_storage_wrappers.c @@ -199,7 +199,7 @@ int crypt_storage_wrapper_init(struct crypt_device *cd, goto err; } - if (!strcmp(_cipher, "cipher_null")) { + if (crypt_is_cipher_null(_cipher)) { log_dbg(cd, "Requested cipher_null, switching to noop wrapper."); w->type = NONE; *cw = w;