From 09157441666e24407baca7502f5a0afe6b5643b7 Mon Sep 17 00:00:00 2001 From: Eugene Date: Sun, 21 Apr 2024 21:35:41 -0700 Subject: [PATCH] fixed #270 - `decode_pkcs5` does not remove padding --- russh-keys/src/format/pkcs5.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/russh-keys/src/format/pkcs5.rs b/russh-keys/src/format/pkcs5.rs index 0e5a2a5e..51e51072 100644 --- a/russh-keys/src/format/pkcs5.rs +++ b/russh-keys/src/format/pkcs5.rs @@ -25,8 +25,7 @@ pub fn decode_pkcs5( #[allow(clippy::unwrap_used)] // AES parameters are static let c = cbc::Decryptor::::new_from_slices(&md5.0, &iv[..]).unwrap(); let mut dec = secret.to_vec(); - c.decrypt_padded_mut::(&mut dec)?; - dec + c.decrypt_padded_mut::(&mut dec)?.to_vec() } Encryption::Aes256Cbc(_) => unimplemented!(), };