From c0bf271bef55f607db57b616517a97f5b759c1dd Mon Sep 17 00:00:00 2001 From: Ondrej Kozina Date: Thu, 12 Sep 2024 11:08:11 +0200 Subject: [PATCH] Add crypt_safe_memcpy in reencrypt digest routine. We copy volume keys for purpose of calculating LUKS2 reencryption digest. Add crypt_safe_memcpy in serialization function as well. --- lib/luks2/luks2_reencrypt_digest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/luks2/luks2_reencrypt_digest.c b/lib/luks2/luks2_reencrypt_digest.c index 94e77be56..52f22e327 100644 --- a/lib/luks2/luks2_reencrypt_digest.c +++ b/lib/luks2/luks2_reencrypt_digest.c @@ -243,7 +243,7 @@ static size_t reenc_keyslot_serialize(struct luks2_hdr *hdr, uint8_t *buffer) static size_t blob_serialize(void *blob, size_t length, uint8_t *buffer) { if (buffer) - memcpy(buffer, blob, length); + crypt_safe_memcpy(buffer, blob, length); return length; }