diff options
author | Ondrej Kozina <okozina@redhat.com> | 2022-01-06 12:21:23 +0100 |
---|---|---|
committer | Milan Broz <gmazyland@gmail.com> | 2022-01-13 07:08:03 +0100 |
commit | bc26c764c6a1d27ebc5e503a161a9a703e640847 (patch) | |
tree | be9ab068f2cbb55106b5746ff354eb6a33ba0080 | |
parent | ce8aab39cad1cfb2d6c6677ec8fd88d31a8d05be (diff) | |
download | cryptsetup-bc26c764c6a1d27ebc5e503a161a9a703e640847.tar.gz |
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.
-rw-r--r-- | lib/luks2/luks2_internal.h | 2 | ||||
-rw-r--r-- | lib/luks2/luks2_keyslot.c | 5 | ||||
-rw-r--r-- | lib/luks2/luks2_reencrypt.c | 2 |
3 files changed, 3 insertions, 6 deletions
diff --git a/lib/luks2/luks2_internal.h b/lib/luks2/luks2_internal.h index 9ebe83eb..7527c195 100644 --- a/lib/luks2/luks2_internal.h +++ b/lib/luks2/luks2_internal.h @@ -213,7 +213,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); diff --git a/lib/luks2/luks2_keyslot.c b/lib/luks2/luks2_keyslot.c index 8409d531..2ad5632c 100644 --- a/lib/luks2/luks2_keyslot.c +++ b/lib/luks2/luks2_keyslot.c @@ -598,7 +598,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) @@ -628,9 +628,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; } diff --git a/lib/luks2/luks2_reencrypt.c b/lib/luks2/luks2_reencrypt.c index 54ace512..f68675de 100644 --- a/lib/luks2/luks2_reencrypt.c +++ b/lib/luks2/luks2_reencrypt.c @@ -2487,7 +2487,7 @@ static int reencrypt_init(struct crypt_device *cd, goto err; } - r = LUKS2_keyslot_reencrypt_create(cd, hdr, reencrypt_keyslot, + r = LUKS2_keyslot_reencrypt_allocate(cd, hdr, reencrypt_keyslot, params); if (r < 0) goto err; |