Skip to content

Commit

Permalink
fixed #270 - decode_pkcs5 does not remove padding
Browse files Browse the repository at this point in the history
  • Loading branch information
Eugeny committed Apr 22, 2024
1 parent 58d9274 commit 0915744
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions russh-keys/src/format/pkcs5.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ pub fn decode_pkcs5(
#[allow(clippy::unwrap_used)] // AES parameters are static
let c = cbc::Decryptor::<Aes128>::new_from_slices(&md5.0, &iv[..]).unwrap();
let mut dec = secret.to_vec();
c.decrypt_padded_mut::<Pkcs7>(&mut dec)?;
dec
c.decrypt_padded_mut::<Pkcs7>(&mut dec)?.to_vec()
}
Encryption::Aes256Cbc(_) => unimplemented!(),
};
Expand Down

0 comments on commit 0915744

Please sign in to comment.