diff --git a/pkcs5/src/pbes2/encryption.rs b/pkcs5/src/pbes2/encryption.rs index b5259e997..7413644f0 100644 --- a/pkcs5/src/pbes2/encryption.rs +++ b/pkcs5/src/pbes2/encryption.rs @@ -178,7 +178,7 @@ impl EncryptionKey { pub fn derive_from_password(password: &[u8], kdf: &Kdf, key_size: usize) -> Result { // if the kdf params defined a key length, ensure it matches the required key size if let Some(len) = kdf.key_length() { - if key_size != len.into() { + if key_size != usize::from(len) { return Err(kdf.to_alg_params_invalid()); } }