From 17069e8b06b187e303455ab1202b6bd50d070242 Mon Sep 17 00:00:00 2001 From: Arthur Gautier Date: Mon, 24 Jun 2024 14:43:30 -0700 Subject: [PATCH] cms: Array conversions should not fail. --- cms/src/builder.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cms/src/builder.rs b/cms/src/builder.rs index 5fad20be8..0fdd5e88e 100644 --- a/cms/src/builder.rs +++ b/cms/src/builder.rs @@ -1020,7 +1020,8 @@ macro_rules! encrypt_block_mode { ))); } ( - Key::<$block_mode::$typ<$alg>>::from_slice(key).to_owned(), + Key::<$block_mode::$typ<$alg>>::try_from(key) + .expect("size invariants violation"), $block_mode::$typ::<$alg>::generate_iv_with_rng($rng)?, ) }