Silent reencryption by volume key passed in file.

It emitted confusing error message. It's expected
new volume key would not match the existing one.
This commit is contained in:
Ondrej Kozina
2022-04-25 13:56:40 +02:00
committed by Milan Broz
parent cc107ee20e
commit a29f74b5ad

View File

@@ -800,7 +800,7 @@ static int reencrypt_luks2_init(struct crypt_device *cd, const char *data_device
if (r < 0) if (r < 0)
goto out; goto out;
if (!crypt_activate_by_volume_key(cd, NULL, vk, key_size, 0)) { if (!crypt_volume_key_verify(cd, vk, key_size)) {
/* passed key was valid volume key */ /* passed key was valid volume key */
vk_change = false; vk_change = false;
crypt_safe_free(vk); crypt_safe_free(vk);