mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-13 11:50:10 +01:00
Use crypt_is_cipher_null check where possible.
This commit is contained in:
committed by
Milan Broz
parent
fb8aa6d03b
commit
c8c28cf6dd
@@ -651,7 +651,7 @@ static char *get_dm_crypt_params(const struct dm_target *tgt, uint32_t flags)
|
|||||||
} else
|
} else
|
||||||
*features = '\0';
|
*features = '\0';
|
||||||
|
|
||||||
if (!strncmp(cipher_dm, "cipher_null-", 12))
|
if (crypt_is_cipher_null(cipher_dm))
|
||||||
null_cipher = 1;
|
null_cipher = 1;
|
||||||
|
|
||||||
if (flags & CRYPT_ACTIVATE_KEYRING_KEY) {
|
if (flags & CRYPT_ACTIVATE_KEYRING_KEY) {
|
||||||
|
|||||||
@@ -1015,7 +1015,7 @@ static int LUKS_open_key(unsigned int keyIndex,
|
|||||||
r = LUKS_verify_volume_key(hdr, vk);
|
r = LUKS_verify_volume_key(hdr, vk);
|
||||||
|
|
||||||
/* Allow only empty passphrase with null cipher */
|
/* 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;
|
r = -EPERM;
|
||||||
out:
|
out:
|
||||||
crypt_safe_free(AfKey);
|
crypt_safe_free(AfKey);
|
||||||
|
|||||||
@@ -199,7 +199,7 @@ int crypt_storage_wrapper_init(struct crypt_device *cd,
|
|||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!strcmp(_cipher, "cipher_null")) {
|
if (crypt_is_cipher_null(_cipher)) {
|
||||||
log_dbg(cd, "Requested cipher_null, switching to noop wrapper.");
|
log_dbg(cd, "Requested cipher_null, switching to noop wrapper.");
|
||||||
w->type = NONE;
|
w->type = NONE;
|
||||||
*cw = w;
|
*cw = w;
|
||||||
|
|||||||
Reference in New Issue
Block a user