From 33f7abbe8f7bba824e4c6de827de6b230bb1dc55 Mon Sep 17 00:00:00 2001 From: Bernd Krietenstein Date: Fri, 8 Dec 2023 08:09:30 +0100 Subject: [PATCH] Adding CEK to wrapped key. Obviously, this should not be forgotten. Co-authored-by: Arthur Gautier --- cms/src/builder.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/cms/src/builder.rs b/cms/src/builder.rs index 2c0ad2376..ff292d8cc 100644 --- a/cms/src/builder.rs +++ b/cms/src/builder.rs @@ -788,6 +788,7 @@ where wrapped_cek.push(0xff ^ content_encryption_key[0]); wrapped_cek.push(0xff ^ content_encryption_key[1]); wrapped_cek.push(0xff ^ content_encryption_key[2]); + wrapped_cek.append(content_encryption_key); if padding_length > 0 { let mut padding = vec![0_u8; padding_length]; self.rng.fill_bytes(padding.as_mut_slice());