Rename LUKS2_keyslot_reencrypt_create function.

The function never writes on-disk. Also removed validation
function call-in since it will be called later before
writing on-disk and metadata does not have to be complete
at the moment of LUKS2_keyslot_reencrypt_allocate call.
This commit is contained in:
Ondrej Kozina
2022-01-06 12:21:23 +01:00
committed by Milan Broz
parent b61ec23e48
commit 59e39e484a
3 changed files with 3 additions and 6 deletions

View File

@@ -234,7 +234,7 @@ int LUKS2_keyslot_reencrypt_store(struct crypt_device *cd,
const void *buffer,
size_t buffer_length);
int LUKS2_keyslot_reencrypt_create(struct crypt_device *cd,
int LUKS2_keyslot_reencrypt_allocate(struct crypt_device *cd,
struct luks2_hdr *hdr,
int keyslot,
const struct crypt_params_reencrypt *params);

View File

@@ -605,7 +605,7 @@ int LUKS2_keyslot_open(struct crypt_device *cd,
return r;
}
int LUKS2_keyslot_reencrypt_create(struct crypt_device *cd,
int LUKS2_keyslot_reencrypt_allocate(struct crypt_device *cd,
struct luks2_hdr *hdr,
int keyslot,
const struct crypt_params_reencrypt *params)
@@ -634,9 +634,6 @@ int LUKS2_keyslot_reencrypt_create(struct crypt_device *cd,
return r;
}
if (LUKS2_hdr_validate(cd, hdr->jobj, hdr->hdr_size - LUKS2_HDR_BIN_LEN))
return -EINVAL;
return 0;
}

View File

@@ -2474,7 +2474,7 @@ static int reencrypt_init(struct crypt_device *cd,
goto out;
}
r = LUKS2_keyslot_reencrypt_create(cd, hdr, reencrypt_keyslot,
r = LUKS2_keyslot_reencrypt_allocate(cd, hdr, reencrypt_keyslot,
params);
if (r < 0)
goto out;